diff --git a/infographunsupervisedandsemisupervisedgraphlevelrepresentationlearningviamutualinformationmaximization/6dacd0f1-04b9-4678-8f07-43afb27e6acf_content_list.json b/infographunsupervisedandsemisupervisedgraphlevelrepresentationlearningviamutualinformationmaximization/6dacd0f1-04b9-4678-8f07-43afb27e6acf_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..594e2bb0d1197856e620b1bb8ff35e48dfc8c184
--- /dev/null
+++ b/infographunsupervisedandsemisupervisedgraphlevelrepresentationlearningviamutualinformationmaximization/6dacd0f1-04b9-4678-8f07-43afb27e6acf_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:4c152b79e644af2ac46debdaf6cdad14dab21d969da2b0d17fec3004f17b6a8b
+size 89116
diff --git a/infographunsupervisedandsemisupervisedgraphlevelrepresentationlearningviamutualinformationmaximization/6dacd0f1-04b9-4678-8f07-43afb27e6acf_model.json b/infographunsupervisedandsemisupervisedgraphlevelrepresentationlearningviamutualinformationmaximization/6dacd0f1-04b9-4678-8f07-43afb27e6acf_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..65f4dddad33d0cdad35be4ede4aba9eb18e2c5f7
--- /dev/null
+++ b/infographunsupervisedandsemisupervisedgraphlevelrepresentationlearningviamutualinformationmaximization/6dacd0f1-04b9-4678-8f07-43afb27e6acf_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:9afbe056f9a5ca7a1df31a5e5d018c69f5c4030edb1ff24fc4d9eb0919c59627
+size 113457
diff --git a/infographunsupervisedandsemisupervisedgraphlevelrepresentationlearningviamutualinformationmaximization/6dacd0f1-04b9-4678-8f07-43afb27e6acf_origin.pdf b/infographunsupervisedandsemisupervisedgraphlevelrepresentationlearningviamutualinformationmaximization/6dacd0f1-04b9-4678-8f07-43afb27e6acf_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..d1fa69139537f64425787ad57787a2cdf43bfee5
--- /dev/null
+++ b/infographunsupervisedandsemisupervisedgraphlevelrepresentationlearningviamutualinformationmaximization/6dacd0f1-04b9-4678-8f07-43afb27e6acf_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f5ae35eefecef32eb4f2a0a10f9587426e04f34cbda25f83e7f8ee235dde682c
+size 438709
diff --git a/infographunsupervisedandsemisupervisedgraphlevelrepresentationlearningviamutualinformationmaximization/full.md b/infographunsupervisedandsemisupervisedgraphlevelrepresentationlearningviamutualinformationmaximization/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..c1fe5469ef4b00c743cddf6d489943e18e880e25
--- /dev/null
+++ b/infographunsupervisedandsemisupervisedgraphlevelrepresentationlearningviamutualinformationmaximization/full.md
@@ -0,0 +1,337 @@
+# INFOGRAPH: UNSUPERVISED AND SEMI-SUPERVISED GRAPH-LEVEL REPRESENTATION LEARNING VIA MUTUAL INFORMATION MAXIMIZATION
+
+Fan-Yun Sun $^{1,2}$ , Jordan Hoffmann $^{2,4}$ , Vikas Verma $^{2,3}$ , Jian Tang $^{2,5,6}$
+
+$^{1}$ National Taiwan University,
+$^{2}$ Mila-Quebec Institute for Learning Algorithms, Canada
+$^{3}$ Aalto University, Finland
+$^{4}$ Harvard University, USA
+$^{5}$ HEC Montreal, Canada
+$^{6}$ CIFAR AI Research Chair
+
+b04902045@ntu.edu.tw
+jhoffmann@g.harvard.edu
+vikas.verma@aalto.fijiian.tang@hec.ca
+
+# ABSTRACT
+
+This paper studies learning the representations of whole graphs in both unsupervised and semi-supervised scenarios. Graph-level representations are critical in a variety of real-world applications such as predicting the properties of molecules and community analysis in social networks. Traditional graph kernel based methods are simple, yet effective for obtaining fixed-length representations for graphs but they suffer from poor generalization due to hand-crafted designs. There are also some recent methods based on language models (e.g. graph2vec) but they tend to only consider certain substructures (e.g. subtrees) as graph representatives. Inspired by recent progress of unsupervised representation learning, in this paper we proposed a novel method called InfoGraph for learning graph-level representations. We maximize the mutual information between the graph-level representation and the representations of substructures of different scales (e.g., nodes, edges, triangles). By doing so, the graph-level representations encode aspects of the data that are shared across different scales of substructures. Furthermore, we further propose InfoGraph*, an extension of InfoGraph for semi-supervised scenarios. InfoGraph* maximizes the mutual information between unsupervised graph representations learned by InfoGraph and the representations learned by existing supervised methods. As a result, the supervised encoder learns from unlabeled data while preserving the latent semantic space favored by the current supervised task. Experimental results on the tasks of graph classification and molecular property prediction show that InfoGraph is superior to state-of-the-art baselines and InfoGraph* can achieve performance competitive with state-of-the-art semi-supervised models.
+
+# 1 INTRODUCTION
+
+Graphs have proven to be an effective way to represent very diverse types of data including social networks Newman & Girvan (2004), biological reaction networksPavlopoulos et al. (2011), protein-protein interactions Krogan et al. (2006), the quantum mechanical properties of individual molecules Xie & Grossman (2018); Jin et al. (2018), and many more. Graphs provide explicit information about the coupling between individual units in a larger part along with a well defined framework for assigning properties to the nodes and the edges connecting them. There has been a significant amount of previous work done studying many aspects of graphs including link prediction Gao et al. (2011); Wang et al. (2011) and node prediction Blei et al. (2003). Due to its flexibility, graph-like data structures can capture rich information which is critical in many applications.
+
+At the lowest level, much work has been done on learning node representations- low-dimensional vector embeddings of individual nodes Perozzi et al. (2014); Tang et al. (2015); Grover & Leskovec (2016). Another field that has attracted a large amount of attention recently is learning representations of entire graphs. Such a problem is critical in a variety of applications such as predicting the properties of molecular graphs in both drug discovery and material science Chen et al. (2019b;a). There has been some recent progress based on neural message passing algorithms Gilmer et al. (2017); Xie & Grossman (2018), which learn the representations of entire graphs in a supervised way. These methods have been shown achieving state-of-the-art results on a variety of different prediction tasks Kipf et al. (2018); Xie & Grossman (2018); Gilmer et al. (2017); Chen et al. (2019a).
+
+However, one of the most difficult obstacles for supervised learning on graphs is that it is often very costly or even impossible to collect annotated labels. For example, in the chemical domain labels are typically produced with a costly Density Functional Theory (DFT) calculation. One option is to use semi-supervised methods which combine a small handful of labels with a larger, unlabeled, dataset. In real-world applications, partially labeled datasets are common, making tools that are able to efficiently utilize the present labels particularly useful.
+
+Coming up with methods that are able to learn unsupervised representations of an entire graph, as opposed to nodes, is an important step in working with unlabeled or partially labeled graphs Narayanan et al. (2017); Hu et al. (2019); Nguyen et al. (2017). For example, there exists work that explores pre-training techniques for graphs to improve generalization Hu et al. (2019). Another common approach to unsupervised representation learning on graphs is through graph kernels Pržulj (2007); Kashima et al. (2003); Orsini et al. (2015). However, many of these methods do not provide explicit graph embeddings which many machine learning algorithms operate on. Furthermore, the handcrafted features of graph kernels lead to high dimensional, sparse or non-smooth representations and thus result in poor generalization performance, especially on large datasets Narayanan et al. (2017).
+
+Unsupervised learning of latent representations is also an important problem in other domains, such as image generation Kingma & Welling (2013); Kim & Mnih (2018) and natural language processing Mikolov et al. (2013a). A recent work introduced Deep Infomax, a method that maximizes the mutual information content between the input data and the learned representation Hjelm et al. (2018). This method outperforms other methods on many unsupervised learning tasks. Motivated by Deep InfoMax Hjelm et al. (2018), we aim to use mutual information maximization for unsupervised representation learning on the entire graph. Specifically, our objective is to maximize the mutual information between the representations of entire graphs and the representations of substructures of different granularity. We name our model InfoGraph.
+
+We also propose a semi-supervised learning model which we name InfoGraph*. We employ a student-teacher framework similar to Mean-Teacher method Tarvainen & Valpola (2017). We maximize the mutual information between intermediate representations of the two models so that the student model learns from the teacher model. The student model is trained on the labeled data using a supervised objective function while the teacher model is trained on unlabeled data with InfoGraph. Using InfoGraph*, we achieve performance competitive with state-of-the-art methods on molecular property prediction.
+
+We summarize our contributions as follows:
+
+- We propose InfoGraph, an unsupervised graph representation learning method based on Deep InfoMax (DIM) Hjelm et al. (2018).
+- We show that InfoGraph can be extended to semi-supervised prediction tasks on graphs.
+- We empirically show that InfoGraph surpasses state-of-the-art performance on graph classification tasks with unsupervised learning and obtains performance comparable with state-of-art methods on molecular property prediction tasks using semi-supervised learning.
+
+# 2 RELATED WORK
+
+Representation learning for graphs has mainly dealt with supervised learning tasks. Recently, however, researchers have proposed algorithms that learn graph-level representations in an unsupervised manner Narayanan et al. (2017); Adhikari et al. (2018).
+
+Concurrently to this work, information maximizing graph neural networks (IGNN) was introduced which uses mutual information maximization between edge states and transform parameters to achieve state-of-the-art predictions on a variety of supervised molecule property prediction tasks Chen et al. (2019b). In this work, our focus is on unsupervised and semi-supervised scenarios.
+
+Graph Kernels. Constructing graph kernels is a common unsupervised task in learning graph representations. These kernels are typically evaluated on node classification tasks. In graph kernels, a graph $G$ is decomposed into (possibly different) $\{G_s\}$ sub-structures. The graph kernel $K(G_1, G_2)$ is defined based on the frequency of each sub-structure appearing in $G_1$ and $G_2$ respectively. Namely, $K(G_1, G_2) = \langle f_{G_{s_1}}, f_{G_{s_2}} \rangle$ , where $f_{G_s}$ is the vector containing frequencies of $\{G_s\}$ sub-structures, and $\langle , \rangle$ is an inner product in an appropriately normalized vector space. Much work has been devoted to deciding which sub-structures are more suitable than others (refer to appendix A.1). Instead of defining hand crafted similarity measures between substructures, InfoGraph adopts a more principled metric - mutual information.
+
+Contrastive methods. An important approach for unsupervised representation learning is to train an encoder to be contrastive between representations that capture statistical dependencies of interest and those that do not. For example, a contrastive approach may employ a scoring function, training the encoder to increase the score on "real" input (a.k.a, positive examples) and decrease the score on "fake" input (a.k.a., negative samples). For more detailed discussion, refer to appendix A.2.
+
+Deep Graph InfoMax (DGI) Velicković et al. (2018) also belongs to this category, which aims to train a node encoder that maximizes mutual information between node representations and the pooled global graph representation. Although we built upon a similar methodology, our aim is different than theirs as our goal is to obtain embeddings at the whole graph level for unsupervised and semi-supervised learning whereas DGI only evaluates node level embeddings. In order to differentiate our method with Deep Graph Infomax (Velicković et al. (2018)), we term our model InfoGraph.
+
+Semi-supervised Learning. A comprehensive overview of semi-supervised learning (SSL) methods is out of the scope of this paper. We refer readers to Appendix B for a short overview or Zhu et al. (2003); Chapelle et al. (2006); Oliver et al. (2018) for more comprehensive discussions. Here, we discuss a state-of-the-art method applicable for regression tasks – Mean Teacher Tarvainen & Valpola (2017). Mean Teacher adds a loss term which encourages the distance between the original network's output and the teacher's output to be small. The teacher's predictions are made using an exponential moving average of parameters from previous training steps. Inspired by the “student-teacher” framework in Mean Teacher model, our semi-supervised model (InfoGraph*) deploys two separate encoders but instead of explicitly encouraging the output of the student model to be similar to the teacher model's output, we enable the student model to learn from the teacher model by maximizing mutual information between intermediate representations learned by two models.
+
+# 3 METHODOLOGY
+
+Most recent work on graphs focus on supervised learning tasks or learning node representations. However, many graph analytic tasks such as graph classification, regression, and clustering require representing entire graphs as fixed-length feature vectors. Though graph-level representations can be obtained through the node-level representations implicitly, explicitly extracting the graph can be more straightforward and optimal for graph-oriented tasks.
+
+Another scenario that is important, yet attracts comparatively less attention in the graph related literature is semi-supervised learning. One of the biggest challenges in prediction tasks in biology Yan et al. (2017); Yang et al. (2014) or molecular machine learning Duvenaud et al. (2015); Gilmer et al. (2017); Jia & Liang (2017) is the extreme scarcity of labeled data. Therefore, semi-supervised learning, in which a large number of unlabeled samples are incorporated with a small number of labeled samples to enhance accuracy of models, will play a key role in these areas.
+
+In this section, we first formulate an unsupervised whole graph representation learning problem and a semi-supervised prediction task on graphs. Then, we present our method to learn graph-level representations. Afterwards we present our proposed model for the semi-supervised learning scenario.
+
+
+Figure 1: Illustration of InfoGraph. N.A. denotes neighborhood aggregation. An input graph is encoded into a feature map by graph convolutions and jumping concatenation. The discriminator takes a (global representation, patch representation) pair as input and decides whether they are from the same graph. InfoGraph uses a batch-wise fashion to generate all possible positive and negative samples. For example, consider the toy example with 2 input graphs in the batch and 7 nodes (or patch representations) in total. For the global representation of the blue graph, there will be 7 input pairs to the discriminator and same for the red graph. Thus, the discriminator will take 14 (global representation, patch representation) pairs as input in this case.
+
+# 3.1 PROBLEM DEFINITION
+
+Unsupervised Graph Representation Learning. Given a set of graphs $\mathbb{G} = \{G_1, G_2, \ldots\}$ and a positive integer $\delta$ (the expected embedding size), our goal is to learn a $\delta$ -dimensional distributed representation of every graph $G_i \in \mathbb{G}$ . We denote the number of nodes in $G_i$ as $|G_i|$ . We denote the matrix of representations of all graphs as $\Phi \in \mathbb{R}^{|G| \times \delta}$ .
+
+Semi-supervised Graph Prediction Tasks. Given a set of labeled graphs $\mathbb{G}^L = \{G_1,\dots ,G_{|\mathbb{G}^L |}\}$ with corresponding output $\{o_1,\dots ,o_{|\mathbb{G}^L |}\}$ , and a set of unlabeled samples $\mathbb{G}^U = \{G_{|\mathbb{G}^L | + 1},\dots ,G_{|\mathbb{G}^L | + |\mathbb{G}^U |}\}$ , our goal is to learn a model that can make predictions for unseen graphs. Note that in most cases $|\mathbb{G}^U |\gg |\mathbb{G}^L |$
+
+# 3.2 INFOGRAPH
+
+We focus on graph neural networks (GNNs)—a flexible class of embedding architectures which generate node representations by repeated aggregation over local node neighborhoods. The representations of nodes are learned by aggregating the features of their neighborhood nodes, so we refer to these as patch representations. GNNs utilize a READOUT function to summarize all the obtained patch representations into a fixed length graph-level representation.
+
+Formally, the $k$ -th layer of a GNN is
+
+$$
+\left. h _ {v} ^ {(k)} = \operatorname {C O M B I N E} ^ {(k)} \left(h _ {v} ^ {(k - 1)}, \operatorname {A G G R E G A T E} ^ {(k)} \left(\left\{\left(h _ {v} ^ {(k - 1)}, h _ {u} ^ {(k - 1)}, e _ {u v}\right): u \in \mathcal {N} (v) \right\}\right)\right), \right. \tag {1}
+$$
+
+where $h_v^{(k)}$ is the feature vector of node $v$ at the $k$ -th iteration/layer (or patch representation centered at node $i$ ), $e_{uv}$ is the feature vector of the edge between $u$ and $v$ , and $\mathcal{N}(v)$ are neighborhoods to node $v$ . $h_v^{(0)}$ is often initialized as node features. READOUT can be a simple permutation invariant function such as averaging or a more sophisticated graph-level pooling function Ying et al. (2018); Zhang et al. (2018).
+
+We seek to obtain graph representations by maximizing the mutual information between graph-level and patch-level representations. By doing so, the graph representations can learn to encode aspects of the data that are shared across all substructures. Assume that we are given a set of training samples $\mathbf{G} := \{G_j \in \mathbb{G}\}_{j=1}^N$ with empirical probability distribution $\mathbb{P}$ on the input space. Let $\phi$ denote the set of parameters of a $K$ -layer graph neural network. After the first $k$ layers of the graph neural network, the input graph will be encoded into a set of patch representations $\{h_i^{(k)}\}_{i=1}^N$ . Next, we summarize feature vectors at all depths of the graph neural network into a single feature vector that captures patch information at different scales centered at every node. Inspired by Xu et al. (2018b), we use
+
+concatenation. That is,
+
+$$
+h _ {\phi} ^ {i} = \operatorname {C O N C A T} \left(\left\{h _ {i} ^ {(k)} \right\} _ {k = 1} ^ {K}\right) \tag {2}
+$$
+
+$$
+H _ {\phi} (G) = \operatorname {R E A D O U T} \left(\left\{h _ {\phi} ^ {i} \right\} _ {i = 1} ^ {N}\right) \tag {3}
+$$
+
+where $h_{\phi}^{i}$ is the summarized patch representation centered at node $i$ and $H_{\phi}(G)$ is the global representation after applying READOUT. Note that here we slightly abuse the notation of $h$ .
+
+We define our mutual information (MI) estimator on global/local pairs, maximizing the estimated MI over the given dataset $\mathbf{G} := \{G_{j} \in \mathbb{G}\}_{j=1}^{N}$ :
+
+$$
+\hat {\phi}, \hat {\psi} = \underset {\phi , \psi} {\arg \max } \sum_ {G \in \mathbf {G}} \frac {1}{| G |} \sum_ {u \in G} I _ {\phi , \psi} \left(\vec {h} _ {\phi} ^ {u}; H _ {\phi} (G)\right). \tag {4}
+$$
+
+$I_{\phi, \psi}$ is the mutual information estimator modeled by discriminator $T_{\psi}$ and parameterized by a neural network with parameters $\psi$ . We use the Jensen-Shannon MI estimator (following the formulation of Nowozin et al. (2016)),
+
+$$
+I _ {\phi , \psi} (h _ {\phi} ^ {i} (G); H _ {\phi} (G)) :=
+$$
+
+$$
+\mathbb {E} _ {\mathbb {P}} \left[ - \operatorname {s p} \left(- T _ {\phi , \psi} \left(\vec {h} _ {\phi} ^ {i} (x), H _ {\phi} (x)\right)\right) \right] - \mathbb {E} _ {\mathbb {P} \times \tilde {\mathbb {P}}} \left[ \operatorname {s p} \left(T _ {\phi , \psi} \left(\vec {h} _ {\phi} ^ {i} \left(x ^ {\prime}\right), H _ {\phi} (x)\right)\right) \right] \tag {5}
+$$
+
+where $x$ is an input sample, $x'$ (negative sample) is an input sampled from $\tilde{\mathbb{P}} = \mathbb{P}$ , a distribution identical to the empirical probability distribution of the input space, and $\mathrm{sp}(z) = \log(1 + e^z)$ is the softplus function. In practice, we generate negative samples using all possible combinations of global and local patch representations across all graph instances in a batch.
+
+Since $H_{\phi}(G)$ is encouraged to have high MI with patches that contain information at all scales, this favours encoding aspects of the data that are shared across patches and aspects that are shared across scales. The algorithm is illustrated in Fig. 1.
+
+It should be noted that our model is similar to Deep Graph Infomax (DGI) Velicković et al. (2018), a model proposed for learning unsupervised node embeddings. However, there are important design differences due to the different problems that we are focusing on. First, in DGI they use random sampling to obtain negative samples due to the fact that they are mainly focusing on learning node embeddings on a graph. However, contrastive methods require a large number of negative samples to be competitive Hjelm et al. (2018), thus the use of batch-wise generation of negative samples is crucial as we are trying to learn graph embeddings given many graph instances. Second, the choice of graph convolution encoders is also crucial. We use GIN Xu et al. (2018a) while DGI uses GCN Kipf & Welling (2016) as GIN provides a better inductive bias for graph level applications. Graph neural network designs should be considered carefully so that graph representations can be discriminative towards other graph instances. For example, we use sum over mean for READOUT and that can provide important information regarding the size of the graph.
+
+# 3.3 SEMI-SUPERVISED INFOGRAPH
+
+Based on the previous unsupervised model, a straightforward way to do semi-supervised property prediction on graphs is to combine the purely supervised loss and the unsupervised objective function which acts as a regularization term. In doing so, the model is trained to predict properties for the labeled dataset while keeping a rich discriminative intermediate representation learned from both the labeled and the unlabeled dataset. That is, we try to minimize the following objective function:
+
+$$
+L _ {\text {t o t a l}} = \sum_ {i = 1} ^ {| \mathbb {G} ^ {L} |} L _ {\text {s u p e r v i s e d}} \left(y _ {\phi} \left(G _ {i}\right), o _ {i}\right) + \lambda \sum_ {j = 1} ^ {| \mathbb {G} ^ {L} | + | \mathbb {G} ^ {U} |} L _ {\text {u n s u p e r v i s e d}} \left(h _ {\phi} \left(G _ {j}\right); H _ {\phi} \left(G _ {j}\right)\right) \tag {6}
+$$
+
+where $L_{\mathrm{supervised}}(y_{\phi}(G_i),o_i)$ is defined as the loss function of graph $G_{i}$ that measures the discrepancy between the classifier output $y_{\phi}(G_{i})$ and the true output $o_{i}$ . $L_{\mathrm{unsupervised}}(h_{\phi}(G_{j});H_{\phi}(G_{j}))$ is the
+
+
+Figure 2: Illustration of the semi-supervised version of InfoGraph (InfoGraph*). There are two separate encoders with the same architecture, one for the supervised task and the other trained using both labeled and unlabeled data with an unsupervised objective (eq. equation 4). We encourage the mutual information of the two representations learned by the two encoders to be high by deploying a discriminator that takes a pair of representation as input and determines whether they are from the same input graph.
+
+unsupervised InfoGraph loss term as defined in eq. equation 4 that can be optimized using both labeled and unlabeled data. The hyper-parameter $\lambda$ controls the relative weight between the purely supervised and the unsupervised loss. The intuition behind this is that the model will benefit from learning a good representation from the large amount of unlabeled data while learning to predict the corresponding supervised label.
+
+However, supervised tasks and unsupervised tasks may favor different information or a different semantic space. Simply combining the two loss functions using the same encoder may lead to "negative transfer" (Pan & Yang, 2009; Rosenstein et al., 2005). We propose a simple way to alleviate this problem: we deploy two encoder models: the encoder on the labelled data (supervised encoder) and the encoder on the unlabelled data (unsupervised encoder). For transferring the learned representations from the unsupervised encoder to the supervised encoder, we define a loss term that encourages the representations learned by the two encoders to have high mutual information, at all levels of representations (third term of Eq. 8). Formally, let $\varphi$ denote the set of parameters of another $K$ -layered graph neural network, identical to the one parameterized by $\phi$ , and let $\lambda$ be a tunable hyper-parameter, $H_{\phi}^{k}(G)$ , $H_{\varphi}^{k}(G)$ be global encoder representations of the graph $G$ at encoder layer $k$ , then total loss function can be defined as follows:
+
+$$
+\begin{array}{l} L _ {\text {t o t a l}} = \sum_ {i = 1} ^ {| \mathbb {G} ^ {L} |} L _ {\text {s u p e r v i s e d}} \left(y _ {\phi} \left(G _ {i}\right), o _ {i}\right) + \sum_ {j = 1} ^ {| \mathbb {G} ^ {L} | + | \mathbb {G} ^ {U} |} L _ {\text {u n s u p e r v i s e d}} \left(h _ {\varphi} \left(G _ {j}\right); H _ {\varphi} \left(G _ {j}\right)\right) (7) \\ - \lambda \sum_ {j = 1} ^ {\left| \mathbb {G} ^ {L} \right| + \left| \mathbb {G} ^ {U} \right|} \frac {1}{\left| G _ {j} \right|} \sum_ {k = 1} ^ {K} I \left(H _ {\phi} ^ {k} \left(G _ {j}\right); H _ {\varphi} ^ {k} \left(G _ {j}\right). \right. (8) \\ \end{array}
+$$
+
+Notice that this formulation can be seen as a special instance of the student-teacher framework. However, unlike the recent student-teacher methods for semi-supervised learning (Laine & Aila, 2016; Tarvainen & Valpola, 2017; Verma et al., 2019b), which enforce the predictions of the student model to be similar to the teacher model, we enforce the transfer of knowledge from the teacher model to the student model via mutual-information maximization at various levels of representations. In practice, to reduce the computation overhead introduced by the third term of Eq 8, instead of enforcing the mutual-information maximization over all the layers of the encoders, at each training
+
+update, we enforce mutual-information maximization on a randomly chosen layer of the encoder (Verma et al., 2019a).
+
+In our semi-supervised experiments, we refer to the naive method using the objective function given in eq. equation 6 as InfoGraph. We refer to the method that uses two separate encoders and employ the objective function given in eq. equation 8 as InfoGraph*. InfoGraph* is fully summarized in Figure 3.
+
+# 4 EXPERIMENTS
+
+We evaluate the effectiveness of the graph-level representation learned by InfoGraph on downstream graph classification tasks and on semi-supervised molecular property prediction tasks.
+
+# 4.1 DATASETS
+
+For graph classification, we conduct experiments on 6 well-known benchmark datasets: MUTAG, PTC, REDDIT-BINARY, REDDIT-MULTI-5K, IMDB-BINARY, and IMDB-MULTI (Yanardag & Vishwanathan (2015)). For semi-supervised learning tasks, we use the publicly available QM9 dataset Ramakrishnan et al. (2014). Additional details of the datasets can be found in Appendix B.
+
+# 4.2 BASELINES
+
+For graph classification, we used 6 state-of-the-art graph kernels for comparison: Random Walk (RW) Gartner et al. (2003), Shortest Path Kernel (SP) Borgwardt & Kriegel (2005), Graphlet Kernel (GK) Shervashidze et al. (2009), Weisfeiler-Lehman Sub-tree Kernel (WL) Shervashidze et al. (2011), Deep Graph Kernels (DGK) Yanardag & Vishwanathan (2015), and Multi-Scale Laplacian Kernel (MLG) Kondor & Pan (2016). Aside from graph kernels, we also compare with 3 unsupervised graph-level representation learning methods: node2vec Grover & Leskovec (2016), sub2vec Adhikari et al. (2018), and graph2vec Narayanan et al. (2017). Node2vec is a neural embedding framework that learns feature representations of individual nodes in graphs and we aggregate node embeddings to obtain graph embeddings.
+
+For semi-supervised tasks, aside from comparing the results with the fully supervised results, we also compare our results with a state-of-the-art semi-supervised method: Mean Teachers Tarvainen & Valpola (2017).
+
+# 4.3 EXPERIMENT CONFIGURATION
+
+For graph classification tasks, we adopt the same procedure of previous works Niepert et al. (2016); Verma & Zhang (2017); Yanardag & Vishwanathan (2015); Zhang et al. (2018) to make a fair comparison and used 10-fold cross validation accuracy to report the classification performance. Experiments are repeated 5 times. We report results from previous papers with the same experimental setup if available. If results are not previously reported, we implement them and conduct a hyperparameter search according to the original paper. For node2vec Grover & Leskovec (2016), we took the result from Narayanan et al. (2017) but we did not run it on all datasets as the implementation details are not clear in the paper. For Deep Graph Kernels, we report the best result out of Deep WL Kernels, Deep GK Kernels, and Deep RW Kernels. For sub2vec, we report the best result out of its two variants: sub2vec-N and sub2vec-S. For all methods, the embedding dimension is set to 512 and parameters of downstream classifiers are independently tuned using cross validation on training folds of data. The best average classification accuracy is reported for each method. The classification accuracies are computed using LIBSVM Chang & Lin (2011), and the $C$ parameter was selected from $\{10^{-3}, 10^{-2}, \ldots, 10^{2}, 10^{3}\}$ .
+
+The QM9 dataset has 130462 molecules in it. We adopt similar experimental settings as traditional semi-supervised methods Tarvainen & Valpola (2017); Laine & Aila (2016); Miyato et al. (2018). We randomly chose 5000 samples as labeled samples for training and another 10000 as validation samples, 10000 samples for testing, and use the rest as unlabeled training samples. Note that we use the exact same split when running the supervised model and the semi-supervised model. We use the validation set to do model selection and we report scores on the test set. All targets were normalized
+
+
| Dataset | MUTAG | PTC-MR | RDT-B | RDT-M5K | IMDB-B | IMDB-M |
| (No. Graphs) | 188 | 344 | 2000 | 4999 | 1000 | 1500 |
| (No. classes) | 2 | 2 | 2 | 5 | 2 | 3 |
| (Avg. Graph Size) | 17.93 | 14.29 | 429.63 | 508.52 | 19.77 | 13.00 |
+
+Graph Kernels
+
+| RW | 83.72 ± 1.50 | 57.85 ± 1.30 | OMR | OMR | 50.68 ± 0.26 | 34.65 ± 0.19 |
| SP | 85.22 ± 2.43 | 58.24 ± 2.44 | 64.11 ± 0.14 | 39.55 ± 0.22 | 55.60 ± 0.22 | 37.99 ± 0.30 |
| GK | 81.66 ± 2.11 | 57.26 ± 1.41 | 77.34 ± 0.18 | 41.01 ± 0.17 | 65.87 ± 0.98 | 43.89 ± 0.38 |
| WL | 80.72 ± 3.00 | 57.97 ± 0.49 | 68.82 ± 0.41 | 46.06 ± 0.21 | 72.30 ± 3.44 | 46.95 ± 0.46 |
| DGK | 87.44 ± 2.72 | 60.08 ± 2.55 | 78.04 ± 0.39 | 41.27 ± 0.18 | 66.96 ± 0.56 | 44.55 ± 0.52 |
| MLG | 87.94 ± 1.61 | 63.26 ± 1.48 | >1 Day | >1 Day | 66.55 ± 0.25 | 41.17 ± 0.03 |
+
+Other Unsupervised Methods
+
+| node2vec | 72.63 ± 10.20 | 58.58 ± 8.00 | - | - | - | - |
| sub2vec | 61.05 ± 15.80 | 59.99 ± 6.38 | 71.48 ± 0.41 | 36.68 ± 0.42 | 55.26 ± 1.54 | 36.67 ± 0.83 |
| graph2vec | 83.15 ± 9.25 | 60.17 ± 6.86 | 75.78 ± 1.03 | 47.86 ± 0.26 | 71.1 ± 0.54 | 50.44 ± 0.87 |
| InfoGraph | 89.01 ± 1.13 | 61.65 ± 1.43 | 82.50 ± 1.42 | 53.46 ± 1.03 | 73.03 ± 0.87 | 49.69 ± 0.53 |
+
+Table 1: Classification accuracy on 6 datasets. The result in **bold** indicates the best reported classification accuracy. The top half of the table compares results with various graph kernel approaches while bottom half compares results with other state-of-the-art unsupervised graph representation learning methods. ‘>1 day’ represents that the computation exceeds 24 hours. ‘OMR’ is out of memory error.
+
+| Target | Mu (0) | Alpha (1) | HOMO (2) | LUMO (3) | Gap (4) | R2 (5) | ZPVE(6) | U0 (7) | U (8) | H (9) | G(10) | Cv (11) |
| MAE | 0.3201 | 0.5792 | 0.0060 | 0.0062 | 0.0091 | 10.0469 | 0.0007 | 0.3204 | 0.2934 | 0.2722 | 0.2948 | 0.2368 |
+
+| Semi-Supervised | Error Ratio |
| Mean-Teachers | 1.09 | 1.00 | 0.99 | 1.00 | 0.97 | 0.52 | 0.77 | 1.16 | 0.93 | 0.79 | 0.86 | 0.86 |
| InfoGraph | 1.02 | 0.97 | 1.02 | 0.99 | 1.01 | 0.71 | 0.96 | 0.85 | 0.93 | 0.93 | 0.99 | 1.00 |
| InfoGraph* | 0.99 | 0.94 | 0.99 | 0.99 | 0.98 | 0.49 | 0.52 | 0.44 | 0.58 | 0.57 | 0.54 | 0.83 |
+
+Table 2: Results of semi-supervised experiments on QM9 dataset. The result in **bold** indicates the best performance. The top half of the table shows the mean absolute error (MAE) of the supervised model. The bottom half shows the error ratio (with respect to supervised result) of the semi-supervised models using the same underlying model. Lower scores are better and values less than 1.0 indicate better performance than the supervised baseline.
+
+to have mean 0 and variance 1. We minimize the mean squared error between the model output and the target, although we evaluate mean absolute error.
+
+# 4.4 MODEL CONFIGURATION
+
+For the unsupervised experiments, we use the Graph Isomorphism Network (GIN) Xu et al. (2018a). For the semi-supervised experiments, we adopt the same model as in Gilmer et al. (2017) (enn-s2s). As recommended in Oliver et al. (2018), we use the exact same underlying model architecture when comparing semi-supervised learning approaches as our goal is not to produce state-of-the-art results, but instead to provide a rigorous comparative analysis in a common framework. In both scenarios, models were trained using SGD with the Adam optimizer. We use Pytorch Paszke et al. (2017) and the Pytorch Geometric Fey & Lenssen (2019) libraries for all our experiments. For detailed hyper-parameter settings and architecture detail of the discriminator, see Appendix C.
+
+# 5 RESULTS
+
+The results of evaluating unsupervised graph level representations using downstream graph classification tasks are presented in Table 1. We show results from six methods including three state-of-the-art graph kernel methods: WL Shervashidze et al. (2011), DGK Yanardag & Vishwanathan (2015), and MLG Kondor & Pan (2016). While these kernel methods perform well on individual datasets, none of them are competitive across all of the datasets. Additionally, MLG suffers from a long run time and take more than 24 hours to run on the two larger benchmark datasets. We find that InfoGraph
+
+outperforms all of these baselines on 4 out of 6 of the datasets. In the other 2 datasets, InfoGraph still has very competitive performance.
+
+The results of the semi-supervised learning experiments on the molecular property prediction task are presented in Table 2. We observe that by simply combining the supervised objective with the unsupervised infomax objective (InfoGraph) obtains better performance compared to the purely supervised models on 7 out of 12 of the targets. However, in 1 out of 12 targets it does not obtain better performance and in 4 out of 12 targets, it results in poorer performance. This "negative transfer" effect may be caused by the fact that the supervised objective and the unsupervised objective favor different information or different latent semantic space. This effect is alleviated with InfoGraph*, our modified version of InfoGraph for semi-supervised learning. InfoGraph* improves over the supervised model in all the 12 targets. InfoGraph* obtains the best result on 11 targets while the Mean Teacher method obtains the best results on 2 targets (with one overlap). However, the Mean Teacher model yields worse performance on 2 targets when compared to the supervised result.
+
+# 6 CONCLUSION AND FUTURE WORK
+
+In this paper, we propose InfoGraph to learn unsupervised graph-level representations and InfoGraph* for semi-supervised learning. We conduct experiments on graph classification and molecular property prediction tasks to evaluate these two methods. Experimental results show that InfoGraph and InfoGraph* are both very competitive with state-of-the-art methods. There are many research works on semi-supervised learning on image data, but few of them focus on semi-supervised learning for graph structured data. In the future, we aim to explore semi-supervised frameworks designed specifically for graphs.
+
+# ACKNOWLEDGMENTS
+
+We would like to thank Shengchao Liu and Weihua Hu for the extremely helpful discussions and comments.
+
+# REFERENCES
+
+Bijaya Adhikari, Yao Zhang, Naren Ramakrishnan, and B Aditya Prakash. Sub2vec: Feature learning for subgraphs. In Pacific-Asia Conference on Knowledge Discovery and Data Mining, pp. 170–182. Springer, 2018.
+David M Blei, Andrew Y Ng, and Michael I Jordan. Latent dirichlet allocation. Journal of machine Learning research, 3(Jan):993-1022, 2003.
+Karsten M Borgwardt and Hans-Peter Kriegel. Shortest-path kernels on graphs. In Fifth IEEE international conference on data mining (ICDM'05), pp. 8-pp. IEEE, 2005.
+Chih-Chung Chang and Chih-Jen Lin. Libsvm: A library for support vector machines. ACM transactions on intelligent systems and technology (TIST), 2(3):27, 2011.
+Olivier Chapelle, Bernhard Scholkopf, Alexander Zien, et al. Semi-supervised learning, vol. 2. Cambridge: MIT Press. Cortes, C., & Mohri, M.(2014). Domain adaptation and sample bias correction theory and algorithm for regression. Theoretical Computer Science, 519:103126, 2006.
+Chi Chen, Weike Ye, Yunxing Zuo, Chen Zheng, and Shyue Ping Ong. Graph networks as a universal machine learning framework for molecules and crystals. Chemistry of Materials, 31(9):3564-3572, 2019a.
+Pengfei Chen, Weiwen Liu, Chang-Yu Hsieh, Guangyong Chen, and Shengyu Zhang. Utilizing edge features in graph neural networks via variational information maximization. arXiv preprint arXiv:1906.05488, 2019b.
+Ronan Collobert and Jason Weston. A unified architecture for natural language processing: Deep neural networks with multitask learning. In Proceedings of the 25th international conference on Machine learning, pp. 160-167. ACM, 2008.
+
+Gerben KD de Vries. A fast approximation of the weisfeiler-lehman graph kernel for rdf data. In Joint European Conference on Machine Learning and Knowledge Discovery in Databases, pp. 606-621. Springer, 2013.
+David K Duvenaud, Dougal Maclaurin, Jorge Iparraguirre, Rafael Bombarell, Timothy Hirzel, Alán Aspuru-Guzik, and Ryan P Adams. Convolutional networks on graphs for learning molecular fingerprints. In Advances in neural information processing systems, pp. 2224-2232, 2015.
+Aasa Feragen, Niklas Kasenburg, Jens Petersen, Marleen de Bruijne, and Karsten Borgwardt. Scalable kernels for graphs with continuous attributes. In Advances in Neural Information Processing Systems, pp. 216-224, 2013.
+Matthias Fey and Jan Eric Lenssen. Fast graph representation learning with pytorch geometric. arXiv preprint arXiv:1903.02428, 2019.
+Sheng Gao, Ludovic Denoyer, and Patrick Gallinari. Temporal link prediction by integrating content and structure information. In Proceedings of the 20th ACM international conference on Information and knowledge management, pp. 1169-1174. ACM, 2011.
+Thomas Gartner, Peter Flach, and Stefan Wrobel. On graph kernels: Hardness results and efficient alternatives. In Learning theory and kernel machines, pp. 129-143. Springer, 2003.
+Justin Gilmer, Samuel S Schoenholz, Patrick F Riley, Oriol Vinyals, and George E Dahl. Neural message passing for quantum chemistry. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 1263-1272. JMLR.org, 2017.
+Yves Grandvalet and Yoshua Bengio. Semi-supervised learning by entropy minimization. In Advances in neural information processing systems, pp. 529-536, 2005.
+Aditya Grover and Jure Leskovec. node2vec: Scalable feature learning for networks. In Proceedings of the 22nd ACM SIGKDD international conference on Knowledge discovery and data mining, pp. 855-864. ACM, 2016.
+R Devon Hjelm, Alex Fedorov, Samuel Lavoie-Marchildon, Karan Grewal, Adam Trischler, and Yoshua Bengio. Learning deep representations by mutual information estimation and maximization. arXiv preprint arXiv:1808.06670, 2018.
+Weihua Hu, Bowen Liu, Joseph Gomes, Marinka Zitnik, Percy Liang, Vijay Pande, and Jure Leskovec. Pre-training graph neural networks. arXiv preprint arXiv:1905.12265, 2019.
+Sergey Ivanov and Evgeny Burnaev. Anonymous walk embeddings. arXiv preprint arXiv:1805.11921, 2018.
+Robin Jia and Percy Liang. Adversarial examples for evaluating reading comprehension systems. arXiv preprint arXiv:1707.07328, 2017.
+Wengong Jin, Regina Barzilay, and Tommi Jaakkola. Junction tree variational autoencoder for molecular graph generation. arXiv preprint arXiv:1802.04364, 2018.
+Hisashi Kashima, Koji Tsuda, and Akihiro Inokuchi. Marginalized kernels between labeled graphs. In Proceedings of the 20th international conference on machine learning (ICML-03), pp. 321-328, 2003.
+Hyunjik Kim and Andriy Mnih. Disentangling by factorising. arXiv preprint arXiv:1802.05983, 2018.
+Diederik P Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013.
+Thomas Kipf, Ethan Fetaya, Kuan-Chieh Wang, Max Welling, and Richard Zemel. Neural relational inference for interacting systems. arXiv preprint arXiv:1802.04687, 2018.
+Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. arXiv preprint arXiv:1609.02907, 2016.
+
+Risi Kondor and Horace Pan. The multiscale laplacian graph kernel. In Advances in Neural Information Processing Systems, pp. 2990-2998, 2016.
+Nils M Kriege, Pierre-Louis Giscard, and Richard Wilson. On valid optimal assignment kernels and applications to graph classification. In Advances in Neural Information Processing Systems, pp. 1623-1631, 2016.
+Nevan J Krogan, Gerard Cagney, Haiyuan Yu, Gouqing Zhong, Xinghua Guo, Alexandr Ignatchenko, Joyce Li, Shuye Pu, Nira Datta, Aaron P Tikuisis, et al. Global landscape of protein complexes in the yeast saccharomyces cerevisiae. Nature, 440(7084):637, 2006.
+Samuli Laine and Timo Aila. Temporal ensembling for semi-supervised learning. arXiv preprint arXiv:1610.02242, 2016.
+Quoc Le and Tomas Mikolov. Distributed representations of sentences and documents. In International conference on machine learning, pp. 1188-1196, 2014.
+Dong-Hyun Lee. Pseudo-label: The simple and efficient semi-supervised learning method for deep neural networks. In Workshop on Challenges in Representation Learning, ICML, volume 3, pp. 2, 2013.
+Tomas Mikolov, Kai Chen, Greg Corrado, and Jeffrey Dean. Efficient estimation of word representations in vector space. arXiv preprint arXiv:1301.3781, 2013a.
+Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S Corrado, and Jeff Dean. Distributed representations of words and phrases and their compositionality. In Advances in neural information processing systems, pp. 3111-3119, 2013b.
+Takeru Miyato, Shin-ichi Maeda, Masanori Koyama, and Shin Ishii. Virtual adversarial training: a regularization method for supervised and semi-supervised learning. IEEE transactions on pattern analysis and machine intelligence, 41(8):1979-1993, 2018.
+Andriy Mnih and Koray Kavukcuoglu. Learning word embeddings efficiently with noise-contrastive estimation. In Advances in neural information processing systems, pp. 2265-2273, 2013.
+Annamalai Narayanan, Mahinthan Chandramohan, Rajasekar Venkatesan, Lihui Chen andvYang Liu, and Shantanu Jaiswal. graph2vec: Learning distributed representations of graphs. CoRR, abs/1707.05005, 2017. URL http://arxiv.org/abs/1707.05005.
+Marion Neumann, Novi Patricia, Roman Garnett, and Kristian Kersting. Efficient graph kernels by randomization. In Joint European Conference on Machine Learning and Knowledge Discovery in Databases, pp. 378-393. Springer, 2012.
+Mark EJ Newman and Michelle Girvan. Finding and evaluating community structure in networks. Physical review E, 69(2):026113, 2004.
+Hai Nguyen, Shin-ichi Maeda, and Kenta Oono. Semi-supervised learning of hierarchical representations of molecules using neural message passing. arXiv preprint arXiv:1711.10168, 2017.
+Mathias Niepert, Mohamed Ahmed, and Konstantin Kutzkov. Learning convolutional neural networks for graphs. In International conference on machine learning, pp. 2014-2023, 2016.
+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.
+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.
+Francesco Orsini, Paolo Frasconi, and Luc De Raedt. Graph invariant kernels. In Twenty-Fourth International Joint Conference on Artificial Intelligence, 2015.
+Sinno Jialin Pan and Qiang Yang. A survey on transfer learning. IEEE Transactions on knowledge and data engineering, 22(10):1345-1359, 2009.
+
+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. 2017.
+Georgios A Pavlopoulos, Maria Secrier, Charalampos N Moschopoulos, Theodoros G Soldatos, Sophia Kossida, Jan Aerts, Reinhard Schneider, and Pantelis G Bagos. Using graph theory to analyze biological networks. BioData mining, 4(1):10, 2011.
+Bryan Perozzi, Rami Al-Rfou, and Steven Skiena. Deepwalk: Online learning of social representations. In Proceedings of the 20th ACM SIGKDD international conference on Knowledge discovery and data mining, pp. 701-710. ACM, 2014.
+Nataša Pržulj. Biological network comparison using graphlet degree distribution. Bioinformatics, 23 (2):e177-e183, 2007.
+Raghunathan Ramakrishnan, Pavlo O Dral, Matthias Rupp, and O Anatole Von Lilienfeld. Quantum chemistry structures and properties of 134 kilo molecules. Scientific data, 1:140022, 2014.
+Michael T Rosenstein, Zvika Marx, Leslie Pack Kaelbling, and Thomas G Dietterich. To transfer or not to transfer. In NIPS 2005 workshop on transfer learning, volume 898, pp. 3, 2005.
+Mehdi Sajjadi, Mehran Javanmardi, and Tolga Tasdizen. Mutual exclusivity loss for semi-supervised deep learning. In 2016 IEEE International Conference on Image Processing (ICIP), pp. 1908-1912. IEEE, 2016.
+Nino Shervashidze, SVN Vishwanathan, Tobias Petri, Kurt Mehlhorn, and Karsten Borgwardt. Efficient graphlet kernels for large graph comparison. In Artificial Intelligence and Statistics, pp. 488-495, 2009.
+Nino Shervashidze, Pascal Schweitzer, Erik Jan van Leeuwen, Kurt Mehlhorn, and Karsten M Borgwardt. Weisfeiler-lehman graph kernels. Journal of Machine Learning Research, 12(Sep): 2539-2561, 2011.
+Jian Tang, Meng Qu, Mingzhe Wang, Ming Zhang, Jun Yan, and Qiaozhu Mei. Line: Large-scale information network embedding. In Proceedings of the 24th international conference on world wide web, pp. 1067-1077. International World Wide Web Conferences Steering Committee, 2015.
+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.
+Petar Velicković, William Fedus, William L Hamilton, Pietro Lio, Yoshua Bengio, and R Devon Hjelm. Deep graph infomax. arXiv preprint arXiv:1809.10341, 2018.
+Saurabh Verma and Zhi-Li Zhang. Hunt for the unique, stable, sparse and fast feature learning on graphs. In Advances in Neural Information Processing Systems, pp. 88-98, 2017.
+Vikas Verma, Alex Lamb, Christopher Beckham, Amir Najafi, Ioannis Mitlagkas, David Lopez-Paz, and Yoshua Bengio. Manifold mixup: Better representations by interpolating hidden states. In Kamalika Chaudhuri and Ruslan Salakhutdinov (eds.), Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research, pp. 6438-6447, Long Beach, California, USA, 09-15 Jun 2019a. PMLR. URL http://proceedings.mlr.press/v97/verma19a.html.
+Vikas Verma, Alex Lamb, Kannala Juho, Yoshua Bengio, and David Lopez-Paz. Interpolation consistency training for semi-supervised learning. In Sarit Kraus (ed.), Proceedings of the Twenty-Eighth International Joint Conference on Artificial Intelligence, IJCAI 2019, Macao, China, August 10-16, 2019. ijcai.org, 2019b. doi: 10.24963/ijcai.2019. URL https://doi.org/10.24963/ijcai.2019.
+Fei Wang, Tao Li, Xin Wang, Shenghuo Zhu, and Chris Ding. Community discovery using nonnegative matrix factorization. Data Mining and Knowledge Discovery, 22(3):493-521, 2011.
+
+Boris Weisfeiler and Andrei A Lehman. A reduction of a graph to a canonical form and an algebra arising during this reduction. Nauchno-Technicheskaya Informatsia, 2(9):12-16, 1968.
+Tian Xie and Jeffrey C Grossman. Crystal graph convolutional neural networks for an accurate and interpretable prediction of material properties. Physical review letters, 120(14):145301, 2018.
+Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How powerful are graph neural networks? arXiv preprint arXiv:1810.00826, 2018a.
+Keyulu Xu, Chengtao Li, Yonglong Tian, Tomohiro Sonobe, Ken-ichi Kawarabayashi, and Stefanie Jegelka. Representation learning on graphs with jumping knowledge networks. arXiv preprint arXiv:1806.03536, 2018b.
+Yan Yan, Shangzhao Qiu, Zhuxuan Jin, Sihong Gong, Yun Bai, Jianwei Lu, and Tianwei Yu. Detecting subnetwork-level dynamic correlations. Bioinformatics, 33(2):256-265, 2017.
+Pinar Yanardag and SVN Vishwanathan. Deep graph kernels. In Proceedings of the 21th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pp. 1365-1374. ACM, 2015.
+Rendong Yang, Yun Bai, Zhaohui Qin, and Tianwei Yu. Egonet: identification of human disease ego-network modules. BMC genomics, 15(1):314, 2014.
+Zhitao Ying, Jiaxuan You, Christopher Morris, Xiang Ren, Will Hamilton, and Jure Leskovec. Hierarchical graph representation learning with differentiable pooling. In Advances in Neural Information Processing Systems, pp. 4800-4810, 2018.
+Muhan Zhang, Zhicheng Cui, Marion Neumann, and Yixin Chen. An end-to-end deep learning architecture for graph classification. In Thirty-Second AAAI Conference on Artificial Intelligence, 2018.
+Xiaojin Zhu, Zoubin Ghahramani, and John D Lafferty. Semi-supervised learning using gaussian fields and harmonic functions. In Proceedings of the 20th International conference on Machine learning (ICML-03), pp. 912-919, 2003.
+
+# A RELATED WORK
+
+# A.1 GRAPH KERNELS
+
+Popular graph kernels are graphlets Pržulj (2007); Shervashidze et al. (2009), random walk and shortest path kernels Kashima et al. (2003); Borgwardt & Kriegel (2005), and the Weisfeiler-Lehman subtree kernel Shervashidze et al. (2011). Furthermore, deep graph kernels Yanardag & Vishwanathan (2015), graph invariant kernels Orsini et al. (2015), optimal assignment graph kernels Kriege et al. (2016) and multiscale Laplacian graph kernels Kondor & Pan (2016) have been proposed with the goal to redefine kernel functions to appropriately capture sub-structural similarity at different levels. Another line of research in this area focuses on efficiently computing these kernels either through exploiting certain structural dependencies, or via approximations/randomization Feragen et al. (2013); de Vries (2013); Neumann et al. (2012).
+
+# A.2 CONTRASTIVE METHODS
+
+Contrastive methods are central many popular word-embedding methods Collobert & Weston (2008); Mnih & Kavukcuoglu (2013); Mikolov et al. (2013b). Word2vec Mikolov et al. (2013a) is an unsupervised algorithm which obtains word representations by using the representations to predict context words (the words that surround it). Doc2vec Le & Mikolov (2014) is an extension of the continuous Skip-gram model that predicts representations of words from that of a document containing them. Researchers extended many of these unsupervised language models to learn representations of graph-structured input Adhikari et al. (2018); Narayanan et al. (2017). For example, graph2vec Narayanan et al. (2017) extends Doc2vec to arbitrary graphs. Intuitively, for graph2vec a graph and the rooted subgraphs in it correspond to a document and words in a paragraph vector, respectively. One of the technical contributions of the paper is using the Weisfeiler-Lehman relabelling algorithm. Weisfeiler & Lehman (1968); Shervashidze et al. (2011) to enumerate all rooted subgraphs up to a specified depth. AWE (Anonymous Walk Embeddings) Ivanov & Burnaev (2018) is another method based on CBOW framework. instead of using rooted subgraphs as words like graph2vec, AWE considers anonymous walk embeddings for the same source node as co-occurring words. InfoGraph has the two advantages when compared with these methods. First, InfoGraph learns representations directly from data instead of utilizing hand-crafted procedures (i.e. Weisfeiler-Lehman relabelling algorithm in graph2vec and random walk in AWE). Second, InfoGraph has a clear objective that can be easily combined with other objectives. For example, InfoGraph*, the semi-supervised method that we proposed.
+
+# B SEMI-SUPERVISED LEARNING
+
+Here we discuss the most common class of SSL methods which involve adding an additional loss term to the training of a neural network as they are pragmatic and are currently the state-of-the-art on image classification datasets.
+
+Entropy Minimization (EntMin): EntMin Grandvalet & Bengio (2005) adds a loss term applied that encourages the network to make "confident" (low-entropy) predictions for all unlabeled examples, regardless of their class.
+
+Pseudo-Labeling: Pseudo-labeling Lee (2013) proceeds by producing "pseudo-labels" for unlabeled input data points using the prediction function itself over the course of training. Pseudo-labels which have a corresponding class probability that is larger than a predefined threshold are used as targets for a standard supervised loss function.
+
+II-Model: Neural networks can produce different outputs for the same input while common regularization techniques such as data augmentation, dropout, and adding noise are applied. II-Model Laine & Aila (2016); Sajjadi et al. (2016) adds a loss term which encourages the distance between a network's output for different passes of unlabeled data through the network to be small.
+
+Virtual Adversarial Training: Instead of relying on the built-in stochasticity as in II-Model, Virtual Adversarial Training (VAT) Miyato et al. (2018) directly approximates a tiny perturbation to add to the input which would most significantly affect the output of the prediction function. This perturbation can be approximated with an extra back-propagation for each optimization step.
+
+Mean Teacher: A difficulty with the $\Pi$ -model approach is that it relies on a potentially unstable "target" prediction, namely the second stochastic network prediction which can rapidly change over the course of training. As a result, Tarvainen & Valpola (2017) proposed to obtain a more stable target output for unlabeled data by setting the target to predictions made using an exponential moving average of parameters from previous training steps.
+
+# C DATASETS
+
+# C.1 GRAPH CLASSIFICATION DATASETS
+
+MUTAG contains 188 mutagenic aromatic and heteroaromatic nitro compounds with 7 different discrete labels. PTC is a dataset of 344 different chemical compounds that have been tested for carcinogenicity in male and female rats. This dataset has 19 discrete labels. IMDB-BINARY and IMDB-MULTI are movie collaboration datasets. Each graph corresponds to an ego-network for each actor/actress, where nodes correspond to actors/actresses and an edge is drawn between two actors/actresses if they appear in the same movie. Each graph is derived from a pre-specified genre of movies, and the task is to classify the genre graph it is derived from. REDDIT-BINARY and REDDIT-MULTI5K are balanced datasets where each graph corresponds to an online discussion thread and nodes correspond to users. An edge was drawn between two nodes if at least one of them responded to another's comment. The task is to classify each graph to the community or subreddit that it belongs to.
+
+# C.2 QM9
+
+All molecules in the dataset consist of Hydrogen (H), Carbon (C), Oxygen (O), Nitrogen (N), and Flourine (F) atoms and contain up to 9 non-Hydrogen atoms. In all, this results in about 134,000 drug-like organic molecules that span a wide range of chemical compositions and properties. A total of 12 interesting and fundamental chemical properties are pre-computed for each molecule. For a detailed description of the properties in the QM9 dataset, see section 10.2 of Gilmer et al. (2017).
+
+# D MODEL CONFIGURATION
+
+For the unsupervised experiments, we use the Graph Isomorphism Network (GIN) Xu et al. (2018a). GNN layers are chosen from $\{4,8,12\}$ . Initial learning rate is chosen from the set $\{10^{-2},10^{-3},10^{-4}\}$ . The number of epochs are chosen from $\{10,20,100\}$ . The batch size is set to 128.
+
+For the semi-supervised experiments, the number of set2set computations is set to 3. Model were trained with an initial learning rate 0.001 for 500 epochs with a batch size 20. For the supervised case, the weight decay is chosen from $\{0,10^{-3},10^{-4}\}$ . For InfoGraph and InfoGraph*, $\lambda$ is chosen from $\{10^{-3},10^{-4},10^{-5}\}$ .
+
+The discriminator scores global-patch representation pairs by passing two representations to different non-linear transformations and then takes the dot product of the two transformed representations. Both non-linear transformations are parameterized by 3-layered feed-forward neural networks with jumping connections. Following each linear layer is a ReLU activation function.
+
+# E CONVERGENCE PLOT
+
+To prove that the objective Eq.8 with multiple loss terms can be optimized, we provide a convergence plot of InfoGraph*. We can see that the three loss terms all converge after around 150 epochs of training.
+
+
+InfoGraph* Convergence Plot
+
+
+
+
+Figure 3: Convergence plot of InfoGraph* on QM9 target 7.
\ No newline at end of file
diff --git a/infographunsupervisedandsemisupervisedgraphlevelrepresentationlearningviamutualinformationmaximization/images.zip b/infographunsupervisedandsemisupervisedgraphlevelrepresentationlearningviamutualinformationmaximization/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..25596dd3bdf3285e18457a5815a1c02e0548f35b
--- /dev/null
+++ b/infographunsupervisedandsemisupervisedgraphlevelrepresentationlearningviamutualinformationmaximization/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:33ef47982664a351d998b4f5bf4d3529b6a7a214af7fd20bb9e41179b17d31d2
+size 304291
diff --git a/infographunsupervisedandsemisupervisedgraphlevelrepresentationlearningviamutualinformationmaximization/layout.json b/infographunsupervisedandsemisupervisedgraphlevelrepresentationlearningviamutualinformationmaximization/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..a4f37f9d4d9ce191039049d43ab36431fbaa7e1b
--- /dev/null
+++ b/infographunsupervisedandsemisupervisedgraphlevelrepresentationlearningviamutualinformationmaximization/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a417d02ed259abe20a3078f34aeaed12fad638040958d4352c9c7c24519d09c0
+size 427770
diff --git a/intensityfreelearningoftemporalpointprocesses/6e0d7a04-6a42-4129-ad2a-c1bbfec4e896_content_list.json b/intensityfreelearningoftemporalpointprocesses/6e0d7a04-6a42-4129-ad2a-c1bbfec4e896_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..4a1f75dc85bfb7f8de43f14fe44eee3df7160c34
--- /dev/null
+++ b/intensityfreelearningoftemporalpointprocesses/6e0d7a04-6a42-4129-ad2a-c1bbfec4e896_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0d869ca243aa6353a1fc54c5f3be33c9000039806961514a4b45097e8a2ba3fe
+size 145295
diff --git a/intensityfreelearningoftemporalpointprocesses/6e0d7a04-6a42-4129-ad2a-c1bbfec4e896_model.json b/intensityfreelearningoftemporalpointprocesses/6e0d7a04-6a42-4129-ad2a-c1bbfec4e896_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..90dcb5de0c8327a445c519822734c452ddbf9b73
--- /dev/null
+++ b/intensityfreelearningoftemporalpointprocesses/6e0d7a04-6a42-4129-ad2a-c1bbfec4e896_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:2a74bf20d7e382ad57272449a3c7390e6f76090fb9eaa882be3b9baae78558ff
+size 172604
diff --git a/intensityfreelearningoftemporalpointprocesses/6e0d7a04-6a42-4129-ad2a-c1bbfec4e896_origin.pdf b/intensityfreelearningoftemporalpointprocesses/6e0d7a04-6a42-4129-ad2a-c1bbfec4e896_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..c0916d4338f8d1b2f00137e610f281583bbb97ad
--- /dev/null
+++ b/intensityfreelearningoftemporalpointprocesses/6e0d7a04-6a42-4129-ad2a-c1bbfec4e896_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:bd70d13d258b7bc0e539503d4ee293b12ffa1cbb11767f7769a7452fb2280577
+size 626717
diff --git a/intensityfreelearningoftemporalpointprocesses/full.md b/intensityfreelearningoftemporalpointprocesses/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..048216a00bc60634fade1e44047d63dd64226b54
--- /dev/null
+++ b/intensityfreelearningoftemporalpointprocesses/full.md
@@ -0,0 +1,632 @@
+# INTENSITY-FREE LEARNING OF TEMPORAL POINT PROCESSES
+
+Oleksandr Shchur\* Marin Bilos\* Stephan Gunnemann
+
+Technical University of Munich, Germany
+
+{shchur,bilos,guennemann}@in.tum.de
+
+# ABSTRACT
+
+Temporal point processes are the dominant paradigm for modeling sequences of events happening at irregular intervals. The standard way of learning in such models is by estimating the conditional intensity function. However, parameterizing the intensity function usually incurs several trade-offs. We show how to overcome the limitations of intensity-based approaches by directly modeling the conditional distribution of inter-event times. We draw on the literature on normalizing flows to design models that are flexible and efficient. We additionally propose a simple mixture model that matches the flexibility of flow-based models, but also permits sampling and computing moments in closed form. The proposed models achieve state-of-the-art performance in standard prediction tasks and are suitable for novel applications, such as learning sequence embeddings and imputing missing data.
+
+# 1 INTRODUCTION
+
+Visits to hospitals, purchases in e-commerce systems, financial transactions, posts in social media — various forms of human activity can be represented as discrete events happening at irregular intervals. The framework of temporal point processes is a natural choice for modeling such data. By combining temporal point process models with deep learning, we can design algorithms able to learn complex behavior from real-world data.
+
+Designing such models, however, usually involves trade-offs along the following dimensions: flexibility (can the model approximate any distribution?), efficiency (can the likelihood function be evaluated in closed form?), and ease of use (is sampling and computing summary statistics easy?). Existing methods (Du et al., 2016; Mei & Eisner, 2017; Omi et al., 2019) that are defined in terms of the conditional intensity function typically fall short in at least one of these categories.
+
+Instead of modeling the intensity function, we suggest treating the problem of learning in temporal point processes as an instance of conditional density estimation. By using tools from neural density estimation (Bishop, 1994; Rezende & Mohamed, 2015), we can develop methods that have all of the above properties. To summarize, our contributions are the following:
+
+- We connect the fields of temporal point processes and neural density estimation. We show how normalizing flows can be used to define flexible and theoretically sound models for learning in temporal point processes.
+- We propose a simple mixture model that performs on par with the state-of-the-art methods. Thanks to its simplicity, the model permits closed-form sampling and moment computation.
+- We show through a wide range of experiments how the proposed models can be used for prediction, conditional generation, sequence embedding and training with missing data.
+
+# 2 BACKGROUND
+
+Definition. A temporal point process (TPP) is a random process whose realizations consist of a sequence of strictly increasing arrival times $\mathcal{T} = \{t_1,\dots,t_N\}$ . A TPP can equivalently be represented
+
+ | Exponential intensity | Neural Hawkes | Fully NN | Normalizing Flows | Mixture Distribution |
| Closed-form likelihood | ✓ | ✗ | ✓ | ✓ | ✓ |
| Flexible | ✗ | ✓ | ✓ | ✓ | ✓ |
| Closed-form E[τ] | ✗ | ✗ | ✗ | ✗ | ✓ |
| Closed-form sampling | ✓ | ✗ | ✗ | ✗ | ✓ |
+
+Table 1: Comparison of neural temporal point process models that encode history with an RNN.
+
+as a sequence of strictly positive inter-event times $\tau_{i} = t_{i} - t_{i-1} \in \mathbb{R}_{+}$ . Representations in terms of $t_{i}$ and $\tau_{i}$ are isomorphic — we will use them interchangeably throughout the paper. The traditional way of specifying the dependency of the next arrival time $t$ on the history $\mathcal{H}_t = \{t_j \in \mathcal{T} : t_j < t\}$ is using the conditional intensity function $\lambda^*(t) \coloneqq \lambda(t|\mathcal{H}_t)$ . Here, the * symbol reminds us of dependence on $\mathcal{H}_t$ . Given the conditional intensity function, we can obtain the conditional probability density function (PDF) of the time $\tau_{i}$ until the next event by integration (Rasmussen, 2011) as $p^*(\tau_i) \coloneqq p(\tau_i|\mathcal{H}_{t_i}) = \lambda^*(t_{i-1} + \tau_i)\exp\left(-\int_0^{\tau_i}\lambda^*(t_{i-1} + s)ds\right)$ .
+
+Learning temporal point processes. Conditional intensity functions provide a convenient way to specify point processes with a simple predefined behavior, such as self-exciting (Hawkes, 1971) and self-correcting (Isham & Westcott, 1979) processes. Intensity parametrization is also commonly used when learning a model from the data: Given a parametric intensity function $\lambda_{\theta}^{*}(t)$ and a sequence of observations $\mathcal{T}$ , the parameters $\pmb{\theta}$ can be estimated by maximizing the log-likelihood: $\pmb{\theta}^{*} = \arg \max_{\pmb{\theta}}\sum_{i}\log p_{\pmb{\theta}}^{*}(\tau_{i}) = \arg \max_{\pmb{\theta}}\left[\sum_{i}\log \lambda_{\pmb{\theta}}^{*}(t_{i}) - \int_{0}^{t_{N}}\lambda_{\pmb{\theta}}^{*}(s)ds\right]$ .
+
+The main challenge of such intensity-based approaches lies in choosing a good parametric form for $\lambda_{\theta}^{*}(t)$ . This usually involves the following trade-off: For a "simple" intensity function (Du et al., 2016; Huang et al., 2019), the integral $\Lambda^{*}(\tau_{i}) := \int_{0}^{\tau_{i}} \lambda^{*}(t_{i-1} + s) ds$ has a closed form, which makes the log-likelihood easy to compute. However, such models usually have limited expressiveness. A more sophisticated intensity function (Mei & Eisner, 2017) can better capture the dynamics of the system, but computing log-likelihood will require approximating the integral using Monte Carlo.
+
+Recently, Omi et al. (2019) proposed fully neural network intensity function (FullyNN) — a flexible, yet computationally tractable model for TPPs. The key idea of their approach is to model the cumulative conditional intensity function $\Lambda^{*}(\tau_{i})$ using a neural network, which allows to efficiently compute the log-likelihood. Still, in its current state, the model has downsides: it doesn't define a valid PDF, sampling is expensive, and the expectation cannot be computed in closed form1.
+
+This work. We show that the drawbacks of the existing approaches can be remedied by looking at the problem of learning in TPPs from a different angle. Instead of modeling the conditional intensity $\lambda^{*}(t)$ , we suggest to directly learn the conditional distribution $p^{*}(\tau)$ . Modeling distributions with neural networks is a well-researched topic, that, surprisingly, is not usually discussed in the context of TPPs. By adopting this alternative point of view, we are able to develop new theoretically sound and effective methods (Section 3), as well as better understand the existing approaches (Section 4).
+
+# 3 MODELS
+
+We develop several approaches for modeling the distribution of inter-event times. First, we assume for simplicity that each inter-event time $\tau_{i}$ is conditionally independent of the history, given the model parameters (that is, $p^{*}(\tau_{i}) = p(\tau_{i})$ ). In Section 3.1, we show how state-of-the-art neural density estimation methods based on normalizing flows can be used to model $p(\tau_{i})$ . Then in Section 3.2, we propose a simple mixture model that can match the performance of the more sophisticated flow-based models, while also addressing some of their shortcomings. Finally, we discuss how to make $p(\tau_{i})$ depend on the history $\mathcal{H}_{t_i}$ in Section 3.3.
+
+# 3.1 MODELING $p(\tau)$ WITH NORMALIZING FLOWS
+
+The core idea of normalizing flows (Tabak & Turner, 2013; Rezende & Mohamed, 2015) is to define a flexible probability distribution by transforming a simple one. Assume that $z$ has a PDF $q(z)$ . Let $x = g(z)$ for some differentiable invertible transformation $g: \mathcal{Z} \to \mathcal{X}$ (where $\mathcal{Z}, \mathcal{X} \subseteq \mathbb{R}^2$ ). We can obtain the PDF $p(x)$ of $x$ using the change of variables formula as $p(x) = q(g^{-1}(x)) \left| \frac{\partial}{\partial x} g^{-1}(x) \right|$ . By stacking multiple transformations $g_1, \ldots, g_M$ , we obtain an expressive probability distribution $p(x)$ . To draw a sample $x \sim p(x)$ , we need to draw $z \sim q(z)$ and compute the forward transformation $x = (g_M \circ \dots \circ g_1)(z)$ . To get the density of an arbitrary point $x$ , it is necessary to evaluate the inverse transformation $z = (g_1^{-1} \circ \dots \circ g_M^{-1})(x)$ and compute $q(z)$ . Modern normalizing flows architectures parametrize the transformations using extremely flexible functions $f_\theta$ , such as polynomials (Jaini et al., 2019) or neural networks (Krueger et al., 2018). The flexibility of these functions comes at a cost — while the inverse $f_\theta^{-1}$ exists, it typically doesn't have a closed form. That is, if we use such a function to define one direction of the transformation in a flow model, the other direction can only be approximated numerically using iterative root-finding methods (Ho et al., 2019). In this work, we don't consider invertible normalizing flows based on dimension splitting, such as RealNVP (Dinh et al., 2017), since they are not applicable to 1D data.
+
+In the context of TPPs, our goal is to model the distribution $p(\tau)$ of inter-event times. In order to be able to learn the parameters of $p(\tau)$ using maximum likelihood, we need to be able to evaluate the density at any point $\tau$ . For this we need to define the inverse transformation $g^{-1} \coloneqq (g_1^{-1} \circ \dots \circ g_M^{-1})$ . First, we set $z_{M} = g_{M}^{-1}(\tau) = \log \tau$ to convert a positive $\tau \in \mathbb{R}_{+}$ into $z_{M} \in \mathbb{R}$ . Then, we stack multiple layers of parametric functions $f_{\theta}: \mathbb{R} \to \mathbb{R}$ that can approximate any transformation. We consider two choices for $f_{\theta}$ : deep sigmoidal flow (DSF) from Krueger et al. (2018) and sum-of-squares (SOS) polynomial flow from Jaini et al. (2019)
+
+$$
+f ^ {D S F} (x) = \sigma^ {- 1} \left(\sum_ {k = 1} ^ {K} w _ {k} \sigma \left(\frac {x - \mu_ {k}}{s _ {k}}\right)\right) \quad f ^ {S O S} (x) = a _ {0} + \sum_ {k = 1} ^ {K} \sum_ {p = 0} ^ {R} \sum_ {q = 0} ^ {R} \frac {a _ {p , k} a _ {q , k}}{p + q + 1} x ^ {p + q + 1} \tag {1}
+$$
+
+where $\pmb{a}, \pmb{w}, \pmb{s}, \pmb{\mu}$ are the transformation parameters, $K$ is the number of components, $R$ is the polynomial degree, and $\sigma(x) = 1/(1 + e^{-x})$ . We denote the two variants of the model based on $f^{DSF}$ and $f^{SOS}$ building blocks as DSFlow and SOSFlow respectively. Finally, after stacking multiple $g_{m}^{-1} = f_{\theta_{m}}$ , we apply a sigmoid transformation $g_{1}^{-1} = \sigma$ to convert $z_{2}$ into $z_{1} \in (0,1)$ .
+
+For both models, we can evaluate the inverse transformations $(g_1^{-1} \circ \dots \circ g_M^{-1})$ , which means the model can be efficiently trained via maximum likelihood. The density $p(\tau)$ defined by either DS-Flow or SOSFlow model is extremely flexible and can approximate any distribution (Section 3.4). However, for some use cases, this is not sufficient. For example, we may be interested in the expected time until the next event, $\mathbb{E}_p[\tau]$ . In this case, flow-based models are not optimal, since for them $\mathbb{E}_p[\tau]$ does not in general have a closed form. Moreover, the forward transformation $(g_M \circ \dots \circ g_1)$ cannot be computed in closed form since the functions $f^{DSF}$ and $f^{SOS}$ cannot be inverted analytically. Therefore, sampling from $p(\tau)$ is also problematic and requires iterative root finding.
+
+This raises the question: Can we design a model for $p(\tau)$ that is as expressive as the flow-based models, but in which sampling and computing moments is easy and can be done in closed form?
+
+# 3.2 MODELING $p(\tau)$ WITH MIXTURE DISTRIBUTIONS
+
+Model definition. While mixture models are commonly used for clustering, they can also be used for density estimation. Mixtures work especially well in low dimensions (McLachlan & Peel, 2004), which is the case in TPPs, where we model the distribution of one-dimensional inter-event times $\tau$ . Since the inter-event times $\tau$ are positive, we choose to use a mixture of log-normal distributions to model $p(\tau)$ . The PDF of a log-normal mixture is defined as
+
+$$
+p (\tau | \boldsymbol {w}, \boldsymbol {\mu}, \boldsymbol {s}) = \sum_ {k = 1} ^ {K} w _ {k} \frac {1}{\tau s _ {k} \sqrt {2 \pi}} \exp \left(- \frac {\left(\log \tau - \mu_ {k}\right) ^ {2}}{2 s _ {k} ^ {2}}\right) \tag {2}
+$$
+
+
+Figure 1: Model architecture. Parameters of $p^{*}(\tau_{i}|\pmb{\theta}_{i})$ are generated based on the conditional information $c_{i}$ .
+
+
+Figure 2: Normalizing flows define a flexible distribution via transformations.
+
+where $\boldsymbol{w}$ are the mixture weights, $\mu$ are the mixture means, and $s$ are the standard deviations. Because of its simplicity, the log-normal mixture model has a number of attractive properties.
+
+Moments. Since each component $k$ has a finite mean, the mean of the entire distribution can be computed as $\mathbb{E}_p[\tau] = \sum_k w_k \exp(\mu_k + s_k^2/2)$ , i.e., a weighted average of component means. Higher moments can be computed based on the moments of each component (Fruhwirth-Schnatter, 2006).
+
+Sampling. While flow-based models from Section 3.1 require iterative root-finding algorithms to generate samples, sampling from a mixture model can be done in closed form:
+
+$$
+\boldsymbol {z} \sim \operatorname {C a t e g o r i c a l} (\boldsymbol {w}) \quad \varepsilon \sim \operatorname {N o r m a l} (0, 1) \quad \tau = \exp (\boldsymbol {s} ^ {T} \boldsymbol {z} \cdot \varepsilon + \boldsymbol {\mu} ^ {T} \boldsymbol {z})
+$$
+
+where $z$ is a one-hot vector of size $K$ . In some applications, such as reinforcement learning (Upadhyay et al., 2018), we might be interested in computing gradients of the samples w.r.t. the model parameters. The samples $\tau$ drawn using the procedure above are differentiable with respect to the means $\mu$ and scales $s$ . By using the Gumbel-softmax trick (Jang et al., 2017) when sampling $z$ , we can obtain gradients w.r.t. all the model parameters (Appendix D.6). Such reparametrization gradients have lower variance and are easier to implement than the score function estimators typically used in other works (Mohamed et al., 2019). Other flexible models (such as multi-layer flow models from Section 3.1) do not permit sampling through reparametrization, and thus are not well-suited for the above-mentioned scenario. In Section 5.4, we show how reparametrization sampling can also be used to train with missing data by performing imputation on the fly.
+
+# 3.3 INCORPORATING THE CONDITIONAL INFORMATION
+
+History. A crucial feature of temporal point processes is that the time $\tau_{i} = (t_{i} - t_{i - 1})$ until the next event may be influenced by all the events that happened before. A standard way of capturing this dependency is to process the event history $\mathcal{H}_{t_i}$ with a recurrent neural network (RNN) and embed it into a fixed-dimensional vector $h_i\in \mathbb{R}^H$ (Du et al., 2016).
+
+Conditioning on additional features. The distribution of the time until the next event might depend on factors other than the history. For instance, distribution of arrival times of customers in a restaurant depends on the day of the week. As another example, if we are modeling user behavior in an online system, we can obtain a different distribution $p^{*}(\tau)$ for each user by conditioning on their metadata. We denote such side information as a vector $\mathbf{y}_i$ . Such information is different from marks (Rasmussen, 2011), since (a) the metadata may be shared for the entire sequence and (b) $\mathbf{y}_i$ only influences the distribution $p^{*}(\tau_i|\mathbf{y}_i)$ , not the objective function.
+
+In some scenarios, we might be interested in learning from multiple event sequences. In such case, we can assign each sequence $\mathcal{T}_j$ a learnable sequence embedding vector $e_j$ . By optimizing $e_j$ , the model can learn to distinguish between sequences that come from different distributions. The learned embeddings can then be used for visualization, clustering or other downstream tasks.
+
+Obtaining the parameters. We model the conditional dependence of the distribution $p^*(\tau_i)$ on all of the above factors in the following way. The history embedding $\pmb{h}_i$ , metadata $\pmb{y}_i$ and sequence embedding $\pmb{e}_j$ are concatenated into a context vector $\pmb{c}_i = [h_i||\pmb{y}_i||\pmb{e}_j]$ . Then, we obtain the parameters of the distribution $p^*(\tau_i)$ as an affine function of $\pmb{c}_i$ . For example, for the mixture model we have
+
+$$
+\boldsymbol {w} _ {i} = \operatorname {s o f t m a x} \left(\boldsymbol {V} _ {\boldsymbol {w}} \boldsymbol {c} _ {i} + \boldsymbol {b} _ {\boldsymbol {w}}\right) \quad \boldsymbol {s} _ {i} = \exp \left(\boldsymbol {V} _ {\boldsymbol {s}} \boldsymbol {c} _ {i} + \boldsymbol {b} _ {\boldsymbol {s}}\right) \quad \boldsymbol {\mu} _ {i} = \boldsymbol {V} _ {\boldsymbol {\mu}} \boldsymbol {c} _ {i} + \boldsymbol {b} _ {\boldsymbol {\mu}} \tag {3}
+$$
+
+where the softmax and exp transformations are applied to enforce the constraints on the distribution parameters, and $\{V_w, V_s, V_\mu, b_w, b_s, b_\mu\}$ are learnable parameters. Such model resembles the
+
+mixture density network architecture (Bishop, 1994). The whole process is illustrated in Figure 1. We obtain the parameters of the flow-based models in a similar way (see Appendix D).
+
+# 3.4 DISCUSSION
+
+Universal approximation. The SOSFlow and DSFlow models can approximate any probability density on $\mathbb{R}$ arbitrarily well (Jaini et al., 2019, Theorem 3), (Krueger et al., 2018, Theorem 4). It turns out, a mixture model has the same universal approximation (UA) property.
+
+Theorem 1 (DasGupta, 2008, Theorem 33.2). Let $p(x)$ be a continuous density on $\mathbb{R}$ . If $q(x)$ is any density on $\mathbb{R}$ and is also continuous, then, given $\varepsilon > 0$ and a compact set $S \subset \mathbb{R}$ , there exist number of components $K \in \mathbb{N}$ , mixture coefficients $\boldsymbol{w} \in \Delta^{K-1}$ , locations $\boldsymbol{\mu} \in \mathbb{R}^K$ , and scales $s \in \mathbb{R}_+^K$ such that for the mixture distribution $\hat{p}(x) = \sum_{k=1}^{K} w_k \frac{1}{s_k} q\left(\frac{x - \mu_k}{s_k}\right)$ it holds $\sup_{x \in S} |p(x) - \hat{p}(x)| < \varepsilon$ .
+
+This results shows that, in principle, the mixture distribution is as expressive as the flow-based models. Since we are modeling the conditional density, we additionally need to assume for all of the above models that the RNN can encode all the relevant information into the history embedding $h_i$ . This can be accomplished by invoking the universal approximation theorems for RNNs (Siegelmann & Sontag, 1992; Schäfer & Zimmermann, 2006).
+
+Note that this result, like other UA theorems of this kind (Cybenko, 1989; Daniels & Velikova, 2010), does not provide any practical guarantees on the obtained approximation quality, and doesn't say how to learn the model parameters. Still, UA intuitively seems like a desirable property of a distribution. This intuition is supported by experimental results. In Section 5.1, we show that models with the UA property consistently outperform the less flexible ones.
+
+Interestingly, Theorem 1 does not make any assumptions about the form of the base density $q(x)$ . This means we could as well use a mixture of distribution other than log-normal. However, other popular distributions on $\mathbb{R}_+$ have drawbacks: log-logistic does not always have defined moments and gamma distribution doesn't permit straightforward sampling with reparametrization.
+
+Intensity function. For both flow-based and mixture models, the conditional cumulative distribution function (CDF) $F^{*}(\tau)$ and the PDF $p^{*}(\tau)$ are readily available. This means we can easily compute the respective intensity functions (see Appendix A). However, we should still ask whether we lose anything by modeling $p^{*}(\tau)$ instead of $\lambda^{*}(t)$ . The main arguments in favor of modeling the intensity function in traditional models (e.g. self-exciting process) are that it's intuitive, easy to specify and reusable (Upadhyay & Rodriguez, 2019).
+
+"Intensity function is intuitive, while the conditional density is not." — While it's true that in simple models (e.g. in self-exciting or self-correcting processes) the dependence of $\lambda^{*}(t)$ on the history is intuitive and interpretable, modern RNN-based intensity functions (as in Du et al. (2016); Mei & Eisner (2017); Omi et al. (2019)) cannot be easily understood by humans. In this sense, our proposed models are as intuitive and interpretable as other existing intensity-based neural network models.
+
+" $\lambda^{*}(t)$ is easy to specify, since it only has to be positive. On the other hand, $p^* (\tau)$ must integrate to one." — As we saw, by using either normalizing flows or a mixture distribution, we automatically enforce that the PDF integrates to one, without sacrificing the flexibility of our model.
+
+"Reusability: If we merge two independent point processes with intensities $\lambda_1^*(t)$ and $\lambda_2^*(t)$ , the merged process has intensity $\lambda^*(t) = \lambda_1^*(t) + \lambda_2^*(t)$ ." — An equivalent result exists for the CDFs $F_1^*(\tau)$ and $F_2^*(\tau)$ of the two independent processes. The CDF of the merged process is obtained as $F^*(\tau) = F_1^*(\tau) + F_2^*(\tau) - F_1^*(\tau)F_2^*(\tau)$ (derivation in Appendix A).
+
+As we just showed, modeling $p^*(\tau)$ instead of $\lambda^*(t)$ does not impose any limitation on our approach. Moreover, a mixture distribution is flexible, easy to sample from and has well-defined moments, which favorably compares it to other intensity-based deep learning models.
+
+# 4 RELATED WORK
+
+Neural temporal point processes. Fitting simple TPP models (e.g. self-exciting (Hawkes, 1971) or self-correcting (Isham & Westcott, 1979) processes) to real-world data may lead to poor results because of model misspecification. Multiple recent works address this issue by proposing more
+
+flexible neural-network-based point process models. These neural models are usually defined in terms of the conditional intensity function. For example, Mei & Eisner (2017) propose a novel RNN architecture that can model sophisticated intensity functions. This flexibility comes at the cost of inability to evaluate the likelihood in closed form, and thus requiring Monte Carlo integration.
+
+Du et al. (2016) suggest using an RNN to encode the event history into a vector $\pmb{h}_i$ . The history embedding $\pmb{h}_i$ is then used to define the conditional intensity, for example, using the constant intensity model $\lambda^{*}(t_{i}) = \exp (\pmb{v}^{T}\pmb{h}_{i} + b)$ (Li et al., 2018; Huang et al., 2019) or the more flexible exponential intensity model $\lambda^{*}(t_{i}) = \exp (w(t_{i} - t_{i - 1}) + \pmb{v}^{T}\pmb{h}_{i} + b)$ (Du et al., 2016; Upadhyay et al., 2018). By considering the conditional distribution $p^{\ast}(\tau)$ of the two models, we can better understand their properties. Constant intensity corresponds to an exponential distribution, and exponential intensity corresponds to a Gompertz distribution (see Appendix B). Clearly, these unimodal distributions cannot match the flexibility of a mixture model (as can be seen in Figure 8).
+
+Omi et al. (2019) introduce a flexible fully neural network (FullyNN) intensity model, where they model the cumulative intensity function $\Lambda^{*}(\tau)$ with a neural net. The function $\Lambda^{*}$ converts $\tau$ into an exponentially distributed random variable with unit rate (Rasmussen, 2011), similarly to how normalizing flows model $p^{*}(\tau)$ by converting $\tau$ into a random variable with a simple distribution. However, due to a suboptimal choice of the network architecture, the PDF of the FullyNN model does not integrate to 1, and the model assigns non-zero probability to negative inter-event times (see Appendix C). In contrast, SOSFlow and DSFlow always define a valid PDF on $\mathbb{R}_{+}$ . Moreover, similar to other flow-based models, sampling from the FullyNN model requires iterative root finding.
+
+Several works used mixtures of kernels to parametrize the conditional intensity function (Taddy et al., 2012; Tabibian et al., 2017; Okawa et al., 2019). Such models can only capture self-exciting influence from past events. Moreover, these models do not permit computing expectation and drawing samples in closed form. Recently, Biloš et al. (2019) and Türkmen et al. (2019) proposed neural models for learning marked TPPs. These models focus on event type prediction and share the limitations of other neural intensity-based approaches. Other recent works consider alternatives to the maximum likelihood objective for training TPPs. Examples include noise-contrastive estimation (Guo et al., 2018), Wasserstein distance (Xiao et al., 2017; 2018; Yan et al., 2018), and reinforcement learning (Li et al., 2018; Upadhyay et al., 2018). This line of research is orthogonal to our contribution, and the models proposed in our work can be combined with the above-mentioned training procedures.
+
+Neural density estimation. There exist two popular paradigms for learning flexible probability distributions using neural networks: In mixture density networks (Bishop, 1994), a neural net directly produces the distribution parameters; in normalizing flows (Tabak & Turner, 2013; Rezende & Mohamed, 2015), we obtain a complex distribution by transforming a simple one. Both mixture models (Schuster, 2000; Eirola & Lendasse, 2013; Graves, 2013) and normalizing flows (Oord et al., 2016; Ziegler & Rush, 2019) have been applied for modeling sequential data. However, surprisingly, none of the existing works make the connection and consider these approaches in the context of TPPs.
+
+# 5 EXPERIMENTS
+
+We evaluate the proposed models on the established task of event time prediction (with and without marks) in Sections 5.1 and 5.2. In the remaining experiments, we show how the log-normal mixture model can be used for incorporating extra conditional information, training with missing data and learning sequence embeddings. We use 6 real-world datasets containing event data from various domains: Wikipedia (article edits), MOOC (user interaction with online course system), Reddit (posts in social media) (Kumar et al., 2019), Stack Overflow (badges received by users), LastFM (music playback) (Du et al., 2016), and Yelp (check-ins to restaurants). We also generate 5 synthetic datasets (Poisson, Renewal, Self-correcting, Hawkes1, Hawkes2), as described in Omi et al. (2019). Detailed descriptions and summary statistics of all the datasets are provided in Appendix E.
+
+# 5.1 EVENT TIME PREDICTION USING HISTORY
+
+Setup. We consider two normalizing flow models, SOSFlow and DSFlow (Equation 1), as well a log-normal mixture model (Equation 2), denoted as LogNormMix. As baselines, we consider RMTPP (i.e. Gompertz distribution / exponential intensity from Du et al. (2016)) and FullyNN
+
+
+Figure 3: NLL loss for event time prediction without marks (left) and with marks (right). NLL of each model is standardized by subtracting the score of LogNormMix. Lower score is better. Despite its simplicity, LogNormMix consistently achieves excellent loss values.
+
+
+
+model by Omi et al. (2019). Additionally, we use a single log-normal distribution (denoted Log-Normal) to highlight the benefits of the mixture model. For all models, an RNN encodes the history into a vector $\pmb{h}_i$ . The parameters of $p^*(\tau)$ are then obtained using $\pmb{h}_i$ (Equation 3). We exclude the NeuralHawkes model from our comparison, since it is known to be inferior to RMTPP in time prediction (Mei & Eisner, 2017), and, unlike other models, doesn't have a closed-form likelihood.
+
+Each dataset consists of multiple sequences of event times. The task is to predict the time $\tau_{i}$ until the next event given the history $\mathcal{H}_{t_i}$ . For each dataset, we use $60\%$ of the sequences for training, $20\%$ for validation and $20\%$ for testing. We train all models by minimizing the negative log-likelihood (NLL) of the inter-event times in the training set. To ensure a fair comparison, we try multiple hyperparameter configurations for each model and select the best configuration using the validation set. Finally, we report the NLL loss of each model on the test set. All results are averaged over 10 train/validation/test splits. Details about the implementation, training process and hyperparameter ranges are provided in Appendix D. For each real-world dataset, we report the difference between the NLL loss of each method and the LogNormMix model (Figure 3). We report the differences, since scores of all models can be shifted arbitrarily by scaling the data. Absolute scores (not differences) in a tabular format, as well as results for synthetic datasets are provided in Appendix F.1.
+
+Results. Simple unimodal distributions (Gompertz/RMTPP, LogNormal) are always dominated by the more flexible models with the universal approximation property (LogNormMix, DSFlow, SOS-Flow, FullyNN). Among the simple models, LogNormal provides a much better fit to the data than RMTPP/Gompertz. The distribution of inter-event times in real-world data often has heavy tails, and the Gompertz distributions fail to capture this behavior. We observe that the two proposed models, LogNormMix and DSFlow consistently achieve the best loss values.
+
+# 5.2 LEARNING WITH MARKS
+
+Setup. We apply the models for learning in marked temporal point processes. Marks are known to improve performance of simpler models (Du et al., 2016), we want to establish whether our proposed models work well in this setting. We use the same setup as in the previous section, except for two differences. The RNN takes a tuple $(\tau_i, m_i)$ as input at each time step, where $m_i$ is the mark. Moreover, the loss function now includes a term for predicting the next mark: $\mathcal{L}(\pmb{\theta}) = -\sum_{i} [\log p_{\pmb{\theta}}^{*}(\tau_i) + \log p_{\pmb{\theta}}^{*}(m_i)]$ (implementation details in Appendix F.2).
+
+Results. Figure 3 (right) shows the time NLL loss (i.e. $-\sum_{i}\log p^{*}(\tau_{i}))$ for Reddit and MOOC datasets. LogNormMix shows dominant performance in the marked case, just like in the previous experiment. Like before, we provide the results in tabular format, as well as report the marks NLL loss in Appendix F.
+
+# 5.3 LEARNING WITH ADDITIONAL CONDITIONAL INFORMATION
+
+Setup. We investigate whether the additional conditional information (Section 3.3) can improve performance of the model. In the Yelp dataset, the task is to predict the time $\tau$ until the next check-in for a given restaurant. We postulate that the distribution $p^{*}(\tau)$ is different, depending on whether it's a weekday and whether it's an evening hour, and encode this information as a vector $\mathbf{y}_i$ . We consider 4 variants of the LogNormMix model, that either use or don't use $\mathbf{y}_i$ and the history embedding $h_i$ .
+
+
+
+
+Figure 4: By sampling the missing values from $p^{*}(\tau)$ during training, LogNormMix learns the true underlying data distribution. Other imputation strategies overfit the partially observed sequence.
+
+| Model | NLL |
| No imputation | 1.01 ± 0.20 |
| Mean imputation | 0.81 ± 0.27 |
| Sampling with reparametrization | 0.36 ± 0.05 |
+
+Results. Figure 5 shows the test set loss for 4 variants of the model. We see that additional conditional information boosts performance of the LogNormMix model, regardless of whether the history embedding is used.
+
+# 5.4 MISSING DATA IMPUTATION
+
+In practical scenarios, one often has to deal with missing data. For example, we may know that records were not kept for a period of time, or that the data is unusable for some reason. Since TPPs are a generative model, they provide a principled way to handle the missing data through imputation.
+
+Setup. We are given several sequences generated by a Hawkes process, where some parts are known to be missing. We consider 3 strategies for learning from such a partially observed sequence: (a) ignore the gaps, maximize log-likelihood of observed inter-event times (b) fill the gaps with the average $\tau$ estimated from observed data, maximize log-likelihood of observed data, and (c) fill the gaps with samples generated by the model, maximize the expected log-likelihood of the observed points. The setup is demonstrated in Figure 4. Note that in case (c) the expected value depends on the parameters of the distribution, hence we need to perform sampling with reparametrization to optimize such loss. A more detailed description of the setup is given in Appendix F.4.
+
+Results. The 3 model variants are trained on the partially-observed sequence. Figure 4 shows the NLL of the fully observed sequence (not seen by any model at training time) produced by each strategy. We see that strategies (a) and (b) overfit the partially observed sequence. In contrast, strategy (c) generalizes and learns the true underlying distribution. The ability of the LogNormMix model to draw samples with reparametrization was crucial to enable such training procedure.
+
+
+Figure 5: Conditional information improves performance.
+
+
+Figure 6: Sequences generated based on different embeddings.
+
+
+Figure 7: Sequence embeddings learned by the model.
+
+# 5.5 SEQUENCE EMBEDDING
+
+Different sequences in the dataset might be generated by different processes, and exhibit different distribution of inter-event times. We can "help" the model distinguish between them by assigning a trainable embedding vector $e_j$ to each sequence $j$ in the dataset. It seems intuitive that embedding vectors learned this way should capture some notion of similarity between sequences.
+
+Learned sequence embeddings. We learn a sequence embedding for each of the sequences in the synthetic datasets (along with other model parameters). We visualize the learned embeddings using t-SNE (Maaten & Hinton, 2008) in Figure 7 colored by the true class. As we see, the model learns to differentiate between sequences from different distributions in a completely unsupervised way.
+
+Generation. We fit the LogNormMix model to two sequences (from self-correcting and renewal processes), and, respectively, learn two embedding vectors $e_{SC}$ and $e_{RN}$ . After training, we generate 3 sequences from the model, using $e_{SC}$ , $\frac{1}{2}(e_{SC} + e_{RN})$ and $e_{RN}$ as sequence embeddings. Additionally, we plot the learned conditional intensity function of our model for each generated sequence (Figure 6). The model learns to map the sequence embeddings to very different distributions.
+
+# 6 CONCLUSIONS
+
+We use tools from neural density estimation to design new models for learning in TPPs. We show that a simple mixture model is competitive with state-of-the-art normalizing flows methods, as well as convincingly outperforms other existing approaches. By looking at learning in TPPs from a different perspective, we were able to address the shortcomings of existing intensity-based approaches, such as insufficient flexibility, lack of closed-form likelihoods and inability to generate samples analytically. We hope this alternative viewpoint will inspire new developments in the field of TPPs.
+
+# ACKNOWLEDGMENTS
+
+This research was supported by the German Federal Ministry of Education and Research (BMBF), grant no. 01IS18036B, and the Software Campus Project Deep-RENT. The authors of this work take full responsibilities for its content.
+
+# REFERENCES
+
+Marin Bilos, Bertrand Charpentier, and Stephan Gunnemann. Uncertainty on asynchronous time event prediction. In Advances in Neural Information Processing Systems. 2019.
+Eli Bingham, Jonathan P. Chen, Martin Jankowiak, Fritz Obermeyer, Neeraj Pradhan, Theofanis Karaletsos, Rohit Singh, Paul Szerlip, Paul Horsfall, and Noah D. Goodman. Pyro: Deep Universal Probabilistic Programming. Journal of Machine Learning Research, 2018.
+Christopher M Bishop. Mixture density networks. 1994.
+Oscar Celma. Music recommendation. In Music recommendation and discovery, pp. 43-85. Springer, 2010.
+George Cybenko. Approximation by superpositions of a sigmoidal function. Mathematics of control, signals and systems, 2(4), 1989.
+Hennie Daniels and Marina Velikova. Monotone and partially monotone neural networks. IEEE Transactions on Neural Networks, 21(6):906-917, 2010.
+Anirban DasGupta. Asymptotic theory of statistics and probability. Springer Science & Business Media, 2008.
+Laurent Dinh, Jascha Sohl-Dickstein, and Samy Bengio. Density estimation using Real NVP. International Conference on Learning Representations, 2017.
+Nan Du, Hanjun Dai, Rakshit Trivedi, Utkarsh Upadhyay, Manuel Gomez-Rodriguez, and Le Song. Recurrent marked temporal point processes: Embedding event history to vector. In ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, 2016.
+Emil Eirola and Amaury Lendasse. Gaussian mixture models for time series modelling, forecasting, and interpolation. In International Symposium on Intelligent Data Analysis, pp. 162-173. Springer, 2013.
+Sylvia Fruhwirth-Schnatter. Finite mixture and Markov switching models. Springer Science & Business Media, 2006.
+Will Grathwohl, Dami Choi, Yuhuai Wu, Geoffrey Roeder, and David Duvenaud. Backpropagation through the void: Optimizing control variates for black-box gradient estimation. International Conference on Learning Representations, 2018.
+
+Alex Graves. Generating sequences with recurrent neural networks. arXiv preprint arXiv:1308.0850, 2013.
+Ruocheng Guo, Jundong Li, and Huan Liu. INITIATOR: Noise-contrastive estimation for marked temporal point process. In International Joint Conference on Artificial Intelligence, 2018.
+Alan G Hawkes. Spectra of some self-exciting and mutually exciting point processes. Biometrika, 58(1):83-90, 1971.
+Jonathan Ho, Xi Chen, Aravind Srinivas, Yan Duan, and Pieter Abbeel. Flow++: Improving flow-based generative models with variational dequantization and architecture design. International Conference on Machine Learning, 2019.
+Hengguang Huang, Hao Wang, and Brian Mak. Recurrentoisson process unit for speech recognition. In AAAI Conference on Artificial Intelligence, 2019.
+Valerie Isham and Mark Westcott. A self-correcting point process. Stochastic Processes and Their Applications, 8(3):335-347, 1979.
+Priyank Jaini, Kira A. Selby, and Yaoliang Yu. Sum-of-squares polynomial flow. In International Conference on Machine Learning, 2019.
+Eric Jang, Shixiang Gu, and Ben Poole. Categorical reparameterization with Gumbel-softmax. International Conference on Learning Representations, 2017.
+Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. The International Conference on Learning Representations, 2015.
+David Krueger, Chin-Wei Huang, Alexandre Lacoste, and Aaron Courville. Neural autoregressive flows. In International Conference on Machine Learning, 2018.
+Srijan Kumar, Xikun Zhang, and Jure Leskovec. Predicting dynamic embedding trajectory in temporal interaction networks. In ACM SIGKDD international conference on Knowledge discovery and data mining, 2019.
+Shuang Li, Shuai Xiao, Shixiang Zhu, Nan Du, Yao Xie, and Le Song. Learning temporal point processes via reinforcement learning. In Advances in Neural Information Processing Systems, 2018.
+Laurens van der Maaten and Geoffrey Hinton. Visualizing data using t-sne. Journal of machine learning research, 9(Nov):2579-2605, 2008.
+Geoffrey McLachlan and David Peel. Finite mixture models. John Wiley & Sons, 2004.
+Hongyuan Mei and Jason M Eisner. The neural hawkes process: A neurally self-modulating multivariate point process. In Advances in Neural Information Processing Systems, 2017.
+Shakir Mohamed, Mihaela Rosca, Michael Figurnov, and Andriy Mnih. Monte carlo gradient estimation in machine learning. arXiv preprint arXiv:1906.10652, 2019.
+Maya Okawa, Tomoharu Iwata, Takeshi Kurashima, Yusuke Tanaka, Hiroyuki Toda, and Naonori Ueda. Deep mixture point processes: Spatio-temporal event prediction with rich contextual information. 2019.
+Takahiro Omi, Naonori Ueda, and Kazuyuki Aihara. Fully neural network based model for general temporal point processes. 2019.
+Aaron van den Oord, Sander Dieleman, Heiga Zen, Karen Simonyan, Oriol Vinyals, Alex Graves, Nal Kalchbrenner, Andrew Senior, and Koray Kavukcuoglu. Wavenet: A generative model for raw audio. arXiv preprint arXiv:1609.03499, 2016.
+Adam Paszke, Sam Gross, Soumith Chintala, Gregory Chanan, Edward Yang, Zachary DeVito, Zeming Lin, Alban Desmaison, Luca Antiga, and Adam Lerer. Automatic differentiation in PyTorch. In NIPS Autodiff Workshop, 2017.
+
+Jakob Gulddahl Rasmussen. Temporal point processes: the conditional intensity function. Lecture Notes, Jan, 2011.
+Danilo Jimenez Rezende and Shakir Mohamed. Variational inference with normalizing flows. International Conference on Machine Learning, 2015.
+Anton Maximilian Schafer and Hans Georg Zimmermann. Recurrent neural networks are universal approximators. In International Conference on Artificial Neural Networks, pp. 632-640. Springer, 2006.
+Mike Schuster. Better generative models for sequential data problems: Bidirectional recurrent mixture density networks. In Advances in Neural Information Processing Systems, 2000.
+Hava T Siegelmann and Eduardo D Sontag. On the computational power of neural nets. In Proceedings of the fifth annual workshop on Computational learning theory, pp. 440-449. ACM, 1992.
+Esteban G Tabak and Cristina V Turner. A family of nonparametric density estimation algorithms. Communications on Pure and Applied Mathematics, 66(2):145-164, 2013.
+Behzad Tabibian, Isabel Valera, Mehrdad Farajtabar, Le Song, Bernhard Scholkopf, and Manuel Gomez-Rodriguez. Distilling information reliability and source trustworthiness from digital traces. In International Conference on World Wide Web, pp. 847-855, 2017.
+Matthew A Taddy, Athanasios Kottas, et al. Mixture modeling for marked poisson processes. Bayesian Analysis, 7(2), 2012.
+George Tucker, Andriy Mnih, Chris J Maddison, John Lawson, and Jascha Sohl-Dickstein. Rebar: Low-variance, unbiased gradient estimates for discrete latent variable models. In Advances in Neural Information Processing Systems, 2017.
+Ali Caner Türkmen, Yuyang Wang, and Alexander J Smola. Fastpoint: Scalable deep point processes. In Joint European Conference on Machine Learning and Knowledge Discovery in Databases, 2019.
+Utkarsh Upadhyay and Manuel Gomez Rodriguez. Temporal point processes. Lecture notes for Human-Centered ML, January 2019. URL http://courses.mpi-sws.org/hcml-WS18/lectures/TPP.pdf.
+Utkarsh Upadhyay, Abir De, and Manuel Gomez Rodriguez. Deep reinforcement learning of marked temporal point processes. In Advances in Neural Information Processing Systems, 2018.
+Andreas Wienke. *Frailty models in survival analysis*. Chapman and Hall/CRC, 2010.
+Ronald J Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine learning, 8(3-4):229-256, 1992.
+Shuai Xiao, Mehrdad Farajtabar, Xiaojing Ye, Junchi Yan, Le Song, and Hongyuan Zha. Wasserstein learning of deep generative point process models. In Advances in Neural Information Processing Systems, 2017.
+Shuai Xiao, hongteng Xu, Junchi Yan, Mehrdad Farajtabar, Xiaokang Yang, Le Song, and Hongyuan Zha. Learning conditional generative models for temporal point processes. In AAAI Conference on Artificial Intelligence, 2018.
+Junchi Yan, Xin Liu, Liangliang Shi, Changsheng Li, and Hongyuan Zha. Improving maximum likelihood estimation of temporal point process via discriminative and adversarial learning. In International Joint Conference on Artificial Intelligence, 2018.
+Zachary M Ziegler and Alexander M Rush. Latent normalizing flows for discrete sequences. International Conference on Machine Learning, 2019.
+
+# A INTENSITY FUNCTION OF FLOW AND MIXTURE MODELS
+
+CDF and conditional intensity function of proposed models. The cumulative distribution function (CDF) of a normalizing flow model can be obtained in the following way. If $z$ has a CDF $Q(z)$ and $\tau = g(z)$ , then the CDF $F(\tau)$ of $\tau$ is obtained as
+
+$$
+F (\tau) = Q (g ^ {- 1} (\tau))
+$$
+
+Since for both SOSFlow and DSFlow we can evaluate $g^{-1}$ in closed form, $F(\tau)$ is easy to compute.
+
+For the log-normal mixture model, CDF is by definition equal to
+
+$$
+F (\tau) = \sum_ {k = 1} ^ {K} w _ {k} \Phi \left(\frac {\log \tau - \mu_ {k}}{s _ {k}}\right)
+$$
+
+where $\Phi (\cdot)$ is the CDF of a standard normal distribution.
+
+Given the conditional PDF and CDF, we can compute the conditional intensity $\lambda^{*}(t)$ and the cumulative intensity $\Lambda^{*}(\tau)$ for each model as
+
+$$
+\lambda^ {*} (t) = \frac {p ^ {*} (t - t _ {i - 1})}{1 - F ^ {*} (t - t _ {i - 1})} \qquad \Lambda^ {*} (\tau_ {i}) := \int_ {0} ^ {\tau_ {i}} \lambda^ {*} (t _ {i - 1} + s) d s = - \log (1 - F ^ {*} (\tau_ {i}))
+$$
+
+where $t_{i-1}$ is the arrival time of most recent event before $t$ (Rasmussen, 2011).
+
+Merging two independent processes. We replicate the setup from Upadhyay & Rodriguez (2019) and consider what happens if we merge two independent TPPs with intensity functions $\lambda_1^*(t)$ and $\lambda_2^*(t)$ (and respectively, cumulative intensity functions $\Lambda_1^*(\tau)$ and $\Lambda_2^*(\tau)$ ). According to Upadhyay & Rodriguez (2019), the intensity function of the new process is $\lambda^*(t) = \lambda_1^*(t) + \lambda_2^*(t)$ . Therefore, the cumulative intensity function of the new process is
+
+$$
+\begin{array}{l} \Lambda^ {*} (\tau) = \int_ {0} ^ {\tau} \lambda^ {*} (t _ {i - 1} + s) d s \\ = \int_ {0} ^ {\tau} \lambda_ {1} ^ {*} (t _ {i - 1} + s) d s + \int_ {0} ^ {\tau} \lambda_ {2} ^ {*} (t _ {i - 1} + s) d s \\ = \Lambda_ {1} ^ {*} (\tau) + \Lambda_ {2} ^ {*} (\tau) \\ \end{array}
+$$
+
+Using the previous result, we can obtain the CDF of the merged process as
+
+$$
+\begin{array}{l} F ^ {*} (\tau) = 1 - \exp (- \Lambda^ {*} (\tau)) \\ = 1 - \exp \left(- \Lambda_ {1} ^ {*} (\tau) - \Lambda_ {2} ^ {*} (\tau)\right) \\ = 1 - \exp \left(\log \left(1 - F _ {1} ^ {*} (\tau)\right) + \log \left(1 - F _ {2} ^ {*} (\tau)\right)\right) \\ = 1 - \left(1 + F _ {1} ^ {*} (\tau) F _ {2} ^ {*} (\tau) - F _ {1} ^ {*} (\tau) - F _ {2} ^ {*} (\tau)\right) \\ = F _ {1} ^ {*} (\tau) + F _ {2} ^ {*} (\tau) - F _ {1} ^ {*} (\tau) F _ {2} ^ {*} (\tau) \\ \end{array}
+$$
+
+The PDF of the merged process is obtained by simply differentiating the CDF w.r.t. $\tau$ .
+
+This means that by using either normalizing flows or mixture distributions, and thus directly modeling PDF / CDF, we are not losing any benefits of the intensity parametrization.
+
+# B DISCUSSION OF CONSTANT & EXPONENTIAL INTENSITY MODELS
+
+Constant intensity model as exponential distribution. The conditional intensity function of the constant intensity model (Upadhyay et al., 2018) is defined as $\lambda^{*}(t_{i}) = \exp (\pmb{v}^{T}\pmb{h}_{i} + b)$ , where $\pmb{h}_i\in \mathbb{R}^H$ is the history embedding produced by an RNN, and $b\in \mathbb{R}$ is a learnable parameter. By setting $c = \exp (\pmb{v}^T\pmb {h}_i + b)$ , it's easy to see that the PDF of the constant intensity model $p^{\ast}(\tau) = c\exp (-c)$ corresponds to an exponential distribution.
+
+Exponential intensity model as Gompertz distribution. PDF of a Gompertz distribution (Wienke, 2010) is defined as
+
+$$
+p (\tau | \alpha , \beta) = \alpha \exp \left(\beta \tau - \frac {\alpha}{\beta} \exp (\beta t) + \frac {\alpha}{\beta}\right)
+$$
+
+
+Figure 8: Different choices for modeling $p(\tau)$ : exponential distribution (left), Gompertz distribution (center), log-normal mixture (right). Mixture distribution can approximate any density while being tractable and easy to sample from.
+
+
+
+
+
+for $\alpha, \beta > 0$ . The two parameters $\alpha$ and $\beta$ define its shape and rate, respectively. For any choice of its parameters, Gompertz distribution is unimodal and light-tailed. The mean of the Gompertz distribution can be computed as $\mathbb{E}[\tau] = \frac{1}{\beta} \exp \left( \frac{\alpha}{\beta} \right) \mathrm{Ei}(-\frac{\alpha}{\beta})$ , where $\mathrm{Ei}(z) = \int_{-z}^{\infty} \exp(-v) / v \, dv$ is the exponential integral function (that can be approximated numerically).
+
+The conditional intensity function of the exponential intensity model (Du et al., 2016) is defined as $\lambda^{*}(t_{i}) = \exp (w(t_{i} - t_{i - 1}) + \pmb{v}^{T}\pmb{h}_{i} + b)$ , where $\pmb{h}_i\in \mathbb{R}^H$ is the history embedding produced by an RNN, and $\pmb {v}\in \mathbb{R}^{H},b\in \mathbb{R},w\in \mathbb{R}_{+}$ are learnable parameters. By defining $d = v^{T}\pmb{h}_{i} + b$ , we obtain the PDF of the exponential intensity model (Du et al., 2016, Equation 12) as
+
+$$
+p (\tau | w, d) = \exp \left(w \tau + d - \frac {1}{w} \exp (w \tau + d) + \frac {1}{w} \exp (d)\right)
+$$
+
+By setting $\alpha = \exp (d)$ and $\beta = w$ we see that the exponential intensity model is equivalent to a Gompertz distribution.
+
+Discussion. Figure 8 shows densities that can be represented by exponential and Gompertz distributions. Even though the history embedding $h_i$ produced by an RNN may capture rich information, the resulting distribution $p^*(\tau_i)$ for both models has very limited flexibility, is unimodal and light-tailed. In contrast, a flow-based or a mixture model is significantly more flexible and can approximate any density.
+
+# C DISCUSSION OF THE FULLYNN MODEL
+
+Summary The main idea of the approach by Omi et al. (2019) is to model the integrated conditional intensity function
+
+$$
+\Lambda^ {*} (\tau) = \int_ {0} ^ {\tau} \lambda^ {*} (t _ {i - 1} + s) d s
+$$
+
+using a feedforward neural network with non-negative weights
+
+$$
+\Lambda^ {*} (\tau) := f (\tau) = \operatorname {s o f t p l u s} \left(\boldsymbol {W} ^ {(3)} \tanh \left(\boldsymbol {W} ^ {(2)} \tanh \left(\boldsymbol {W} ^ {(1)} \tau + \tilde {\boldsymbol {b}} ^ {(1)}\right) + \boldsymbol {b} ^ {(2)}\right) + \boldsymbol {b} ^ {(3)}\right) \tag {4}
+$$
+
+where $\tilde{\pmb{b}}^{(1)} = \pmb {V}\pmb {h} + \pmb{b}^{(0)},\pmb {h}\in \mathbb{R}^H$ is the history embedding, $W^{(1)}\in \mathbb{R}_{+}^{D\times 1}$ $W^{(2)}\in \mathbb{R}_+^{D\times D}$ $W^{(3)}\in \mathbb{R}_+^{1\times D}$ are non-negative weight matrices, and $\pmb {V}\in \mathbb{R}^{D\times H}$ $b^{(0)}\in \mathbb{R}^D$ $b^{(2)}\in \mathbb{R}^D$ $b^{(3)}\in \mathbb{R}$ are the remaining model parameters.
+
+FullyNN as a normalizing flow Let $z\sim \mathrm{Exponential}(1)$ , that is
+
+$$
+F (z) = 1 - \exp (- z) \quad p (z) = \exp (- z)
+$$
+
+We can view $f:\mathbb{R}_{+}\to \mathbb{R}_{+}$ as a transformation that maps $\tau$ to $z$
+
+$$
+z = f (\tau) \iff \tau = f ^ {- 1} (z)
+$$
+
+We can now use the change of variables formula to obtain the conditional CDF and PDF of $\tau$ .
+
+Alternatively, we can obtain the conditional intensity as
+
+$$
+\lambda^ {*} (\tau) = \frac {\partial}{\partial \tau} \Lambda^ {*} (\tau) = \frac {\partial}{\partial \tau} f (\tau)
+$$
+
+and use the fact that $p^*(\tau_i) = \lambda^*(t_{i-1} + \tau_i) \exp \left( -\int_0^{\tau_i} \lambda^*(t_{i-1} + s) ds \right)$ .
+
+Both approaches lead to the same conclusion
+
+$$
+F ^ {*} (\tau) = 1 - \exp (- f (\tau)) \quad p ^ {*} (\tau) = \exp (- f (\tau)) \frac {\partial}{\partial \tau} f (\tau)
+$$
+
+However, the first approach also provides intuition on how to draw samples $\tilde{\tau}$ from the resulting distribution $p^*(\tau)$ — an approach known as the inverse method (Rasmussen, 2011)
+
+1. Sample $\tilde{z} \sim$ Exponential(1)
+2. Obtain $\tilde{\tau}$ by solving $f(\tau) - \tilde{z} = 0$ for $\tau$ (using e.g. bisection method)
+
+Similarly to other flow-based models, sampling from the FullyNN model cannot be done exactly and requires a numerical approximation.
+
+# Shortcomings of the FullyNN model
+
+1. The PDF defined by the FullyNN model doesn't integrate to 1.
+
+By definition of the CDF, the condition that the PDF integrates to 1 is equivalent to $\lim_{\tau \to \infty}F^{*}(\tau) = 1$ , which in turn is equivalent to $\lim_{\tau \to \infty}\Lambda^{*}(\tau) = \infty$ . However, because of saturation of tanh activations (i.e. $\sup_{x\in \mathbb{R}}|\tanh (x)| = 1$ ) in Equation 4
+
+$$
+\lim _ {\tau \rightarrow \infty} \Lambda^ {*} (\tau) = \lim _ {\tau \rightarrow \infty} f (\tau) < \text {s o f t p l u s} \left(\sum_ {d = 1} ^ {D} | w _ {d} ^ {(3)} | + b ^ {(3)}\right) < \infty
+$$
+
+Therefore, the PDF doesn't integrate to 1.
+
+2. The FullyNN model assigns a non-zero amount of probability mass to the $(-\infty, 0)$ interval, which violates the assumption that inter-event times are strictly positive.
+
+Since the inter-event times $\tau$ are assumed to be strictly positive almost surely, it must hold that $\mathrm{Prob}(\tau \leq 0) = F^{*}(0) = 0$ , or equivalently $\Lambda^{*}(0) = 0$ . However, we can see that
+
+$$
+\Lambda^ {*} (0) = f (0) = \operatorname {s o f t p l u s} \left(\boldsymbol {W} ^ {(3)} \tanh \left(\boldsymbol {W} ^ {(2)} \tanh (\tilde {\boldsymbol {b}} ^ {(1)}) + \boldsymbol {b} ^ {(2)}\right) + \boldsymbol {b} ^ {(3)}\right) > 0
+$$
+
+which means that the FullyNN model permits negative inter-event times.
+
+# D IMPLEMENTATION DETAILS
+
+# D.1 SHARED ARCHITECTURE
+
+We implement SOSFlow, DSFlow and LogNormMix, together with baselines: RMTPP (Gompertz distribution), exponential distribution and a FullyNN model. All of them share the same pipeline, from the data preprocessing to the parameter tuning and model selection, differing only in the way we calculate $p^*(\tau)$ . This way we ensure a fair evaluation. Our implementation uses Pytorch.3
+
+From arival times $t_i$ we calculate the inter-event times $\tau_i = t_i - t_{i-1}$ . Since they can contain very large values, RNN takes log-transformed and centered inter-event time and produces $\pmb{h}_i \in \mathbb{R}^H$ . In case we have marks, we additionally input $m_i$ — the index of the mark class from which we get mark embedding vector $\pmb{m}_i$ . In some experiments we use extra conditional information, such as metadata $\pmb{y}_i$ and sequence embedding $\pmb{e}_j$ , where $j$ is the index of the sequence.
+
+As illustrated in Section 3.3 we generate the parameters $\pmb{\theta}$ of the distribution $p^*(\tau_i)$ from $[h_i||y_i||e_j]$ using an affine layer. We apply a transformation of the parameters to enforce the constraints, if necessary.
+
+All decoders are implemented using a common framework relying on normalizing flows. By defining the base distribution $q(z)$ and the inverse transformation $(g_1^{-1} \circ \dots \circ g_M^{-1})$ we can evaluate the PDF $p^*(\tau)$ at any $\tau$ , which allows us to train with maximum likelihood (Section 3.1).
+
+# D.2 LOG-NORMAL MIXTURE
+
+The log-normal mixture distribution is defined in Equation 2. We generate the parameters of the distribution $\pmb{w} \in \mathbb{R}^{K}, \pmb{\mu} \in \mathbb{R}^{K}, \pmb{s} \in \mathbb{R}^{K}$ (subject to $\sum_{k} w_{k} = 1, w_{k} \geq 0$ and $s_{k} > 0$ ), using an affine transformation (Equation 3). The log-normal mixture is equivalent to the following normalizing flow model
+
+$$
+z _ {1} \sim \operatorname {G a u s s i a n M i x t u r e} (\boldsymbol {w}, \boldsymbol {\mu}, \boldsymbol {s})
+$$
+
+$$
+z _ {2} = a z _ {1} + b
+$$
+
+$$
+\tau = \exp (z _ {2})
+$$
+
+By using the affine transformation $z_{2} = az_{1} + b$ before the exp transformation, we obtain a better initialization, and thus faster convergence. This is similar to the batch normalization flow layer (Dinh et al., 2017), except that $b = \frac{1}{N}\sum_{i=1}^{N}\log\tau_{i}$ and $a = \sqrt{\frac{1}{N}\sum_{i=1}^{N}(\log\tau_{i} - b)}$ are estimated using the entire dataset, not using batches.
+
+Forward direction samples a value from a Gaussian mixture, applies an affine transformation and applies exp. In the bacward direction we apply log-transformation to an observed data, center it with an affine layer and compute the density under the Gaussian mixture.
+
+# D.3 BASELINES
+
+We implement FullyNN model (Omi et al., 2019) as described in Appendix C, using the official implementation as a reference4. The model uses feed-forward neural network with non-negative weights (enforced by clipping values at 0 after every gradient step). Output of the network is a cumulative intensity function $\Lambda^{*}(\tau)$ from which we can easily get intensity function $\lambda^{*}(\tau)$ as a derivative w.r.t. $\tau$ using automatic differentiation in Pytorch. We get the PDF as $p^{*}(\tau) = \lambda^{*}(\tau)\exp (-\Lambda^{*}(\tau))$ .
+
+We implement RMTPP / Gompertz distribution (Du et al., 2016) and the exponential distribution (Upadhyay et al., 2018) models as described in Appendix B.
+
+All of the above methods define the distribution $p^*(\tau)$ . Since the inter-event times may come at very different scales, we apply a linear scaling $\tilde{\tau} = a\tau$ , where $a = \frac{1}{N}\sum_{i=1}^{N}\tau_i$ is estimated from the data. This ensures a good initialization for all models and speeds up training.
+
+# D.4 DEEP SIGMOIDAL FLOW
+
+A single layer of DSFlow model is defined as
+
+$$
+f _ {\boldsymbol {\theta}} ^ {D S F} (x) = \sigma^ {- 1} \left(\sum_ {k = 1} ^ {K} w _ {k} \sigma \left(\frac {x - \mu_ {k}}{s _ {k}}\right)\right)
+$$
+
+with parameters $\pmb{\theta} = \{\pmb{w} \in \mathbb{R}^K, \pmb{\mu} \in \mathbb{R}^K, \pmb{s} \in \mathbb{R}^K\}$ (subject to $\sum_{k} w_k = 1, w_k \geq 0$ and $s_k > 0$ ). We obtain the parameters of each layer using Equation 3.
+
+We define $p(\tau)$ through the inverse transformation $(g_1^{-1} \circ \dots \circ g_M^{-1})$ , as described in Section 3.1.
+
+$$
+z _ {M} = g _ {M} ^ {- 1} (\tau) = \log \tau
+$$
+
+.
+
+$$
+z _ {m} = g _ {m} ^ {- 1} \big (z _ {m + 1} \big) = f _ {\pmb {\theta} _ {m}} ^ {D S F} \big (z _ {m + 1} \big)
+$$
+
+.
+
+$$
+z _ {1} = \sigma (z _ {2})
+$$
+
+$$
+z _ {1} \sim q _ {1} (z _ {1}) = \operatorname {U n i f o r m} (0, 1)
+$$
+
+We use the batch normalization flow layer (Dinh et al., 2017) between every pair of consecutive layers, which significantly speeds up convergence.
+
+# D.5 SUM-OF-SQUARES POLYNOMIAL FLOW
+
+A single layer of SOSFlow model is defined as
+
+$$
+f ^ {S O S} (x) = a _ {0} + \sum_ {k = 1} ^ {K} \sum_ {p = 0} ^ {R} \sum_ {q = 0} ^ {R} \frac {a _ {p , k} a _ {q , k}}{p + q + 1} x ^ {p + q + 1}
+$$
+
+There are no constraints on the polynomial coefficients $\pmb{a} \in \mathbb{R}^{(R + 1) \times K}$ . We obtain $\pmb{a}$ similarly to Equation 3 as $\pmb{a} = \pmb{V}_{\pmb{a}}\pmb{c} + \pmb{b}_{\pmb{a}}$ , where $\pmb{c}$ is the context vector.
+
+We define $p(\tau)$ by through the inverse transformation $(g_1^{-1}\circ \dots \circ g_M^{-1})$ , as described in Section 3.1.
+
+.
+
+··
+
+$$
+\begin{array}{l} z _ {M} = g _ {M} ^ {- 1} (\tau) = \log \tau \\ z _ {m} = g _ {m} ^ {- 1} (z _ {m + 1}) = f _ {\pmb {\theta} _ {m}} ^ {S O S} (z _ {m + 1}) \\ z _ {1} = \sigma (z _ {2}) \\ z _ {1} \sim q _ {1} (z _ {1}) = \operatorname {U n i f o r m} (0, 1) \\ \end{array}
+$$
+
+Same as for DSFlow, we use the batch normalization flow layer between every pair of consecutive layers. When implementing SOSFlow, we used Pyro6 for reference.
+
+# D.6 REPARAMETRIZATION SAMPLING
+
+Using a log-normal mixture model allows us to sample with reparametrization which proves to be useful, e.g. when imputing missing data (Section 5.4). In a score function estimator (Williams, 1992) given a random variable $x \sim p_{\theta}(x)$ , where $\theta$ are parameters, we can compute $\nabla_{\theta} \mathbb{E}_{x \sim p_{\theta}(x)}[f(x)]$ as $\mathbb{E}_{x \sim p_{\theta}(x)}[f(x) \nabla_{\theta} \log p_{\theta}(x)]$ . This is an unbiased estimator of the gradients but it often suffers from high variance. If the function $f$ is differentiable, we can obtain an alternative estimator using the reparametrization trick: $\epsilon \sim q(\epsilon), x = g_{\theta}(\epsilon)$ . Thanks to this reparametrization, we can compute $\nabla_{\theta} \mathbb{E}_{x \sim p_{\theta}(x)}[f(x)] = \mathbb{E}_{\epsilon \sim q(\epsilon)}[\nabla_{\theta} f(g_{\theta}(\epsilon))]$ . Such reparametrization estimator typically has lower variance than the score function estimator (Mohamed et al., 2019). In both cases, we estimate the expectation using Monte Carlo.
+
+To sample with reparametrization from the mixture model we use the Straight-Through Gumbel Estimator (Jang et al., 2017). We first obtain a relaxed sample $\boldsymbol{z}^{*} = \mathrm{softmax}((\log \boldsymbol{w} + \boldsymbol{o}) / T)$ , where each $o_{i}$ is sampled i.i.d. from a Gumbel distribution with zero mean and unit scale, and $T$ is the temperature parameter. Finally, we get a one-hot sample $\boldsymbol{z} = \mathrm{onehot}(\arg \max_k z_k^*)$ . While a discrete $\boldsymbol{z}$ is used in the forward pass, during the backward pass the gradients will flow through the differentiable $\boldsymbol{z}^{*}$ .
+
+The gradients obtained by the Straight-Through Gumbel Estimator are slightly biased, which in practice doesn't have a significant effect on the model's performance. There exist alternatives (Tucker et al., 2017; Grathwohl et al., 2018) that provide unbiased gradients, but are more expensive to compute.
+
+# E DATASET STATISTICS
+
+# E.1 SYNTHETIC DATA
+
+Synthetic data is generated according to Omi et al. (2019) using well known point processes. We sample 64 sequences for each process, each sequence containing 1024 events.
+
+**Poisson.** Conditional intensity function for a homogeneous (or stationary) Poisson point process is given as $\lambda^{*}(t) = 1$ . Constant intensity corresponds to exponential distribution.
+
+Renewal. A stationary process defined by a log-normal probability density function $p(\tau)$ , where we set the parameters to be $\mu = 1.0$ and $\sigma = 6.0$ . Sequences appear clustered.
+
+| Dataset name | Number of sequences | Number of events |
| LastFM | 929 | 1268385 |
| Reddit | 10000 | 672350 |
| Stack Overflow | 6633 | 480414 |
| MOOC | 7047 | 396633 |
| Wikipedia | 1000 | 157471 |
| Yelp | 300 | 215146 |
+
+Table 2: Dataset statistics.
+
+Self-correcting. Unlike the previous two, this point process depends on the history and is defined by a conditional intensity function $\lambda^{*}(t) = \exp (t - \sum_{t_i < t}1)$ . After every new event the intensity suddenly drops, inhibiting the future points. The resulting point patterns appear regular.
+
+Hawkes. We use a self-exciting point process with a conditional intensity function given as $\lambda^{*}(t) = \mu +\sum_{t_i < t}\sum_{j = 1}^M\alpha_j\beta_j\exp (-\beta_j(t - t_i))$ . As per Omi et al. (2019), we create two different datasets: Hawkes1 with $M = 1$ , $\mu = 0.02$ , $\alpha_{1} = 0.8$ and $\beta_{1} = 1.0$ ; and Hawkes2 with $M = 2$ , $\mu = 0.2$ , $\alpha_{1} = 0.4$ , $\beta_{1} = 1.0$ , $\alpha_{2} = 0.4$ and $\beta_{2} = 20$ . For the imputation experiment we use Hawkes1 to generate the data and remove some of the events.
+
+# E.2 REAL-WORLD DATA
+
+In addition we use real-world datasets that are described bellow. Table 2 shows their summary. All datasets have a large amount of unique sequences and the number of events per sequence varies a lot. Using marked temporal point processes to predict the type of an event is feasible for some datasets (e.g. when the number of classes is low), and is meaningless for other.
+
+LastFM. The dataset contains sequences of songs that selected users listen over time. Artists are used as an event type.
+
+Reddit.8 On this social network website users submit posts to subreddits. In the dataset, most active subreddits are selected, and posts from the most active users on those subreddits are recoded. Each sequence corresponds to a list of submissions a user makes. The data contains 984 unique subreddits that we use as classes in mark prediction.
+
+Stack Overflow. Users of a question-answering website get rewards (called badges) over time for participation. A sequence contains a list of rewards for each user. Only the most active users are selected and only those badges that users can get more than once.
+
+MOOC.8 Contains the interaction of students with an online course system. An interaction is an event and can be of various types (97 unique types), e.g. watching a video, solving a quiz etc.
+
+Wikipedia. $^{8}$ A sequence corresponds to edits of a Wikipedia page. The dataset contains most edited pages and users that have an activity (number of edits) above a certain threshold.
+
+Yelp. $^{10}$ We use the data from the review forum and consider the reviews for the 300 most visited restaurants in Toronto. Each restaurant then has a corresponding sequence of reviews over time.
+
+# F ADDITIONAL DISCUSSION OF THE EXPERIMENTS
+
+# F.1 EVENT TIME PREDICTION USING HISTORY
+
+Detailed setup. Each dataset consists of multiple sequences of inter-event times. We consider 10 train/validation/test splits of the sequences (of sizes $60\% /20\% /20\%$ ). We train all model parameters by minimizing the negative log-likelihood (NLL) of the training sequences, defined as $\mathcal{L}_{time}(\pmb {\theta}) =$
+
+
+Figure 9: Models learn different conditional distribution $p(\tau|\mathcal{H})$ on Yelp dataset. Since check-ins occur during the opening hours, true distribution of the next check-in resembles the one on the right.
+
+$-\frac{1}{N}\sum_{i = 1}^{N}\log p_{\pmb{\theta}}^{*}(\tau_{i})$ . After splitting the data into the 3 sets, we break down long training sequences into sequences of length at most 128. Optimization is performed using Adam (Kingma & Ba, 2015) with learning rate $10^{-3}$ . We perform training using mini-batches of 64 sequences. We train for up to 2000 epochs (1 epoch = 1 full pass through all the training sequences). For all models, we compute the validation loss at every epoch. If there is no improvement for 100 epochs, we stop optimization and revert to the model parameters with the lowest validation loss.
+
+We select hyperparameter configuration for each model that achieves the lowest average loss on the validation set. For each model, we consider different values of $L_{2}$ regularization strength $C \in \{0,10^{-5},10^{-3}\}$ . Additionally, for SOSFlow we tune the number of transformation layers $M \in \{1,2,3\}$ and for DSFlow $M \in \{1,2,3,5,10\}$ . We have chosen the values of $K$ such that the mixture model has approximately the same number of parameters as a 1-layer DSFlow or a 1-layer FullyNN model. More specifically, we set $K = 64$ for LogNormMix, DSFlow and FullyNN. We found all these models to be rather robust to the choice of $K$ , as can be seen in Table 3 for LogNormMix. For SOSFlow we used $K = 4$ and $R = 3$ , resulting in a polynomial of degree 7 (per each layer). Higher values of $R$ led to unstable training, even when using batch normalization.
+
+Additional discussion. In this experiment, we only condition the distribution $p^*(\tau_i)$ on the history embedding $h_i$ . We don't learn sequence embeddings $e_j$ since they can only be learned for the training sequences, and not fore the validation/test sets.
+
+There are two important aspects related to the NLL loss values that we report. First, the absolute loss values can be arbitrarily shifted by rescaling the data. Assume, that we have a distribution $p(\tau)$ that models the distribution of $\tau$ . Now assume that we are interested in the distribution $q(x)$ of $x = a\tau$ (for $a > 0$ ). Using the change of variables formula, we obtain $\log q(x) = \log p(\tau) + \log a$ . This means that by simply scaling the data we can arbitrarily offset the log-likelihood score that we obtain. Therefore, the absolute values of the (negative) log-likelihood $\mathcal{L}$ for different models are of little interest — all that matters are the differences between them.
+
+The loss values are dependent on the train/val/test split. Assume that model 1 achieves loss values $\mathcal{L}_1 = \{1.0,3.0\}$ on two train/val/test splits, and model 2 achieves $\mathcal{L}_2 = \{2.0,4.0\}$ on the same splits. If we first aggregate the scores and report the average $\hat{\mathcal{L}}_1 = 2.0\pm 1.0,\hat{\mathcal{L}}_2 = 3.0\pm 1.0$ , it may seem that the difference between the two models is not significant. However, if we first compute the differences and then aggregate $(\mathcal{L}_2 - \mathcal{L}_1) = 1.0\pm 0.0$ we see a different picture. Therefore, we use the latter strategy in Figure 3. For completeness, we also report the numbers obtained using the first strategy in Table 4.
+
+As a baseline, we also considered the constant intensity / exponential distribution model (Upadhyay et al., 2018). However, we excluded the results for it from Figure 3, since it consistently achieved the worst loss values and had high variance. We still include the results for the constant intensity model in Table 4. We also performed all the experiments on the synthetic datasets (Appendix E.1). The results are shown in Table 5, together with NLL scores under the true model. We see that LogNormMix and DSFlow, besides achieving the best results, recover the true distribution.
+
+Finally, in Figure 9 we plot the conditional distribution $p(\tau|\mathcal{H})$ with models trained on Yelp dataset. The events represent check-ins into a specific restaurant. Since check-ins mostly happen during the opening hours, the inter-event time is likely to be on the same day (0h), next day (24h), the day after (48h), etc. LogNormMix can fully recover this behavior from data while others either cannot learn multimodal distributions (e.g. RMTPP) or struggle to capture it (e.g. FullyNN).
+
+| K | 2 | 4 | 8 | 16 | 32 | 64 |
| Reddit | 10.239 | 10.208 | 10.189 | 10.185 | 10.191 | 10.192 |
| LastFM | -2.828 | -2.879 | -2.881 | -2.880 | -2.877 | -2.860 |
| MOOC | 6.246 | 6.053 | 6.055 | 6.055 | 6.050 | 5.660 |
| Stack Overflow | 14.461 | 14.438 | 14.435 | 14.435 | 14.436 | 14.428 |
| Wikipedia | 8.399 | 8.389 | 8.385 | 8.384 | 8.384 | 8.386 |
| Yelp | 13.169 | 13.103 | 13.058 | 13.045 | 13.032 | 13.024 |
| Poisson | 1.006 | 0.992 | 0.991 | 0.991 | 0.990 | 0.991 |
| Renewal | 0.256 | 0.254 | 0.254 | 0.254 | 0.256 | 0.259 |
| Self-correcting | 0.831 | 0.785 | 0.782 | 0.783 | 0.784 | 0.784 |
| Hawkes1 | 0.530 | 0.523 | 0.532 | 0.532 | 0.523 | 0.523 |
| Hawkes2 | 0.036 | 0.026 | 0.024 | 0.024 | 0.026 | 0.024 |
+
+Table 3: Performance of LogNormMix model for different numbers $K$ of mixture components.
+
+ | Reddit | LastFM | MOOC | Stack Overflow | Wikipedia | Yelp |
| LogNormMix | 10.19 ± 0.078 | -2.88 ± 0.147 | 6.03 ± 0.092 | 14.44 ± 0.013 | 8.39 ± 0.079 | 13.02 ± 0.070 |
| DSFlow | 10.20 ± 0.074 | -2.88 ± 0.148 | 6.03 ± 0.090 | 14.44 ± 0.019 | 8.40 ± 0.090 | 13.09 ± 0.065 |
| SOSFlow | 10.27 ± 0.106 | -2.56 ± 0.133 | 6.27 ± 0.058 | 14.47 ± 0.049 | 8.44 ± 0.120 | 13.21 ± 0.068 |
| FullyNN | 10.23 ± 0.072 | -2.84 ± 0.179 | 6.83 ± 0.152 | 14.45 ± 0.014 | 8.40 ± 0.086 | 13.04 ± 0.073 |
| LogNormal | 10.38 ± 0.077 | -2.60 ± 0.140 | 6.53 ± 0.016 | 14.62 ± 0.013 | 8.52 ± 0.078 | 13.44 ± 0.074 |
| RMTPP | 10.88 ± 0.293 | -1.30 ± 0.164 | 10.65 ± 0.023 | 14.51 ± 0.014 | 10.02 ± 0.085 | 13.36 ± 0.056 |
| Exponential | 11.07 ± 0.070 | -1.28 ± 0.152 | 10.64 ± 0.026 | 18.48 ± 3.257 | 10.03 ± 0.083 | 13.78 ± 1.250 |
+
+Table 4: Time prediction test NLL on real-world data.
+
+# F.2 LEARNING WITH MARKS
+
+Detailed setup. We use the same setup as in Section F.1, except two differences. For learning in a marked temporal point process, we mimic the architecture from Du et al. (2016). The RNN takes a tuple $(\tau_i, m_i)$ as input at each time step, where $m_i$ is the mark. Moreover, the loss function now includes a term for predicting the next mark: $\mathcal{L}_{total}(\pmb{\theta}) = -\frac{1}{N}\sum_{i=1}^{N}[\log p_{\pmb{\theta}}^*(\tau_i) + \log p_{\pmb{\theta}}^*(m_i)]$ .
+
+The next mark $m_i$ at time $t_i$ is predicted using a categorical distribution $p^*(m_i)$ . The distribution is parametrized by the vector $\pi_i$ , where $\pi_{i,c}$ is the probability of event $m_i = c$ . We obtain $\pi_i$ using the history embedding $h_i$ passed through a feedforward neural network
+
+$$
+\boldsymbol {\pi} _ {i} = \operatorname {s o f t m a x} \left(\boldsymbol {V} _ {\boldsymbol {\pi}} ^ {(2)} \tanh \left(\boldsymbol {V} _ {\boldsymbol {\pi}} ^ {(1)} \boldsymbol {h} _ {i} + \boldsymbol {b} _ {\boldsymbol {\pi}} ^ {(1)}\right) + \boldsymbol {b} _ {\boldsymbol {\pi}} ^ {(2)}\right)
+$$
+
+where $V_{\pi}^{(1)}, V_{\pi}^{(2)}b_{\pi}^{(1)}, b_{\pi}^{(2)}$ are the parameters of the neural network.
+
+Additional discussion. In Figure 3 (right) we reported the differences in time NLL between different models $\mathcal{L}_{time}(\pmb{\theta}) = -\frac{1}{N}\sum_{i=1}^{N}\log p_{\pmb{\theta}}^{*}(\tau_{i})$ . In Table 6 we additionally provide the total NLL $\mathcal{L}_{total}(\pmb{\theta}) = -\frac{1}{N}\sum_{i=1}^{N}\left[\log p_{\pmb{\theta}}^{*}(\tau_{i}) + \log p_{\pmb{\theta}}^{*}(m_{i})\right]$ averaged over multiple splits.
+
+Using marks as input to the RNN improves time prediction quality for all the models. However, since we assume that the marks are conditionally independent of the time given the history (as was done in earlier works), all models have similar mark prediction accuracy.
+
+# F.3 LEARNING WITH ADDITIONAL CONDITIONAL INFORMATION
+
+Detailed setup. In the Yelp dataset, the task is to predict the time $\tau_{i}$ until the next customer check-in, given the history of check-ins up until the current time $t_{i-1}$ . We want to verify our intuition that the distribution $p^{*}(\tau_{i})$ depends on the current time $t_{i-1}$ . For example, $p^{*}(\tau_{i})$ might be different depending on whether it's a weekday and / or it's an evening hour. Unfortunately, a model that processes the history with an RNN cannot easily obtain this information. Therefore, we provide this information directly as a context vector $\mathbf{y}_{i}$ when modeling $p^{*}(\tau_{i})$ .
+
+The first entry of context vector $\pmb{y}_i \in \{0,1\}^2$ indicates whether the previous event $t_{i-1}$ took place on a weekday or a weekend, and the second entry indicates whether $t_{i-1}$ was in the 5PM-11PM time
+
+ | Poisson | Renewal | Self-correcting | Hawkes1 | Hawkes2 |
| True model | 0.999 | 0.254 | 0.757 | 0.453 | -0.043 |
| LogNormMix | 0.99 ± 0.006 | 0.25 ± 0.010 | 0.78 ± 0.003 | 0.52 ± 0.047 | 0.02 ± 0.049 |
| DSFlow | 0.99 ± 0.006 | 0.25 ± 0.010 | 0.78 ± 0.002 | 0.52 ± 0.047 | 0.02 ± 0.050 |
| SOSFlow | 1.00 ± 0.013 | 0.25 ± 0.010 | 0.88 ± 0.011 | 0.59 ± 0.056 | 0.06 ± 0.046 |
| FullyNN | 1.00 ± 0.006 | 0.28 ± 0.013 | 0.78 ± 0.004 | 0.55 ± 0.047 | 0.06 ± 0.047 |
| LogNormal | 1.08 ± 0.008 | 0.25 ± 0.010 | 1.03 ± 0.006 | 0.55 ± 0.047 | 0.06 ± 0.049 |
| RMTPP | 0.99 ± 0.006 | 1.01 ± 0.023 | 0.78 ± 0.003 | 0.74 ± 0.057 | 0.69 ± 0.058 |
| Exponential | 0.99 ± 0.006 | 1.00 ± 0.023 | 0.94 ± 0.002 | 0.74 ± 0.055 | 0.69 ± 0.054 |
+
+Table 5: Time prediction test NLL on synthetic data.
+
+ | Time NLL | Total NLL | Mark accuracy |
| Reddit | MOOC | Reddit | MOOC | Reddit | MOOC |
| LogNormMix | 10.28 ± 0.066 | 5.75 ± 0.040 | 12.40 ± 0.094 | 7.58 ± 0.047 | 0.62±0.014 | 0.45±0.003 |
| DSFlow | 10.28 ± 0.073 | 5.78 ± 0.067 | 12.39 ± 0.064 | 7.52 ± 0.074 | 0.62±0.013 | 0.45±0.004 |
| SOSFlow | 10.35 ± 0.106 | 6.06 ± 0.084 | 12.49 ± 0.158 | 7.78 ± 0.107 | 0.62±0.013 | 0.46±0.009 |
| FullyNN | 10.41 ± 0.079 | 6.22 ± 0.224 | 12.51 ± 0.094 | 7.93 ± 0.230 | 0.63±0.013 | 0.46±0.004 |
| LogNormal | 10.42 ± 0.076 | 6.38 ± 0.019 | 12.51 ± 0.080 | 8.11 ± 0.026 | 0.62±0.013 | 0.42±0.005 |
| RMTPP | 11.15 ± 0.061 | 10.29 ± 0.209 | 13.26 ± 0.085 | 12.14 ± 0.220 | 0.62±0.014 | 0.41±0.006 |
+
+Table 6: Time and total NLL and mark accuracy when learning a marked TPP.
+
+window. To each of the four possibilities we assign a learnable 64-dimensional embedding vector. The distribution of $p^*(\tau_i)$ until the next event depends on the embedding vector of the time stamp $t_{i-1}$ of the most recent event.
+
+# F.4 MISSING DATA IMPUTATION
+
+Detailed setup. The dataset for the experiment is generated as a two step process: 1) We generate a sequence of 100 events from the model used for Hawkes1 dataset (Appendix E.1) resulting in a sequence of arrival times $\{t_1,\dots t_N\}$ , 2) We choose random $t_i$ and remove all the events that fall inside the interval $[t_i,t_{i + k}]$ where $k$ is selected such that the interval length is approximately $t_N / 3$ .
+
+We consider three strategies for learning with missing data (shown in Figure 4 (left)):
+
+a) No imputation. The missing block spans the time interval $[t_i, t_{i+k}]$ . We simply ignore the missing data, i.e., training objective $\mathcal{L}_{\text{time}}$ will include an inter-event time $\tau = t_{i+k} - t_i$ .
+b) Mean imputation. We estimate the average inter-event time $\hat{\tau}$ from the observed data, and impute events at times $\{t_i + n\hat{\tau}$ for $n \in \mathbb{N}$ , such that $t_i + n\hat{\tau} < t_{i+k}$ . These imputed events are fed into the history-encoding RNN, but are not part of the training objective.
+c) Sampling. The RNN encodes the history up to and including $t_i$ and produces $\pmb{h}_i$ that we use to define the distribution $p^*(\tau | \pmb{h}_i)$ . We draw a sample $\tau_j^{(imp)}$ from this distribution and feed it into the RNN. We keep repeating this procedure until the samples get past the point $t_{i+k}$ . The imputed inter-event times $\tau_j^{(imp)}$ are affecting the hidden state of the RNN (thus influencing the likelihood of future observed inter-event times $\tau_i^{(obs)}$ ).
+
+We sample multiple such sequences in order to approximate the expected log-likelihood of the observed inter-event times $\mathbb{E}_{\tau^{(imp)}}\sim p^*\left[\sum_i\log p^* (\tau_i^{obs})\right]$ . Since this objective includes an expectation that depends on $p^*$ , we make use of reparametrization sampling to obtain the gradients w.r.t. the distribution parameters (Mohamed et al., 2019).
+
+# F.5 SEQUENCE EMBEDDING
+
+Detailed setup. When learning sequence embeddings, we train the model as described in Appendix F.1, besides one difference. First, we pre-train the sequence embeddings $e_j$ by disabling the his-
+
+tory embedding $\pmb{h}_i$ and optimizing $-\frac{1}{N}\sum_{i}\log p_{\pmb{\theta}}(\tau_i|\pmb{e}_j)$ . Afterwards, we enable the history and minimize $-\frac{1}{N}\sum_{i}\log p_{\pmb{\theta}}(\tau_i|\pmb{e}_j,\pmb{h}_i)$ .
+
+In Figure 6 the top row shows samples generated using $e_{SC}$ , embedding of a self-correcting sequence, the bottom row was generated using $e_{SC}$ , embedding of a renewal sequence, and the middle row was generated using $1/2(e_{SC} + e_{RN})$ , an average of the two embeddings.
\ No newline at end of file
diff --git a/intensityfreelearningoftemporalpointprocesses/images.zip b/intensityfreelearningoftemporalpointprocesses/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..4a78d1030b66117c6fbab5deb9ce69b88bf9d6b1
--- /dev/null
+++ b/intensityfreelearningoftemporalpointprocesses/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:01daec945879ac4e3766c586f5abedc67987264f35a918a725ae99b9d6e8e0fe
+size 687185
diff --git a/intensityfreelearningoftemporalpointprocesses/layout.json b/intensityfreelearningoftemporalpointprocesses/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..2f2a3d8e474ad1e6b933a06733dc99614dd5e87d
--- /dev/null
+++ b/intensityfreelearningoftemporalpointprocesses/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:6f38061f385f1a3f14aaa806ea689c2f1b3a3347d55040a588144f568449b07d
+size 896577
diff --git a/isagoodrepresentationsufficientforsampleefficientreinforcementlearning/61292cd3-8b75-433a-9dc7-74b64142282e_content_list.json b/isagoodrepresentationsufficientforsampleefficientreinforcementlearning/61292cd3-8b75-433a-9dc7-74b64142282e_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..e813cc3de952c9d2d46ed3f9ab8f7f668dd8b1f4
--- /dev/null
+++ b/isagoodrepresentationsufficientforsampleefficientreinforcementlearning/61292cd3-8b75-433a-9dc7-74b64142282e_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:651741f670f9776e2e6c77875107ce728666c70e600f5da48bcebbcd00a5e82a
+size 126867
diff --git a/isagoodrepresentationsufficientforsampleefficientreinforcementlearning/61292cd3-8b75-433a-9dc7-74b64142282e_model.json b/isagoodrepresentationsufficientforsampleefficientreinforcementlearning/61292cd3-8b75-433a-9dc7-74b64142282e_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..069ca0098b1853b9572c0237440636697a32eec8
--- /dev/null
+++ b/isagoodrepresentationsufficientforsampleefficientreinforcementlearning/61292cd3-8b75-433a-9dc7-74b64142282e_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:17528c09cd8281ecd14bbd9921c952c53cb965150a45b9b6c0b2a37691e5c10a
+size 152299
diff --git a/isagoodrepresentationsufficientforsampleefficientreinforcementlearning/61292cd3-8b75-433a-9dc7-74b64142282e_origin.pdf b/isagoodrepresentationsufficientforsampleefficientreinforcementlearning/61292cd3-8b75-433a-9dc7-74b64142282e_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..88a9e4e1471789d2c8789da693168c97a9120b01
--- /dev/null
+++ b/isagoodrepresentationsufficientforsampleefficientreinforcementlearning/61292cd3-8b75-433a-9dc7-74b64142282e_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:bbb8cdf5bebc53fc75a274a5edcd7f22af3ac7c516971085c2b994e83cd6754d
+size 460093
diff --git a/isagoodrepresentationsufficientforsampleefficientreinforcementlearning/full.md b/isagoodrepresentationsufficientforsampleefficientreinforcementlearning/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..a90557d4409148b179f7e0d8db94269778225c8b
--- /dev/null
+++ b/isagoodrepresentationsufficientforsampleefficientreinforcementlearning/full.md
@@ -0,0 +1,463 @@
+# IS A GOOD REPRESENTATION SUFFICIENT FOR SAMPLE EFFICIENT REINFORCEMENT LEARNING?
+
+Simon S. Du
+
+Institute for Advanced Study
+ssdu@ias.edu
+
+Sham M. Kakade
+
+University of Washington, Seattle sham@cs.washington.edu
+
+Ruosong Wang
+
+Carnegie Mellon University ruosongw@andrew.cmu.edu
+
+Lin F. Yang
+
+University of California, Los Angeles
+linyang@ee.ucla.edu
+
+# ABSTRACT
+
+Modern deep learning methods provide effective means to learn good representations. However, is a good representation itself sufficient for sample efficient reinforcement learning? This question has largely been studied only with respect to (worst-case) approximation error, in the more classical approximate dynamic programming literature. With regards to the statistical viewpoint, this question is largely unexplored, and the extant body of literature mainly focuses on conditions which permit sample efficient reinforcement learning with little understanding of what are necessary conditions for efficient reinforcement learning.
+
+This work shows that, from the statistical viewpoint, the situation is far subtler than suggested by the more traditional approximation viewpoint, where the requirements on the representation that suffice for sample efficient RL are even more stringent. Our main results provide sharp thresholds for reinforcement learning methods, showing that there are hard limitations on what constitutes good function approximation (in terms of the dimensionality of the representation), where we focus on natural representational conditions relevant to value-based, model-based, and policy-based learning. These lower bounds highlight that having a good (value-based, model-based, or policy-based) representation in and of itself is insufficient for efficient reinforcement learning, unless the quality of this approximation passes certain hard thresholds. Furthermore, our lower bounds also imply exponential separations on the sample complexity between 1) value-based learning with perfect representation and value-based learning with a good-but-not-perfect representation, 2) value-based learning and policy-based learning, 3) policy-based learning and supervised learning and 4) reinforcement learning and imitation learning.
+
+# 1 INTRODUCTION
+
+Modern reinforcement learning (RL) problems are often challenging due to the huge state space. To tackle this challenge, function approximation schemes are often employed to provide a compact representation, so that reinforcement learning can generalize across states. A common paradigm is to first use a feature extractor to transform the raw input to features (a succinct representation) and then apply a linear predictor on top of the features. Traditionally, the feature extractor is often handcrafted (Sutton & Barto, 2018), while more modern methods often train a deep neural network to extract features. The hope of this paradigm is that, if there exists a good low dimensional (linear) representation, then efficient reinforcement learning is possible.
+
+Empirically, combining various RL function approximation algorithms with neural networks for feature extraction has lead to tremendous successes on various tasks (Mnih et al., 2015; Schulman et al., 2015; 2017). A major problem, however, is that these methods often require a large amount of samples to learn a good policy. For example, deep $Q$ -network requires millions of samples to solve certain Atari games (Mnih et al., 2015). Here, one may wonder if there are fundamental statistical
+
+limitations on such methods, and, if so, under what conditions it would be possible to efficiently learn a good policy?
+
+In the supervised learning context, it is well-known that empirical risk minimization is a statistically efficient method when using a low-complexity hypothesis space (Shalev-Shwartz & Ben-David, 2014), e.g. a hypothesis space with bounded VC dimension. For example, polynomial number of samples suffice for learning a near-optimal $d$ -dimensional linear classifier, even in the agnostic setting1. In contrast, in the more challenging RL setting, we seek to understand if efficient learning is possible (say from a sample complexity perspective) when we have access to an accurate (and compact) parametric representation — e.g. our policy class contains a near-optimal policy or our hypothesis class accurately approximates the optimal value function. In particular, this work focuses on the following question:
+
+# Is a good representation sufficient for sample-efficient reinforcement learning?
+
+This question has largely been studied only with respect to approximation error in the more classical approximate dynamic programming literature, where it is known that algorithms are stable to certain worst-case approximation errors. With regards to sample efficiency, this question is largely unexplored, where the extant body of literature mainly focuses on conditions which are sufficient for efficient reinforcement learning though there is little understanding of what are necessary conditions for efficient reinforcement learning. In reinforcement learning, there is no direct analogue of empirical risk minimization as in the supervised learning context, and it is not evident what are the statistical limits of learning based on properties of our underlying hypothesis class (which may be value-based, policy-based, or model-based).
+
+Many recent works have provided polynomial upper bounds under various sufficient conditions, and in what follows we list a few examples. For value-based learning, the work of Wen & Van Roy (2013) showed that for deterministic systems $^{2}$ , if the optimal $Q$ -function can be perfectly predicted by linear functions of the given features, then the agent can learn the optimal policy exactly with polynomial number of samples. Recent work (Jiang et al., 2017) further showed that if certain complexity measure called Bellman rank is bounded, then the agent can learn a near-optimal policy efficiently. For policy-based learning, Agarwal et al. (2019) gave polynomial upper bounds which depend on a parameter that measures the difference between the initial distribution and the distribution induced by the optimal policy.
+
+Our Contributions. This paper gives, perhaps surprisingly, strong negative results to this question. The main results are exponential lower bounds in terms of planning horizon $H$ for value-based, model-based, and policy-based algorithms with given good representations3. Notably, the requirements on the representation that suffice for sample efficient RL are even more stringent than the more traditional approximation viewpoint. A comprehensive summary of previous upper bounds and our lower bounds is given in Table 1, and here we briefly summarize our hardness results.
+
+1. For value-based learning, we show even if $Q$ -functions of all policies can be approximated by linear functions of the given representation with approximation error $\delta = \Omega \left( \sqrt{\frac{H}{d}} \right)$ where $d$ is the dimension of the representation and $H$ is the planning horizon, then the agent still needs to sample exponential number of trajectories to find a near-optimal policy.
+2. For model-based learning, we show even if the transition matrix and the reward function can be approximated by linear functions of the given representation with approximation error $\delta = \Omega\left(\sqrt{\frac{H}{d}}\right)$ (in $\ell_{\infty}$ sense), the agent still needs to sample exponential number of trajectories to find a near-optimal policy.
+3. We show even if optimal policy can be perfectly predicted by a linear function of the given representation with a strictly positive margin, the agent still requires exponential number of trajectories to find a near-optimal policy.
+
+These lower bounds hold even in deterministic systems and even if the agent knows the transition model. Note these negative results apply to the case where the $Q$ -function, the model, or the optimal policy can be predicted well by a linear function of the given representation. Since the class of linear functions is a strict subset of many more complicated function classes, including neural networks in particular, our negative results imply lower bounds for these more complex function classes as well. Our results highlight the following conceptual insights:
+
+- The requirements on the representation that suffice for sample efficient RL are significantly more stringent than the more traditional approximation viewpoint; our statistical lower bounds show that there are hard thresholds on the worst-case approximation quality of the representation which are not necessary from the approximation viewpoint.
+- Since our lower bounds apply even when the agent knows the transition model, the hardness is not due to the difficulty of exploration in the standard sense. The unknown reward function is sufficient to make the problem exponentially difficult.
+- Our lower bounds are not due to the agent's inability to perform efficient supervised learning, since our assumptions do admit polynomial sample complexity upper bounds if the data distribution is fixed.
+- Our lower bounds are not pathological in nature and suggest that these concerns may arise in practice. In a precise sense, almost all feature extractors induce a hard MDP instance in our construction (see Section 4.4).
+
+Instead, one interpretation is that the hardness is due to a distribution mismatch in the following sense: the agent does not know which distribution to use for minimizing a (supervised) learning error (see Kakade (2003) for discussion), and even a known transition model is not information-theoretically sufficient to reduce the sample complexity.
+
+Furthermore, our work implies several interesting exponential separations on the sample complexity between: 1) value-based learning with perfect representation and value-based learning with a good-but-not-perfect representation, 2) value-based learning and policy-based learning, 3) policy-based learning and supervised learning and 4) reinforcement learning and imitation learning. We provide more details in Section 5.
+
+# 2 RELATED WORK
+
+A summary of previous upper bounds, together with lower bounds proved in this paper, is provided in Table 1. Some key assumptions are formally stated in Section 3 and Section 4. Our lower bounds highlight that classical complexity measures in supervised learning including small approximation error and margin, and standard assumptions in reinforcement learning including optimality gap and deterministic systems, are not enough for efficient RL with function approximation. We need additional assumptions, e.g., ones used in previous upper bounds, for efficient RL.
+
+# 2.1 PREVIOUS LOWER BOUNDS
+
+Existing exponential lower bounds, to our knowledge, construct unstructured MDPs with an exponentially large state space and reduce a bandit problem with exponentially many arms to an MDP (Krishnamurthy et al., 2016; Sun et al., 2017). However, these lower bounds cannot apply to MDPs whose transition models, value functions, or policies can be approximated with some natural function classes, e.g., linear functions, neural networks, etc. The current paper gives the first set of lower bounds for RL with linear function approximation (and thus also hold for super classes of linear functions such as neural networks).
+
+# 2.2 PREVIOUS UPPER BOUNDS
+
+We divide previous algorithms (with provable guarantees) into three classes: those that utilize uncertainty-based bonuses (e.g. UCB variants or Thompson sampling variants); approximate dynamic programming variants (which often make assumptions with respect to concentrability coefficients); and direct policy search-based methods (such as conserve policy iteration (CPI, see Kakade (2003)) or policy gradient methods, which make assumptions with respect to distribution mismatch coefficients).
+
+| Query Oracle | RL | Generative Model | Known Transition |
| Previous Upper Bounds |
| Exact linear Q* + DetMDP (Wen & Van Roy, 2013) | ✓ | ✓ | ✓ |
| Exact linear Q* + Bellman-Rank (Jiang et al., 2017) | ✓ | ✓ | ✓ |
| Exact Linear Q* + Low Var + Gap (Du et al., 2019a) | ✓ | ✓ | ✓ |
| Exact Linear Q* + Gap (Open Problem / Theorem C.1) | ? | ✓ | ✓ |
| Exact Linear Qπ for all π (Open Problem / Theorem D.1) | ? | ✓ | ✓ |
| Approx. Linear Qπ for all π + Concentratability (Munos, 2005; Antos et al., 2008) | ✓ | ✓ | ✓ |
| Approx. Linear Qπ for all π + Bounded Dist Mismatch Coeff (Kakade & Langford, 2002) | ✓ | ✓ | ✓ |
| Lower Bounds (this work) |
| Approx Linear Q* (Theorem 4.1) | × | × | × |
| Approx Linear Qπ for all π (Theorem 4.1) | × | × | × |
| l∞ Approx Linear MDP (Theorem 4.2) | × | × | × |
| Exact Linear π* + Margin + Gap + DetMDP (Theorem 4.3) | × | × | × |
| Exact Linear Q* (Open Problem) | ? | ? | ? |
+
+Table 1: Summary of theoretical results on reinforcement learning with linear function approximation. See Section 2 for discussion on this table. RL, Generative Model, Known Transition are defined in Section 3.3. Exact linear $Q^{*}$ : Assumption 4.1 with $\delta = 0$ . Approx linear $Q^{*}$ : Assumption 4.1 with $\delta = \Omega \left( \sqrt{\frac{H}{d}} \right)$ . Exact linear $\pi^{*}$ : Assumption 4.4. Margin: Assumption 4.5. Exact Linear $Q^{\pi}$ for all $\pi$ : Assumption 4.2 with $\delta = 0$ . Approximate Linear $Q^{\pi}$ for all $\pi$ : Assumption 4.2 with $\delta = \Omega \left( \sqrt{\frac{H}{d}} \right)$ . DetMDP: deterministic system defined in Section 3.1. Bellman-rank: Definition 5 in Jiang et al. (2017). Low Var: Assumption 1 in Du et al. (2019b). Gap: Assumption 3.1. Bounded Distribution Mismatch Coefficient: Definition 3.3 in Agarwal et al. (2019). $\ell_{\infty}$ Approx Linear MDP: Assumption 4.3 with $\delta = \Omega \left( \sqrt{\frac{H}{d}} \right)$ . $\checkmark$ : there exists an algorithm with polynomial sample complexity to find a near-optimal policy. $\checkmark$ : requires certain condition on the initial distribution. $\times$ : exponential number of samples is required. ?: open problem.
+
+The first class of methods include those based on witness rank, Belman rank, and the Eluder dimension, while the latter two classes of algorithms make assumptions either on concentrability coefficients or on distribution mismatch coefficients (see Agarwal et al. (2019); Scherrer (2014) for discussions).
+
+Uncertainty bonus-based algorithms. Now we discuss existing theoretical results on value-based learning with function approximation. The most relevant work is Wen & Van Roy (2013) which showed in deterministic systems, if the optimal $Q$ -function is within a pre-specified function class which has bounded Eluder dimension, for which the class of linear functions is a special case, then the agent can learn the optimal policy using polynomial number of samples. This result has recently been generalized by Du et al. (2019a) which can deal with stochastic reward and low variance transition but requires strictly positive optimality gap. As we listed in Table 1, it is an open problem whether the condition that the optimal $Q$ -function is linear itself is sufficient for efficient RL.
+
+Li et al. (2011) proposed a $Q$ -learning algorithm which requires the Know-What-It-Knows oracle. However, it is in general unknown how to implement such oracle in practice. Jiang et al. (2017) proposed the concept of Bellman Rank to characterize the sample complexity of value-based learning methods and gave an algorithm that has polynomial sample complexity in terms of the Bellman Rank, though the proposed algorithm is not computationally efficient. Bellman rank is bounded for a wide range of problems, including MDP with small number of hidden states, linear MDP, LQR, etc. Later work gave computationally efficient algorithms for certain special cases (Dann et al., 2018; Du et al., 2019a; Yang & Wang, 2019b; Jin et al., 2019). Recently, Witness rank, a generalization of Bellman rank to model-based methods, is studied in Sun et al. (2019).
+
+Approximate dynamic programming-based algorithms. We now discuss approximate dynamic programming-based results characterized in terms of the concentrability coefficient. While classical approximate dynamic programming results typically require $\ell_{\infty}$ -bounded errors, the notion of concentrability (originally due to (Munos, 2005)) permits sharper bounds in terms of average-case function approximation error, provided that the concentrability coefficient is bounded (e.g. see Munos (2005); Szepesvári & Munos (2005); Antos et al. (2008); Geist et al. (2019)). Under the assumption that this problem-dependent parameter is bounded, Munos (2005); Szepesvári & Munos (2005) and Antos et al. (2008) proved sample complexity and error bounds for approximate dynamic programming methods when there is a data collection policy (under which value-function fitting occurs) that induces a finite concentrability coefficient. The assumption that the concentrability coefficient is finite is in fact quite limiting. See Chen & Jiang (2019) which provides a more detailed discussion on this quantity.
+
+Direct policy search-based algorithms. Stronger guarantees over approximate dynamic programming-based algorithm can be obtained with direct policy search-based methods, where instead of having a bounded concentrability coefficient, one only needs to have a bounded distribution mismatch coefficient. The latter assumption requires the agent to have access to a "good" initial state distribution (e.g. a measure which has coverage over where an optimal policy tends to visit); note that this assumption does not make restrictions over the class of MDPs. There are two classes of algorithms that fall into this category. First, there is Conservative Policy Iteration (Kakade & Langford, 2002), along with Policy Search by Dynamic Programming (PSDP) (Bagnell et al., 2004), and other boosting-style of policy search-based methods Scherrer & Geist (2014); Scherrer (2014), which have guarantees in terms of bounded distribution mismatch ratio. Second, more recently, Agarwal et al. (2019) showed that policy gradient styles of algorithms also have comparable guarantees.
+
+Recent extensions. Subsequent to this work, the work by Van Roy & Dong (2019) and Lattimore & Szepesvari (2019) made notable contributions to the misspecified linear bandit problem. In particular, both papers found that Theorem 4.1 in our paper can be extended to the misspecified linear bandit problem and gave upper bounds for this problem showing that our lower bound has tight dependency on $\delta$ and $d$ . Lattimore & Szepesvari (2019) further gave an upper bound for the setting where the $Q$ -functions of all policies can be approximated by linear functions with small approximation errors and the agent can interact with the environment using a generative model. This upper bound also demonstrates that our lower bound has tight dependency on $\delta$ and $d$ .
+
+# 3 PRELIMINARIES
+
+Throughout this paper, for a given integer $H$ , we use $[H]$ to denote the set $\{0,1,\ldots ,H - 1\}$ .
+
+# 3.1 EPISODIC REINFORCEMENT LEARNING
+
+Let $\mathcal{M} = (\mathcal{S},\mathcal{A},H,P,R)$ be an Markov Decision Process (MDP) where $\mathcal{S}$ is the state space, $\mathcal{A}$ is the action space whose size is bounded by a constant, $H\in \mathbb{Z}_{+}$ is the planning horizon, $P:S\times \mathcal{A}\to \triangle (\mathcal{S})$ is the transition function which takes a state-action pair and returns a distribution over states and $R:S\times \mathcal{A}\rightarrow \triangle (\mathbb{R})$ is the reward distribution. Without loss of generality, we assume a fixed initial state $s_0^4$ . A policy $\pi :S\to \triangle (\mathcal{A})$ prescribes a distribution over actions for each state. The policy $\pi$ induces a (random) trajectory $s_0,a_0,r_0,s_1,a_1,r_1,\ldots ,s_{H - 1},a_{H - 1},r_{H - 1}$ where $a_0\sim \pi (s_0),r_0\sim R(s_0,a_0),s_1\sim P(s_0,a_0),a_1\sim \pi (s_1)$ , etc. To streamline our analysis, for each $h\in [H]$ , we use $\mathcal{S}_h\subseteq \mathcal{S}$ to denote the set of states at level $h$ , and we assume $\mathcal{S}_h$ do not intersect with each other. We also assume $\sum_{h = 0}^{H - 1}r_h\in [0,1]$ almost surely. Our goal is to find a policy $\pi$ that maximizes the expected total reward $\mathbb{E}\left[\sum_{h = 0}^{H - 1}r_h\mid \pi \right]$ . We use $\pi^{*}$ to denote the optimal policy. We say a policy $\pi$ is $\varepsilon$ -optimal if $\mathbb{E}\left[\sum_{h = 0}^{H - 1}r_h\mid \pi \right]\geq \mathbb{E}\left[\sum_{h = 0}^{H - 1}r_h\mid \pi^*\right] - \varepsilon$ .
+
+In this paper we prove lower bounds for deterministic systems, i.e., MDPs with deterministic transition $P$ , deterministic reward $R$ . In this setting, $P$ and $R$ can be regarded as functions instead of distributions. Since deterministic systems are special cases of general stochastic MDPs, lower bounds proved in this paper still hold for more general MDPs.
+
+# 3.2 $Q$ -FUNCTION AND OPTIMALITY GAP
+
+An important concept in RL is the $Q$ -function. Given a policy $\pi$ , a level $h \in [H]$ and a state-action pair $(s, a) \in S_h \times \mathcal{A}$ , the $Q$ -function is defined as $Q_h^\pi(s, a) = \mathbb{E}\left[\sum_{h' = h}^{H-1} r_{h'} \mid s_h = s, a_h = a, \pi\right]$ . For simplicity, we denote $Q_h^*(s, a) = Q_h^{\pi^*}(s, a)$ . In addition to these definitions, we list below an important assumption, the optimality gap assumption, which is widely used in reinforcement learning and bandit literature. To state the assumption, we first define the function $\mathrm{gap}: S \times \mathcal{A} \to \mathbb{R}$ as $\mathrm{gap}(s, a) = \arg \max_{a' \in \mathcal{A}} Q^*(s, a') - Q^*(s, a)$ . Now we formally state the assumption.
+
+Assumption 3.1 (Optimality Gap). There exists $\rho >0$ such that $\rho \leq \mathrm{gap}(s,a)$ for all $(s,a)\in S\times \mathcal{A}$ with $\mathrm{gap}(s,a) > 0$ .
+
+Here, $\rho$ is the smallest reward-to-go difference between the best set of actions and the rest. Recently, Du et al. (2019b) gave a provably efficient $Q$ -learning algorithm based on this assumption and Simchowitz & Jamieson (2019) showed that with this condition, the agent only incurs logarithmic regret in the tabular setting.
+
+# 3.3 QUERY MODELS
+
+Here we discuss three possible query oracles interacting with the MDP.
+
+- RL: The most basic and weakest query oracle for MDP is the standard reinforcement learning query oracle where the agent can only interact with the MDP by choosing actions and observe the next state and the reward.
+- Generative Model: A stronger query model assumes the agent can transit to any state (Kearns & Singh, 2002; Kakade, 2003; Sidford et al., 2018). This query model is available in certain robotic applications where one can control the robot to reach the target state.
+- Known Transition: The strongest query model considered is that the agent can not only transit to any state, but also knows the whole transition function. In this model, only the reward is unknown.
+
+In this paper, we will prove lower bounds for the strongest Known Transition query oracle. Therefore, our lower bounds also apply to RL and Generative Model query oracles.
+
+# 4 MAIN RESULTS
+
+In this section we formally present our lower bounds. We also discuss proof ideas in Section 4.4.
+
+# 4.1 LOWER BOUND FOR VALUE-BASED LEARNING
+
+We first present our lower bound for value-based learning. A common assumption is that the $Q$ -function can be predicted well by a linear function of the given features (representation) (Bertsekas & Tsitsiklis, 1996). Formally, the agent is given a feature extractor $\phi : S \times \mathcal{A} \to \mathbb{R}^d$ which can be hand-crafted or a pre-trained neural network that transforms a state-action pair to a $d$ -dimensional embedding. The following assumption states that the given feature extractor can be used to predict the $Q$ -function with approximation error at most $\delta$ using a linear function.
+
+Assumption 4.1. There exists $\delta >0$ and $\theta_0,\theta_1,\ldots ,\theta_{H - 1}\in \mathbb{R}^d$ such that for any $h\in [H]$ and any $(s,a)\in \mathcal{S}_h\times \mathcal{A},|Q_h^* (s,a) - \langle \theta_h,\phi (s,a)\rangle |\leq \delta .$
+
+Here $\delta$ is the approximation error, which indicates the quality of the representation. If $\delta = 0$ , then $Q$ -function can be perfectly predicted by a linear function of $\phi(\cdot, \cdot)$ . In general, $\delta$ becomes smaller as we increase the dimension of $\phi$ , since larger dimension usually has more expressive power. When the feature extractor is strong enough, previous papers (Chen & Jiang, 2019; Farahmand, 2011) assume that linear functions of $\phi$ can approximate the $Q$ -function of any policy.
+
+Assumption 4.2 (Policy Completeness). There exists $\delta >0$ , such that for any $h\in [H]$ and any policy $\pi$ , there exists $\theta_h^\pi \in \mathbb{R}^d$ such that for any $(s,a)\in S_h\times \mathcal{A}$ , $|Q_h^\pi (s,a) - \langle \theta_h,\phi (s,a)\rangle |\leq \delta$ .
+
+In the theoretical reinforcement learning literature, Assumption 4.2 is often called the (approximate) policy completeness assumption. This assumption is crucial in proving polynomial sample complexity guarantee for value iteration type of algorithms (Chen & Jiang, 2019; Farahmand, 2011).
+
+The following theorem shows when $\delta = \Omega\left(\sqrt{\frac{H}{d}}\right)$ , the agent needs to sample exponential number of trajectories to find a near-optimal policy.
+
+Theorem 4.1 (Exponential Lower Bound for Value-based Learning). There exists a family of MDPs with $|\mathcal{A}| = 2$ and a feature extractor $\phi$ that satisfy Assumption 4.2, such that any algorithm that returns a 1/2-optimal policy with probability 0.9 needs to sample $\Omega \left( \min \{|S|, 2^H, \exp(d\delta^2 / 16)\} \right)$ trajectories.
+
+Note this lower bound also applies to MDPs that satisfy Assumption 4.1, since Assumption 4.2 is strictly stronger. We would like to emphasize that since linear functions is a subclass of more complicated function classes, e.g., neural networks, our lower bound also holds for these function classes. Moreover, in many scenarios, the feature extractor $\phi$ is the last layer of a neural network. Modern neural networks are often over-parameterized, which makes $d$ large. In this case, $d$ is much larger than $H$ . Thus, our lower bound holds even if the representation has small approximation error. Furthermore, the assumption that $|\mathcal{A}| = 2$ is only for simplicity. Our lower bound can be easily generalized to the case that $|\mathcal{A}| > 2$ , in which case the sample complexity lower bound is $\Omega \left( \min \{|S|, |\mathcal{A}|^H, \exp(d\delta^2 / 16)\} \right)$ .
+
+# 4.2 LOWER BOUND FOR MODEL-BASED LEARNING
+
+Here we present our lower bound for model-based learning. Recently, Yang & Wang (2019b) proposed the linear transition assumption which was later studied in Yang & Wang (2019a); Jin et al. (2019). Again, we assume the agent is given a feature extractor $\phi : S \times \mathcal{A} \to \mathbb{R}^d$ , and now we state the assumption formally as follow.
+
+Assumption 4.3 (Approximate Linear MDP). There exists $\delta > 0$ , $\beta_0, \beta_1, \ldots, \beta_{H-1} \in \mathbb{R}^d$ and $\psi : S \to \mathbb{R}^d$ such that for any $h \in [H-1]$ , $(s,a) \in S_h \times A$ and $s' \in S_{h+1}$ , $|P(s'| s,a) - \langle \psi(s'), \phi(s,a) \rangle| \leq \delta$ and $|\mathbb{E}[R(s,a)] - \langle \beta_h, \phi(s,a) \rangle| \leq \delta$ .
+
+It has been shown in Yang & Wang (2019b;a); Jin et al. (2019) if $\| P(\cdot \mid s,a) - \langle \psi (\cdot),\phi (s,a)\rangle \| _1$ is bounded, then the problem admits an algorithm with polynomial sample complexity. Now we show that when $\delta = \Omega \left(\sqrt{\frac{H}{d}}\right)$ in Assumption 4.3, the agent needs exponential number of samples to find a near-optimal policy.
+
+Theorem 4.2 (Exponential Lower Bound for Linear Transition Model). There exists a family of MDPs with $|\mathcal{A}| = 2$ and a feature extractor $\phi$ that satisfy Assumption 4.3, such that any algorithm that returns a $1/2$ -optimal policy with probability 0.9 needs to sample $\Omega \left( \min \{ |S|, 2^H, \exp(d\delta^2 / 16) \} \right)$ trajectories.
+
+Again, our lower bound can be easily generalized to the case that $|\mathcal{A}| > 2$ .
+
+We do note that an $\ell_{\infty}$ approximation for a transition matrix may be a weak condition. Under the stronger condition that the transition matrix can be approximated well under the total variational distance, there exists polynomial sample complexity upper bounds that can tolerate approximation errors (Yang & Wang, 2019b;a; Jin et al., 2019).
+
+# 4.3 LOWER BOUND FOR POLICY-BASED LEARNING
+
+Next we present our lower bound for policy-based learning. This class of methods use function approximation on the policy and use optimization techniques, e.g., policy gradient, to find the optimal policy. In this paper, we focus on linear policies on top of a given representation. A linear policy $\pi$ is a policy of the form $\pi(s_h) = \arg \max_{a \in \mathcal{A}} \langle \theta_h, \phi(s_h, a) \rangle$ where $s_h \in S_h$ , $\phi(\cdot, \cdot)$ is a given feature extractor and $\theta_h \in \mathbb{R}^d$ is the linear coefficient. Note that applying policy gradient on softmax parameterization of the policy is indeed trying to find the optimal policy among linear policies.
+
+Similar to value-based learning, a natural assumption for policy-based learning is that the optimal policy is realizable5, i.e., the optimal policy is linear.
+
+Assumption 4.4. For any $h \in [H]$ , there exists $\theta_h \in \mathbb{R}^d$ that satisfies for any $s \in S_h$ , we have $\pi^*(s) \in \arg \max_a \langle \theta_h, \phi(s, a) \rangle$ .
+
+Here we discuss another assumption. For learning a linear classifier in the supervised learning setting, one can reduce the sample complexity significantly if the optimal linear classifier has a margin.
+
+Assumption 4.5. We assume $\phi(s, a) \in \mathbb{R}^d$ satisfies $\|\phi(s, a)\|_2 = 1$ for any $(s, a) \in S \times \mathcal{A}$ . For any $h \in [H]$ , there exists $\theta_h \in \mathbb{R}^d$ with $\|\theta_h\|_2 = 1$ and $\triangle > 0$ such that for any $s \in S_h$ , there is a unique optimal action $\pi^*(s)$ , and for any $a \neq \pi^*(s)$ , $\langle \theta_h, \phi(s, \pi^*(s)) \rangle - \langle \theta_h, \phi(s, a) \rangle \geq \triangle$ .
+
+Here we restrict the linear coefficients and features to have unit norm for normalization. Note that Assumption 4.5 is strictly stronger than Assumption 4.4. Now we present our result for linear policy.
+
+Theorem 4.3 (Exponential Lower Bound for Policy-based Learning). There exists an absolute constant $\triangle_0$ , such that for any $\triangle \leq \triangle_0$ , there exists a family of MDPs with $|\mathcal{A}| = 2$ and a feature extractor $\phi$ that satisfy Assumption 3.1 with $\rho = \frac{1}{2\min\{H,d\}}$ and Assumption 4.5, such that any algorithm that returns a $1/4$ -optimal policy with probability at least 0.9 needs to sample $\Omega\left(\min\{2^H, 2^d\}\right)$ trajectories.
+
+Again, our lower bound can be easily generalized to the case that $|\mathcal{A}| > 2$ .
+
+Compared with Theorem 4.1, Theorem 4.3 is even more pessimistic, in the sense that even with perfect representation with benign properties (gap and margin), the agent still needs to sample exponential number of samples. It also suggests that policy-based learning could be very different from supervised learning.
+
+# 4.4 PROOF IDEAS
+
+The binary tree hard instance. All our lower bound are proved based on reductions from the following hard instance. In this instance, both the transition $P$ and the reward $R$ are deterministic. There are $H$ levels of states, which form a full binary tree of depth $H$ . There are $2^h$ states in level $h$ , and thus $2^H - 1$ states in total. Among all the $2^{H-1}$ states in level $H - 1$ , there is only one state with reward $R = 1$ , and for all other states in the MDP, the corresponding reward value $R = 0$ . Intuitively, to find a 1/2-optimal policy for such MDPs, the agent must enumerate all possible states in level $H - 1$ to find the state with reward $R = 1$ . Doing so intrinsically induces a sample complexity of $\Omega(2^H)$ . This intuition is formalized in Theorem A.1 using Yao's minimax principle (Yao, 1977).
+
+Lower bound for value-based and model-based learning We now show how to construct a set of features so that Assumption 4.1-4.3 hold. Our main idea is to utilize the following fact regarding the identity matrix: $\varepsilon\text{-rank}(I_{2^H}) \leq O(H / \varepsilon^2)$ . Here for a matrix $A \in \mathbb{R}^{n \times n}$ , its $\varepsilon$ -rank (a.k.a approximate rank) is defined to be $\min \{\mathrm{rank}(B) : B \in \mathbb{R}^{n \times n}, \|A - B\|_{\infty} \leq \varepsilon\}$ , where we use $\|\cdot\|_{\infty}$ to denote the entry-wise $\ell_{\infty}$ norm of a matrix. The upper bound $\varepsilon\text{-rank}(I_n) \leq O(\log n / \varepsilon^2)$ was first proved in Alon (2009) using the Johnson-Lindenstrauss Lemma (Johnson & Lindenstrauss, 1984), and we also provide a proof in Lemma A.1. The concept of $\varepsilon$ -rank has wide applications in theoretical computer science (Alon, 2009; Barak et al., 2011; Alon et al., 2013; 2014; Chen & Wang, 2019), but to our knowledge, this is the first time that it appears in reinforcement learning.
+
+This fact can be alternatively stated as follow: there exists $\Phi \in \mathbb{R}^{2^H\times O(H / \varepsilon^2)}$ such that $\| I_{2^H} - \Phi \Phi^\top \|_\infty \leq \varepsilon$ . We interpret each row of $\Phi$ as the feature of a state in the binary tree. By construction of $\Phi$ , now features of states in the binary tree have a nice property that (i) each feature vector has approximately unit norm and (ii) different feature vector are nearly orthogonal. Using this set of features, we can now show that Assumption 4.1-4.3 hold. Here we prove Assumption 4.1 holds as an example and prove other assumptions also hold in the appendix. To prove Assumption 4.1, we note that in the binary tree hard instance, for each level $h$ , only a single state satisfies $Q^{*} = 1$ , and all other states satisfy $Q^{*} = 0$ . We simply take $\theta_h$ to be the feature of the state with $Q^{*} = 1$ . Since all feature vectors are nearly orthogonal, Assumption 4.1 holds.
+
+Since the above fact regarding the $\varepsilon$ -rank of the identity matrix can be proved by simply taking each row of $\Phi$ to be a random unit vector, our lower bound reveals another intriguing (yet pessimistic) aspect of Assumption 4.1-4.3: for the binary tree instance, almost all feature extractors induce a hard MDP instance. This again suggests that a good representation itself may not necessarily lead to efficient RL and additional assumptions (e.g. on the reward distribution) could be crucial.
+
+Lower bound for policy-based learning. It is straightforward to construct a set of feature vectors for the binary tree instance so that Assumption 4.4 holds, even if $d = 1$ . We set $\phi(s, a)$ to be $+1$ if $a = a_1$ and $-1$ if $a = a_2$ . For each level $h$ , for the unique state $s$ in level $h$ with $Q^* = 1$ , we set $\theta_h$ to be 1 if $\pi^*(s) = a_1$ and $-1$ if $\pi^*(s) = a_2$ . With this construction, Assumption 4.4 holds.
+
+To prove that the lower bound under Assumption 4.5, we use a new reward function for states in level $H - 1$ in the binary tree instance above so that there exists a unique optimal action for each state in the MDP. See Figure 2 for an example with $H = 3$ levels of states. Another nice property of the new reward function is that for all states $s$ we always have $\pi^{*}(s) = a_{1}$ . Now, we define $2^{H - 1}$ different new MDPs as follows: for each state in level $H - 1$ , we change its original reward (defined in Figure 2) to 1. An exponential sample complexity lower bound for these MDPs can be proved using the same argument as the original binary tree hard instance, and now we show this set of MDPs satisfy Assumption 4.5. We first show in Lemma A.2 that there exists a set $\mathcal{N} \subseteq \mathbb{S}^{d - 1}$ with $|\mathcal{N}| = (1 / \triangle)^{\Omega(d)}$ , so that for each $p \in \mathcal{N}$ , there exists a hyperplane $L$ that separates $p$ and $\mathcal{N} \setminus \{p\}$ , and all vectors in $\mathcal{N}$ have distance at least $\triangle$ to $L$ . Equivalently, for each $p \in \mathcal{N}$ , we can always define a linear function $f_{p}$ so that $f_{p}(p) \geq \triangle$ and $f_{p}(q) \leq -\triangle$ for all $q \in \mathcal{N} \setminus \{p\}$ . This can be proved using standard lower bounds on the size of $\varepsilon$ -nets. Now we simply use vectors in $\mathcal{N}$ as features of states. By construction of the reward function, for each level $h$ , there could only be two possible cases for the optimal policy $\pi^{*}$ . I.e., either $\pi^{*}(s) = a_{1}$ for all states in level $h$ , or $\pi^{*}(s) = a_{2}$ for a unique state $s$ and $\pi^{*}(s') = a_{1}$ for all $s \neq s'$ . In both cases, we can easily define a linear function with margin $\triangle$ to implement the optimal policy $\pi^{*}$ , and thus Assumption 4.5 holds. Notice that in this proof, we critically relies on $d = \Theta(H)$ , so that we can utilize the curse of dimensionality to construct a large set of vectors as features.
+
+# 5 SEPARATIONS
+
+Perfect representation vs. good-but-not-perfect representation. For value-based learning in deterministic systems, Wen & Van Roy (2013) showed polynomial sample complexity upper bound when the representation can perfectly predict the $Q$ -function. In contrast, if the representation is only able to approximate the $Q$ -function, then the agent requires exponential number of trajectories. This exponential separation demonstrates a provable exponential benefit of better representation.
+
+Value-based learning vs. policy-based learning. Note that if the optimal $Q$ -function can be perfectly predicted by the provided representation, then the optimal policy can also be perfectly
+
+predicted using the same representation. Since Wen & Van Roy (2013) showed polynomial sample complexity upper bound when the representation can perfectly predict the $Q$ -function, our lower bound on policy-based learning, which applies to perfect representations, thus demonstrates that the ability of predicting the $Q$ -function is much stronger than that of predicting the optimal policy.
+
+Supervised learning vs. reinforcement learning. For policy-based learning, if the planning horizon $H = 1$ , the problem becomes learning a linear classifier, for which there are polynomial sample complexity upper bounds. For policy-based learning, the agent needs to learn $H$ linear classifiers sequentially. Our lower bound on policy-based learning shows the sample complexity dependency on $H$ is exponential.
+
+Imitation learning vs. reinforcement learning. In imitation learning (IL), the agent can observe trajectories induced by the optimal policy (expert). If the optimal policy is linear in the given representation, it can be shown that the simple behavior cloning algorithm only requires polynomial number of samples to find a near-optimal policy (Ross et al., 2011). Our Theorem 4.3 shows if the agent cannot observe expert's behavior, then it requires exponential number of samples. Therefore, our lower bound shows there is an exponential separation between policy-based RL and IL when function approximation is used.
+
+# 6 ACKNOWLEDGMENTS
+
+The authors would like to thank Yuping Luo, Wenlong Mou, Martin Wainwright, Mengdi Wang and Yifan Wu for insightful discussions. Also, the authors would also like to gratefully acknowledge Benjamin Van Roy, Shi Dong, Tor Lattimore and Csaba Szepesvári for sharing a draft of their work and their comments. Simon S. Du is supported by NSF grant DMS-1638352 and theInfosys Membership. Sham M. Kakade acknowledges funding from the Washington Research Foundation Fund for Innovation in Data-Intensive Discovery; the NSF award CCF 1740551; and the ONR award N00014-18-1-2247. Ruosong Wang is supported in part by NSF IIS1763562, AFRL CogDeCON FA875018C0014, and DARPA SAGAMORE HR00111990016. Part of this work was done while Simon S. Du was visiting Google Brain Princeton and Ruosong Wang was visiting Princeton University.
+
+# REFERENCES
+
+Alekh Agarwal, Sham M Kakade, Jason D Lee, and Gaurav Mahajan. Optimality and approximation with policy gradient methods in markov decision processes. arXiv preprint arXiv:1908.00261, 2019.
+Noga Alon. Perturbed identity matrices have high rank: Proof and applications. Combinatorics, Probability and Computing, 18(1-2):3-15, 2009.
+Noga Alon, Troy Lee, Adi Shraibman, and Santosh Vempala. The approximate rank of a matrix and its algorithmic applications: approximate rank. In Proceedings of the forty-fifth annual ACM symposium on Theory of computing, pp. 675-684. ACM, 2013.
+Noga Alon, Troy Lee, and Adi Shraibman. The cover number of a matrix and its algorithmic applications. Approximation, Randomization, and Combinatorial Optimization. Algorithms and Techniques, pp. 34, 2014.
+Andras Antos, Csaba Szepesvari, and Rémi Munos. Learning near-optimal policies with bellman-residual minimization based fitted policy iteration and a single sample path. Machine Learning, 71 (1):89-129, 2008.
+Baruch Awerbuch and Robert Kleinberg. Online linear optimization and adaptive routing. Journal of Computer and System Sciences, 74(1):97-114, 2008.
+J. A. Bagnell, Sham M Kakade, Jeff G. Schneider, and Andrew Y. Ng. Policy search by dynamic programming. In S. Thrun, L. K. Saul, and B. Schölkopf (eds.), Advances in Neural Information Processing Systems 16, pp. 831-838. MIT Press, 2004.
+
+Boaz Barak, Zeev Dvir, Amir Yehudayoff, and Avi Wigderson. Rank bounds for design matrices with applications to combinatorial geometry and locally correctable codes. In Proceedings of the forty-third annual ACM symposium on Theory of computing, pp. 519-528. ACM, 2011.
+Dimitri P Bertsekas and John N Tsitsiklis. Neuro-dynamic programming, volume 5. Athena Scientific Belmont, MA, 1996.
+Jinglin Chen and Nan Jiang. Information-theoretic considerations in batch reinforcement learning. arXiv preprint arXiv:1905.00360, 2019.
+Lijie Chen and Ruosong Wang. Classical algorithms from quantum and arthur-merlin communication protocols. 10th Innovations in Theoretical Computer Science, 2019.
+Christoph Dann, Nan Jiang, Akshay Krishnamurthy, Alekh Agarwal, John Langford, and Robert E Schapire. On polynomial time PAC reinforcement learning with rich observations. arXiv preprint arXiv:1803.00606, 2018.
+Sanjoy Dasgupta and Anupam Gupta. An elementary proof of a theorem of johnson and lindenstrauss. _Random Structures & Algorithms_, 22(1):60-65, 2003.
+Simon S Du, Akshay Krishnamurthy, Nan Jiang, Alekh Agarwal, Miroslav Dudík, and John Langford. Provably efficient RL with rich observations via latent state decoding. arXiv preprint arXiv:1901.09018, 2019a.
+Simon S Du, Yuping Luo, Ruosong Wang, and Hanrui Zhang. Provably efficient $Q$ -learning with function approximation via distribution shift error checking oracle. arXiv preprint arXiv:1906.06321, 2019b.
+Amir-massoud Farahmand. Regularization in reinforcement learning. 2011.
+Matthieu Geist, Bruno Scherrer, and Olivier Pietquin. A theory of regularized markov decision processes. arXiv preprint arXiv:1901.11275, 2019.
+Nan Jiang, Akshay Krishnamurthy, Alekh Agarwal, John Langford, and Robert E Schapire. Contextual decision processes with low bellman rank are PAC-learnable. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 1704-1713. JMLR.org, 2017.
+Chi Jin, Zhuoran Yang, Zhaoran Wang, and Michael I Jordan. Provably efficient reinforcement learning with linear function approximation. arXiv preprint arXiv:1907.05388, 2019.
+William B Johnson and Joram Lindenstrauss. Extensions of lipschitz mappings into a hilbert space. Contemporary mathematics, 26(189-206):1, 1984.
+Sham Kakade and John Langford. Approximately optimal approximate reinforcement learning. In ICML, volume 2, pp. 267-274, 2002.
+Sham Machandranath Kakade. On the sample complexity of reinforcement learning. PhD thesis, University of College London, 2003.
+Michael Kearns and Satinder Singh. Near-optimal reinforcement learning in polynomial time. Mach. Learn., 49(2-3):209-232, November 2002. ISSN 0885-6125. doi: 10.1023/A:1017984413808. URL https://doi.org/10.1023/A:1017984413808.
+Akshay Krishnamurthy, Alekh Agarwal, and John Langford. PAC reinforcement learning with rich observations. In Advances in Neural Information Processing Systems, pp. 1840-1848, 2016.
+Tor Lattimore and Csaba Szepesvari. Learning with good feature representations in bandits and in rl with a generative model. arXiv preprint arXiv:1911.07676, 2019.
+Lihong Li, Michael L Littman, Thomas J Walsh, and Alexander L Strehl. Knows what it knows: a framework for self-aware learning. Machine learning, 82(3):399-443, 2011.
+GG Lorentz. Metric entropy and approximation. Bulletin of the American Mathematical Society, 72 (6):903-937, 1966.
+
+Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Andrei A Rusu, Joel Veness, Marc G Bellemare, Alex Graves, Martin Riedmiller, Andreas K Fidjeland, Georg Ostrovski, et al. Human-level control through deep reinforcement learning. Nature, 518(7540):529, 2015.
+Rémi Munos. Error bounds for approximate value iteration. In Proceedings of the National Conference on Artificial Intelligence, volume 20, pp. 1006. Menlo Park, CA; Cambridge, MA; London; AAAI Press; MIT Press; 1999, 2005.
+Stéphane Ross, Geoffrey Gordon, and Drew Bagnell. A reduction of imitation learning and structured prediction to no-regret online learning. In Proceedings of the fourteenth international conference on artificial intelligence and statistics, pp. 627-635, 2011.
+Bruno Scherrer. Approximate policy iteration schemes: A comparison. In Proceedings of the 31st International Conference on International Conference on Machine Learning - Volume 32, ICML'14. JMLR.org, 2014.
+Bruno Scherrer and Matthieu Geist. Local policy search in a convex space and conservative policy iteration as boosted policy search. In Joint European Conference on Machine Learning and Knowledge Discovery in Databases, pp. 35-50. Springer, 2014.
+John Schulman, Sergey Levine, Pieter Abbeel, Michael Jordan, and Philipp Moritz. Trust region policy optimization. In International conference on machine learning, pp. 1889-1897, 2015.
+John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017.
+S. Shalev-Shwartz and S. Ben-David. Understanding Machine Learning: From Theory to Algorithms. Understanding Machine Learning: From Theory to Algorithms. Cambridge University Press, 2014. ISBN 9781107057135. URL https://books.google.com/books?id=ttJkAwAAQBAJ.
+Aaron Sidford, Mengdi Wang, Xian Wu, Lin F Yang, and Yinyu Ye. Near-optimal time and sample complexities for solving discounted markov decision process with a generative model. arXiv preprint arXiv:1806.01492, 2018.
+Max Simchowitz and Kevin Jamieson. Non-asymptotic gap-dependent regret bounds for tabular MDPs. 05 2019.
+Wen Sun, Arun Venkatraman, Geoffrey J Gordon, Byron Boots, and J Andrew Bagnell. Deeply aggravated: Differentiable imitation learning for sequential prediction. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 3309-3318. JMLR.org, 2017.
+Wen Sun, Nan Jiang, Akshay Krishnamurthy, Alekh Agarwal, and John Langford. Model-based rl in contextual decision processes: Pac bounds and exponential improvements over model-free approaches. In Conference on Learning Theory, pp. 2898-2933, 2019.
+Richard S Sutton and Andrew G Barto. Reinforcement learning: An introduction. MIT press, 2018.
+Csaba Szepesvári and Rémi Munos. Finite time bounds for sampling based fitted value iteration. In Proceedings of the 22nd international conference on Machine learning, pp. 880-887. ACM, 2005.
+Benjamin Van Roy and Shi Dong. Comments on the du-kakade-wang-yang lower bounds. arXiv preprint arXiv:1911.07910, 2019.
+Zheng Wen and Benjamin Van Roy. Efficient exploration and value function generalization in deterministic systems. In Advances in Neural Information Processing Systems, pp. 3021-3029, 2013.
+Lin F. Yang and Mengdi Wang. Reinforcement leaning in feature space: Matrix bandit, kernels, and regret bound. arXiv preprint arXiv:1905.10389, 2019a.
+Lin F. Yang and Mengdi Wang. Sample-optimal parametric q-learning using linearly additive features. In International Conference on Machine Learning, pp. 6995-7004, 2019b.
+Andrew Chi-Chin Yao. Probabilistic computations: Toward a unified measure of complexity. In 18th Annual Symposium on Foundations of Computer Science (sfcs 1977), pp. 222-227. IEEE, 1977.
+
+# A PROOFS OF LOWER BOUNDS
+
+In this section we present our lower bounds. It will also be useful to define the value function of a given state $s \in S_h$ as $V_h^\pi(s) = \mathbb{E}\left[\sum_{h' = h}^{H - 1} r_{h'} \mid s_h = s, \pi\right]$ . For simplicity, we denote $V_h^* = V_h^{\pi^*}(s)$ . Throughout the appendix, for the $Q$ -function $Q_h^\pi$ and $Q_h^*$ and the value function $V_h^\pi$ and $V_h^*$ , we may omit $h$ from the subscript when it is clear from the context.
+
+We first introduce the INDEX-QUERY problem, which will be useful in our lower bound arguments.
+
+Definition A.1 (INDEX-QUERY). In the $\mathsf{INDQ}_n$ problem, there is an underlying integer $i^* \in [n]$ . The algorithm sequentially (and adaptively) outputs guesses $i \in [n]$ and queries whether $i = i^*$ . The goal is to output $i^*$ , using as few queries as possible.
+
+Definition A.2 ( $\delta$ -correct algorithms). For a real number $\delta \in (0,1)$ , we say a randomized algorithm $\mathcal{A}$ is $\delta$ -correct for $\mathrm{INDQ}_n$ , if for any underlying integer $i^* \in [n]$ , with probability at least $1 - \delta$ , $\mathcal{A}$ outputs $i^*$ .
+
+The following theorem states the query complexity of $\mathsf{INDQ}_n$ for 0.1-correct algorithms, whose proof is provided in Section B.1.
+
+Theorem A.1. Any 0.1-correct algorithm $\mathcal{A}$ for $\mathrm{INDQ}_n$ requires at least $0.9n$ queries in the worst case.
+
+# A.1 PROOF OF LOWER BOUND FOR VALUE-BASED LEARNING
+
+In this section we prove Theorem 4.1. We need the following existential result, whose proof is provided in Section B.2.
+
+Lemma A.1. For any $n > 2$ , there exists a set of vectors $\mathcal{P} = \{p_0, p_1, \ldots, p_{n-1}\} \subset \mathbb{R}^d$ with $d = \lceil 8 \ln n / \varepsilon^2 \rceil$ such that
+
+1. $\| p_i\| _2 = 1$ for all $0\leq i\leq n - 1$
+2. $|\langle p_i, p_j \rangle| \leq \varepsilon$ for any $0 \leq i, j \leq n - 1$ with $i \neq j$ .
+
+Now we give the construction of the hard MDP instances. We first define the transitions and the reward functions. In the hard instances, both the rewards and the transitions are deterministic. There are $H$ levels of states, and level $h \in [H]$ contains $2^h$ distinct states. Thus we have $|\mathcal{S}| = 2^H - 1$ . If $|S| > 2^H - 1$ we simply add dummy states to the state space $S$ . We use $s_0, s_1, \ldots, s_{2^H - 2}$ to name these states. Here, $s_0$ is the unique state in level $h = 0$ , $s_1$ and $s_2$ are the two states in level $h = 1$ , $s_3, s_4, s_5$ and $s_6$ are the four states in level $h = 2$ , etc. There are two different actions, $a_1$ and $a_2$ , in the MDPs. For a state $s_i$ in level $h$ with $h < H - 1$ , playing action $a_1$ transits state $s_i$ to state $s_{2i + 1}$ and playing action $a_2$ transits state $s_i$ to state $s_{2i + 2}$ , where $s_{2i + 1}$ and $s_{2i + 2}$ are both states in level $h + 1$ . See Figure 1 for an example with $H = 3$ .
+
+In our hard instances, $r(s, a) = 0$ for all $(s, a)$ pairs except for a unique state $s$ in level $H - 2$ and a unique action $a \in \{a_1, a_2\}$ . It is convenient to define $\overline{r}(s') = r(s, a)$ , if playing action $a$ transits $s$ to $s'$ . For our hard instances, we have $\overline{r}(s) = 1$ for a unique node $s$ in level $H - 1$ and $\overline{r}(s) = 0$ for all other nodes.
+
+Now we define the features map $\phi(\cdot, \cdot)$ . Here we assume $d \geq 2 \cdot \lceil 8\ln 2 \cdot H / \delta^2 \rceil$ , and otherwise we can simply decrease the planning horizon so that $d \geq 2 \cdot \lceil 8\ln 2 \cdot H / \delta^2 \rceil$ . We invoke Lemma A.1 to get a set $\mathcal{P} = \{p_0, p_1, \ldots, p_{2^H - 1}\} \subset \mathbb{R}^{d/2}$ . For each state $s_i$ , $\phi(s_i, a_1) \in \mathbb{R}^d$ is defined to be $[p_i; 0]$ , and $\phi(s_i, a_2) \in \mathbb{R}^d$ is defined to be $[0; p_i]$ . This finishes the definition of the MDPs. We now show that no matter which state $s$ in level $H - 1$ satisfies $\overline{r}(s) = 1$ , the resulting MDP always satisfies Assumption 4.2.
+
+Verifying Assumption 4.2. By construction, for each level $h \in [H]$ , there is a unique state $s_h$ in level $h$ and action $a_h \in \{a_1, a_2\}$ , such that $Q^*(s_h, a_h) = 1$ . For all other $(s, a)$ pairs such that $s \neq s_h$ or $a \neq a_h$ , it is satisfied that $Q^*(s, a) = 0$ . For a given level $h$ and policy $\pi$ , we take $\theta_h^\pi$ to be $Q^\pi(s_h, a_h) \cdot \phi(s_h, a_h)$ . Now we show that $|Q^\pi(s, a) - \langle \theta_h^\pi, \phi(s, a) \rangle| \leq \delta$ for all states $s$ in level $h$ and $a \in \{a_1, a_2\}$ .
+
+
+Figure 1: An example with $H = 3$ . For this example, we have $\overline{r}(s_5) = 1$ and $\overline{r}(s) = 0$ for all other states $s$ . The unique state $s_5$ which satisfies $\overline{r}(s) = 1$ is marked as dash in the figure. The induced $Q^*$ function is marked on the edges.
+
+Case I: $a \neq a_h$ . In this case, we have $Q^{\pi}(s,a) = 0$ and $\langle \theta_h^\pi, \phi(s,a) \rangle = 0$ , since $\theta_h^\pi$ and $\phi(s,a)$ do not have a common non-zero coordinate.
+
+Case II: $a = a_h$ and $s \neq s_h$ . In this case, by the second property of $\mathcal{P}$ in Lemma A.1 and the fact that $Q^{\pi}(s_h, a_h) \leq 1$ , we have $|\langle \theta_h^\pi, \phi(s, a) \rangle| \leq \delta$ . Meanwhile, we have $Q^{\pi}(s, a) = 0$ .
+
+Case III: $a = a_h$ and $s = s_h$ . In this case, we have $\langle \theta_h^\pi, \phi(s, a) \rangle = Q^\pi(s_h, a_h)$ .
+
+Finally, we prove any algorithm that solves these MDP instances and succeeds with probability at least 0.9 needs to sample at least $\frac{9}{20} \cdot 2^H$ trajectories. We do so by providing a reduction from $\mathrm{INDQ}_{2^{H-1}}$ to solving MDPs. Suppose we have an algorithm for solving these MDPs, we show that such an algorithm can be transformed to solve $\mathrm{INDQ}_{2^{H-1}}$ . For a specific choice of $i^*$ in $\mathrm{INDQ}_{2^{H-1}}$ , there is a corresponding MDP instance with
+
+$$
+\overline {{r}} (s) = \left\{ \begin{array}{l l} 1 & \text {i f} s = s _ {i ^ {*} + 2 ^ {H - 1} - 1} \\ 0 & \text {o t h e r w i s e} \end{array} \right..
+$$
+
+Notice that for all MDPs that we are considering, the transition and features are always the same. Thus, the only thing that the learner needs to learn by interacting with the environment is the reward value. Since the reward value is non-zero only for states in level $H - 1$ , each time the algorithm for solving MDP samples a trajectory that ends at state $s_i$ where $s_i$ is a state in level $H - 1$ , we query whether $i^* = i - 2^{H - 1} + 1$ or not in INDQ $_{2^{H - 1}}$ , and return reward value 1 if $i^* = i - 2^{H - 1} + 1$ and 0 otherwise. If the algorithm is guaranteed to return a 1/2-optimal policy, then it must be able to find $i^*$ .
+
+# A.2 PROOF OF LOWER BOUND FOR MODEL-BASED LEARNING
+
+Proof of Theorem 4.2. We use the same construction as in the proof of Theorem 4.1. Note we just need to verify that the construction satisfies Assumption 4.3. By construction, for all $h \in \{1, 2, \ldots, H - 1\}$ , for each state $s'$ in level $h$ , there exists a unique $(s, a)$ pair such that playing action $a$ transits $s$ to $s'$ , and we take $\psi(s') = \phi(s, a)$ . We also take $\beta_h = 0$ for $h \in \{0, 1, \ldots, H - 4, H - 3\}$ and $\beta_{H - 2} = \phi(s, a)$ where $(s, a)$ is the unique pair with $R(s, a) = 1$ . Now, according to the design of $\phi(\cdot, \cdot)$ and Lemma A.1, Assumption 4.3 is satisfied.
+
+# A.3 PROOF OF LOWER BOUND FOR POLICY-BASED LEARNING
+
+In this section, we present our hardness results for linear policy learning. We first prove a weaker lower bound which only satisfies Assumption 4.4, and then prove Theorem 4.3.
+
+Warmup: Lower Bound for Linear Policy Without Margin. To present the hardness results, we first give the construction of the hard instances. The transitions and rewards functions of these MDP instances are exactly the same as those in Section A.1. The main difference is in the definition of the feature map $\phi(\cdot, \cdot)$ . For this lower bound, we define $\phi(s, a) = 1 \in \mathbb{R}$ if $a = a_1$ and $\phi(s, a) = -1$ if $a = a_2$ . By construction, these MDPs satisfy Assumption 3.1 with $\rho = 1$ . We now show that no matter which state $s$ in level $H - 1$ satisfies $\overline{r}(s) = 1^6$ , the resulting MDP always satisfies Assumption 4.4.
+
+**Verifying Assumption 4.4.** Recall that for each level $h \in [H]$ , there is a unique state $s_h$ in level $h$ and action $a_h \in \{a_1, a_2\}$ , such that $Q^*(s_h, a_h) = 1$ . For all other $(s, a)$ pairs such that $s \neq s_h$ or $a \neq a_h$ , it is satisfied that $Q^*(s, a) = 0$ . We simply take $\theta_h$ to be 1 if $a_h = a_1$ , and take $\theta_h$ to be -1 if $a_h = a_2$ .
+
+Using the same lower bound argument (by reducing INDEX-QUERY to MDPs), we have the following theorem.
+
+Theorem A.2. There exists a family of MDPs and a feature map $\phi (\cdot ,\cdot)$ that satisfy Assumption 4.4 with $d = 1$ and Assumption 3.1 with $\rho = 1$ , such that any algorithm that returns a $1 / 2$ -optimal policy with probability at least 0.9 needs to sample $\Omega (2^H)$ trajectories.
+
+Proof of Theorem 4.3 Now we prove Theorem 4.3. In order to prove Theorem 4.3, we need the following geometric lemma whose proof is provided in Section B.3.
+
+Lemma A.2. Let $d \in \mathbb{N}_+$ be a positive integer and $\epsilon \in (0,1)$ be a real number. Then there exists a set of points $\mathcal{N} \subset \mathbb{S}^{d-1}$ with size $|\mathcal{N}| = \Omega(1/\epsilon^{d/2})$ such that for every point $x \in \mathcal{N}$ ,
+
+$$
+\inf _ {y \in \operatorname {c o n v} (\mathcal {N} \backslash \{x \})} \| x - y \| _ {2} \geq \epsilon / 2. \tag {1}
+$$
+
+Now we are ready to prove Theorem 4.3. In the proof we assume $H = d$ , since otherwise we can take $H$ and $d$ to be $\min \{H, d\}$ by decreasing the planning horizon $H$ or adding dummy dimensions to the feature extractor $\phi$ .
+
+Proof of Theorem 4.3. We define a set of $2^{H - 1}$ deterministic MDPs. The transitions of these hard instances are exactly the same as those in Section A.1. The main difference is in the definition of the feature map $\phi (\cdot ,\cdot)$ and the reward function. Again in the hard instances, $r(s,a) = 0$ for all $s$ in the first $H - 2$ levels. Using the terminology in Section A.1, we have $\overline{r} (s) = 0$ for all states in the first $H - 1$ levels. Now we define $\overline{r} (s)$ for states $s$ in level $H - 1$ . We do so by recursively defining the optimal value function $V^{*}(\cdot)$ . The initial state $s_0$ in level 0 satisfies $V^{*}(s_{0}) = 1 / 2$ . For each state $s_i$ in the first $H - 2$ levels, we have $V^{*}(s_{2i + 1}) = V^{*}(s_{i})$ and $V^{*}(s_{2i + 2}) = V^{*}(s_{i}) - 1 / 2H$ . For each state $s_i$ in the level $h = H - 2$ , we have $\overline{r} (s_{2i + 1}) = V^{*}(s_{i})$ and $\overline{r} (s_{2i + 2}) = V^{*}(s_{i}) - 1 / 2H$ . This implies that $\rho = 1 / 2H$ . In fact, this implies a stronger property that each state has a unique optimal action. See Figure 2 for an example with $H = 3$ .
+
+To define $2^{H - 1}$ different MDPs, for each state $s$ in level $H - 1$ of the MDP defined above, we define a new MDP by changing $\overline{r} (s)$ from its original value to 1. This also affects the definition of the optimal $V$ function for states in the first $H - 1$ levels. In particular, for each level $i\in \{0,1,2,\dots ,H - 2\}$ , we have changed the $V$ value of a unique state in level $i$ from its original value (at most $1 / 2$ ) to 1. By doing so we have defined $2^{H - 1}$ different MDPs. See Figure 3 for an example with $H = 3$ .
+
+Now we define the feature function $\phi (\cdot ,\cdot)$ . We invoke Lemma A.2 with $\epsilon = 8\triangle$ and $d = H / 2 - 1$ . Since $\triangle$ is sufficiently small, we have $|\mathcal{N}|\geq 2^{H}$ . We use $\mathcal{P} = \{p_0,p_2,\dots ,p_{2^H -1}\} \subset \mathbb{R}^{H / 2 - 1}$ to denote an arbitrary subset of $\mathcal{N}$ with cardinality $2^{H}$ . By Lemma A.2, for any $p\in \mathcal{P}$ , the distance between $p$ and the convex hull of $\mathcal{P}\setminus \{p\}$ is at least $4\triangle$ . Thus, there exists a hyperplane $L$ which separates $p$ and $\mathcal{P}\setminus \{p\}$ , and for all points $q\in \mathcal{P}$ , the distance between $q$ and $L$ is at least $2\triangle$ . Equivalently, for each point $p\in \mathcal{P}$ , there exists $n_p\in \mathbb{R}^{H / 2 - 1}$ and $o_p\in \mathbb{R}$ such that $\| n_p\| _2 = 1$ , $|o_p|\leq 1$ and the linear function $f_{p}(q) = \langle q,n_{p}\rangle +o_{p}$ satisfies $f_{p}(p)\geq 2\triangle$ and $f_{p}(q)\leq -2\triangle$ for all $q\in \mathcal{P}\setminus \{p\}$ . Given the set $\mathcal{P} = \{p_0,p_2,\ldots ,p_{2^H -1}\} \subset \mathbb{R}^{H / 2 - 1}$ , we construct a new set
+
+
+Figure 2: An example with $H = 3$ .
+
+
+Figure 3: An example with $H = 3$ . Here we define a new MDP by changing $\overline{r}(s_5)$ from its original value $1/3$ to 1. This also affects the value of $V(s_2)$ and $V(s_0)$ .
+
+$\overline{\mathcal{P}} = \{\overline{p}_0,\overline{p}_2,\dots ,\overline{p}_{2^H -1}\} \subset \mathbb{R}^{H / 2}$ , where $\overline{p}_i = [p_i;1]\in \mathbb{R}^{H / 2}$ . Thus $\| \overline{p}_i\| _2 = \sqrt{2}$ for all $\overline{p}_i\in \overline{\mathcal{P}}$ . Clearly, for each $\overline{p}\in \overline{\mathcal{P}}$ , there exists a vector $\omega_{\overline{p}}\in \mathbb{R}^{H / 2}$ such that $\langle \omega_{\overline{p}},\overline{p}\rangle \geq 2\triangle$ and $\langle \omega_{\overline{p}},\overline{q}\rangle \leq -2\triangle$ for all $\overline{q}\in \overline{\mathcal{P}}\setminus \{\overline{p}\}$ . It is also clear that $\| \omega_{\overline{p}}\| _2\leq \sqrt{2}$ . We take $\phi (s_i,a_1) = [0;\overline{p}_i]\in \mathbb{R}^H$ and $\phi (s_i,a_2) = [\overline{p}_i;0]\in \mathbb{R}^H$ .
+
+We now show that all the $2^{H - 1}$ MDPs constructed above satisfy the linear policy assumption. Namely, we show that for any state $s$ in level $H - 1$ , after changing $\overline{r}(s)$ to be 1, the resulting MDP satisfies the linear policy assumption. As in Section A.1, for each level $h \in [H]$ , there is a unique state $s_h$ in level $h$ and action $a_h \in \{a_1, a_2\}$ , such that $Q^*(s_h, a_h) = 1$ . For all other $(s, a)$ pairs such that $s \neq s_h$ or $a \neq a_h$ , it is satisfied that $Q^*(s, a) = 0$ . For each level $h$ , if $a_h = a_1$ , then we take $(\theta_h)_{H/2} = 1$ and $(\theta_h)_H = -1$ , and all other entries in $\theta_h$ are zeros. If $a_h = a_2$ , we use $\overline{p}$ to denote the vector formed by the first $H/2$ coordinates of $\phi(s_h, a_2)$ . By construction, we have $\overline{p} \in \overline{\mathcal{P}}$ . We take $\theta_h = [\omega_{\overline{p}}; 0]$ in this case. In any case, we have $\| \theta_h \|_2 \leq \sqrt{2}$ . Now for each level $h$ , if $a_h = a_1$ , then for all states $s$ in level $h$ , we have $\pi^*(s) = a_1$ . In this case, $\langle \phi(s, a_1), \theta_h \rangle = 1$ and $\langle \phi(s, a_2), \theta_h \rangle = -1$ for all states in level $h$ , and thus Assumption 4.5 is satisfied. If $a_h = a_2$ , then $\pi^*(s_h) = a_2$ and $\pi^*(s) = a_1$ for all states $s \neq s_h$ in level $h$ . By construction, we have $\langle \theta_h, \phi(s, a_1) \rangle = 0$ for all states $s$ in level $h$ , since $\theta_h$ and $\phi(s, a_1)$ do not have a common non-zero entry. We also have $\langle \theta_h, \phi(s_h, a_2) \rangle \geq 2\triangle$ and $\langle \theta_h, \phi(s, a_2) \rangle \leq -2\triangle$ for all states $s \neq s_h$ in level $h$ . Finally, we normalize all $\theta_h$ and $\phi(s, a)$ so that they all have unit norm. Since $\| \phi(s, a) \|_2 = \sqrt{2}$ for all $(s, a)$ pairs before normalization, Assumption 4.5 is still satisfied after normalization.
+
+Finally, we prove any algorithm that solves these MDP instances and succeeds with probability at least 0.9 needs to sample at least $\Omega(2^H)$ trajectories. We do so by providing a reduction from $\mathrm{INDQ}_{2^{H-1}}$ to solving MDPs. Suppose we have an algorithm for solving these MDPs, we show that such an algorithm can be transformed to solve $\mathrm{INDQ}_{2^{H-1}}$ . For a specific choice of $i^*$ in $\mathrm{INDQ}_{2^{H-1}}$ , there is a corresponding MDP instance with
+
+$$
+\overline {{r}} (s) = \left\{ \begin{array}{l l} 1 & \text {i f} s = s _ {i ^ {*} + 2 ^ {H - 1} - 1} \\ \text {t h e o r i g i n a l (r e c u r s i v e l y d e f i n e d) v a l u e} & \text {o t h e r w i s e} \end{array} \right..
+$$
+
+Notice that for all MDPs that we are considering, the transition and features are always the same. Thus, the only thing that the learner needs to learn by interacting with the environment is the reward value. Since the reward value is non-zero only for states in level $H - 1$ , each time the algorithm for solving MDP samples a trajectory that ends at state $s_i$ where $s_i$ is a state in level $H - 1$ , we query whether $i^* = i - 2^{H - 1} + 1$ or not in $\mathsf{INDQ}_{2^{H - 1}}$ , and return reward value 1 if $i^* = i - 2^{H - 1} + 1$ and it original reward value otherwise. If the algorithm is guaranteed to return a 1/4-optimal policy, then it must be able to find $i^*$ .
+
+
+
+# B TECHNICAL PROOFS
+
+# B.1 PROOF OF THEOREM A.1
+
+Proof. The proof is a straightforward application of Yao's minimax principle Yao (1977). We provide the full proof for completeness.
+
+Consider an input distribution where $i^{*}$ is drawn uniformly at random from $[n]$ . Suppose there is a 0.1-correct algorithm for $\mathrm{INDQ}_n$ with worst-case query complexity $T$ such that $T < 0.9n$ . By averaging, there is a deterministic algorithm $\mathcal{A}'$ with worst-case query complexity $T$ , such that
+
+$$
+\operatorname * {P r} _ {i \sim [ n ]} \left[ \mathcal {A} ^ {\prime} \text {c o r r e c t l y o u t p u t s} i \text {w h e n} i ^ {*} = i \right] \geq 0. 9.
+$$
+
+We may assume that the sequence of queries made by $\mathcal{A}'$ is fixed. This is because (i) $\mathcal{A}'$ is deterministic and (ii) before $\mathcal{A}'$ correctly guesses $i^*$ , all responses that $\mathcal{A}'$ receives are the same (i.e., all guesses are incorrect). We use $S = \{s_1, s_2, \ldots, s_m\}$ to denote the sequence of queries made by $\mathcal{A}'$ . Notice that $m$ is the worst-case query complexity of $\mathcal{A}'$ . Suppose $m < 0.9n$ , there exist $0.1n$ distinct $i \in [n]$ such that $\mathcal{A}'$ will never guess $i$ , and will be incorrect if $i^*$ equals $i$ , which implies
+
+$$
+\operatorname * {P r} _ {i \sim [ n ]} \left[ \mathcal {A} ^ {\prime} \text {c o r r e c t l y o u t p u t s} i \text {w h e n} i ^ {*} = i \right] < 0. 9.
+$$
+
+
+
+# B.2 PROOF OF LEMMA A.1
+
+We need the following tail inequality for random unit vectors, which will be useful for the proof of Lemma A.1.
+
+Lemma B.1 (Lemma 2.2 in Dasgupta & Gupta (2003)). For a random unit vector $u$ in $\mathbb{R}^d$ and $\beta > 1$ , we have
+
+$$
+\operatorname * {P r} \left[ u _ {1} ^ {2} \geq \beta / d \right] \leq \exp ((1 + \ln \beta - \beta) / 2).
+$$
+
+In particular, when $\beta \geq 6$ , we have
+
+$$
+\operatorname * {P r} \left[ u _ {1} ^ {2} > \beta / d \right] \leq \exp (- \beta / 4).
+$$
+
+Proof of Lemma A.1. Let $\mathcal{Q} = \{q_1, q_2, \ldots, q_n\}$ be a set of $n$ independent random unit vectors in $\mathbb{R}^d$ with $d = \lceil 8 \ln n / \varepsilon^2 \rceil$ . We will prove that with probability at least $1/2$ , $\mathcal{Q}$ satisfies the two desired properties as stated in Lemma A.1. This implies the existence of such set $\mathcal{P}$ .
+
+It is clear that $\| q_i\| _2 = 1$ for all $i\in [n]$ , since each $q_{i}$ is drawn from the unit sphere. We now prove that for any $i,j\in [n]$ with $i\neq j$ , with probability at least $1 - \frac{1}{n^2}$ , we have $|\langle q_i,q_j\rangle |\leq \varepsilon$ . Notice that this is sufficient to prove the lemma, since by a union bound over all the $\binom{n}{2} = n(n-1)/2$ possible pairs of $(i,j)$ , this implies that $\mathcal{Q}$ satisfies the two desired properties with probability at least $1/2$ .
+
+Now, we prove that for two independent random unit vectors $u$ and $v$ in $\mathbb{R}^d$ with $d = \lceil 8\ln n / \varepsilon^2 \rceil$ , with probability at least $1 - \frac{1}{n^2}$ , $|\langle u,v\rangle |\leq \varepsilon$ . By rotational invariance, we assume that $v$ is a standard basis vector. I.e., we assume $v_{1} = 1$ and $v_{i} = 0$ for all $1 < i\leq d$ . Notice that now $\langle u,v\rangle$ is the magnitude of the first coordinate of $u$ . We finish the proof by invoking Lemma B.1 and taking $\beta = 8\ln n > 6$ .
+
+# B.3 PROOF OF LEMMA A.2
+
+Proof of Lemma A.2. Consider a $\sqrt{\epsilon}$ -packing $\mathcal{N}$ with size $\Omega(1/\epsilon^{d/2})$ on the $d$ -dimensional unit sphere $\mathbb{S}^{d-1}$ (for the existence of such a packing, see, e.g., Lorentz (1966)). Let $o$ be the origin. For two points $x, x' \in \mathbb{R}^d$ , we denote $|xx'| := \|x - x'\|_2$ the length of the line segment between $x, x'$ . Note that every two points $x, x' \in \mathcal{N}$ satisfy $|xx'| \geq \sqrt{\epsilon}$ .
+
+To prove the lemma, it suffices to show that $\mathcal{N}$ satisfies the property equation 1. Consider a point $x\in \mathcal{N}$ , let $A$ be a hyperplane that is perpendicular to $x$ (notice that $x$ is a also a vector) and separates $x$ and every other points in $\mathcal{N}$ . We let the distance between $x$ and $A$ be the largest possible, i.e., $A$ contains a point in $\mathcal{N}\backslash \{x\}$ . Since $x$ is on the unit sphere and $\mathcal{N}$ is a $\sqrt{\epsilon}$ -packing, we have that $x$ is at least $\sqrt{\epsilon}$ away from every point on the spherical cap not containing $x$ , defined by the cutting plane $A$ . More formally, let $b$ be the intersection point of the line segment $ox$ and $A$ . Then
+
+$$
+\forall y \in \left\{y ^ {\prime} \in \mathbb {S} ^ {d - s}: \langle b, y ^ {\prime} \rangle \leq \| b \| _ {2} ^ {2} \right\}: \quad \| x - y \| _ {2} \geq \sqrt {\epsilon}.
+$$
+
+Indeed, by symmetry, $\forall y\in \{y^{\prime}\in \mathbb{S}^{d - 1}:\langle b,y^{\prime}\rangle \leq \| b\|_{2}^{2}\}$
+
+$$
+\left\| x - y \right\| _ {2} \geq \left\| x - z \right\| _ {2} \geq \sqrt {\epsilon}.
+$$
+
+where $z \in \mathcal{N} \cap A$ . Notice that the distance between $x$ and the convex hull of $\mathcal{N} \backslash \{x\}$ is lower bounded by the distance between $x$ and $A$ , which is given by $|bx|$ . Consider the triangles defined by $x, z, o, b$ . We have $bz \perp ox$ (note that $bz$ lies inside $A$ ). By Pythagorean theorem, we have
+
+$$
+\begin{array}{l} \left| b z \right| ^ {2} + \left| b x \right| ^ {2} = \left| x z \right| ^ {2}; \\ \vert b x \vert + \vert b o \vert = \vert x o \vert = 1; \\ \left| b z \right| ^ {2} + \left| b o \right| ^ {2} = \left| o z \right| ^ {2} = 1. \\ \end{array}
+$$
+
+Solve the above three equations for $|bx|$ , we have
+
+$$
+| b x | = | x z | ^ {2} / 2 \geq \epsilon / 2
+$$
+
+as desired.
+
+
+
+# C EXACT LINEAR $Q^{*} + \mathrm{GAP}$ IN GENERATIVE MODEL
+
+In this section we present and prove the following theorem.
+
+Theorem C.1. Under Assumption 3.1, Assumption 4.2 and Generative Model query model, the agent can find the optimal $\pi^{*}$ with poly $\left(d,H,\frac{1}{\rho},\log \left(\frac{1}{\delta}\right)\right)$ queries with probability $1 - \delta$ for a given failure probability $\delta >0$ ,
+
+Proof of Theorem C.1. We first describe the algorithm. For each level, the agent first constructs a barycentric spanner $\Lambda_h \triangleq \{\phi(s_h^1, a_h^1), \ldots, \phi(s_h^d, a_h^d)\} \subset \Phi_h \triangleq \{\phi(s, a)\}_{s \in S_h, a \in \mathcal{A}}$ (Awerbuch & Kleinberg, 2008). We have the property that any $\phi(s, a)$ with $s_h \in S_h, a \in \mathcal{A}$ , we have $c_{s,a}^1, \ldots, c_{s,a}^d \in [-1,1]$ such that $\phi(s, a) = \sum_{i=1}^{d} c_{s,a}^i \phi(s_h^i, a_h^i)$ .
+
+The algorithm learns the optimal policy from $h = H - 1, \ldots, 0$ . At any level $h$ , we assume the agent has learned the optimal policy $\pi_{h'}^*$ at level $h' = h + 1, \ldots, H - 1$ .
+
+Now we present a procedure to show how to learn the optimal policy at level $h$ . At level $h$ , the agent queries every vector $\phi(s_h^i, a_h^i)$ in $\Lambda_h$ for $\mathrm{poly}(d, \frac{1}{\rho}, \log(\frac{H}{\delta}))$ times and uses $\pi_{h+1}^*, \ldots, \pi_H^*$ as the roll-out to get the on-the-go reward. Note by the definition of $\pi^*$ and $Q^*$ , the on-the-go reward is an unbiased sample of $Q^*(s_h^i, a_h^i)$ . We denote $\widehat{Q}(s_h^i, a_h^i)$ the average of these on-the-go rewards. By Hoeffding inequality, it is easy to show with probability $1 - \frac{\delta}{H}$ , for all $i = 1, \ldots, d$ , $\left| \widehat{Q}(s_h^i, a_h^i) - Q^*(s_h^i, a_h^i) \right| \leq \mathrm{poly}\left(\frac{1}{d}, \rho\right)$ . Now we define our estimated $Q^*$ at level $h$ as follows: for any $(s, a) \in S_h \times \mathcal{A}$ , $\widehat{Q}(s, a) = \sum_{i=1}^{d} c_{s,a}^i \widehat{Q}(s_h^i, a_h^i)$ . By the boundedness property of $c_{s,a}$ , we know for any $(s, a) \in S_h \times \mathcal{A}$ , $\widehat{Q}(s, a) - Q^*(s, a) < \frac{\rho}{2}$ . Note this implies the policy induced by $\widehat{Q}$ is the same as $\pi^*$ . Therefore by induction we finish the proof.
+
+
+
+# D LINEAR $Q^{\pi}$ FOR ALL $\pi$ IN GENERATIVE MODEL
+
+In this section we present and prove the following theorem.
+
+Theorem D.1. Under Assumption 4.2 with $\delta = 0$ , in the Generative Model query model, there is an algorithm that finds an $\epsilon$ -optimal policy $\hat{\pi}$ using poly $(d,H,\frac{1}{\epsilon})$ trajectories with probability 0.99.
+
+Proof of Theorem D.1. The algorithm is the same as the one in Theorem C.1 We only need to change the analysis. Suppose we are learning at level $h$ and we have learned policies $\pi_{h+1}, \ldots, \pi_{H-1}$ for level $h+1, h+2, \ldots, H-1$ , respectively. Because we use the roll-out policy $\pi_{h+1} \circ \dots \circ \pi_{H-1}$ , by Assumption 4.2 and the property of barycentric spanner, using the same argument in the proof of Theorem C.1, we know with probability $1 - 0.01 / H$ , we can learn a policy $\pi_h$ with poly $(d, H, \frac{1}{\epsilon})$ samples such that for any $s \in S_h$ , we know $\pi_h$ is only sub-optimal by $\frac{\epsilon}{H}$ from the $\tilde{\pi}_h$ where $\tilde{\pi}_h$ is the optimal policy at level $h$ such that $\pi_{h+1} \circ \dots \circ \pi_{H-1}$ is the fixed roll-out policy.
+
+Now we can bound the sub-optimality of $\hat{\pi} \triangleq \pi_0 \circ \dots \circ \pi_{H - 1}$ :
+
+$$
+\begin{array}{l} V ^ {\pi_ {0} \circ \pi_ {1} \circ \dots \circ \pi_ {H - 1}} (s _ {1}) - V ^ {\pi_ {0} ^ {*} \circ \pi_ {1} ^ {*} \circ \dots \circ \pi_ {H - 1} ^ {*}} (s _ {1}) \\ = V ^ {\pi_ {0} \circ \pi_ {1} \circ \dots \circ \pi_ {H - 1}} (s _ {1}) - V ^ {\tilde {\pi} _ {0} \circ \pi_ {1} \circ \dots \circ \pi_ {H - 1}} (s _ {1}) \\ + V ^ {\pi_ {0} \circ \pi_ {1} \circ \dots \circ \pi_ {H - 1}} (s _ {1}) - V ^ {\pi_ {0} ^ {*} \circ \pi_ {1} \circ \dots \circ \pi_ {H - 1}} (s _ {1}) \\ + V ^ {\pi_ {0} ^ {*} \circ \pi_ {1} \circ \dots \circ \pi_ {H - 1}} (s _ {1}) - V ^ {\pi_ {0} ^ {*} \circ \pi_ {1} ^ {*} \circ \dots \circ \pi_ {H - 1} ^ {*}} (s _ {1}). \\ \end{array}
+$$
+
+The first term is at least $-\frac{\epsilon}{H}$ by our estimation bound, The second term is positive by definition of $\tilde{\pi}_0$ . We can just recursively apply this argument to obtain
+
+$$
+\begin{array}{l} V ^ {\pi_ {0} \circ \pi_ {1} \circ \dots \circ \pi_ {H - 1}} \left(s _ {1}\right) - V ^ {\pi_ {0} ^ {*} \circ \pi_ {1} ^ {*} \circ \dots \circ \pi_ {H - 1} ^ {*}} \left(s _ {1}\right) \\ \geq V ^ {\pi_ {0} ^ {*} \circ \pi_ {1} \circ \dots \circ \pi_ {H - 1}} (s _ {1}) - V ^ {\pi_ {0} ^ {*} \circ \pi_ {1} ^ {*} \circ \dots \circ \pi_ {H - 1} ^ {*}} (s _ {1}) - \frac {\epsilon}{H}. \\ \geq V ^ {\pi_ {0} ^ {*} \circ \pi_ {1} ^ {*} \circ \dots \circ \pi_ {H - 1}} (s _ {1}) - V ^ {\pi_ {0} ^ {*} \circ \pi_ {1} ^ {*} \circ \dots \circ \pi_ {H - 1} ^ {*}} (s _ {1}) - \frac {2 \epsilon}{H}. \\ \end{array}
+$$
+
+$$
+\begin{array}{l} > \dots \\ \geq - \epsilon . \\ \end{array}
+$$
\ No newline at end of file
diff --git a/isagoodrepresentationsufficientforsampleefficientreinforcementlearning/images.zip b/isagoodrepresentationsufficientforsampleefficientreinforcementlearning/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..af502ea0a85f7aedaefdc50918017ef2024b4f87
--- /dev/null
+++ b/isagoodrepresentationsufficientforsampleefficientreinforcementlearning/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:44a492d8a533a9038681b78b6638de9d72a36886b90c2c8cd305952b39cb2dca
+size 244977
diff --git a/isagoodrepresentationsufficientforsampleefficientreinforcementlearning/layout.json b/isagoodrepresentationsufficientforsampleefficientreinforcementlearning/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..45a718dc50878ea6c164f6139fdb261e4a816aee
--- /dev/null
+++ b/isagoodrepresentationsufficientforsampleefficientreinforcementlearning/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:50ef3d7bb80a0cbf64614720e8c7562b194913c4c8c1feb33421c8056219e888
+size 1117464
diff --git a/kaleidoscopeanefficientlearnablerepresentationforallstructuredlinearmaps/8c08e008-771c-4067-b15b-2059279bb74c_content_list.json b/kaleidoscopeanefficientlearnablerepresentationforallstructuredlinearmaps/8c08e008-771c-4067-b15b-2059279bb74c_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..d241e36240914af8cbbd039a6916a3108be6c1e7
--- /dev/null
+++ b/kaleidoscopeanefficientlearnablerepresentationforallstructuredlinearmaps/8c08e008-771c-4067-b15b-2059279bb74c_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:62ef81a093ad7173b154e4bbefb65b970b257a1219dce0becfd52c1bbb488927
+size 319520
diff --git a/kaleidoscopeanefficientlearnablerepresentationforallstructuredlinearmaps/8c08e008-771c-4067-b15b-2059279bb74c_model.json b/kaleidoscopeanefficientlearnablerepresentationforallstructuredlinearmaps/8c08e008-771c-4067-b15b-2059279bb74c_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..c4b33a9d5f1a22cae68b9631d3962ecfa9199338
--- /dev/null
+++ b/kaleidoscopeanefficientlearnablerepresentationforallstructuredlinearmaps/8c08e008-771c-4067-b15b-2059279bb74c_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:7a638cd17017ed680bd17b7cf4ef097a40865129c87d885bef540bb37c3eb140
+size 376098
diff --git a/kaleidoscopeanefficientlearnablerepresentationforallstructuredlinearmaps/8c08e008-771c-4067-b15b-2059279bb74c_origin.pdf b/kaleidoscopeanefficientlearnablerepresentationforallstructuredlinearmaps/8c08e008-771c-4067-b15b-2059279bb74c_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..d2b502a655c35698cc10b7648d96a69c70c12ad7
--- /dev/null
+++ b/kaleidoscopeanefficientlearnablerepresentationforallstructuredlinearmaps/8c08e008-771c-4067-b15b-2059279bb74c_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0d38e919cbd36d288d31036ead19a9c55c50ce24edbf946b4a9f80e703db9466
+size 1615609
diff --git a/kaleidoscopeanefficientlearnablerepresentationforallstructuredlinearmaps/full.md b/kaleidoscopeanefficientlearnablerepresentationforallstructuredlinearmaps/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..25fa98d2acf1c5a2057306a9f67a0f0780de8dbc
--- /dev/null
+++ b/kaleidoscopeanefficientlearnablerepresentationforallstructuredlinearmaps/full.md
@@ -0,0 +1,1331 @@
+# KALEIDOSCOPE: AN EFFICIENT, LEARNABLE REPRESENTATION FOR ALL STRUCTURED LINEAR MAPS
+
+Tri Dao1, Nimit Sharad Sohoni*², Albert Gu*¹, Matthew Eichhorn³, Amit Blonder⁴, Megan Leszczynski1, Atri Rudra4, Christopher Ré1
+
+1 Department of Computer Science, Stanford University
+$^{2}$ Institute for Computational and Mathematical Engineering, Stanford University
+3 Center for Applied Mathematics, Cornell University
+$^{4}$ Department of Computer Science and Engineering, University at Buffalo, The State University of New York {trid, nims, albertgu} @stanford.edu, mae226@cornell.edu, amitblon@buffalo.edu, mleszczy@stanford.edu, atri@buffalo.edu, chrismre@cs.stanford.edu
+
+# ABSTRACT
+
+Modern neural network architectures use structured linear transformations, such as low-rank matrices, sparse matrices, permutations, and the Fourier transform, to improve inference speed and reduce memory usage compared to general linear maps. However, choosing which of the myriad structured transformations to use (and its associated parameterization) is a laborious task that requires trading off speed, space, and accuracy. We consider a different approach: we introduce a family of matrices called kaleidoscope matrices (K-matrices) that provably capture any structured matrix with near-optimal space (parameter) and time (arithmetic operation) complexity. We empirically validate that K-matrices can be automatically learned within end-to-end pipelines to replace hand-crafted procedures, in order to improve model quality. For example, replacing channel shuffles in ShuffleNet improves classification accuracy on ImageNet by up to $5\%$ . K-matrices can also simplify hand-engineered pipelines—we replace filter bank feature computation in speech data preprocessing with a learnable kaleidoscope layer, resulting in only $0.4\%$ loss in accuracy on the TIMIT speech recognition task. In addition, K-matrices can capture latent structure in models: for a challenging permuted image classification task, a K-matrix based representation of permutations is able to learn the right latent structure and improves accuracy of a downstream convolutional model by over $9\%$ . We provide a practically efficient implementation of our approach, and use K-matrices in a Transformer network to attain $36\%$ faster end-to-end inference speed on a language translation task.
+
+# 1 INTRODUCTION
+
+Structured linear maps are fundamental and ubiquitous in modern machine learning. Their efficiency in speed (fast algorithms) and space (few parameters) can reduce computation and memory usage. The class of structured linear maps includes fixed specialized transforms such as the discrete Fourier transform (DFT) and Hadamard transform used in signal processing (Cooley et al., 1969), convolutions for image, language, and speech modeling (Gu et al., 2018), and low-rank and sparse matrices for efficient storage and inference on edge devices (Yu et al., 2017). Forms of structure such as sparsity have been at the forefront of recent advances in ML (Frankle & Carbin, 2019), and are critical for on-device and energy-efficient models, two application areas of tremendous recent interest (Tsidulko, 2019; Schwartz et al., 2019).
+
+There are a plethora of classes of structured linear maps, each with a significantly different representation, algorithm, and implementation. They have different tradeoffs in terms of inference speed, training speed, and accuracy, and the conventional wisdom is that no one class works uniformly well across all applications. As a result, ML practitioners currently hand-pick specific classes of structured linear maps for each of their applications. This is a difficult and labor-intensive task.
+
+Ideally, these problems should be addressed with a universal representation for structured linear maps: (i) Such a parameterization should be expressive enough to capture important classes of structure, with a nearly tight parameter count and runtime: the space required to represent the linear map should be close to optimal, and the resulting algorithm for matrix vector multiplication should be close to the fastest possible algorithm. (ii) The parameterization should be differentiable in order to be learned as a component of end-to-end ML pipelines, enabling it to easily be used as a drop-in replacement for manually engineered structured components. (iii) The parameterization should admit practically efficient algorithms for training and inference, in terms of both speed and memory.
+
+Currently, no class of structured linear maps satisfies all of these criteria. Most existing classes of structured matrices—such as the class of low-rank matrices—fail to tightly capture other important types of structure. For example, the DFT has an efficient structured representation of size $O(n \log n)$ , yet cannot be well-approximated by a low-rank transform of size $\ll n^2$ . Another important type of structure is sparsity; lots of exciting recent work has focused on the design of sparse neural networks. For instance, sparse networks of comparable quality to their dense counterparts—yet an order of magnitude fewer parameters—may be created via pruning (Han et al., 2016) or by identifying "winning lottery tickets" (Frankle & Carbin, 2019). In parallel, recent theoretical results by De Sa et al. (2018) show that sparsity and the notion of structure in linear maps are fundamentally linked: any given matrix can be factored into a product of sparse matrices with total parameter count equal to the efficiency (i.e. minimum arithmetic circuit complexity) of the matrix. In other words, the representation of linear maps as products of sparse matrices tightly captures all forms of structure. Unfortunately, it is difficult to actually learn these sparse factorizations, because it requires finding the sparsity patterns of the factors—a discrete, nondifferentiable search problem. Thus, current methods for training sparse neural networks are either expensive (Frankle & Carbin, 2019) or rely on highly hand-tuned heuristics for evolving the sparsity patterns throughout training (Dettmers & Zettlemoyer, 2019).
+
+By contrast, we propose a representation of linear maps as products of sparse matrices with specific predefined sparsity patterns (Section 2), and show that it does satisfy our desiderata: it retains the expressiveness of unstructured sparsity, while being differentiably learnable and efficient like other structured representations. Concretely, our representation is based on products of a particular building block known as a butterfly matrix (Parker, 1995; Dao et al., 2019); we term such products kaleidoscope matrices (K-matrices for short).1 (i) Our main theoretical contribution (Section 2.3) concerns the expressiveness of this representation: we show that any structured linear map (i.e. one that can be applied using $s \ll n^2$ arithmetic operations) can be represented as a K-matrix, with a nearly tight number of parameters and algorithmic complexity (both on the order of $s$ up to logarithmic factors). (ii) The kaleidoscope representation is fully differentiable; thus, all the parameters of a K-matrix can be learned using standard optimization algorithms such as SGD. (iii) Because of their simple, regular structure, K-matrices are practical and easy to use. We provide memory- and runtime-efficient implementations of K-matrix multiplication on CPU and GPU for training and inference, with a simple PyTorch interface.
+
+We empirically validate that, due to their expressiveness, learnability, and efficiency, we can use K-matrices as a drop-in replacement for linear components in deep learning models. In Section 3.1, we use K-matrices to replace hand-crafted structure in two different settings. We simplify the six steps of filter bank computation in speech preprocessing into a single learnable K-matrix step, with only an $0.4\%$ accuracy drop on the TIMIT speech recognition task. We use K-matrices to replace channel shuffles in ShuffleNet, improving ImageNet classification accuracy by up to $5\%$ . In Section 3.2, we show that K-matrices can successfully recover latent structure; a K-matrix is used to learn latent permutations in a permuted image dataset (Permuted CIFAR), resulting in 9 points higher accuracy in a downstream CNN model. In Section 3.3, we show that our efficient K-matrix multiplication implementation can be applied to speed up real-world tasks: we replace linear layers with K-matrices in a DynamicConv-Transformer network to attain $36\%$ faster end-to-end inference speed with a 1.0 drop in BLEU score on the IWSLT14 German→English translation task.
+
+# 2 A NEARLY-TIGHT PARAMETERIZATION OF ALL STRUCTURED MATRICES
+
+We first present some background on the characterization of all structured matrices (i.e. those with subquadratic multiplication algorithms) as products of sparse factors, along with the definition of butterfly matrices. We then propose a differentiable family of kaleidoscope matrices, composed of products of butterfly matrices, and prove their expressivity: all structured matrices can be represented in this form, with almost optimal parameter count and runtime.
+
+# 2.1 BACKGROUND: SPARSE FACTORIZATION, BUTTERFLY MATRICES
+
+Sparse factorization One method of constructing matrices with theoretically fast matrix-vector multiplication algorithms is as a product of sparse matrices, so that multiplication by an arbitrary vector has cost proportional to the total number of nonzeros (NNZ) of the matrices in the product. Surprisingly, the converse is also true. De Sa et al. (2018) introduce the concept of sparse product width (SPW), which roughly corresponds to the total NNZ in a factorization of a matrix, and show that it is an asymptotically optimal descriptor of the algorithmic complexity of matrix-vector multiplication (Bürgisser et al., 2013). We use a similar argument in the proof of our main theorem (Section 2.3). However, attempting to learn such a factorization of a given matrix is difficult, as the sparsity constraint is not continuous. Moreover, because of the possibly irregular sparsity patterns, it is difficult to realize the theoretical speedups in practice (Gray et al., 2017; Gahvari et al., 2007).
+
+Butterfly matrices
+Butterfly matrices, encoding the recursive divide-and-conquer structure of the fast Fourier transform (FFT) algorithm, have long been used in numerical linear algebra (Parker, 1995; Li et al., 2015) and machine learning (Mathieu & LeCun, 2014; Jing et al., 2017; Munkhoeva et al., 2018; Dao et al., 2019; Choromanski et al., 2019). Here we define butterfly matrices, which we use as a building block for our hierarchy of kaleidoscope matrices.
+
+Definition 2.1. A butterfly factor of size $k \geq 2$ (denoted as $\mathbf{B}_k$ ) is a matrix of the form $\mathbf{B}_k = \begin{bmatrix} \mathbf{D}_1 & \mathbf{D}_2 \\ \mathbf{D}_3 & \mathbf{D}_4 \end{bmatrix}$ where each $\mathbf{D}_i$ is a $\frac{k}{2} \times \frac{k}{2}$ diagonal matrix. We restrict $k$ to be a power of 2.
+
+Definition 2.2. A butterfly factor matrix of size $n$ with block size $k$ (denoted as $\mathbf{B}_k^{(n)}$ ) is a block diagonal matrix of $\frac{n}{k}$ (possibly different) butterfly factors of size $k$ :
+
+$$
+\mathbf {B} _ {k} ^ {(n)} = \mathrm {d i a g} \left(\left[ \mathbf {B} _ {k} \right] _ {1}, \left[ \mathbf {B} _ {k} \right] _ {2}, \dots , \left[ \mathbf {B} _ {k} \right] _ {\frac {n}{k}}\right)
+$$
+
+Definition 2.3. A butterfly matrix of size $n$ (denoted as $\mathbf{B}^{(n)}$ ) is a matrix that can be expressed as a product of butterfly factor matrices: $\mathbf{B}^{(n)} = \mathbf{B}_n^{(n)}\mathbf{B}_{\frac{n}{2}}^{(n)}\ldots \mathbf{B}_2^{(n)}$ . Equivalently, we may define $\mathbf{B}^{(n)}$ recursively as a matrix that can be expressed in the following form:
+
+$$
+\mathbf {B} ^ {(n)} = \mathbf {B} _ {n} ^ {(n)} \left[ \begin{array}{c c} {[ \mathbf {B} ^ {(\frac {n}{2})} ] _ {1}} & 0 \\ 0 & {[ \mathbf {B} ^ {(\frac {n}{2})} ] _ {2}} \end{array} \right]
+$$
+
+(Note that $[\mathbf{B}^{(\frac{n}{2})}]_1$ and $[\mathbf{B}^{(\frac{n}{2})}]_2$ may be different.)
+
+# 2.2 THE KALEIDOSCOPE HIERARCHY
+
+Using the building block of butterfly matrices, we formally define the kaleidoscope $(\mathcal{BB}^{*})$ hierarchy and prove its expressiveness. This class of matrices serves as a fully differentiable alternative to products of sparse matrices (Section 2.1), with similar expressivity. In Appendix J, we show where various common structured matrix classes are located within this hierarchy.
+
+The building block for this hierarchy is the product of a butterfly matrix and the (conjugate) transpose of another butterfly matrix (which is simply a product of butterfly factors taken in the opposite order). Figure 1 visualizes the sparsity patterns of the butterfly factors in $\mathcal{BB}^*$ , where the red and blue dots represent the allowed locations of nonzero entries.
+
+Definition 2.4 (Kaleidoscope hierarchy, kaleidoscope matrices).
+
+- Define $\mathcal{B}$ as the set of all matrices that can be expressed in the form $\mathbf{B}^{(n)}$ (for some $n$ ).
+- Define $\mathcal{BB}^*$ as the set of matrices $\mathbf{M}$ of the form $\mathbf{M} = \mathbf{M}_1\mathbf{M}_2^*$ for some $\mathbf{M}_1, \mathbf{M}_2 \in \mathcal{B}$ .
+
+
+Figure 1: Visualization of the fixed sparsity pattern of the building blocks in $\mathcal{BB}^*$ , in the case $n = 16$ . The red and blue dots represent all the possible locations of the nonzero entries.
+
+
+
+- Define $(\mathcal{BB}^{*})^{w}$ as the set of matrices $\mathbf{M}$ that can be expressed as $\mathbf{M} = \mathbf{M}_w \ldots \mathbf{M}_2\mathbf{M}_1$ , with each $\mathbf{M}_i \in \mathcal{BB}^*$ ( $1 \leq i \leq w$ ). (The notation $w$ represents width.)
+- Define $(\mathcal{BB}^{*})_{e}^{w}$ as the set of $n \times n$ matrices $\mathbf{M}$ that can be expressed as $\mathbf{M} = \mathbf{S}\mathbf{E}\mathbf{S}^T$ for some $en \times en$ matrix $\mathbf{E} \in (\mathcal{BB}^{*})^{w}$ , where $\mathbf{S} \in \mathbb{F}^{n \times en} = [I_n \quad 0 \quad \ldots \quad 0]$ (i.e. $\mathbf{M}$ is the upper-left corner of $\mathbf{E}$ ). (The notation $e$ represents expansion relative to $n$ .)
+- M is a kaleidoscope matrix, abbreviated as $\mathbf{K}$ -matrix, if $M \in (\mathcal{B}\mathcal{B}^*)_e^w$ for some $w$ and $e$ .
+
+The kaleidoscope hierarchy, or $(\mathcal{BB}^{*})$ hierarchy, refers to the families of matrices $(\mathcal{BB}^{*})_{e}^{1}\subseteq (\mathcal{BB}^{*})_{e}^{2}\subseteq \ldots$ , for a fixed expansion factor $e$ . Each butterfly matrix can represent the identity matrix, so $(\mathcal{BB}^{*})_{e}^{w}\subseteq (\mathcal{BB}^{*})_{e}^{w + 1}$ . We show that the inclusion is proper in Appendix E. This hierarchy generalizes the $\mathcal{BP}$ hierarchy proposed by Dao et al. (2019), as shown in Appendix J.
+
+Efficiency in space and speed Each matrix in $(\mathcal{B}\mathcal{B}^{*})_{e}^{w}$ is a product of $2w$ total butterfly matrices and transposes of butterfly matrices, each of which is in turn a product of $\log (ne)$ factors with $2ne$ nonzeros (NNZ) each. Therefore, each matrix in $(\mathcal{B}\mathcal{B}^{*})_{e}^{w}$ has $4wne\log (ne)$ parameters and a matrix-vector multiplication algorithm of complexity $O(wne\log ne)$ (by multiplying the vector with each sparse factor sequentially). We prove this more formally in Appendix E. For the applications in Section 3, $w$ and $e$ are small constants (up to 2), so those K-matrices have $O(n\log n)$ parameters and runtime.
+
+# 2.3 ALL LOW-DEPTH STRUCTURED MATRICES ARE IN THE KALEIDOSCOPE HIERARCHY
+
+We now present our main theoretical result: the fact that general linear transformations, expressed as low-depth linear arithmetic circuits, are captured in the $\mathcal{BB}^*$ hierarchy with low width. Arithmetic circuits are commonly used to formalize algebraic algorithmic complexity (Bürgisser et al., 2013); we include a primer on this in Appendix M. The quantities of interest are the total number of gates in the circuit, representing the total number of steps required to perform the algorithm for a serial processor, and the depth, representing the minimum number of steps required for a parallel processor.
+
+Theorem 1. Let $\mathbf{M}$ be an $n\times n$ matrix such that multiplication of $\mathbf{M}$ times an arbitrary vector $\mathbf{v}$ can be represented as a linear arithmetic circuit with $s$ total gates and depth $d$ . Then, $\mathbf{M}\in (\mathcal{BB}^{*})_{O(\frac{s}{n})}^{O(d)}$ .
+
+The representation of such a matrix $\mathbf{M}$ in the $\mathcal{BB}^*$ hierarchy has $O(ds\log s)$ parameters and yields a $O(ds\log s)$ multiplication algorithm, compared to the $O(s)$ parameters and runtime of the circuit representation. To the best of our knowledge, the most general classes of efficient matrices that have been studied (De Sa et al., 2018) have depth $d$ on the order of $\log n$ or poly log $n$ . In these cases, the representation with K-matrices matches the best known bounds up to polylogarithmic factors.
+
+The crux of the proof of Theorem 1 (shown in Appendix F) is the construction of an almost tight representation of any sparse matrix as a K-matrix (i.e. a product of butterfly matrices): specifically, we show that any $n \times n$ sparse matrix with $s$ nonzeros is in $\left(\mathcal{BB}^{*}\right)_{O(1)}^{O\left(\left\lceil \frac{s}{n}\right\rceil\right)}$ (Theorem 3, Appendix I). We then leverage the expressivity result of products of sparse matrices to represent all arithmetic circuits (similar to the sparse product width result of De Sa et al. (2018) referenced in Section 2.1) to complete the proof of Theorem 1.
+
+This intermediate result is also a novel characterization of sparse matrices. For a matrix with $s$ NNZ, the kaleidoscope representation has $O(s\log n)$ parameters and runtime, instead of the optimal $O(s)$ parameters and runtime; so, we trade off an extra logarithmic factor in space and time for full differentiability (thanks to the fixed sparsity patterns in the representation). The intuition behind
+
+the result is as follows: a sparse matrix with $s$ NNZ can be written as a sum of $\lceil s/n \rceil$ matrices each with at most $n$ NNZ. Any $n \times n$ matrix with at most $n$ NNZ, up to permuting the rows and columns, is a product of two butterfly matrices (Lemma I.1). Sorting networks (Knuth, 1997) imply that permutation matrices are in $(\mathcal{BB}^*)^{O(\log n)}$ , but we tighten the result to show that they are in fact in $\mathcal{BB}^*$ (Theorem 2, Appendix G). We thus obtain a kaleidoscope representation for each summand matrix with $O(n\log n)$ parameters. By the addition closure property of the $\mathcal{BB}^*$ hierarchy (Lemma H.5), each sparse matrix with $s$ NNZ then has a kaleidoscope representation with $O(s\log n)$ parameters.
+
+Tight representation for structured linear maps common in ML Even though Theorem 1 suggests that the kaleidoscope representation can be loose by logarithmic factors, many structured linear maps common in ML can be represented in this hierarchy with an optimal number of parameters and runtime compared to the best known parameterizations, up to constant factors. Appendix J includes several examples such as discrete transforms (the DFT, discrete cosine transform (DCT), discrete sine transform (DST), and Hadamard transform), convolution (i.e. circulant matrices), Toeplitz matrices (Gray, 2006), structured matrices for kernel approximation $(HD)^3$ (Yu et al., 2016)) and compact neural network design (Fastfood (Le et al., 2013), ACDC (Moczulski et al., 2016)). There have been other large classes of structured matrices proposed in the machine learning literature, such as Toeplitz-like (Sindhwani et al., 2015) and low displacement rank (LDR) (Thomas et al., 2018), but they are not known to be able to capture these common structures as tightly as K-matrices can. More detailed discussions are in Appendix A.
+
+# 2.4 EXTENSIONS
+
+ReLU networks with low-depth structured weight matrices In Appendix L, we prove that finding an efficient circuit for a ReLU network can be reduced to finding efficient circuits for each of its weight matrices, with at most a constant factor greater size and run-time (i.e. number of gates). We also show that ReLU networks with kaleidoscope weight matrices have near-linear VC dimension in the number of parameters, matching the bound for networks with unconstrained weight matrices (Bartlett et al., 1999; Harvey et al., 2017) and LDR (Thomas et al., 2018). This yields a corresponding sample complexity bound.
+
+Orthogonal kaleidoscope hierarchy Orthogonal butterfly matrices are one commonly used variant due to their improved stability (Parker, 1995), where each butterfly factor is constrained to be orthogonal: $\left[ \begin{array}{cc}\mathbf{C} & \mathbf{S}\\ -\mathbf{S} & \mathbf{C} \end{array} \right]$ with $\mathbf{C},\mathbf{S}$ being diagonal and $\mathbf{C}^2 +\mathbf{S}^2 = \mathbf{I}$ . Similar to the $\mathcal{BB}^*$ hierarchy, in Appendix K, we define the OBB hierarchy consisting of products of orthogonal butterfly matrices and diagonal matrices, and show that this hierarchy has the same expressiveness as the $\mathcal{BB}^*$ hierarchy.
+
+# 3 EMPIRICAL EVALUATION
+
+We validate three claims that suggest that kaleidoscopes are a promising technique to learn different types of structure in modern architectures.
+
+1. Section 3.1: for applications in speech and lightweight computer vision relying on highly hand-crafted structured transformations, we show that we can recover—and even improve—the quality of such architectures by simply replacing existing hand-structured components with K-matrices, with only a small overhead in memory and computation.
+2. In Section 3.2, for a challenging task with latent structure (Permuted CIFAR-10), a K-matrix-based relaxation of permutations is able to learn the right latent permutation, yielding 9 points better accuracy in a downstream CNN compared to standard RNN and CNN baselines used on such permuted image classification tasks.
+3. In Section 3.3, we show that, although not yet highly optimized, our current implementation of K-matrices can improve the inference throughput of DynamicConv Transformer, a state-of-the-art fast machine translation model, by $36\%$ , with only a relatively small drop in translation quality.
+
+In all of the above applications, as K-matrices are fully differentiable, we simply train them jointly with the rest of the model using standard learning algorithms (such as SGD). Full details for all of the experiments (precise architectures, hyperparameters, etc.) are in Appendix B2.
+
+# 3.1 REPLACING HAND-CRAFTED STRUCTURES
+
+We validate that kaleidoscope matrices can recover or improve on the performance of hand-crafted structure in ML models. For example, a single learnable kaleidoscope layer can be used to replace the hand-engineered filter bank speech preprocessing pipeline with only $0.4\%$ loss in accuracy on the TIMIT speech recognition task (Section 3.1.1). Replacing channel shuffles in ShuffleNet with learnable K-matrices improves classification accuracy on ImageNet by up to $5.0\%$ (Section 3.1.2).
+
+# 3.1.1 SPEECH PREPROCESSING
+
+
+Figure 2: Comparison of the standard MFSC featurization pipeline with our "kaleidoscope" pipeline.
+
+We show that K-matrices can remove the need for hand-tuning by significantly simplifying speech recognition data preprocessing pipelines. In particular, we can entirely replace the complex handcrafted MFSC featurization commonly used in speech recognition tasks with a fully learnable kaleidoscope layer, with only $0.4\%$ drop in accuracy on the TIMIT speech recognition benchmark. Results are presented in Table 1. Our approach is competitive with the accuracy of standard models that use hand-crafted features, and significantly outperforms current approaches for learning from raw audio input.
+
+Table 1: TIMIT phoneme error rate (PER%) for different methods. Our kaleidoscope, raw-input version of the model (row 3) performs competitively with the original model trained on MFSC features (row 1), with only an $0.4\%$ drop in PER. It significantly outperforms existing approaches that learn from raw audio, i.e. without handcrafted featurization (e.g. SincNet [row 2], which to our knowledge attains the previous state-of-the-art for learning from raw audio), and is only $0.8\%$ less accurate than the overall state-of-the-art on TIMIT. Additional comparisons are given in Appendix B.1.
+
+| Method | Test set PER% | Raw audio input |
| MFSC features + LSTM | 14.2 | X |
| SincNet (Ravanelli et al., 2019) | 17.2 | ✓ |
| Kaleidoscope + LSTM | 14.6 | ✓ |
+
+Modern speech recognition models currently rely on carefully hand-crafted features extracted from the audio, which are then fed into an acoustic model. By contrast, learning directly from the raw audio—i.e. end-to-end learning from the audio waveform without any manual featurization—obviates the need for this complicated and often expensive preprocessing step. There have been recent attempts to learn directly from raw audio, such as SincNet (Ravanelli & Bengio, 2018); however, they often rely on specialized architectures designed by domain experts. Instead, we use a standard RNN speech recognition architecture, but use a learnable kaleidoscope layer to replace the featurization steps.
+
+The baseline architecture takes as input filter bank (MFSC) features, which are a popular standard featurization for speech recognition (Paliwal, 1999) and involve several steps hand-crafted specifically for this domain. These features are extracted from the raw audio waveform, and fed as the input into a Bi-LSTM model. We significantly simplify this pipeline by replacing the featurization step with a trainable kaleidoscope layer that is trained end-to-end together with the Bi-LSTM. The original pipeline and our modified kaleidoscope version are depicted in Figure 2.
+
+The computation of MFSC features involves a series of painstakingly hand-designed steps (further described in Appendix B.1), each involving their own hyperparameters: (i) the waveform is framed (split into chunks), (ii) the waveform is dithered (noise is added), (iii) pre-emphasis is applied, (iv) the Hamming window is applied, (v) the FFT is applied and the power spectrum is computed, (vi) the result is mapped to the mel scale (which involves applying a particular linear transformation and then taking the logarithm of the result), (vii) cepstral mean and variance normalization is applied. We replace the last six steps (ii-vii) of this featurization process with a learnable kaleidoscope layer; specifically, after windowing, we multiply the input by a K-matrix, and then compute the logarithm of the power spectrum; the output is fed into the Bi-LSTM model.
+
+# 3.1.2 REPLACING CNN CHANNEL SHUFFLE
+
+We evaluate how K-matrices can improve the quality of hand-crafted, lightweight architectures for computer vision tasks, without the need for hand-tuning. We select ShuffleNet (Zhang et al., 2018), which is a state-of-the-art lightweight CNN architecture that uses a manually designed "channel shuffle" permutation matrix to improve performance. By replacing this fixed permutation with a learnable K-matrix, we achieve up to $5\%$ further improvement in classification accuracy, without hand-tuned components and with a modest space penalty of up to $10\%$ . Results are given in Table 2.
+
+Table 2: Top-1 classification accuracy of ShuffleNet on ImageNet validation set (parameter counts in parentheses). We compare our approach (col. 3) with our reimplementation of 'vanilla' ShuffleNet (col. 1) and a recent approach based on the Hadamard transform (col. 2).4 We report results for different network width multipliers (# channels). The last column shows the differences in accuracy and parameter count between our approach and vanilla ShuffleNet; using a learnable K-matrix in place of each fixed permutation (shuffle) or Hadamard matrix improves accuracy by up to $5\%$ .
+
+ | Shuffle | Hadamard | Kaleidoscope (K.) | K. vs. Shuffle |
| 0.25 ShuffleNet g8 | 44.1% (0.46M) | 43.9% (0.46M) | 49.2% (0.51M) | +5.0% (+0.05M) |
| 0.5 ShuffleNet g8 | 57.1% (1.0M) | 56.2% (1.0M) | 59.5% (1.1M) | +2.4% (+0.1M) |
| 1.0 ShuffleNet g8 | 65.3% (2.5M) | 65.0% (2.5M) | 66.5% (2.8M) | +1.2% (+0.2M) |
+
+Grouped convolution (Krizhevsky et al., 2012) is often used to reduce parameter count and speed up inference compared to standard convolution, but, by default, channels in different groups cannot exchange information. To remedy this, ShuffleNet uses a permutation matrix to shuffle the channels after each grouped convolution. Zhao et al. (2019) propose to instead use the Hadamard transform before and after each grouped convolution to mix the channels. In place of these hand-engineered solutions, we use a K-matrix before and after each grouped convolution, and learn these end-to-end together with the rest of the network. As shown in Table 2, across a range of sizes, replacing the channel shuffles with K-matrices results in improved performance at comparable parameter counts.
+
+# 3.2 LEARNING A LATENT PERMUTATION
+
+We show that K-matrices can be used in a challenging task for which existing classes of structured linear maps have not been found suitable. We investigate the problem of image classification on a permuted image dataset (Permuted CIFAR-10). This problem is challenging due to the discrete nature of learning the latent permutation of the dataset; we present a differentiable relaxation for this using a K-matrix as a key component. Results are presented in Table 3; compared to methods that do
+
+not have a permutation learning step, our approach gets 9 points higher accuracy (84.4% to 93.6%), coming within 2 points of the accuracy on the un-permuted dataset (94.9%).
+
+Table 3: Permuted CIFAR-10 validation set classification accuracy (\%). Our kaleidoscope layer is able to nearly perfectly recover the latent structure, allowing a downstream CNN to approach the accuracy of a standard ResNet18 on the unpermuted dataset (last column).
+
+| Model | FC | RNN | CNN | Dense + CNN | K + CNN | Unpermuted |
| Accuracy | 61.2 | 57.8 | 73.7 | 84.4 | 93.6 | 94.9 |
+
+In this task, we use a permuted image classification dataset (Permuted CIFAR-10), wherein a fixed global permutation is applied to the pixels of every image in the original input set. Typically, only fully-connected (FC) and recurrent models are applied to such datasets (Le et al., 2015), because the permutation destroys locality in the image, presenting a difficulty for CNNs. However, CNNs are much better-suited for standard image tasks. We thus expect that learning the permutation and then applying a standard CNN should outperform these baselines. As mentioned in Section 2, the kaleidoscope hierarchy provides a nearly tight parameterization of permutations; this makes them a natural fit for the permutation learning step.
+
+Experimentally, we use a K-matrix to represent a distribution over permutations, which converges to a single permutation at the end of training. The correct latent structure is learned by applying samples from this distribution to the permuted training images, and minimizing an auxiliary smoothness-based loss that encourages the reconstructed images to be more "natural" (i.e. vary smoothly pixel-to-pixel). The learned permutation is evaluated by training a ResNet18 with the K-matrix permutation layer inserted at the beginning. Full details of our approach are provided in Appendix B.3.
+
+In Table 3, we compare our approach to a ResNet18 without this extra K-matrix layer, a ResNet18 with an extra dense matrix at the beginning instead of a K-matrix, and other baselines. As generic representations such as unstructured matrices do not have the requisite properties to fit in the pipeline, these baselines fail to effectively learn the latent permutation. We emphasize that a K-matrix provides this ability to recover latent structure despite not being specialized for permutations. Figure 3 describes the pipeline and displays examples of permuted and unpermuted images.
+
+
+Figure 3: (a) (Left) Schematic describing permutation learning approach. The inputs are multiplied by a K-matrix and then fed into a CNN, from which the classification loss is computed. Separately, the input is permuted by a permutation matrix sampled from the distribution described by the K-matrix, and a "smoothness" loss (Rudin et al., 1992) is computed from the result, as described in Appendix B.3. (b) (Right) Left panel: original (unpermuted) example images. Center panel: the permuted versions. Right panel: these images after then applying the permutation recovered by the K-matrix. The K-matrix is able to nearly unscramble the images into their unpermuted versions.
+
+
+
+# 3.3 SPEEDING UP INFERENCE
+
+We evaluate the inference speed benefit of using K-matrices on a real language translation model. We choose the state-of-the-art DynamicConv Transformer translation model (Wu et al., 2019), which offers $20\%$ inference speedup over the standard Transformer model, and replace dense matrices in the decoder's linear layers with K-matrices, which leads to a further $36\%$ inference speedup (Table 4).
+
+As outlined in Section 2.3, K-matrices admit a simple and fast $O(n \log n)$ matrix-vector multiplication algorithm. We provide fast implementations of this algorithm in C++ and CUDA, with an interface to PyTorch (Paszke et al., 2017), and use this implementation in our experiments.
+
+Table 4: Inference speed on the IWSLT-14 German-English translation task (test set). Using K-matrices instead of dense matrices in the DynamicConv decoder linear layers results in $36\%$ faster inference speed (measured on a single-threaded CPU with a batch size of 1 and beam size of 1).
+
+| Model | # params | BLEU | Sentences/sec | Tokens/sec |
| Transformer (Vaswani et al., 2017) | 43M | 34.4 | 3.0 | 66.4 |
| DynamicConv Transformer (Wu et al., 2019) | 39M | 35.2 | 3.6 | 80.2 |
| DynamicConv Transformer w/ K-matrices (ours) | 30M | 34.2 | 4.9 | 103.4 |
+
+We use K-matrices to replace all the linear layers in the decoder of DynamicConv (since $90\%$ of inference time is spent in the decoder). As shown in Table 4, on the IWSLT-14 German-English translation task, this yields a $25\%$ smaller model with $36\%$ faster inference time on CPU, at the cost of 1.0 drop in BLEU score. Our model also nearly matches the state-of-the-art BLEU performance of 2 years ago obtained by the Transformer model (Vaswani et al., 2017), despite being over $60\%$ faster for inference than the Transformer.) The majority $(55\%)$ of inference time is spent in matrix-vector multiplication; our implementation of K-matrix-vector multiplication is about 2 times faster than the optimized implementation of dense matrix-vector multiplication in the Intel MKL library. Direct comparisons of K-matrix multiplication with this and other highly-optimized routines such as the FFT are further detailed in Appendix C.
+
+# 4 CONCLUSION
+
+We address the problem of having to manually choose among the numerous classes of structured linear maps by proposing the universal (expressive, efficient, and learnable) family of kaleidoscope matrices. We prove that K-matrices can represent any structured linear maps with near-optimal space and time complexity. Empirical validations suggest that K-matrices are a promising and flexible way to employ structure in modern ML; they can be used to reduce the need for hand-engineering, capture challenging latent structure, and improve efficiency in models. We are excited about future work on further hardware-optimized implementations of K-matrices, to fully realize the size and speed benefits of structured matrices on a broad array of real-world applications.
+
+# ACKNOWLEDGMENTS
+
+We thank Avner May and Jian Zhang for their helpful feedback.
+
+We gratefully acknowledge the support of DARPA under Nos. FA87501720095 (D3M), FA86501827865 (SDH), and FA86501827882 (ASED); NIH under No. U54EB020405 (Mobilize), NSF under Nos. CCF1763315 (Beyond Sparsity), CCF1563078 (Volume to Velocity), and 1937301 (RTML); ONR under No. N000141712266 (Unifying Weak Supervision); the Moore Foundation, NXP, Xilinx, LETI-CEA, Intel, IBM, Microsoft, NEC, Toshiba, TSMC, ARM, Hitachi, BASF, Accenture, Ericsson, Qualcomm, Analog Devices, the Okawa Foundation, American Family Insurance, Google Cloud, Swiss Re, and members of the Stanford DAWN project: Teradata, Facebook, Google, Ant Financial, NEC, VMWare, andInfosys. The U.S. Government is authorized to reproduce and distribute reprints for Governmental purposes notwithstanding any copyright notation thereon. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views, policies, or endorsements, either expressed or implied, of DARPA, NIH, ONR, or the U.S. Government. Matthew Eichhorn and Atri Rudra's research is supported by NSF grant CCF-1763481.
+
+# REFERENCES
+
+Martin Arjovsky, Amar Shah, and Yoshua Bengio. Unitary evolution recurrent neural networks. In International Conference on Machine Learning, pp. 1120-1128, 2016.
+Shaojie Bai, J. Zico Kolter, and Vladlen Koltun. An empirical evaluation of generic convolutional and recurrent networks for sequence modeling. arXiv preprint arXiv:1803.01271, 2018.
+
+Peter L. Bartlett, Vitaly Maiorov, and Ron Meir. Almost linear VC dimension bounds for piecewise polynomial networks. In Advances in Neural Information Processing Systems, pp. 190-196, 1999.
+Peter Burgisser, Michael Clausen, and Mohammad A. Shokrollahi. Algebraic complexity theory, volume 315. Springer Science & Business Media, 2013.
+Kyunghyun Cho, Bart Van Merrienboer, Caglar Gulcehre, Dzmitry Bahdanau, Fethi Bougares, Holger Schwenk, and Yoshua Bengio. Learning phrase representations using RNN encoder-decoder for statistical machine translation. arXiv preprint arXiv:1406.1078, 2014.
+Krzysztof Choromanski, Mark Rowland, Wenyu Chen, and Adrian Weller. Unifying orthogonal Monte Carlo methods. In International Conference on Machine Learning, pp. 1203-1212, 2019.
+Ronan Collobert, Christian Puhrsch, and Gabriel Synnaeve. Wav2Letter: an end-to-end ConvNet-based speech recognition system. arXiv preprint arXiv:1609.03193, 2016.
+James W. Cooley, Peter A. W. Lewis, and Peter D. Welch. The fast fourier transform and its applications. IEEE Transactions on Education, 12(1), 1969.
+Tri Dao, Albert Gu, Matthew Eichhorn, Atri Rudra, and Christopher Ré. Learning fast algorithms for linear transforms using butterfly factorizations. In The International Conference on Machine Learning (ICML), 2019.
+Christopher De Sa, Albert Gu, Rohan Puttagunta, Christopher Ré, and Atri Rudra. A two-pronged progress in structured dense matrix vector multiplication. In Proceedings of the Twenty-Ninth Annual ACM-SIAM Symposium on Discrete Algorithms, pp. 1060-1079. SIAM, 2018.
+Tim Dettmers and Luke Zettlemoyer. Sparse networks from scratch: Faster training without losing performance. arXiv preprint arXiv:1907.04840, 2019.
+J. R. Driscoll, D. M. Healy, Jr., and D. N. Rockmore. Fast discrete polynomial transforms with applications to data analysis for distance transitive graphs. SIAM J. Comput., 26(4):1066-1099, August 1997. ISSN 0097-5397. doi: 10.1137/S0097539792240121. URL http://dx.doi.org/10.1137/S0097539792240121.
+Utku Evci, Trevor Gale, Jacob Menick, Pablo S. Castro, and Erich Elsen. Rigging the lottery: Making all tickets winners. arXiv preprint arXiv:1911.11134, 2019.
+Jonathan Frankle and Michael Carbin. The lottery ticket hypothesis: Finding sparse, trainable neural networks. In International Conference on Learning Representations (ICLR), 2019.
+Hormozd Gahvari, Mark Hoemmen, James Demmel, and Katherine Yelick. Benchmarking sparse matrix-vector multiply in five minutes. In SPEC Benchmark Workshop, 2007.
+John S. Garofolo, Lori F. Lamel, William M. Fisher, Jonathan G. Fiscus, David S. Pallett, Nancy L. Dahlgren, and Victor Zue. TIMIT acoustic-phonetic continuous speech corpus LDC93S1. Web Download. Philadelphia: Linguistic Data Consortium, 1993.
+Pegah Ghahremani, Vimal Manohar, Daniel Povey, and Sanjeev Khudanpur. Acoustic modelling from the signal domain using CNNs. In Interspeech, pp. 3434-3438, 2016.
+Robert M. Gray. Toeplitz and circulant matrices: A review. Foundations and Trends in Communications and Information Theory, 2(3):155-239, 2006.
+Scott Gray, Alec Radford, and Diederik P. Kingma. GPU kernels for block-sparse weights. arXiv preprint arXiv:1711.09224, 2017.
+Jiuxiang Gu, Zhenhua Wang, Jason Kuen, Lianyang Ma, Amir Shahroudy, Bing Shuai, Ting Liu, Xingxing Wang, Li Wang, Gang Wang, Jianfei Cai, and Tsuhan Chen. Recent advances in convolutional neural networks. Pattern Recognition, 77:354-377, 2018.
+Song Han, Huizi Mao, and William J. Dally. Deep compression: Compressing deep neural networks with pruning, trained quantization and huffman coding. In International Conference on Learning Representations (ICLR), 2016.
+
+Fredric J. Harris. On the use of windows for harmonic analysis with the discrete fourier transform. In Proceedings of the IEEE, 1978.
+Nick Harvey, Christopher Liaw, and Abbas Mehrabian. Nearly-tight VC-dimension bounds for piecewise linear neural networks. In Satyen Kale and Ohad Shamir (eds.), Proceedings of the 2017 Conference on Learning Theory, volume 65 of Proceedings of Machine Learning Research, pp. 1064-1068, Amsterdam, Netherlands, 07-10 Jul 2017. PMLR. URL http://proceedings.mlr.press/v65/harvey17a.html.
+Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2016.
+David P. Helmbold and Manfred K. Warmuth. Learning permutations with exponential weights. Journal of Machine Learning Research, 10(Jul):1705-1736, 2009.
+Alston S. Householder. Unitary triangularization of a nonsymmetric matrix. J. ACM, 5(4):339-342, October 1958. ISSN 0004-5411. doi: 10.1145/320941.320947. URL http://doi.acm.org/10.1145/320941.320947.
+Li Jing, Yichen Shen, Tena Dubcek, John Peurifoy, Scott Skirlo, Yann LeCun, Max Tegmark, and Marin Soljacic. Tunable efficient unitary neural networks (eunn) and their application to rnns. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 1733-1741. JMLR.org, 2017.
+Dan Jurafsky and James H. Martin. Speech and language processing, volume 3. Pearson London, 2014.
+Thomas Kailath, Sun-Yuan Kung, and Martin Morf. Displacement ranks of matrices and linear equations. Journal of Mathematical Analysis and Applications, 68(2):395-407, 1979.
+Donald Ervin Knuth. The art of computer programming, Volume 3: Sorting and Searching. Pearson Education, 1997.
+Alex Krizhevsky, Ilya Sutskever, and Geoffrey E. Hinton. Imagenet classification with deep convolutional neural networks. In Advances in Neural Information Processing Systems, pp. 1097-1105, 2012.
+Quoc Le, Tamás Sarlós, and Alexander Smola. Fastfood-computing hilbert space expansions in loglinear time. In International Conference on Machine Learning, pp. 244-252, 2013.
+Quoc V. Le, Navdeep Jaitly, and Geoffrey E. Hinton. A simple way to initialize recurrent networks of rectified linear units. arXiv preprint arXiv:1504.00941, 2015.
+Lisha Li, Kevin Jamieson, Giulia DeSalvo, Afshin Rostamizadeh, and Ameet Talwalkar. Hyperband: A novel bandit-based approach to hyperparameter optimization. The Journal of Machine Learning Research, 18(1):6765-6816, 2017.
+Yingzhou Li, Haizhao Yang, Eileen R. Martin, Kenneth L. Ho, and Lexing Ying. Butterfly factorization. Multiscale Modeling & Simulation, 13(2):714-732, 2015.
+Yingzhou Li, Haizhao Yang, and Lexing Ying. Multidimensional butterfly factorization. Applied and Computational Harmonic Analysis, 44(3):737-758, 2018.
+Fu-Hua Liu, Richard M. Stern, Xuedong Huang, and Alejandro Acero. Efficient cepstral normalization for robust speech recognition. In ARPA Workshop on Human Language Technology, 1993.
+Jiancheng Lyu, Shuai Zhang, Yingyong Qi, and Jack Xin. Autoshufflenet: Learning permutation matrices via an exact lipschitz continuous penalty in deep convolutional neural networks. arXiv preprint arXiv:1901.08624, 2019.
+J. Makhoul. A fast cosine transform in one and two dimensions. IEEE Transactions on Acoustics, Speech, and Signal Processing, 28(1):27-34, February 1980. ISSN 0096-3518. doi: 10.1109/TASSP.1980.1163351.
+
+Michael Mathieu and Yann LeCun. Fast approximation of rotations and Hessians matrices. arXiv preprint arXiv:1404.7195, 2014.
+Gonzalo Mena, David Belanger, Scott Linderman, and Jasper Snoek. Learning latent permutations with Gumbel-Sinkhorn networks. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id=Byt3oJ-0W.
+Zakaria Mhammedi, Andrew Hellicar, Ashfaqur Rahman, and James Bailey. Efficient orthogonal parametrisation of recurrent neural networks using householder reflections. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 2401-2409. JMLR.org, 2017.
+Decebal C. Mocanu, Elena Mocanu, Peter Stone, Phuong H. Nguyen, Madeleine Gibescu, and Antonio Liotta. Scalable training of artificial neural networks with adaptive sparse connectivity inspired by network science. Nature Communications, 9, 2018.
+Marcin Moczulski, Misha Denil, Jeremy Appleyard, and Nando de Freitas. ACDC: a structured efficient linear layer. In International Conference on Learning Representations, 2016.
+Hesham Mostafa and Xin Wang. Parameter efficient training of deep convolutional neural networks by dynamic sparse reparameterization. In The International Conference on Machine Learning (ICML), 2019.
+Marina Munkhoeva, Yermek Kapushev, Evgeny Burnaev, and Ivan Oseledets. Quadrature-based features for kernel approximation. In S. Bengio, H. Wallach, H. Larochelle, K. Grauman, N. Cesa-Bianchi, and R. Garnett (eds.), Advances in Neural Information Processing Systems 31, pp. 9165-9174. Curran Associates, Inc., 2018.
+Vadim Olshovsky and Mohammad Amin Shokrollahi. Matrix-vector product for confluent Cauchy-like matrices with application to confluent rational interpolation. In Proceedings of the Thirty-Second Annual ACM Symposium on Theory of Computing, May 21-23, 2000, Portland, OR, USA, pp. 573-581, 2000. doi: 10.1145/335305.335380. URL http://doi.acm.org/10.1145/335305.335380.
+Myle Ott, Sergey Edunov, Alexei Baevski, Angela Fan, Sam Gross, Nathan Ng, David Grangier, and Michael Auli. fairseq: A fast, extensible toolkit for sequence modeling. In Proceedings of NAACL-HLT 2019: Demonstrations, 2019.
+Dimitri Palaz, Ronan Collobert, and Mathew Magimai-Doss. Estimating phoneme class conditional probabilities from raw speech signal using convolutional neural networks. In Interspeech, 2013.
+Kuldip Paliwal. On the use of filter-bank energies as features for robust speech recognition. In International Symposium on Signal Processing and its Applications (ISSPA), 1999.
+Victor Y. Pan. Structured Matrices and Polynomials: Unified Superfast Algorithms. Springer-Verlag New York, Inc., New York, NY, USA, 2001. ISBN 0-8176-4240-4.
+Victor M. Panaretos and Shahin Tavakoli. Fourier analysis of stationary time series in function space. The Annals of Statistics, 41(2):568-603, 2013.
+D. Stott Parker. Random butterfly transformations with applications in computational linear algebra. Technical report, UCLA, 1995.
+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 Advances in Neural Information Processing Systems (NeurIPS) - Autodiff Workshop, 2017.
+Daniel Povey, Arnab Ghoshal, Gilles Boulianne, Lukas Burget, Ondrej Glembek, Nagendra Goel, Mirko Hannemann, Petr Motlicek, Yanmin Qian, Petr Schwarz, Jan Silovsky, Georg Stemmer, and Karel Vesely. The kaldi speech recognition toolkit. In IEEE 2011 Workshop on Automatic Speech Recognition and Understanding. IEEE Signal Processing Society, 2011.
+Mirco Ravanelli and Yoshua Bengio. Speaker recognition from raw waveform with sincnet. In IEEE Workshop on Spoken Language Technology, 2018.
+
+Mirco Ravanelli, Philemon Brakel, Maurizio Omologo, and Yoshua Bengio. Light gated recurrent units for speech recognition. In IEEE Transactions on Emerging Topics in Computational Intelligence, volume 2, pp. 92-102, 2018.
+Mirco Ravanelli, Titouan Parcollet, and Yoshua Bengio. The PyTorch-Kaldi speech recognition toolkit. In IEEE International Conference on Acoustics, Speech, and Signal Processing (ICASSP), 2019.
+Vladimir Rokhlin and Mark Tygert. Fast algorithms for spherical harmonic expansions. SIAM Journal on Scientific Computing, 27(6):1903-1928, 2006.
+Leonid I. Rudin, Stanley Osher, and Emad Fatemi. Nonlinear total variation based noise removal algorithms. Physica D: nonlinear phenomena, 60(1-4):259-268, 1992.
+Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, Alexander C. Berg, and Li Fei-Fei. ImageNet Large Scale Visual Recognition Challenge. International Journal of Computer Vision (IJCV), 115 (3):211-252, 2015. doi: 10.1007/s11263-015-0816-y.
+Tara N. Sainath, Brian Kingsbury, Vikas Sindhwani, Ebru Arisoy, and Bhuvana Ramabhadran. Low-rank matrix factorization for deep neural network training with high-dimensional output targets. In Proceedings of the IEEE International Conference on Acoustics, Speech and Signal Processing, pp. 6655-6659. IEEE, 2013.
+Tara N. Sainath, Ron J. Weiss, Andrew Senior, Kevin W. Wilson, and Oriol Vinyals. Learning the speech front-end with raw waveform CLDNNs. In Interspeech, 2015.
+Roy Schwartz, Jesse Dodge, Noah A. Smith, and Oren Etzioni. Green AI. arXiv preprint arXiv:1907.10597, 2019.
+Vikas Sindhwani, Tara N. Sainath, and Sanjiv Kumar. Structured transforms for small-footprint deep learning. In Advances in Neural Information Processing Systems, pp. 3088-3096, 2015.
+S. S. Stevens, J. Volkmann, and E. B. Newman. A scale for the measurement of the psychological magnitude pitch. Journal of the Acoustic Society of America, 8(3), 1937.
+G. Szegö. Orthogonal Polynomials. Number v. 23 in American Mathematical Society colloquium publications. American Mathematical Society, 1967. ISBN 9780821889527. URL https://books.google.com/books?id=3hcW8HBh7gsC.
+Anna T. Thomas, Albert Gu, Tri Dao, Atri Rudra, and Christopher Ré. Learning compressed transforms with low displacement rank. In Advances in Neural Information Processing Systems (NeurIPS), 2018.
+Trieu H. Trinh, Andrew M Dai, Minh-Thang Luong, and Quoc V. Le. Learning longer-term dependencies in RNNs with auxiliary losses. arXiv preprint arXiv:1803.00144, 2018.
+Joseph Tsidulko. Google showcases on-device artificial intelligence breakthroughs at I/O. CRN, 2019.
+Mark Tygert. Fast algorithms for spherical harmonic expansions, ii. Journal of Computational Physics, 227(8):4260-4279, 2008.
+Mark Tygert. Fast algorithms for spherical harmonic expansions, iii. Journal of Computational Physics, 229(18):6181-6192, 2010a.
+Mark Tygert. Recurrence relations and fast algorithms. Applied and Computational Harmonic Analysis, 28(1):121-128, 2010b.
+Aaron van den Oord, Sander Dieleman, Heiga Zen, Karen Simonyan, Oriol Vinyals, Alex Graves, Nal Kalchbrenner, Andrew Senior, and Koray Kavukcuoglu. WaveNet: A generative model for raw audio. arXiv preprint arXiv:1609.03499, 2016.
+
+Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in Neural Information Processing Systems (NeurIPS), 2017.
+Scott Wisdom, Thomas Powers, John Hershey, Jonathan Le Roux, and Les Atlas. Full-capacity unitary recurrent neural networks. In Advances in Neural Information Processing Systems, pp. 4880-4888, 2016.
+Felix Wu, Angela Fan, Alexei Baevski, Yann N Dauphin, and Michael Auli. Pay less attention with lightweight and dynamic convolutions. In International Conference on Learning Representations (ICLR), 2019.
+Saining Xie, Ross Girshick, Piotr Dolkar, Zhuowen Tu, and Kaiming He. Aggregated residual transformations for deep neural networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 1492-1500, 2017.
+Felix X. Yu, Sanjiv Kumar, Henry A. Rowley, and Shih-Fu Chang. Compact nonlinear maps and circulant extensions. CoRR, abs/1503.03893, 2015.
+Felix X. Yu, Ananda T. Suresh, Krzysztof M. Choromanski, Daniel N. Holtmann-Rice, and Sanjiv Kumar. Orthogonal random features. In D. D. Lee, M. Sugiyama, U. V. Luxburg, I. Guyon, and R. Garnett (eds.), Advances in Neural Information Processing Systems 29, pp. 1975-1983. Curran Associates, Inc., 2016.
+Xiyu Yu, Tongliang Liu, Xinchao Wang, and Dacheng Tao. On compressing deep models by low rank and sparse decomposition. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2017.
+Neil Zeghidour, Nicolas Usunier, Iasonas Kokkinos, Thomas Schatz, Gabriel Synnaeve, and Emmanuel Dupoux. Learning filterbanks from raw speech for phone recognition. In IEEE International Conference on Acoustics, Speech, and Signal Processing (ICASSP), 2018.
+Xiangyu Zhang, Xinyu Zhou, Mengxiao Lin, and Jian Sun. Shufflenet: An extremely efficient convolutional neural network for mobile devices. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 6848-6856, 2018.
+Ritchie Zhao, Yuwei Hu, Jordan Dotzel, Christopher De Sa, and Zhiru Zhang. Building efficient deep neural networks with unitary group convolutions. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 11303-11312, 2019.
+Michael Zhu and Suyog Gupta. To prune, or not to prune: exploring the efficacy of pruning for model compression. arXiv preprint arXiv:1710.01878, 2017.
+
+# A RELATED WORK
+
+# A.1 STRUCTURED MATRICES IN MACHINE LEARNING
+
+Structured linear maps such as the DFT, the Hadamard transform and convolution are a workhorse of machine learning, with diverse applications including data preprocessing, random projection, featurization, and model compression. For example, the DFT is a crucial step in the standard filter bank speech preprocessing pipeline (Jurafsky & Martin, 2014), and is commonly used when dealing with time series data in general (Panaretos & Tavakoli, 2013). Fast random projection and kernel approximation methods rely on the fast Hadamard transform (Le et al., 2013; Yu et al., 2016) and convolution (Yu et al., 2015), and convolution is a critical component of modern image processing architectures (Krizhevsky et al., 2012) as well as being useful in speech recognition (Zeghidour et al., 2018) and natural language processing (Wu et al., 2019). Large learnable classes of structured matrices such as Toeplitz-like matrices (Sindhwani et al., 2015) and low-displacement rank (LDR) matrices (Thomas et al., 2018) have been used for model compression. However, despite their theoretical speedup, these structured matrix classes lack efficient implementations, especially on GPUs. Therefore, their use has largely been confined to small models (e.g. single hidden layer neural nets) and small datasets (e.g. CIFAR-10).
+
+Butterfly matrices encode the recursive divide-and-conquer structure of the fast Fourier transform (FFT) algorithm. They were first used in numerical linear algebra for fast preconditioning (Parker, 1995). The butterfly factorization is then generalized to encompass complementary low-rank matrices commonly encountered in solving differential and integral equations (Rokhlin & Tygert, 2006; Tygert, 2008; 2010b;a; Li et al., 2015; 2018). In machine learning, butterfly matrices have been used to approximate the Hessian for fast optimization (Mathieu & LeCun, 2014), and to perform fast random projection (Jing et al., 2017; Munkhoeva et al., 2018; Choromanski et al., 2019). Dao et al. (2019) show that butterfly matrices can be used to learn fast algorithms for discrete transforms such as the Fourier transform, cosine/sine transform, Hadamard transform, and convolution.
+
+# A.2 SPARSE MATRICES
+
+Several classes of structured linear transforms are ubiquitous in modern deep learning architectures; particularly widespread examples include convolution and multiheaded attention. Recently, attempts to impose sparsity on the neural network weights have been gaining traction. State-of-the-art approaches of this type typically accomplish this by pruning small weights (either gradually during training (Zhu & Gupta, 2017), or post-training (Han et al., 2016)) or by training a dense network and then identifying "winning lottery tickets"—sparse subnetworks which may then be retrained from scratch with appropriate initialization (Frankle & Carbin, 2019). Importantly, these approaches start from a dense network, and therefore training is expensive. There is also a more nascent line of work that aims to train unstructured sparse neural networks directly (Mocanu et al., 2018; Mostafa & Wang, 2019; Dettmers & Zettlemoyer, 2019; Evci et al., 2019). These approaches maintain a constant network sparsity level throughout training, and use heuristics to evolve the sparsity pattern during training. One drawback is that the indices of the nonzero entries need to be stored in addition to the entry values themselves, which increases the memory required to store the sparse weight tensors. Another drawback is that these approaches to learn the sparsity pattern are based on intricate heuristics, which can be brittle. We note that these heuristic sparsification techniques could potentially be combined with our approach, to further sparsify the K-matrix factors.
+
+# A.3 SPEECH RECOGNITION FROM RAW AUDIO
+
+Numerous works focus on the problem of speech recognition from raw audio input, i.e. without manual featurization. SincNet (Ravanelli & Bengio, 2018) is a CNN-based architecture parameterized with sinc functions, designed so that the first convolutional layer imitates a band-pass filter. Zeghidour et al. (2018) formulate a learnable version of a filter bank featurization; their filters are initialized as an approximation of MFSC features and then fine-tuned jointly with the rest of the model. Sainath et al. (2015) proposed a powerful combined convolutional LSTM (CLDNN)-based model for learning from raw audio, using a large amount of training data. The WaveNet generative architecture (van den Oord et al., 2016), based on dilated convolutions, has been adapted to speech recognition and can be trained on raw audio. Other approaches that can learn from raw audio can be found in (Palaz et al.,
+
+2013; Collobert et al., 2016; Ghahremani et al., 2016). To our knowledge, the $14.6\%$ PER achieved by our kaleidoscope + LSTM model on the TIMIT test set is the lowest error rate obtained by a model trained directly on the raw audio.
+
+# A.4 LEARNING PERMUTATIONS
+
+Permutation matrices find use in tasks such as matching and sorting (among many others). Techniques to obtain posterior distributions over permutations have been developed, such as the exponential weights algorithm (Helmbold & Warmuth, 2009) and the Gumbel-Sinkhorn network (Mena et al., 2018).
+
+Classifying images with permuted pixels is a standard task to benchmark the ability of RNNs to learn long range dependencies. Le et al. (2015) propose the Permuted MNIST task, in which the model has to classify digit images with all the pixels permuted. Many new RNN architectures, with unitary or orthogonal weight matrices to avoid gradient explosion or vanishing, have been proposed and tested on this task (Le et al., 2015; Arjovsky et al., 2016; Wisdom et al., 2016; Mhammedi et al., 2017; Trinh et al., 2018). Standard gated RNN architectures such as LSTM and GRU have also been found to be competitive with these new RNN architectures on this task (Bai et al., 2018).
+
+# B ADDITIONAL EXPERIMENTAL DETAILS
+
+# B.1 SPEECH PREPROCESSING
+
+In this section, we fully describe our settings and procedures for the speech preprocessing experiments in Section 3.1.1, and present additional auxiliary baselines and results.
+
+# B.1.1 EXPERIMENTAL SETUP
+
+We evaluate our speech recognition models on the TIMIT speech corpus (Garofolo et al., 1993), a standard benchmark for speech recognition. The input is audio (16-bit, $16\mathrm{kHz}$ .wav format), and the target is the transcription into a sequence of phonemes (units of spoken sound). Our evaluation metric is the phoneme error rate (PER) between the true phoneme sequence and the phoneme sequence predicted by our model. We use PyTorch (Paszke et al., 2017), the Kaldi speech recognition toolkit (Povey et al., 2011), and the PyTorch-Kaldi toolkit (Ravanelli et al., 2019) for developing PyTorch speech recognition models for all our experiments and evaluations.
+
+# B.1.2 MODEL AND EVALUATION
+
+Our baseline Bi-LSTM architecture is taken from the PyTorch-Kaldi repository. This is a strong baseline model that, to the best of our knowledge, matches state-of-the-art performance for models that use a single type of input featurization (Ravanelli et al., 2019). The original Bi-LSTM model takes as input filter bank features. These are computed as follows: (i) the waveform is framed (split into chunks of $25\mathrm{ms}$ each that overlap by $10\mathrm{ms}$ each), (ii) the waveform is dithered (zero-mean Gaussian random noise is added), (iii) pre-emphasis is applied to amplify high frequencies, (iv) the Hamming window function (Harris, 1978) is applied, (v) the FFT is applied, and the power spectrum of the resulting (complex-valued) output is computed, (vi) the power spectrum (which has dimension 512) is mapped to the "mel scale" (which is a scale intended to mimic human auditory perception (Stevens et al., 1937)) by multiplication with a specific banded matrix of dimension $512\times 23$ , and the entrywise logarithm of the output is taken (the 23 outputs are called the filters), and (vii) cepstral mean and variance normalization (Liu et al., 1993) is applied. Numerical hyperparameters of this procedure include the dither noise scale, the pre-emphasis coefficient, the Hamming window size, the number of mel filters, and more; we kept all these the same as the Kaldi/PyTorch-Kaldi defaults.
+
+In contrast, our "K-matrix version" of the model takes as input the raw waveform, split into chunks the same way as before but with no normalization, dithering, or other preprocessing, which is then fed into a complex-valued kaleidoscope $[(B\mathcal{B}^{*})^{2}]$ matrix. Similarly to the nonlinear steps in computing filter bank features, the logarithm of the power spectrum of the output (which has dimension 512)
+
+is then computed. This output is fed into the Bi-LSTM; the Bi-LSTM and kaleidoscope layer are trained together in standard end-to-end fashion. The Bi-LSTM architecture is not modified aside from changing the input dimension from 23 to 512; this (along with the $\approx 75\mathrm{K}$ parameters in the kaleidoscope layer itself) results in approximately a 1.1M increase in the total number of parameters compared to the model that takes in MFSC features (a modest $8\%$ relative increase). Total training time for our kaleidoscope-based architecture is $7\%$ greater than that required for the model that uses MFSC features, not counting the time required to precompute the MFSC features; the FLOPs for inference-time are approximately $15\%$ greater (mostly due to the larger dimension of the input to the Bi-LSTM; the kaleidoscope layer accounts for less than $0.5\%$ of the total FLOPs).
+
+As baselines, we also compare to inserting other types of linear transformations before the Bi-LSTM: fixed linear transformations (such as the fixed FFT, or no transform at all [i.e. the identity]), other trainable structured layers (low-rank, circulant, and sparse [using the sparse training algorithm of Dettmers & Zettlemoyer (2019)]), and a trainable unstructured (dense) linear layer. The kaleidoscope layer performs the best out of all such approaches. The fact that it outperforms even a dense linear layer with more parameters is particularly notable, as it suggests that the structural bias imposed by the K-matrix representation is beneficial for performance on this task. Full results are given in Table 5.
+
+Table 5: TIMIT phoneme error rate (PER%, ± standard deviation across 5 random seeds).
+
+| Model | Test set PER% | # Parameters |
| Low rank + LSTM | 23.6 ± 0.9 | 15.5M |
| Sparse + LSTM | 21.7 ± 0.9 | 15.5M |
| Circulant + LSTM | 23.9 ± 0.9 | 15.4M |
| Dense + LSTM | 15.4 ± 0.6 | 15.9M |
| FFT + LSTM | 15.7 ± 0.1 | 15.4M |
| Identity + LSTM | 20.7 ± 0.3 | 15.4M |
| Kaleidoscope + LSTM | 14.6 ± 0.3 | 15.4M |
| MFSC features + LSTM | 14.2 ± 0.2 | 14.3M |
| SincNet (Ravanelli et al., 2019) | 17.2 | 10.0M |
| LiGRU (Ravanelli et al., 2018) | 13.8 | 12.3M |
+
+In our experiments, we grid search the initial learning rate for the "preprocessing layer" (if applicable) in $\{5\mathrm{e} - 5,1\mathrm{e} - 4,2\mathrm{e} - 4,4\mathrm{e} - 4,8\mathrm{e} - 4,1.6\mathrm{e} - 3\}$ , and fix all other hyperparameters (including the initial learning rates for the other parts of the network) to their default values in the PyTorch-Kaldi repository. The model and any preprocessing layers are trained end-to-end with the RMSProp optimizer for 24 epochs (as per the defaults in PyTorch-Kaldi). For each model, we use the validation set to select the best preprocessing learning rate, while the final error rates are reported on the separate held-out test set. For all structured matrix baselines except circulant (which always has $n$ parameters for an $n\times n$ matrix), the number of parameters in the structured matrices is set to equal the number of parameters in the butterfly layer, while the unconstrained matrix is simply a standard dense complex-valued square matrix. For all experiments with a trainable "preprocessing layer," we initialize the preprocessing matrix to represent the FFT (or approximate it as closely as possible [i.e. minimize the Frobenius error to the true FFT matrix], in the case of low-rank, sparse, and circulant), which we found to outperform random initialization.
+
+# B.1.3 EXTENSION: COMBINING MFSC AND KALEIDOSCOPE
+
+As an additional experiment, we sought to investigate whether combining the hand-engineered MFSC featurization pipeline and a learnable kaleidoscope layer (instead of replacing the former with the latter) could lead to accuracy gains. Specifically, in this experiment we first used the standard filter bank featurization pipeline described above, and trained end-to-end as usual. Then, we replaced the FFT step with a K-matrix initialized to the FFT, and made the weights of the Hamming window function and the mel filter bank matrix learnable as well (similarly to (Zeghidour et al., 2018)). We fine-tuned the resulting architecture for an additional 10 epochs. The final test PER% attained by this "hybrid" model is $14.0 \pm 0.3$ ; the model has 14.4M parameters—a negligible increase over the 14.3M in the original architecture. Thus, by combining the manually encoded domain knowledge in the filter bank featurization and allowing this structure to be learnable rather than fixed, we are able
+
+to nearly match the state-of-the-art $13.8\%$ accuracy on TIMIT. While this "hybrid" model certainly involves some hand-engineing, the state-of-the-art results use a concatenation of three different speech audio featurizations—MFSC, MFCC, and fMLLR—as the neural network input, along with a customized RNN architecture (LiGRU) specifically designed for speech recognition, and thus require a more complicated pipeline that is arguably even more hand-crafted.
+
+# B.2 REPLACING CNN CHANNEL SHUFFLE
+
+# B.2.1 MODEL ARCHITECTURES
+
+ShuffleNet is a convolutional neural network with residual (skip) connections that uses a permutation matrix to shuffle the channels after each grouped 1x1 convolution, sending the $i$ -th channel to the $(i \bmod g)$ -th group, where $g$ is the total number of groups. The architecture for each residual block in ShuffleNet is: 1x1 group conv $\rightarrow$ Batch norm, $\mathrm{ReLU} \rightarrow$ Permutation $\rightarrow$ 3x3 depthwise conv $\rightarrow$ Batch norm $\rightarrow$ 1x1 group conv. The permutation is fixed.
+
+Zhao et al. (2019) propose to instead use the Hadamard transform before and after each grouped 1x1 convolution to mix the channels. Note that the Hadamard transforms are placed before the batch normalization and ReLU layer (unlike the permutation matrix in the original ShuffleNet design). In particular, the architecture for each block is: Hadamard $\rightarrow$ 1x1 group conv $\rightarrow$ Hadamard $\rightarrow$ Batch norm, ReLU $\rightarrow$ 3x3 depthwise conv $\rightarrow$ Batch norm $\rightarrow$ 1x1 group conv. The Hadamard transform is fixed.
+
+In our architecture, we use a kaleidoscope matrix in OBB (product of an orthogonal butterfly matrix, a diagonal matrix, and the transpose of another butterfly matrix) before and after each grouped 1x1 convolution. We place the second K-matrix after the batch norm and ReLU, to more closely mimic the original ShuffleNet design. The structure for each block is: K-matrix $\rightarrow$ 1x1 group conv $\rightarrow$ Batch norm, ReLU $\rightarrow$ K-matrix $\rightarrow$ 3x3 depthwise conv $\rightarrow$ Batch norm $\rightarrow$ 1x1 group conv. The K-matrices are trained along with the rest of the network, rather than being fixed.
+
+# B.2.2 EXPERIMENTAL SETUP
+
+We evaluate the CNN architectures on the image classification task of the standard ImageNet dataset (Russakovsky et al., 2015). We use the standard data augmentation, training, and evaluation pipeline as in (Xie et al., 2017). We train with SGD on 8 GPUs for 90 epochs, with a total batch size of 2048 and initial learning rate 0.8. For the 1.0 ShuffleNet g8 architecture, we reduce the total batch size to 1792 to fit into GPU memory, and correspondingly linearly scale the initial learning rate to 0.7. Other hyperparameters (e.g. learning rate schedule, weight decay, etc.) are kept the same as in the ShuffleNet paper (Zhang et al., 2018). We use the training script from NVIDIA's deep learning examples repository.7
+
+# B.2.3 ADDITIONAL RESULTS
+
+In Table 6, we report top-5 classification accuracy on ImageNet, to complement the top-1 accuracies in Table 2.
+
+Table 6: Top-5 classification accuracy of ShuffleNet on ImageNet validation set. We report results for different network width multipliers (number of channels), and for different kinds of matrices used for channel mixing. Using a learnable K-matrix in place of each fixed permutation (shuffle) or Hadamard matrix improves top-5 accuracy by up to $4.8\%$ . Parameter counts are the same as in Table 2.
+
+ | Shuffle | Hadamard | Kaleidoscope (K.) | K. vs. Shuffle |
| 0.25 ShuffleNet g8 | 68.6% | 68.4% | 73.4% | +4.8% |
| 0.5 ShuffleNet g8 | 79.9% | 79.2% | 81.7% | +1.8% |
| 1.0 ShuffleNet g8 | 86.0% | 85.8% | 86.8% | +0.8% |
+
+In each setting, the total training time of our K-matrix approach is within $20\%$ of the total training time of vanilla ShuffleNet.
+
+In Figure 4, we plot the loss and accuracy on the training set and validation set when we train 1.0 ShuffleNet g8, with either a fixed permutation (Shuffle) or a K-matrix for channel shuffling. Even though each K-matrix is a product of multiple (sparse) matrices, the model with K-matrices takes about the same number of training steps to converge as the baseline model does. One possible reason is that we constrain the K-matrices to be orthogonal (Section 2.4), thus avoiding vanishing or exploding gradients.
+
+
+(a) Train and validation loss
+
+
+(b) Train and validation accuracy
+Figure 4: Loss and top-1 accuracy of 1.0 ShuffleNet g8 with either a fixed permutation (Shuffle) or a K-matrix for channel shuffling. The K-matrix model takes about the same number of training steps to converge as does the baseline model.
+
+# B.3 LEARNING PERMUTATIONS
+
+# B.3.1 DATASET
+
+The permuted CIFAR-10 dataset is constructed by applying a fixed permutation to every input. We choose to use the 2-D bit-reversal permutation, i.e., the bit reversal permutation on 32 elements is applied to the rows and to the columns. This permutation was chosen because it is locality-destroying: if two indices $i, j$ are close, they must differ in a lower-order bit, so that the bit-reversed indices $i', j'$ are far. This makes it a particularly challenging test case for architectures that rely on spatial locality such as "vanilla" CNNs.
+
+# B.3.2 MODEL AND TRAINING
+
+We describe the model architectures used in Section 3.1 (those reported in Table 3).
+
+Our model (K + CNN) The model represents a fixed permutation $P$ , parametrized as a K-matrix, to learn to recover the true permutation, followed by a standard ResNet18 architecture (He et al., 2016). Because of the simple decomposable nature of the butterfly factors (Section 2.1), our parameterization is easily extensible with additional techniques:
+
+(i) We constrain each butterfly factor matrix in the K-matrix to be doubly-stochastic. For example, each $2 \times 2$ block in the butterfly factor matrix of block size 2 has the form $\left[ \begin{array}{cc}a & 1 - a\\ 1 - a & a \end{array} \right]$ , where $a\in [0,1]$ . We treat this block as a distribution over permutations,
+
+generating the identity $\left[ \begin{array}{ll}1 & 0\\ 0 & 1 \end{array} \right]$ with probability $a$ and the swap $\left[ \begin{array}{ll}0 & 1\\ 1 & 0 \end{array} \right]$ with probability $1 - a$ . Butterfly factor matrices with larger block sizes are constrained to be doubly-stochastic in a similar manner. In this way, a permutation is sampled for each butterfly factor matrix, and these permutations are composed to get the final permutation that is applied to the image.
+
+(ii) For each minibatch, the examples $P_x$ by applying permutation samples on the (permuted) inputs are fed into an additional unsupervised reconstruction loss
+
+$$
+\sum_ {0 \leq i, j < n} \left\| \left[ \begin{array}{l} (P x) [ i + 1, j ] - (P x) [ i, j ] \\ (P x) [ i, j + 1 ] - (P x) [ i, j ] \end{array} \right] \right\| _ {2} \tag {1}
+$$
+
+measuring total variation smoothness of the de-noised inputs. Such loss functions are often used in image denoising (Rudin et al., 1992). A final regularization loss was placed on the entropy of $P$ , which was annealed over time to encourage $P$ to converge toward a sharper doubly-stochastic matrix (in other words, a permutation).
+
+The model is trained with just the reconstruction loss to convergence before the standard ResNet is trained on top.
+
+These techniques are applicable to the K-matrix as well as specialized methods for representing permutations such as Gumbel-Sinkhorn (Mena et al., 2018) and are important for recovering the true permutation. However, they are not applicable to a general linear layer, which showcases the flexibility of K-matrices for representing generic structure despite not being specially tailored for this task. We also remark that other classes of structured linear maps such as low-rank, circulant, and so on, are even less suited to this task than dense matrices, as they are incapable of representing all permutations.
+
+# Baseline architectures
+
+1. Fully connected (FC): This is a 3-layer MLP, with hidden size 1024 and ReLU nonlinearity in-between the fully connected layers.
+2. Recurrent neural network (RNN): We use a gated recurrent unit (GRU) model (Cho et al., 2014), with hidden size 1024. Many RNN architectures have been proposed to capture long-range dependency on permuted image dataset such as Permuted MNIST (Arjovsky et al., 2016). Standard gated architectures such as LSTM and GRU have shown competitive performance on the Permuted MNIST dataset, and we choose GRU as a baseline since it has been reported to slightly outperform LSTM (Bai et al., 2018).
+3. CNN: We use the standard ResNet18 architecture, adapted to smaller image size of the CIFAR-10 dataset (changing stride from 2 to 1 of the first convolutional layer, and removing max-pooling layer that follows).
+4. Dense + CNN: We add an additional linear layer (i.e. a dense matrix) of size $1024 \times 1024$ before the ResNet18 architecture. This dense layer can in theory represent a permutation, but cannot benefit from the additional techniques described above.
+5. Baseline CNN (unpermuted): We use the standard ResNet18 architecture applied to the unpermuted CIFAR-10 dataset.
+
+All models are trained for 200 total epochs, with the Adam optimizer. We use the standard learning rate schedule and weight decay from Mostafa & Wang (2019). We use Hyperband (Li et al., 2017) to tune other hyperparameters such as the initial learning rate and annealing temperature.
+
+# B.4 SPEEDING UP DYNAMICCONV'S INFERENCE
+
+# B.4.1 MODEL ARCHITECTURE
+
+We start with the DynamicConv Transformer architecture (Wu et al., 2019), which is a variant of the Transformer architecture (Vaswani et al., 2017) where the self-attention in each layer is replaced with a light-weight DynamicConv module. We use the implementation from the Fairseq library(Ott et al., 2019), with PyTorch version 1.2.
+
+The architecture of each layer of the decoder is: Linear $\rightarrow$ DynamicConv $\rightarrow$ Linear $\rightarrow$ LayerNorm $\rightarrow$ Encoder-decoder attention $\rightarrow$ LayerNorm $\rightarrow$ Linear $\rightarrow$ ReLU $\rightarrow$ Linear $\rightarrow$ ReLU $\rightarrow$ LayerNorm. In every layer of the decoder, we replace the dense weight matrix in each of the four Linear layers with a K-matrix from the $B$ class (i.e. a butterfly matrix).
+
+# B.4.2 TRAINING AND EVALUATION
+
+The models are trained from scratch using the training script from the Fairseq repository, with the same hyperparameters (optimizer, learning rate, number of updates, etc.) used in the DynamicConv paper (Wu et al., 2019). We note that the DynamicConv model with K-matrices in the decoder trains slightly faster than the default DynamicConv model (both models are trained for 50,000 updates, which requires approximately $7\%$ less time for the K-matrix model than for the default model).
+
+To evaluate inference speed, we run the decoding script on the IWSLT-14 De-En test set in single-threaded mode on a server Intel Xeon CPU E5-2690 v4 at 2.60GHz, and measure wall-clock time. The test set contains 6750 sentences, with 149241 tokens. Following Wu et al. (2019), we set the batch size to 1 and beam size to 1 for this evaluation.
+
+# B.4.3 ADDITIONAL COMPARISON WITH OTHER STRUCTURED MATRICES
+
+We additionally compare the speed-quality tradeoff of K-matrices with other classes of structured matrices, when used to replace the fully-connected layers of DynamicConv's decoder. We consider the following additional classes of structured matrices: low-rank, circulant, Toeplitz-like (Sindhwani et al., 2015), ACDC (Moczulski et al., 2016), Fastfood (Le et al., 2013), and sparse. For classes with a variable number of parameters (e.g. low-rank, sparse), we set the number of parameters to match that of K-matrices. For sparse matrices, besides the result for an ensemble of 10 models (the default setting in the Fairseq repository), we also report the result for a single model, as that could have faster inference time (since ensembling/averaging sparse matrices produces a less sparse matrix).
+
+In Figure 5, we plot the tradeoff between translation quality (measured by BLEU score) and inference speed (sentences per second). Most classes of structured matrices produce similar translation quality (between 34.1 and 34.4 BLEU score). K-matrices have the second fastest inference time, only $7\%$ slower than low-rank matrices. We note that low-rank matrices benefit from very well-tuned BLAS routines (matrix-matrix multiplication). Even though our implementation of K-matrix multiplication is not yet highly optimized, it is already quite close to the speed of low-rank matrix multiplication at an equivalent parameter count.
+
+# C SPEED BENCHMARK AND IMPLEMENTATION DETAILS
+
+Each K-matrix (for fixed width and expansion), has an $O(n \log n)$ matrix-vector multiplication algorithm: sequentially multiply the input vector with each of the sparse factors. Our implementation of this simple algorithm is surprisingly competitive with optimized subroutines, both on GPU (e.g. for training) and on CPU (e.g. for inference). In Figure 6, we compare the speed of multiplying by a K-matrix in class $\mathcal{B}$ (i.e. a butterfly matrix) against a specialized implementation of the FFT. We normalize the speed by the speed of dense matrix-matrix multiply (on GPU) or dense matrix-vector multiply (on CPU). On GPU, with input sizes $n = 1024$ and batch size 2048, the training time (forward and backward) of K-matrices matrix is about 3x faster than dense matrix multiply (GEMM from cuBLAS). For inference on CPU, the kaleidoscope fast multiplication can be one or two orders of magnitude faster than GEMV. Over a range of matrix sizes, our implementation is within a factor of 2-4x of specialized implementations of the FFT, a highly optimized kernel.
+
+Our implementation is also memory-efficient. In the forward pass through the $O(\log n)$ sparse factors, we do not store the intermediate results, but recompute them during the backward pass. Therefore the activation memory required is $O(bn)$ for an input batch size of $b$ .
+
+# D SYNTHETIC MATRIX RECOVERY
+
+We directly validate Theorem 1 on well-known types of structured matrices used in machine learning. Given a structured matrix $\mathbf{M}$ , we attempt to represent $\mathbf{M}$ as closely as possible using K-matrices as
+
+
+Figure 5: Tradeoff between translation quality (measured by BLEU score) and inference speed (sentences per second). K-matrices have the second fastest inference speed, only $7\%$ slower than low-rank matrices.
+
+
+(a) Training (GPU)
+
+
+(b) Inference (CPU)
+Figure 6: Speedup of FFT and Kaleidoscope against dense matrix-matrix multiply (GEMM) for training, and against dense matrix-vector multiply (GEMV) for inference.
+
+well as the standard classes of structured matrices: sparse and low-rank. In Table 7, we quantify the expressivity of each of these three methods, as measured by their ability to approximate a range of different structures. Results for "global minimum" of kaleidoscope matrices are obtained from the theoretical expressiveness results in Section I and Section J. Low-rank and sparse approximation have closed form solutions: truncating the SVD and keeping the largest-magnitude entries, respectively. We also report the results using SGD for kaleidoscope matrices to validate that good approximation with K-matrices can be obtained even from standard first-order optimization algorithms. Even with imperfect optimization, kaleidoscope matrices can still capture out-of-class target matrices better than low-rank and sparse matrices.
+
+The target matrices are kaleidoscope, low-rank, sparse, convolution (i.e. circulant matrices), Fast-food (Le et al., 2013), and entrywise random IID Gaussian matrix (to show the typical magnitude of the error). All target matrices $\bar{\mathbf{M}}$ were randomly initialized such that $\mathbb{E}[\mathbf{M}^T\mathbf{M}] = \mathbf{I}$
+
+Table 7: Expressiveness of different classes of structured matrices: Frobenius error of representing common structured matrices (columns) of dimension 256 using three structured representations of matrices with adjustable numbers of parameters. (Left group: Target matrices in the same class as the methods. Middle group: Target matrices with fixed number of parameters. Right: Random matrix to show typical scale of error.) Each method is allotted the same number of parameters, equal to a log $n$ factor more than that of the target matrix. Low-rank and sparse matrices are unable to capture any structure outside their own class, while the minima for kaleidoscope matrices found via optimization better capture the actual structure for out-of-class targets better than the baselines.
+
+ | Target Method | Kaleidoscope | Low-rank | Sparse | Convolution | Fastfood | Random |
| Global Min. | Kaleidoscope | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | |
| Low-rank | 14.9 | 0.0 | 10.8 | 14.6 | 11.6 | 15.5 |
| Sparse | 11.7 | 12.2 | 0.0 | 13.1 | 7.1 | 14.1 |
| With SGD | Kaleidoscope | 0.0 | 0.01 | 8.0 | 0.0 | 5.1 | 14.5 |
+
+To find a kaleidoscope approximation with SGD, we used Hyperband to tune its learning rate (between 0.001 and 0.5).
+
+# E PROPERTIES OF THE $\mathcal{B}\mathcal{B}^*$ HIERARCHY
+
+Here, we justify why the definitions in Section 2.2 give rise to a hierarchy. We first make some basic observations about the parameterization.
+
+Observation E.1. An $n \times n$ matrix $\mathbf{M} \in \mathcal{BB}^*$ has $4n\log n$ parameters.
+
+Proof. M can be expressed as a product of $2\log n$ butterfly factor matrices of size $n\times n$ . Each of these factor matrices has 2 parameters per row, for a total of $2n$ parameters each. Hence, the total number of parameters is $4n\log n$ .
+
+**Observation E.2.** Let $\mathbf{M}$ be an $n \times n$ matrix in $(\mathcal{B}\mathcal{B}^{*})_{e}^{w}$ . Then, given an arbitrary vector $\mathbf{v}$ of length $n$ , we can compute $\mathbf{Mv}$ with $O(wne\log (ne))$ field operations.
+
+Proof. Since $\mathbf{M} \in (\mathcal{B}\mathcal{B}^{*})_{e}^{w}$ , we can decompose it as $\mathbf{S}\mathbf{E}_{1}\mathbf{E}_{2}\ldots \mathbf{E}_{w}\mathbf{S}^{T}$ , where $\mathbf{S}$ is as given in Definition 2.4, and each $\mathbf{E}_{i}$ is an $en \times en$ matrix in $\mathcal{B}\mathcal{B}^{*}$ . Therefore, to compute $\mathbf{M}\mathbf{v}$ , we can use associativity of matrix multiplication to multiply the vector by one of these matrices at a time.
+
+Since all of these factors are sparse, we use the naive sparse matrix-vector multiplication algorithm (begin with a 0-vector and perform the corresponding multiplication and addition for each nonzero matrix entry). $\mathbf{S}$ (and thus $\mathbf{S}^T$ ) have $n$ NNZ. Therefore, matrix-vector multiplication by $\mathbf{S}$ or $\mathbf{S}^T$ requires $O(n)$ operations, which is dominated by the butterfly matrix-vector multiplication. Each $\mathbf{E}_i$ can be further decomposed into $2\log (ne)$ matrices with at most $2ne$ non-zero entries each (by Observation E.1). Therefore, matrix vector multiplication by each $\mathbf{E}_i$ requires $O(ne\log (ne))$ . Since there are $w$ such $\mathbf{E}_i$ , we require a total of $O(wne\log (ne))$ operations.
+
+Now, we are ready to show that our definition of classes $(\mathcal{B}\mathcal{B}^{*})_{e}^{w}$ forms a natural hierarchy.
+
+First, we must argue that all matrices are contained within the hierarchy.
+
+Lemma E.3. Let $\mathbf{M}$ be an arbitrary $n\times n$ matrix. Then $\mathbf{M}\in (\mathcal{BB}^{*})^{(2n - 2)}$ .
+
+Proof. Corollary E.3 in Appendix K shows that any $n \times n$ matrix can be written in the form $\mathbf{M}_1\mathbf{M}_1^{\prime}^{*}\ldots \mathbf{M}_{n - 1}\mathbf{M}_{n - 1}^{\prime}^{*}\mathbf{MM}_n\mathbf{M}_n^{\prime}^{*}\ldots \mathbf{M}_{2n - 2}\mathbf{M}_{n - 2}^{\prime}^{*}$ , where $\mathbf{M}_i, \mathbf{M}_i^{\prime}$ are orthogonal butterfly matrices and $\mathbf{M}$ is a diagonal matrix. We can combine $D$ with $M_{n}$ to form another (possibly not orthogonal) butterfly matrix. This yields a decomposition of $\mathbf{M}$ as products of (possibly not orthogonal) butterfly matrices and their (conjugate) transposes, completing the proof.
+
+Next, we argue that, up to a certain point, this hierarchy is strict.
+
+Lemma E.4. For every fixed $c \geq 1$ , there is an $n \times n$ matrix $\mathbf{M}_n$ (with $n$ sufficiently large) such that $\mathbf{M}_n \in (\mathcal{B}\mathcal{B}^*)^{c+1}$ but $\mathbf{M}_n \notin (\mathcal{B}\mathcal{B}^*)^c$ .
+
+Proof. Given $c$ , fix $n$ to be a power of 2 such that $c < \frac{n}{4\log_2n}$ . For sake of contradiction, assume that every $n \times n$ matrix in $(\mathcal{BB}^*)^{c + 1}$ is also in $(\mathcal{BB}^*)^c$ . Let $\mathbf{A}$ be an arbitrary $n \times n$ matrix. From Lemma E.3, $\mathbf{A} \in (\mathcal{BB}^*)^{(2n - 2)}$ . From our assumption, we can replace the first $c + 1$ $\mathcal{BB}^*$ factors of $\mathbf{A}$ with $c$ (potentially different) $\mathcal{BB}^*$ factors and still recover $\mathbf{A}$ . We can repeat this process until we are left with $c\mathcal{BB}^*$ factors, implying that $\mathbf{A} \in (\mathcal{BB}^*)^c$ . From Observation E.1, we require $4cn\log n < n^2$ (by our choice of $n$ ) parameters to completely describe $\mathbf{A}$ . This is a contradiction since $\mathbf{A}$ is an arbitrary $n \times n$ matrix, and therefore has $n^2$ arbitrary parameters. Hence, there must be some $n \times n$ matrix in $(\mathcal{BB}^*)^{c + 1}$ that is not in $(\mathcal{BB}^*)^c$ .
+
+# F ARITHMETIC CIRCUITS IN $\mathcal{B}\mathcal{B}^*$ HIERARCHY
+
+In this appendix, we prove our main theoretical result, namely, our ability to capture general transformations, expressed as low-depth linear arithmetic circuits, in the $\mathcal{BB}^*$ hierarchy. This result is recorded in Theorem 1.
+
+Theorem 1. Let $\mathbf{M}$ be an $n\times n$ matrix such that matrix-vector multiplication of $\mathbf{M}$ times an arbitrary vector $\mathbf{v}$ can be represented as a linear arithmetic circuit $C$ comprised of $s$ gates (including inputs) and having depth $d$ . Then, $\mathbf{M} \in (\mathcal{B}\mathcal{B}^{*})_{O(\frac{s}{n})}^{O(d)}$ .
+
+To prove Theorem 1, we make use of the following two theorems.
+
+Theorem 2. Let $\mathbf{P}$ be an $n\times n$ permutation matrix (with $n$ a power of 2). Then $\mathbf{P}\in \mathcal{BB}^*$
+
+Theorem 3. Let $\mathbf{S}$ be an $n\times n$ matrix of s NNZ. Then $\mathbf{S}\in (\mathcal{BB}^{*})_{4}^{4\left\lceil \frac{s}{n}\right\rceil}$ .
+
+Theorem 2 is proven in Appendix G, and Theorem 3 is proven in Appendix I.
+
+Proof of Theorem 1. We will represent $C$ as a product of $d$ matrices, each of size $s' \times s'$ , where $s'$ is the smallest power of 2 that is greater than or equal to $s$ .
+
+To introduce some notation, define $w_{1}, \ldots, w_{d}$ such that $w_{k}$ represents the number of gates in the $k$ 'th layer of $C$ (note that $s = n + \sum_{k=1}^{d} w_{k}$ ). Also, define $z_{1}, \ldots, z_{d}$ such that $z_{1} = n$ and $z_{k} = w_{k-1} + z_{k-1}$ ( $z_{k}$ is the number of gates that have already been used by the time we get to layer $k$ ).
+
+Let $g_{i}$ denote the $i$ 'th gate (and its output) of $C$ ( $0 \leq i < s$ ), defined such that:
+
+$$
+g _ {i} = \left\{ \begin{array}{l l} v _ {i} & 0 \leq i < n \\ \alpha_ {j} g _ {i _ {1}} + \beta_ {i} g _ {i _ {2}} & n \leq i < s \end{array} \right.
+$$
+
+where $i_1, i_2$ are indices of gates in earlier layers.
+
+For the $k$ 'th layer of $C$ , we define the $s' \times s'$ matrix $\mathbf{M}_k$ such that it performs the computations of the gates in that layer. Define the $i$ 'th row of $\mathbf{M}_k$ to be:
+
+$$
+\mathbf {M} _ {k} [ i: ] = \left\{ \begin{array}{l l} \mathbf {e} _ {i} ^ {T} & 0 \leq i < z _ {k} \\ \alpha_ {i} \mathbf {e} _ {i _ {1}} ^ {T} + \beta_ {i} \mathbf {e} _ {i _ {2}} ^ {T} & z _ {k} \leq i < z _ {k} + w _ {k} \\ 0 & i \geq z _ {k} + w _ {k} \end{array} \right.
+$$
+
+For any $0 \leq k \leq d$ , let $\mathbf{v_k}$ be vector
+
+$$
+\mathbf {v} _ {k} = \mathbf {M} _ {k} \ldots \mathbf {M} _ {2} \mathbf {M} _ {1} \left[ \begin{array}{c} \mathbf {v} \\ 0 \end{array} \right].
+$$
+
+We'd like to argue that $\mathbf{v}_d$ contains the outputs of all gates in $C$ (i.e., the $n$ values that make up $\mathbf{M}\mathbf{v}$ ). To do this we argue, by induction on $k$ , that $\mathbf{v}_k$ is the vector whose first $z_{k+1}$ entries are $g_0, g_1, \ldots, g_{(z_k-1)}$ , and whose remaining entries are 0. The base case, $k=0$ is trivial. Assuming this holds for the case $k-1$ , and consider multiplying $\mathbf{v}_{k-1}$ by $\mathbf{M}_k$ . The first $z_k$ rows of $\mathbf{M}_k$ duplicate
+
+the first $z_k$ entries of $\mathbf{v}_{k-1}$ . The next $w_k$ rows perform the computation of gates $g_{z_k}, \ldots, g_{(z_{k+1}-1)}$ . Finally, the remaining rows pad the output vector with zeros. Therefore, $\mathbf{v}_k$ is exactly as desired.
+
+The final matrix product will contain all $n$ elements of the output. By left multiplying by some permutation matrix $\mathbf{P}$ , we can reorder this vector such that the first $n$ entries are exactly $\mathbf{M}\mathbf{v}$ . Hence, we are left to argue the position of $\mathbf{PM}_d \ldots \mathbf{M}_2\mathbf{M}_1$ within the $\mathcal{BB}^*$ hierarchy. Each $\mathbf{M}_k$ is a matrix with total $2w_k + z_k < 2s'$ NNZ. From Theorem 3, we can, therefore, represent $\mathbf{M}_k$ as a product of $O(1)$ matrices (of size $2s'$ ) in $\mathcal{BB}^*$ . From Theorem 2, $\mathbf{P} \in \mathcal{BB}^*$ . Note that $s \leq s' < 2s$ , so $s' = \Theta(s)$ .
+
+Our final decomposition will have $O(d) \mathcal{BB}^*$ factors, and requires an expansion from size $n$ to size $2s'$ , or an expansion factor of $O\left(\frac{s}{n}\right)$ . Therefore, $\mathbf{M} \in (\mathcal{BB}^*)_{O\left(\frac{s}{n}\right)}^{O(d)}$ , as desired.
+
+Remark F.1. By applying Observation E.2, we see that Theorem 1 gives an $O(sd\log s)$ matrix vector multiplication algorithm for $\mathbf{M}$ .
+
+# G PERMUTATIONS IN $\mathcal{B}\mathcal{B}^*$
+
+In this appendix, we prove Theorem 2. In addition, we will also show that permutations are in $\mathcal{B}^*\mathcal{B}$ where the set $\mathcal{B}^*\mathcal{B}$ is defined analogously to $\mathcal{BB}^*$ (i.e. matrices of the form $\mathbf{M} = \mathbf{M}_1^*\mathbf{M}_2$ for some $\mathbf{M}_1,\mathbf{M}_2\in \mathcal{B}$ ).
+
+To prove Theorem 2, we decompose permutation matrix $\mathbf{P}$ into $\mathbf{P} = \mathbf{L}\mathbf{R}$ , with $\mathbf{L} \in \mathcal{B}$ and $\mathbf{R} \in \mathcal{B}^*$ . Throughout the proof, we make use of the following definition.
+
+Definition G.1. Let $\mathbf{L}$ be an $n \times n$ permutation matrix ( $n$ a power of 2). We say that $\mathbf{L}$ meets the $2^{j}$ balance condition if $\mathbf{L}$ can be divided into chunks of $2^{j}$ (with each chunk having all columns $i$ such that $\left\lfloor \frac{i}{2^j} \right\rfloor$ has the same value) such that for every $0 \leq m < 2^{j}$ , each chunk has exactly one $\mathbf{L}[:, k] = \mathbf{e}_{\pi_k}$ with $\pi_k \equiv m \pmod{2^j}$ . We say that $\mathbf{L}$ is modular-balanced if it meets the $2^{j}$ balance condition for each $2 \leq 2^{j} \leq n$ .
+
+
+Figure 7: First step of decomposition of modular-balanced matrix $\mathbf{L}$ . Here, the red entries must be permuted into the main diagonal blocks.
+
+Lemma G.1. Let $\mathbf{L}$ be an $n\times n$ modular-balanced matrix. Then $\mathbf{L}\in \mathcal{B}$
+
+Proof. We proceed by induction on $n$ . The base case $n = 2$ is trivial. As our inductive hypothesis, we assume that all modular-balanced matrices of size $\frac{n}{2} \times \frac{n}{2}$ are butterfly matrices of size $\frac{n}{2}$ . From Definition 2.3, it is sufficient to show that $\mathbf{L}$ can be decomposed as:
+
+$$
+\mathbf {L} = \mathbf {B} _ {n} \underbrace {\left[ \begin{array}{c c} \mathbf {L} _ {1} & 0 \\ 0 & \mathbf {L} _ {2} \end{array} \right]} _ {\mathbf {L} ^ {\prime}},
+$$
+
+where $\mathbf{B}_n$ is a butterfly factor of size $n$ and each $\mathbf{L}_j$ is an $\frac{n}{2} \times \frac{n}{2}$ modular-balanced matrix.
+
+Define $\mathbf{L}_1$ and $\mathbf{L}_2$ such that:
+
+$$
+\mathbf {L} _ {1} [ i, j ] = \mathbf {L} [ i, j ] + \mathbf {L} \left[ i + \frac {n}{2}, j \right] \quad \mathbf {L} _ {2} [ i, j ] = \mathbf {L} \left[ i, j + \frac {n}{2} \right] + \mathbf {L} \left[ i + \frac {n}{2}, j + \frac {n}{2} \right].
+$$
+
+Note that since $\mathbf{L}$ is a permutation matrix (and thus has exactly one non-zero entry per column), at most one term of each of these sums can be non-zero.
+
+For sake of contradiction, assume $\mathbf{L}_1$ is not modular-balanced. Then, for some $2^j \leq \frac{n}{2}$ , there are two columns $c_1, c_2$ such that $\left\lfloor \frac{c_1}{2^j} \right\rfloor = \left\lfloor \frac{c_2}{2^j} \right\rfloor$ and such that indices of the non-zero entries of $\mathbf{L}_1$ in columns $c_1$ and $c_2$ are the same modulo $2^j$ . However, from the definition of $\mathbf{L}_1$ , this implies that the indices of the non-zero entries of $\mathbf{L}$ in columns $c_1$ and $c_2$ are also the same modulo $2^j$ , contradicting $\mathbf{L}$ being modular-balanced. Hence, $\mathbf{L}_1$ is modular-balanced. An analogous argument (that instead considers columns $c_1 + \frac{n}{2}, c_2 + \frac{n}{2}$ of $\mathbf{L}$ ) shows that $\mathbf{L}_2$ is also modular-balanced.
+
+To complete the proof, we must argue that $\mathbf{B}_n$ is a butterfly factor of size $n$ . Since each $\mathbf{L}_i$ is modular-balanced, it is a permutation matrix. Therefore, $\mathbf{L}'$ has exactly 1 non-zero entry in each of the first $\frac{n}{2}$ rows and columns from $\mathbf{L}_1$ and exactly 1 non-zero entry in each of the second $\frac{n}{2}$ rows and columns from $\mathbf{L}_2$ . Hence, $\mathbf{L}'$ is a permutation matrix. Since both $\mathbf{L}$ and $\mathbf{L}'$ are permutation matrices, $\mathbf{B} = \mathbf{L}(\mathbf{L}')^{-1}$ must also be a permutation matrix. Therefore, we can view $\mathbf{B}$ as performing a permutation of the rows of $\mathbf{L}'$ to get $\mathbf{L}$ .
+
+Consider the $i$ 'th row of $\mathbf{L}'$ , with $0 \leq i < \frac{n}{2}$ . There are two possible cases.
+
+Case 1: $\mathbf{L}'[i,:] = \mathbf{L}[i,:]$
+
+In this case, the column of $\mathbf{L}$ with a non-zero entry in row $i$ is in the left $\frac{n}{2}$ columns. The column of $\mathbf{L}$ with a non-zero entry in row $i + \frac{n}{2}$ must, therefore, be in the right $\frac{n}{2}$ columns, otherwise $\mathbf{L}$ would not satisfy the $\frac{n}{2}$ balance condition. Therefore, $\mathbf{L}'\left[i + \frac{n}{2}, : \right] = \mathbf{L}\left[i + \frac{n}{2}, : \right]$ , so we set $\mathbf{B}[i, i] = \mathbf{B}\left[i + \frac{n}{2}, i + \frac{n}{2} \right] = 1$ .
+
+Case 2: $\mathbf{L}'[i,:] \neq \mathbf{L}[i,:]$
+
+By the definition of $\mathbf{L}'$ , $\mathbf{L}'[i,:] = vL\left[i + \frac{n}{2}, : \right]$ . In this case, the column of $\mathbf{L}$ with a non-zero entry in row $i + \frac{n}{2}$ must be in the left $\frac{n}{2}$ columns. By the $\frac{n}{2}$ balance condition of $\mathbf{L}$ , the column of $\mathbf{L}$ with a non-zero entry in row $i$ must be in the right $\frac{n}{2}$ columns. Therefore, $\mathbf{L}'\left[i + \frac{n}{2}, : \right] = \mathbf{L}\left[i,: \right]$ , so we set $\mathbf{B}\left[i,i + \frac{n}{2}\right] = \mathbf{B}\left[i + \frac{n}{2}, i\right] = 1$ .
+
+In both cases, the non-zero entries of $\mathbf{B}$ fall into the correct diagonal bands (the main diagonal, and the bands $\frac{n}{2}$ away). Hence, $\mathbf{B}$ is a butterfly factor of size $n$ .
+
+Now, we consider the process of transforming $\mathbf{P}$ into a modular-balanced matrix. We make use of the following lemma.
+
+
+Figure 8: First step of balancing $8 \times 8$ bit reversal permutation (a component of the $8 \times 8$ DFT). Red signifies edges that must be flipped.
+
+
+
+
+
+Lemma G.2. Let $\mathbf{M}$ be a $k \times k$ matrix with 1 non-zero entry per column, such that for each $0 \leq m < \frac{k}{2}$ , there are exactly 2 columns with non-zero entry in a row with index $\equiv m \pmod{\frac{k}{2}}$ . Then, there is a butterfly factor $\mathbf{B}_k$ such that $\mathbf{MB}_k = \mathbf{M}'$ , where $\mathbf{M}'$ meets the $\frac{k}{2}$ balance condition.
+
+Proof. We construct a directed graph $G$ with nodes in $\left[\frac{k}{2}\right]$ . For each $0 \leq i < \frac{k}{2}$ we add a directed edge from node $(s \mod \frac{k}{2})$ to node $(t \mod \frac{k}{2})$ if $\mathbf{M}[:,i] = \mathbf{e}_s$ and $\mathbf{M}[:,i + \frac{k}{2}] = \mathbf{e}_t$ . Each node has (undirected) degree exactly 2 by the structure of $\mathbf{M}$ . Hence, $G$ is a union of disjoint (undirected) cycles.
+
+If $\mathbf{M}$ met the $\frac{k}{2}$ balance condition, then each node would additionally have in-degree exactly 1 and out-degree exactly 1. By reversing edges of $G$ such that each (undirected) cycle becomes a directed cycle, we can achieve this. However, reversing edges corresponds to swapping columns of $\mathbf{M}$ that are $\frac{k}{2}$ apart. Let $\mathbf{B}_k$ be the permutation matrix that performs all such swaps. $\mathbf{B}_k$ has non-zero entries only along the main diagonal and the diagonal bands $\frac{k}{2}$ away, and thus is a butterfly factor of size $k$ .
+
+We are ready to present the decomposition of $\mathbf{P}$ .
+
+Lemma G.3. Let $\mathbf{P}$ be an $n\times n$ permutation matrix. Then we can decompose $\mathbf{P}$ into $\mathbf{P} = \mathbf{LR}$ , where $\mathbf{L}$ is modular-balanced and $\mathbf{R}\in \mathcal{B}^*$ .
+
+Proof. We repeatedly apply Lemma G.2. First, we conclude that there is a butterfly factor $\mathbf{B}_n$ such that
+
+$$
+\mathbf {P B} _ {n} = \mathbf {P} ^ {\prime},
+$$
+
+where $\mathbf{P}'$ meets the $\frac{n}{2}$ balance condition. Now, we consider the first and last $\frac{n}{2}$ columns of $\mathbf{P}'$ independently. We can again apply Lemma G.2 (twice) to conclude that there are butterfly factors $\left[\mathbf{B}_{\frac{n}{2}}\right]_1, \left[\mathbf{B}_{\frac{n}{2}}\right]_2$ such that
+
+$$
+\mathbf {P B} _ {n} \left[ \begin{array}{c c} \left[ \mathbf {B} _ {\frac {n}{2}} \right] _ {1} & 0 \\ 0 & \left[ \mathbf {B} _ {\frac {n}{2}} \right] _ {2} \end{array} \right] = \mathbf {P B} _ {n} ^ {(n)} \mathbf {B} _ {\frac {n}{2}} ^ {(n)} = \mathbf {P} ^ {\prime \prime},
+$$
+
+where $\mathbf{P}''$ meets the $\frac{n}{2}$ and $\frac{n}{4}$ balance conditions.
+
+We continue this process until we obtain a matrix that meets all of the balance conditions. Our final equation is of the form:
+
+$$
+\mathbf {P} \cdot \mathbf {B} _ {n} ^ {(n)} \mathbf {B} _ {\frac {n}{2}} ^ {(n)} \dots \mathbf {B} _ {2} ^ {(n)} = \mathbf {P B} = \mathbf {L},
+$$
+
+where $\mathcal{B}$ is a butterfly matrix and $\mathbf{L}$ is a modular-balanced matrix. Let $\mathbf{R} = \mathbf{B}^{-1} = \mathbf{B}^{*}$ (since $\mathbf{B}$ is a permutation matrix, and thus is orthogonal) and hence $\mathbf{R} \in \mathcal{B}^{*}$ . Then $\mathbf{P} = \mathbf{L}\mathbf{R}$ , as desired.
+
+Theorem 2 follows immediately from Lemmas G.3 and G.1.
+
+We now show that permutations are also in $\mathcal{B}^*\mathcal{B}$ . We start with the relationship between butterfly matrices and the bit-reversal permutation.
+
+Lemma G.4. Let $\mathbf{P}_{\mathrm{br}}$ be the $n\times n$ bit-reversal permutation matrix where $n$ is some power of 2, and let $\mathbf{M}_1\in \mathcal{B}$ be an $n\times n$ butterfly matrix. Then there is some butterfly matrix $\mathbf{M}_2\in \mathcal{B}$ such that
+
+$$
+\mathbf {M} _ {1} ^ {*} = \mathbf {P} _ {\mathrm {b r}} \mathbf {M} _ {2} \mathbf {P} _ {\mathrm {b r}}.
+$$
+
+Proof sketch. For any input vector $\mathbf{x}$ of length $n$ , to perform $\mathbf{M}_1^*\mathbf{x}$ , we trace through $\log_2 n$ steps of the multiplication algorithm. At each step, we perform $2 \times 2$ matrix multiplication on elements of $\mathbf{x}$ whose indices are $n/2$ apart (e.g. indices 0 and $n/2$ , 1 and $n/2 + 1$ , etc.), then $n/4$ apart, and so on, till indices are that 1 apart. If we apply the bit-reversal permutation on $\mathbf{x}$ , then indices that are $n/2$ apart will become 1 apart, indices that are $n/4$ apart will become 2 apart, and so on. So the multiplication algorithm $\mathbf{M}_1^*\mathbf{x}$ is equivalent to applying bit-reversal, then multiplying the permuted vector with another butterfly matrix (i.e. $2 \times 2$ matrix multiplication on indices that are 1 apart, then 2 apart, and so on, till indices that are $n/2$ apart). Finally we need to do another bit-reversal permutation to put all the indices back to the original order. If we call this other butterfly matrix $\mathbf{M}_2$ , then we have shown that $\mathbf{M}_1^*\mathbf{x} = \mathbf{P}_{\mathrm{br}}\mathbf{M}_2\mathbf{P}_{\mathrm{br}}\mathbf{x}$ . This holds for all $\mathbf{x}$ (for the same matrix $\mathbf{M}_2$ ), so we have $\mathbf{M}_1^* = \mathbf{P}_{\mathrm{br}}\mathbf{M}_2\mathbf{P}_{\mathrm{br}}$ .
+
+Remark G.5. Lemma G.4 explains the connection between the two most common fast Fourier transform algorithm, decimation in time and decimation in frequency. Using the decimation-in-time
+
+FFT, we can write the DFT matrix $\mathbf{F}$ as product of a butterfly matrix $\mathbf{M}_1$ and the bit-reversal permutation (see Section J):
+
+$$
+\mathbf {F} = \mathbf {M} _ {1} \mathbf {P} _ {\mathrm {b r}}.
+$$
+
+Taking conjugate transpose, we obtain $\mathbf{F}^{*} = \mathbf{P}_{\mathrm{br}}\mathbf{M}_{1}^{*}$ (recall that $\mathbf{P}_{\mathrm{br}}$ is its own transpose/inverse). On the other hand, $\mathbf{F}^{*}$ is just a scaled version of the inverse DFT matrix, so apply decimation-in-time FFT to the inverse DFT, we can write $\mathbf{F}^{*} = \mathbf{M}_{2}\mathbf{P}_{\mathrm{br}}$ for some other butterfly matrix $\mathbf{M}_2$ . Hence $\mathbf{P}_{\mathrm{br}}\mathbf{M}_1^* = \mathbf{M}_2\mathbf{P}_{\mathrm{br}}$ , and thus $\mathbf{P}_{\mathrm{br}}\mathbf{M}_1^*\mathbf{P}_{\mathrm{br}} = \mathbf{M}_2$ (for these particular butterfly matrices $\mathbf{M}_1$ and $\mathbf{M}_2$ ). Note that this yields another decomposition of the DFT matrix, $\mathbf{F} = \mathbf{P}_{\mathrm{br}}\mathbf{M}_2^*$ , which is exactly the decimation-in-frequency FFT algorithm.
+
+We are ready to show that permutations are in $\mathcal{B}^*\mathcal{B}$
+
+Lemma G.6. Let $\mathbf{P}$ be an $n\times n$ permutation matrix (with $n$ a power of 2). Then there are butterfly matrices $\mathbf{M}_1,\mathbf{M}_2\in \mathcal{B}$ such that $\mathbf{P} = \mathbf{M}_1^*\mathbf{M}_2$
+
+Proof. Consider the permutation $\tilde{\mathbf{P}} = \mathbf{P}_{\mathrm{br}}\mathbf{P}\mathbf{P}_{\mathrm{br}}$ . By Theorem 2, there are some butterfly matrices $\tilde{\mathbf{M}}_1,\tilde{\mathbf{M}}_2\in \mathcal{B}$ such that $\tilde{\mathbf{P}} = \tilde{\mathbf{M}}_1\tilde{\mathbf{M}}_2^*$ . Applying Lemma G.4, we can replace $\tilde{\mathbf{M}}_2^*$ with $\mathbf{P}_{\mathrm{br}}\mathbf{M}_2\mathbf{P}_{\mathrm{br}}$ for some butterfly matrix $\mathbf{M}_2\in \mathcal{B}$ . We thus have:
+
+$$
+\mathbf {P} _ {\mathrm {b r}} \mathbf {P P} _ {\mathrm {b r}} = \tilde {\mathbf {M}} _ {1} \mathbf {P} _ {\mathrm {b r}} \mathbf {M} _ {2} \mathbf {P} _ {\mathrm {b r}}.
+$$
+
+Pre- and post-multiply both sides by $\mathbf{P}_{\mathrm{br}}$ (which is its own inverse):
+
+$$
+\mathbf {P} = \mathbf {P} _ {\mathrm {b r}} \tilde {\mathbf {M}} _ {1} \mathbf {P} _ {\mathrm {b r}} \mathbf {M} _ {2}.
+$$
+
+Applying Lemma G.4 again, we can replace $\mathbf{P}_{\mathrm{br}}\tilde{\mathbf{M}}_1\mathbf{P}_{\mathrm{br}}$ with $\mathbf{M}_1^*$ for some butterfly matrix $\mathbf{M}_1\in \mathcal{B}$ . Thus:
+
+$$
+\mathbf {P} = \mathbf {M} _ {1} ^ {*} \mathbf {M} _ {2}.
+$$
+
+
+
+# H $\mathcal{BB}^*$ CLOSURE LEMMAS
+
+Here, we present some basic facts of the $\mathcal{B}\mathcal{B}^*$ hierarchy that will be useful for later constructions. For simplicity, we assume (WLOG via 0-padding) that all matrices are square matrices with size that is a power of 2.
+
+Lemma H.1. If $\mathbf{M} \in \mathcal{B}$ (or $\mathbf{M} \in \mathcal{B}^*$ ), then $\mathbf{DM}, \mathbf{MD} \in \mathcal{B}$ ( $\mathcal{B}^*$ resp.) for any diagonal matrix $\mathbf{D}$ .
+
+Proof. Left multiplication by a diagonal matrix scales the rows of $\mathbf{M}$ by the corresponding diagonal entries. The same can be achieved by scaling all entries the leftmost butterfly factor matrix. Similarly, right multiplication by a diagonal matrix scales the columns of $\mathbf{M}$ , which can be achieved by scaling all entries in the columns of the rightmost butterfly factor matrix.
+
+Lemma H.2. Let $\mathbf{A},\mathbf{B}\in \mathbb{F}^{n\times n}$ . If $\mathbf{A}\in (\mathcal{BB}^*)_e^{w_1}$ and $\mathbf{B}\in (\mathcal{BB}^*)_e^{w_2}$ then $\mathbf{AB}\in (\mathcal{BB}^*)_e^{w_1 + w_2}$ .
+
+Proof. Let $\mathbf{E}_{\mathbf{A}}, \mathbf{E}_{\mathbf{B}} \in \mathbb{F}^{en \times en}$ be defined such that $\mathbf{A} = \mathbf{S}\mathbf{E}_{\mathbf{A}}\mathbf{S}^T$ , $\mathbf{B} = \mathbf{S}\mathbf{E}_{\mathbf{B}}\mathbf{S}^T$ (with $\mathbf{S}$ as in Definition 2.4). Then
+
+$$
+\mathbf {A B} = \mathbf {S} \underbrace {\left[ \begin{array}{c c} \mathbf {I} _ {n} & 0 \\ 0 & 0 \end{array} \right]} _ {e n \times e n} \mathbf {E} _ {\mathbf {A}} \underbrace {\left[ \begin{array}{c c} \mathbf {I} _ {n} & 0 \\ 0 & 0 \end{array} \right]} _ {e n \times e n} \mathbf {E} _ {\mathbf {B}} \mathbf {S} ^ {T}
+$$
+
+$\begin{bmatrix} \mathbf{I}_n & 0 \\ 0 & 0 \end{bmatrix} \mathbf{E}_{\mathbf{A}} \in (\mathcal{BB}^*)^{w_1}, \begin{bmatrix} \mathbf{I}_n & 0 \\ 0 & 0 \end{bmatrix} \mathbf{E}_{\mathbf{B}} \in (\mathcal{BB}^*)^{w_2}$ by Lemma H.1. Hence, $\mathbf{AB} \in (\mathcal{BB}^*)_e^{w_1 + w_2}$ by Definition 2.4.
+
+Lemma H.3. Let $\mathbf{A}_1, \ldots, \mathbf{A}_m \in \mathbb{F}^{k \times k}$ . If $\mathbf{A}_1, \ldots, \mathbf{A}_m \in (\mathcal{BB}^*)_e^w$ then $\operatorname{Diag}(\mathbf{A}_1, \ldots, \mathbf{A}_m) \in (\mathcal{BB}^*)_e^{w+2}$ .
+
+Proof. For each $1 \leq i \leq m$ , let $\mathbf{E}_{\mathbf{A}_i} \in \mathbb{F}^{ek \times ek}$ be defined such that $\mathbf{A}_i = \mathbf{S}\mathbf{E}_{\mathbf{A}_i}\mathbf{S}^T$ (with $\mathbf{S}$ as in Definition 2.4). Then
+
+$$
+\left[ \begin{array}{c c c c} \mathbf {A} _ {1} & 0 & \dots & 0 \\ 0 & \mathbf {A} _ {2} & \dots & 0 \\ \vdots & \vdots & \ddots & 0 \\ 0 & 0 & \dots & \mathbf {A} _ {m} \end{array} \right] = \mathbf {S P} \left[ \begin{array}{c c c c} \mathbf {E} _ {\mathbf {A} _ {1}} & 0 & \dots & 0 \\ 0 & \mathbf {E} _ {\mathbf {A} _ {2}} & \dots & 0 \\ \vdots & \vdots & \ddots & 0 \\ 0 & 0 & \dots & \mathbf {E} _ {\mathbf {A} _ {m}} \end{array} \right] \mathbf {P} ^ {T} \mathbf {S} ^ {T}
+$$
+
+where $\mathbf{P}$ is a permutation that that moves the first $k$ rows of each $\mathbf{E}_{\mathbf{A}_i}$ (in order) into the top $mk$ rows. From Theorem 2, $\mathbf{P} \in \mathcal{BB}^*$ , (and so is $\mathbf{P}^T$ , also a permutation). Within the RHS block matrix, the decompositions of each $\mathbf{E}_{\mathbf{A}_i}$ can be done in parallel, requiring total width $w$ . Hence, $\mathrm{Diag}(\mathbf{A}_1, \ldots, \mathbf{A}_m) \in (\mathcal{BB}^*)_e^{w+2}$ , as desired.
+
+Remark H.4. If $e = 1$ in Lemma H.3, then $\mathbf{P}$ is unnecessary. Hence, $\operatorname{Diag}(\mathbf{A}_1, \ldots, \mathbf{A}_m) \in (\mathcal{BB}^*)^w$ .
+
+Lemma H.5. Let $\mathbf{A}_1, \ldots, \mathbf{A}_m$ be $k \times k$ matrices in $(\mathcal{B}\mathcal{B}^*)_e^w$ then $\sum_{i=1}^{m} \mathbf{A}_i \in (\mathcal{B}\mathcal{B}^*)_{4e}^{mw}$ .
+
+Proof. For each $1 \leq i \leq m$ , let $\mathbf{E}_{\mathbf{A}_i} \in \mathbb{F}^{ek \times ek}$ be defined such that $\mathbf{A}_i = \mathbf{S}\mathbf{E}_{\mathbf{A}_i}\mathbf{S}^T$ (with $\mathbf{S}$ as in Definition 2.4). Note that $\mathbf{E}_{\mathbf{A}_i} \in (\mathcal{BB}^*)^w$ . Consider matrices of the form:
+
+$$
+\underbrace {\left[ \begin{array}{c c c c} \mathbf {I} _ {e k} & \mathbf {E} _ {\mathbf {A} _ {i}} & 0 & 0 \\ 0 & \mathbf {I} _ {e k} & 0 & 0 \\ 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 \end{array} \right]} _ {\mathbf {M} _ {i} \in \mathbb {F} ^ {4 e k \times 4 e k}} = \underbrace {\left[ \begin{array}{c c} \mathbf {I} _ {2 e k} & \mathbf {I} _ {2 e k} \\ 0 & 0 \end{array} \right]} _ {\mathbf {L}} \underbrace {\left[ \begin{array}{c c c c} \mathbf {I} _ {e k} & 0 & 0 & 0 \\ 0 & \mathbf {I} _ {e k} & 0 & 0 \\ 0 & 0 & \mathbf {E} _ {\mathbf {A} _ {i}} & 0 \\ 0 & 0 & 0 & 0 \end{array} \right]} _ {\mathbf {S}} \underbrace {\left[ \begin{array}{c c c c} \mathbf {I} _ {e k} & 0 & 0 & 0 \\ 0 & \mathbf {I} _ {e k} & 0 & 0 \\ 0 & 0 & 0 & \mathbf {I} _ {e k} \\ 0 & 0 & \mathbf {I} _ {e k} & 0 \end{array} \right]} _ {\mathbf {P} _ {1}} \underbrace {\left[ \begin{array}{c c c} \mathbf {I} _ {2 e k} & 0 \\ \mathbf {I} _ {2 e k} & 0 \end{array} \right]} _ {\mathbf {R}}.
+$$
+
+Here, $\mathbf{L}$ and $\mathbf{R}$ compute the sum of the $2ek \times 2ek$ matrices on the diagonal of $\mathbf{SP}_1$ , where $\mathbf{P}_1$ is a permutation swapping $\mathbf{E}_{\mathbf{A}_i}$ to the $4^{th}ek$ -block column. Note that $\mathbf{S}$ is the diagonalization of four matrices in $(\mathcal{BB}^*)^w$ , so $\mathbf{S} \in (\mathcal{BB}^*)^w$ by Remark H.4. In addition, since each block in $\mathbf{S}$ is a butterfly matrix of size $ek$ , $\mathbf{S}$ only uses butterfly factors up to size $ek$ , so the outer factor matrices of sizes $4ek$ and $2ek$ in $\mathbf{S}$ are unused. Also note that $\mathbf{L}$ and $\mathbf{R}$ are butterfly factor matrices of size $4ek$ (or $\mathbf{B}_{4ek}^{(4ek)}$ ), and $\mathbf{P}_1$ is a butterfly factor matrix of size $2ek$ (or $\mathbf{B}_{2ek}^{(4ek)}$ ). This allows us to fold the surrounding matrices $\mathbf{L}, \mathbf{P}_1, \mathbf{R}$ into $\mathbf{S}$ , so $\mathbf{M}_i \in (\mathcal{BB}^*)^w$ .
+
+Through repeated application ( $m$ times) of the identity
+
+$$
+\left[ \begin{array}{c c} \mathbf {I} & \mathbf {A} \\ 0 & \mathbf {I} \end{array} \right] \left[ \begin{array}{c c} \mathbf {I} & \mathbf {B} \\ 0 & \mathbf {I} \end{array} \right] = \left[ \begin{array}{c c} \mathbf {I} & \mathbf {A} + \mathbf {B} \\ 0 & \mathbf {I} \end{array} \right],
+$$
+
+we see that
+
+$$
+\underbrace {\left[ \begin{array}{c c c c} \mathbf {I} _ {e k} & \sum_ {i = 1} ^ {m} \mathbf {E} _ {\mathbf {A} _ {i}} & 0 & 0 \\ 0 & \mathbf {I} _ {e k} & 0 & 0 \\ 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 \end{array} \right]} _ {\mathbf {M} \in \mathbb {F} ^ {4 e n \times 4 e n}} = \prod_ {i = 1} ^ {m} \mathbf {M} _ {i}. \tag {2}
+$$
+
+From Lemma H.2, $\mathbf{M} \in (\mathcal{BB}^{*})^{mw}$ . Finally, note that $\sum_{i=1}^{m} \mathbf{A}_{i} = \mathbf{SMP}_{2} \mathbf{S}^{T}$ , where $\mathbf{P}_{2}$ is a permutation that moves the first $k$ columns of the second block-column of $\mathbf{M}$ to the left. $\mathbf{P}_{2}$ can be folded into the final summation factor $M_{m}$ as follows:
+
+
+
+
+
+
+
+
+
+Hence, $\sum_{i=1}^{m} \mathbf{A}_{i} \in (\mathcal{B}\mathcal{B}^{*})_{4e}^{mw}$ , as desired.
+
+Lemma H.6. Let $\mathbf{M}$ be an invertible $n\times n$ matrix such that $M\in \mathcal{B}$ . Then $\mathbf{M}^{-1}\in \mathcal{B}^*$ .
+
+Proof. We prove this in a series of steps.
+
+First, let $\mathbf{B}_k$ be an invertible butterfly factor of size $k$ . Consider the method of computing $\mathbf{B}_k^{-1}$ by performing Gaussian elimination on the matrix $[\mathbf{B}_k|\mathbf{I}_k]$ to obtain the matrix $[\mathbf{I}_k|\mathbf{B}_k^{-1}]$ . By the form of $\mathbf{B}$ , non-zero entries within a row or column are always exactly $\frac{k}{2}$ positions apart. Therefore, the only row operations needed for this Gaussian elimination are:
+
+- Scaling a row by a constant factor $c \neq 0$
+- Addition of a row to another row exactly $\frac{k}{2}$ rows apart
+
+Performing these operations on $\mathbf{I}_k$ will only allow non-zeros on the main diagonal and $\frac{k}{2}$ diagonals away from the main diagonal. Hence, $\mathbf{B}_k^{-1}$ is also a butterfly factor of size $k$ .
+
+Next, let $\mathbf{B}_k^{(n)}$ be an invertible butterfly factor matrix of size $n$ and block size $k$ . Its inverse is the block diagonal matrix formed by the inverses of each of its constituent butterfly factors. From above, $\left(\mathbf{B}_k^{(n)}\right)^{-1}$ is also a butterfly factor matrix of size $n$ and block size $k$ .
+
+Finally, consider $\mathbf{M} \in \mathcal{B}$ .
+
+$$
+\mathbf {M} ^ {- 1} = \left(\mathbf {B} _ {n} ^ {(n)} \mathbf {B} _ {\frac {n}{2}} ^ {(n)} \ldots \mathbf {B} _ {2} ^ {(n)}\right) ^ {- 1} = \left(\mathbf {B} _ {2} ^ {(n)}\right) ^ {- 1} \left(\mathbf {B} _ {4} ^ {(n)}\right) ^ {- 1} \ldots \left(\mathbf {B} _ {n} ^ {(n)}\right) ^ {- 1} = \mathbf {B} _ {2} ^ {\prime} ^ {(n)} \mathbf {B} _ {4} ^ {\prime} ^ {(n)} \ldots \mathbf {B} _ {n} ^ {\prime} ^ {(n)} \in \mathcal {B} ^ {*}
+$$
+
+
+
+Finally, we include a closure result for the Kronecker product, another common matrix composition operation. Although Lemma H.7 is not directly used in the subsequent proofs, it allows for examples the results for the DFT to be lifted to higher-dimensional Fourier transforms. We also note that the closure bound in Lemma H.7 can be tightened in such cases (cfRemark H.4).
+
+Lemma H.7. Let $\mathbf{A},\mathbf{B}\in \mathbb{F}^{n\times n}$ . If $\mathbf{A}\in (\mathcal{BB}^*)_e^{w_1}$ and $\mathbf{B}\in (\mathcal{BB}^*)_e^{w_2}$ then $\mathbf{A}\otimes \mathbf{B}\in (\mathcal{BB}^*)_e^{w_1 + w_2 + 6}$ .
+
+Proof. Note that
+
+$$
+\mathbf {A} \otimes \mathbf {B} = (\mathbf {A} \otimes \mathbf {I}) (\mathbf {I} \otimes \mathbf {B}) = \mathbf {P} ^ {- 1} (\mathbf {I} \otimes \mathbf {A}) \mathbf {P} (\mathbf {I} \otimes \mathbf {B}),
+$$
+
+for some permutation $\mathbf{P}$ . By Lemma H.3, $\mathbf{I} \otimes \mathbf{A}$ and $\mathbf{I} \otimes \mathbf{B}$ are in $(\mathcal{BB}^*)_e^{w_1 + 2}$ , $(\mathcal{BB}^*)_e^{w_2 + 2}$ respectively. The result follows from combining with $\mathbf{P} \in \mathcal{BB}^*$ and Lemma H.2.
+
+# I SPARSE MATRICES IN $\mathcal{B}\mathcal{B}^*$ HIERARCHY
+
+In this appendix, we prove Theorem 3. First, we consider matrices with at most $n$ NNZ.
+
+Lemma 1.1. let $\mathbf{S}$ be an $n\times n$ matrix with at most $n$ NNZ. Then, $\mathbf{S}\in (\mathcal{BB}^{*})^{4}$ .
+
+We use this lemma and the addition closure lemma to prove Theorem 3.
+
+Proof of Theorem 3. We note that any $s$ sparse matrix is the sum of $\left\lceil \frac{s}{n} \right\rceil$ matrices of at most $n$ NNZ, and we appeal to Lemma H.5.
+
+In the rest of the section we will prove Lemma I.1. We begin by defining two classes of matrices that will be used in our decomposition.
+
+Definition 1.1. An $n \times n$ matrix $\mathbf{H}$ is a horizontal step matrix if for every $0 \leq i, i' < n$ and $0 \leq j \leq j' < n$ , if $\mathbf{H}[i, j] \neq 0$ and $\mathbf{H}[i', j'] \neq 0$ , then $j' - j \geq (i' - i) \mod n$ .
+
+An $n \times n$ matrix $\mathbf{V}$ is a vertical step matrix if $\mathbf{V}^*$ is a horizontal step matrix.
+
+With this definition, the horizontal step matrix obeys a "Lipschitz-like" condition. Each column of a horizontal step matrix can have at most one non-zero entry, and given two non-zero columns $k$ apart, the non-zero entry in the right column must be between 0 and $k$ rows below the non-zero entry in the left column. Note that to show that a matrix is a horizontal step matrix, it is sufficient to argue that this condition holds for each pair of neighboring non-zero columns.
+
+Similarly, each row of a vertical step matrix can have at most one non-zero entry, and given two non-zero rows $k$ apart, the non-zero entry in the lower row must be between 0 and $k$ columns to the right of the non-zero entry in the upper row.
+
+Lemma I.2. Let $\mathbf{H}$ be an $n\times n$ horizontal step matrix. Then $\mathbf{H}\in \mathcal{B}$
+
+Proof. We proceed by induction on $n$ . The base case $n = 2$ is trivial. As our inductive hypothesis, we assume that all horizontal step matrices of size $\frac{n}{2} \times \frac{n}{2}$ are butterfly matrices of size $\frac{n}{2}$ . From Definition 2.3, it is sufficient to show that $\mathbf{H}$ can be decomposed as:
+
+$$
+\mathbf {H} = \left[ \begin{array}{l l} \mathbf {D} _ {1} & \mathbf {D} _ {2} \\ \mathbf {D} _ {3} & \mathbf {D} _ {4} \end{array} \right] \left[ \begin{array}{c c} \mathbf {H} _ {1} & 0 \\ 0 & \mathbf {H} _ {2} \end{array} \right] = \left[ \begin{array}{l l} \mathbf {D} _ {1} \mathbf {H} _ {1} & \mathbf {D} _ {2} \mathbf {H} _ {2} \\ \mathbf {D} _ {3} \mathbf {H} _ {1} & \mathbf {D} _ {4} \mathbf {H} _ {2} \end{array} \right], \tag {4}
+$$
+
+where $\mathbf{H}_1, \mathbf{H}_2$ are $\frac{n}{2} \times \frac{n}{2}$ horizontal step matrices and each $\mathbf{D}_k$ is a $\frac{n}{2} \times \frac{n}{2}$ diagonal matrix. Denote the four, $\frac{n}{2} \times \frac{n}{2}$ corner submatrices of $\mathbf{H}$ by:
+
+$$
+\mathbf {H} = \left[ \begin{array}{c c} \mathbf {H} _ {1 1} & \mathbf {H} _ {1 2} \\ \mathbf {H} _ {2 1} & \mathbf {H} _ {2 2} \end{array} \right].
+$$
+
+Then, define $\mathbf{H}_1$ and $\mathbf{H}_2$ by:
+
+$$
+\mathbf {H} _ {1} = \mathbf {H} _ {1 1} + \mathbf {H} _ {2 1} \quad \mathbf {H} _ {2} = \mathbf {H} _ {1 2} + \mathbf {H} _ {2 2}
+$$
+
+For sake of contradiction, assume that $\mathbf{H}_1$ is not a horizontal step matrix. Then, there are $0 \leq i, i' < \frac{n}{2}$ , $0 \leq j \leq j' < \frac{n}{2}$ such that $\mathbf{H}_1[i,j] \neq 0$ , $\mathbf{H}_1[i',j'] \neq 0$ , and $j' - j < (i' - i) \mod \frac{n}{2}$ . From our definition of $\mathbf{H}_1$ , the non-zero entries in columns $j$ and $j'$ of $\mathbf{H}$ are either $\left((i' - i) \mod \frac{n}{2}\right)$ or $\left(\frac{n}{2} + (i' - i) \mod \frac{n}{2}\right)$ , both of which are greater than $j' - j$ , rows apart. This contradicts $\mathbf{H}$ being a horizontal step matrix. Hence, $\mathbf{H}_1$ must be a horizontal step matrix, as must $\mathbf{H}_2$ from an analogous argument.
+
+Next, we define $\mathbf{D}_1, \mathbf{D}_2, \mathbf{D}_3, \mathbf{D}_4$ by:
+
+$$
+\mathbf {D} _ {1} [ k, k ] = \left\{ \begin{array}{l l} 1 & \mathbf {H} _ {2 1} [ k,: ] = \mathbf {0} \\ 0 & \text {o t h e r w i s e} \end{array} \right. \qquad \mathbf {D} _ {2} [ k, k ] = \left\{ \begin{array}{l l} 1 & \mathbf {H} _ {2 2} [ k,: ] = \mathbf {0} \\ 0 & \text {o t h e r w i s e} \end{array} \right.
+$$
+
+$$
+\mathbf {D} _ {3} [ k, k ] = \left\{ \begin{array}{l l} 1 & \mathbf {H} _ {1 1} [ k,: ] = \mathbf {0} \\ 0 & \text {o t h e r w i s e .} \end{array} \right. \qquad \mathbf {D} _ {4} [ k, k ] = \left\{ \begin{array}{l l} 1 & \mathbf {H} _ {1 2} [ k,: ] = \mathbf {0} \\ 0 & \text {o t h e r w i s e .} \end{array} \right.
+$$
+
+To finish the proof, we argue the correctness of the decomposition by equating arbitrary entries of each of the 4 corner submatrices. We begin with the upper left submatrix.
+
+$$
+\begin{array}{l} \mathbf {D} _ {1} \mathbf {H} _ {1} [ i, j ] = \sum_ {k = 0} ^ {\frac {n}{2}} \mathbf {D} _ {1} [ i, k ] \cdot \mathbf {H} _ {1} [ k, j ] \quad \text {b y} \\ = \mathbf {D} _ {1} [ i, i ] \cdot \mathbf {H} _ {1} [ i, j ] \quad \mathbf {D} _ {1} \text {i s a d i a g o n a l m a t r i x} \\ = \mathbb {1} _ {\left(\mathbf {H} _ {2 1} [ i, j ] = \mathbf {0}\right)} \cdot \left(\mathbf {H} _ {1 1} [ i, j ] + \mathbf {H} _ {2 1} [ i, j ]\right) \quad \text {b y} \\ \end{array}
+$$
+
+Here, we consider two cases:
+
+Case 1: $\mathbf{H}_{21}[i,j] \neq 0$
+
+Since $\mathbf{H}$ is a horizontal step matrix (and hence may have at most one non-zero entry per column), it follows that $\mathbf{H}_{11}[i,j] = 0$ . In this case, the indicator function evaluates to 0, so $\mathbf{D}_1\mathbf{H}_1[i,j] = 0 = \mathbf{H}_{11}[i,j]$ , as desired.
+
+Case 2: $\mathbf{H}_{21}[i,j] = 0$
+
+If $\mathbf{H}_{11}[i,j] = 0$ , then $\mathbf{D}_1\mathbf{H}_1[i,j] = 0 = \mathbf{H}_{11}[i,j]$ . Otherwise, for sake of contradiction, suppose that $\mathbf{H}_{21}[i,:] \neq \mathbf{0}$ . Then, two of the first $\frac{n}{2}$ columns of $\mathbf{H}$ would have non-zero entries $\frac{n}{2}$ rows apart, contradicting $\mathbf{H}$ being a horizontal step matrix. Hence, $\mathbf{H}_{21}[i,:] = \mathbf{0}$ , so $\mathbf{D}_1\mathbf{H}_1[i,j] = \mathbf{H}_{11}[i,j]$ , as desired.
+
+In all cases, $\mathbf{D}_1\mathbf{H}_1[i,j] = \mathbf{H}_{11}[i,j]$ , so our decomposition correctly recovers the upper left corner of $\mathbf{H}$ . Analogous arguments show that the other three corners are also correctly recovered. Hence, our decomposition is correct, and by induction, $\mathbf{H} \in \mathcal{B}$ .
+
+Corollary I.3. Let $\mathbf{V}$ be a vertical step matrix. Then $\mathbf{V} \in \mathcal{B}^*$ .
+
+
+Figure 9: Decomposition of $4 \times 4$ sparse matrix $\mathbf{S}$ into $\mathbf{P}_1\mathbf{H}\mathbf{P}_2\mathbf{V}\mathbf{P}_3$
+
+Now, we use step matrices to prove Lemma I.1.
+
+Proof of Lemma I.1. Given $\mathbf{S}$ , we decompose it as $\mathbf{S} = \mathbf{P}_1\mathbf{H}\mathbf{P}_2\mathbf{V}\mathbf{P}_3$ , where each $P_{\ell}$ is a permutation matrix, $\mathbf{H}$ is a horizontal step matrix, and $\mathbf{V}$ is a vertical step matrix. For an example of this, see Figure 9.
+
+We first decompose $\mathbf{S}$ as $\mathbf{S} = \mathbf{P}_1\mathbf{S}'\mathbf{P}_3$ , where $\mathbf{P}_1$ is the permutation that moves all 0 rows of $\mathbf{S}$ to the bottom and $\mathbf{P}_3$ is the permutation that moves all 0 columns of $\mathbf{S}$ to the right.
+
+Next, we further decompose $\mathbf{S}'$ into $\mathbf{S}' = \mathbf{H}\mathbf{V}'$ as follows. Since $\mathbf{S}'$ has $s \leq n$ NNZ, we can parameterize $\mathbf{S}'$ by $\theta = \{(c_k, i_k, j_k) : 0 \leq k < s\}$ such that $\mathbf{S}'[i_k, j_k] = c_k$ , with the non-zero entries indexed in row-major order. Define matrix $\mathbf{H}$ by:
+
+$$
+\mathbf {H} [:, k ] = \left\{ \begin{array}{l l} c _ {k} \cdot \mathbf {e} _ {i _ {k}} & 0 \leq k < s \\ \mathbf {0} & \text {o t h e r w i s e .} \end{array} \right.
+$$
+
+Define matrix $\mathbf{V}'$ by:
+
+$$
+\mathbf {V} ^ {\prime} [ k,: ] = \left\{ \begin{array}{l l} \mathbf {e} _ {\mathcal {J} _ {k}} ^ {T} & 0 \leq k < s \\ \mathbf {0} & \text {o t h e r w i s e .} \end{array} \right.
+$$
+
+To show that $\mathbf{S}' = \mathbf{H}\mathbf{V}'$ , we consider an arbitrary entry:
+
+$$
+\begin{array}{l} \mathbf {H V} ^ {\prime} [ i, j ] = \sum_ {k = 0} ^ {n} \mathbf {H} [ i, k ] \cdot \mathbf {V} ^ {\prime} [ k, j ] \quad \text {b y} \\ = \sum_ {k = 0} ^ {s} \mathbf {H} [ i, k ] \cdot \mathbf {V} ^ {\prime} [ k, j ] \quad \mathbf {H} \text {i s} 0 \text {i n a l l b u t f i r s t s c o l u m n s} \\ = \sum_ {k = 0} ^ {s} c _ {k} \cdot \mathbb {1} _ {i = i _ {k}} \cdot \mathbb {1} _ {j = j _ {k}} \quad \text {b y} \\ \end{array}
+$$
+
+Here, we note that $(i,j)$ can equal $(i_k,j_k)$ for at most one value of $k$ since the locations in $\theta$ are unique. Hence, $\mathbf{HV}'[i,j] = c_k$ only if $(i,j) = (i_k,j_k)$ for some $k$ , which is exactly the definition of $\mathbf{S}'$ . Hence, $\mathbf{S}' = \mathbf{HV}'$ .
+
+We argue that $\mathbf{H}$ is a horizontal step matrix through a series of assertions. First, note that $\mathbf{H}$ has exactly one non-zero entry in each of its first $s$ columns. Also, note that since $\theta$ is in row-major order, these non-zero entries are sorted (any column to the right cannot have a non-zero entry in a higher row). Hence, to show that $\mathbf{H}$ is a horizontal step matrix, it is sufficient to argue that adjacent columns of $\mathbf{H}$ have non-zero entries at most one row apart. This is equivalent to $\mathbf{S}'$ having no zero rows between two non-zero rows, which is guaranteed by $\mathbf{P}_1$ . Hence, $\mathbf{H}$ is a horizontal step matrix.
+
+Since $\mathbf{V}'$ has at most one non-zero entry per row, we may permute the rows of $\mathbf{V}'$ to obtain a matrix $\mathbf{V}$ , where the non-zero entries of $\mathbf{V}$ are sorted (any lower row below cannot have a non-zero entry in an earlier column). Hence, for some permutation matrix $(\mathbf{P}_2)^{-1}$ , $\mathbf{V} = (\mathbf{P}_2)^{-1}\mathbf{V}'$ , which implies that $\mathbf{V}' = \mathbf{P}_2\mathbf{V}$ . It has exactly one non-zero entry in each of its first $s$ columns. From the action of $\mathbf{P}_2$ , these non-zero entries are sorted. Therefore, by the same argument as for $\mathbf{H}$ above, $\mathbf{V}^T$ is a horizontal step matrix. Hence, $\mathbf{V}$ is a vertical step matrix.
+
+In all, we have found a decomposition $\mathbf{S} = \mathbf{P}_1\mathbf{H}\mathbf{P}_2\mathbf{V}\mathbf{P}_3$ , where each $P_{\ell}$ is a permutation matrix $(\in \mathcal{B}\mathcal{B}^{*}$ by Theorem 2), $\mathbf{H}$ is a horizontal step matrix $(\in \mathcal{B}$ by Lemma I.2), and $\mathbf{V}$ is a vertical step matrix $(\in \mathcal{B}^{*}$ by Corollary I.3). Moreover, by Lemma G.6, $\mathbf{P}_2\in \mathcal{B}^*\mathcal{B}$ , so $\mathbf{H},\mathbf{P}_2,\mathbf{V}$ can be combined to obtain $\mathbf{HP}_2\mathbf{V}\in (\mathcal{B}\mathcal{B}^*)^2$ . By Lemma H.2, $\mathbf{S}\in (\mathcal{B}\mathcal{B}^{*})^{4}$ .
+
+Corollary 1.4. Let $\mathbf{R}$ be an $n\times n$ matrix of rank $r$ . Then $\mathbf{R}\in (\mathcal{BB}^{*})_{4}^{8r}$ .
+
+Proof. We can decompose $\mathbf{R}$ as $\mathbf{R} = \mathbf{G}\mathbf{H}^*$ where $\mathbf{G},\mathbf{H}$ are $n\times r$ matrices. With appropriate zero-padding, both of these can be made into $n\times n$ matrices with at most $rn$ NNZ. The proof follows immediately from Theorem 3 and Lemma H.2.
+
+# J EXAMPLE OF K-MATRIX REPRESENTATION OF STRUCTURED MATRICES AND COMPARISON TO $\mathcal{BP}$ HIERARCHY
+
+In this appendix, we show explicitly how some common structured matrices (e.g. originating from fast transforms) can be represented as K-matrices. We also draw comparisons between the $\mathcal{B}\mathcal{B}^*$ hierarchy and the $\mathcal{BP}$ hierarchy introduced by Dao et al. (2019).
+
+Lemma J.1. Let $\mathbf{F}_n$ be the Discrete Fourier Transform of size $n$ . Then $\mathbf{F}_n \in (\mathcal{BB}^*)^2$ .
+
+Proof. From Parker (1995), we can express $\mathbf{F}_n$ as $\mathbf{F}_n = \mathbf{B} \mathbf{P}$ , where $\mathbf{B} \in \mathcal{B}$ and $\mathbf{P}$ is a permutation (the bit reversal permutation). From Theorem 2, $\mathbf{P} \in \mathcal{BB}^*$ . Hence, by Lemma H.2, $\mathbf{F}_n \in (\mathcal{BB}^*)^2$ .
+
+Lemma J.2. Let $\mathbf{H}_n$ be the Hadamard Transform of size $n$ . Then $\mathbf{H}_n \in \mathcal{BB}^*$ .
+
+Proof. $\mathbf{H}_n\in \mathcal{B}$ , so trivially $\mathbf{H}_n\in \mathcal{B}\mathcal{B}^*$ .
+
+Lemma J.3. Let $\mathbf{S}_n$ be the Discrete Sine Transform of size $n$ . Then $\mathbf{S}_n \in (\mathcal{BB}^*)^2$ .
+
+Proof. As described in Makhoul (1980), $\mathbf{S}_n$ can be performed as a scaled permutation (separating the even and odd indices of the input, and reversing and negating the odd indices) composed with $\mathbb{F}_n$ . Therefore, we may decompose $\mathbf{S}_n$ as $\mathbf{S}_n = \mathbf{B} \mathbf{P}_2 \mathbf{D} \mathbf{P}_1$ , where $\mathbf{P}_1, \mathbf{P}_2$ are permutations, $\mathbf{B} \in \mathcal{B}$ , and $\mathbf{D}$ is a diagonal matrix. $\mathbf{P}_2 \mathbf{D} \mathbf{P}_1$ is simply a permutation matrix with scaled entries, which can be equivalently expressed as $\mathbf{D}' \mathbf{P}'$ for some diagonal matrix $\mathbf{D}'$ and permutation $\mathbf{P}'$ . By Lemma H.1, $\mathbf{B} \mathbf{D}' \in \mathcal{BB}^*$ . By Theorem 2, $\mathbf{P}' \in \mathcal{BB}^*$ . Hence, by Lemma H.2, $\mathbf{S}_n \in (\mathcal{BB}^*)^2$ .
+
+Remark J.4. An analogous argument shows that the Discrete Cosine Transform is also in $(\mathcal{B}\mathcal{B}^{*})^{2}$ .
+
+Lemma J.5. Let $\mathbf{C}_n$ be an $n\times n$ circulant (convolution) matrix. Then $\mathbf{C}_n\in \mathcal{BB}^*$ .
+
+Proof. Using Theorem 2.6.4 of Pan (2001), we can express $\mathbf{C}_n$ as $\mathbf{C}_n = (\mathbf{F}_n)^{-1}\mathbf{D}\mathbf{F}_n$ where $\mathbf{F}_n$ is the Discrete Fourier Transform and $\mathbf{D}$ is a diagonal matrix. $(\mathbf{F}_n)^{-1} = \mathbf{B}\mathbf{P}$ (with $\mathbf{B} \in \mathcal{B}$ , $\mathbf{P}$ a permutation), which implies that $\mathbf{F}_n = (\mathbf{P})^{-1}(\mathbf{B})^{-1}$ . Therefore
+
+$$
+\mathbf {C} _ {n} = \mathbf {B P D} (\mathbf {P}) ^ {- 1} (\mathbf {B}) ^ {- 1}.
+$$
+
+The middle three factors have the effect of performing a permutation, scaling each element, and undoing the permutation, which is equivalent to simply scaling by some diagonal matrix $\mathbf{D}'$ . Hence, we are left with
+
+$$
+\mathbf {C} _ {n} = \mathbf {B} \mathbf {\Delta} \mathbf {D} ^ {\prime} (\mathbf {B}) ^ {- 1}.
+$$
+
+By Lemma H.1, $\mathbf{B}\mathbf{D}'\in \mathcal{B}$ . By Lemma H.6, $(\mathbf{B})^{-1}\in \mathcal{B}^{*}$ . Hence, $\mathbf{C}_n\in \mathcal{B}\mathcal{B}^*$
+
+
+
+Remark J.6. We can expand any $n \times n$ Toeplitz matrix $\mathbf{T}_n$ into a $2n \times 2n$ circulant matrix (with upper left $n \times n$ submatrix equal to $\mathbf{T}_n$ ). Hence, $\mathbf{T}_n \in (\mathcal{BB}^*)_2^1$ by Lemma J.5.
+
+The Fastfood matrix class (Le et al., 2013) can be tightly captured in the $\mathcal{BB}^*$ hierarchy:
+
+Lemma J.7. The product SHDPHB where $\mathbf{S},\mathbf{D},\mathbf{B}$ are diagonal matrices, $\mathbf{H}$ is the Hadamard transform, and $\mathbf{P}$ is a permutation matrix, is in $(\mathcal{B}\mathcal{B}^{*})^{3}$ .
+
+Proof. We have shown in Lemma J.2 that $\mathbf{H} \in \mathcal{BB}^*$ , and in Theorem 2 that $\mathbf{P} \in \mathcal{BB}^*$ . Since $\mathcal{BB}^*$ is closed under diagonal multiplication (Lemma H.1), we conclude that $\mathbf{SHDPHB} \in (\mathcal{BB}^*)^3$ .
+
+The two classes of matrices introduced in Moczulski et al. (2016), called AFDF and ACDC, are also tightly captured in the $\mathcal{BB}^*$ hierarchy:
+
+Lemma J.8. Let $\mathbf{AF}^{-1}\mathbf{DF}$ be a product of a diagonal matrix $\mathbf{A}$ , the inverse Fourier transform $\mathbf{F}^{-1}$ , another diagonal matrix $\mathbf{D}$ , and the Fourier transform $\mathbf{F}$ . Then $\mathbf{AF}^{-1}\mathbf{DF} \in \mathcal{B}\mathcal{B}^*$ .
+
+Let $\mathbf{AC}^{-1}\mathbf{DC}$ be a product of a diagonal matrix $\mathbf{A}$ , the inverse cosine transform $\mathbf{C}^{-1}$ , another diagonal matrix $\mathbf{D}$ , and the cosine transform $\mathbf{C}$ . Then $\mathbf{AC}^{-1}\mathbf{DC} \in (\mathcal{BB}^{*})^{4}$ .
+
+Proof. We have argued in Lemma J.5 that $\mathbf{F}^{-1}\mathbf{D}\mathbf{F} \in \mathcal{B}\mathcal{B}^*$ . Since $\mathcal{B}\mathcal{B}^*$ is closed under diagonal multiplication (Lemma H.1), we conclude that $\mathbf{A}\mathbf{F}^{-1}\mathbf{D}\mathbf{F} \in \mathcal{B}\mathcal{B}^*$ .
+
+We have shown that $\mathbf{C} \in (\mathcal{BB}^{*})^{2}$ , so $\mathbf{C}^{-1} \in (\mathcal{BB}^{*})^{2}$ as well. Since $\mathcal{BB}^{*}$ is closed under diagonal multiplication (Lemma H.1), we conclude that $\mathbf{AC}^{-1}\mathbf{DC} \in (\mathcal{BB}^{*})^{4}$ .
+
+Remark J.9. Within each butterfly factor matrix of the DFT (excluding the bit reversal permutation) and the Hadamard transform, the columns are pairwise orthogonal and have norm 2. Hence, we can divide all factors by $\sqrt{2}$ to make orthogonal factor matrices. To counteract this scaling, we can add a diagonal matrix with $\sqrt{2}^{\log_2(n)} = \sqrt{n}$ in all entries to the factorization. By doing this we can place all of the above transforms in the OBB hierarchy (defined in Appendix K) with the same width and expansion factor.
+
+# J.1 MULTI-DIMENSIONAL TRANSFORMS
+
+Here, we show that, using larger matrices, we are able to similarly capture multi-dimensional versions of the above transforms.
+
+Lemma J.10. Let $\mathbf{F}_n^2$ be the 2-dimensional Discrete Fourier Transform (represented as an $n^2 \times n^2$ matrix). Then $\mathbf{F}_n^2 \in (\mathcal{BB}^*)^2$ .
+
+Proof. The separation property of the 2-D DFT allows us to express its action on an $n \times n$ matrix as the composition of a 1-D DFT on each of its rows and a 1-D DFT on each of its columns. If we view the 2-D DFT as an $n^2 \times n^2$ matrix, its input and outputs will both be column vectors of size $n^2$ . As our convention, we list the entries of the input vector in the row-major order corresponding to the $n \times n$ input matrix. Then, we consider the 2-D DFT in four steps, where the first two steps perform the 1-D DFT row-wise, and the second two steps perform the 1-D DFT column-wise:
+
+Step 1: Permute the columns:
+
+We permute the columns (with a bit reversal permutation), which performs a bit reversal permutation on each row. Viewing the input as a vector, this step corresponds to left multiplication by a permutation matrix $\mathbf{P}_c$ that permutes the entries of each chunk of size $n$ of the input vector. Step 2: Multiply each row by a butterfly matrix
+
+Since the entries of the input were listed in row major order, this step is achieved through multiplication by a block diagonal matrix of $n$ butterfly matrices of size $n$ , which can be viewed as a product of butterfly factor matrices $\mathbf{B}_n^{(n^2)} \ldots \mathbf{B}_{\frac{n}{2}}^{(n^2)} \mathbf{B}_2^{(n^2)}$ .
+
+Step 3: Permute the rows:
+
+We permute the rows (with a bit reversal permutation), which performs a bit reversal permutation on each column. This corresponds to left multiplication by a permutation matrix $\mathbf{P}_r$ . Since we are permuting the rows, $\mathbf{P}_r$ permutes the entries at the granularity of each $n$ -chunk. Since Steps 1 and 2 each performed an identical computation to each $n$ -chunk we can move this row permutation before Step 2, combining $\mathbf{P}_c$ and $\mathbf{P}_r$ into a single permutation $\mathbf{P}$ .
+
+Step 4: Multiply each column by a butterfly matrix
+
+Consider multiplication by the first factor matrix. In each row, this matrix is taking linear combinations of adjacent column entries. In our length- $n^2$ vector, these entries will be exactly $n$ indices apart. Therefore this multiplication can be handled by a butterfly factor matrix $\mathbf{B}_{2n}^{(n^2)}$ . Similarly, we find that this butterfly multiplication can be expressed as multiplication by a product of butterfly factor matrices $\mathbf{B}_{n^2}^{(n^2)} \ldots \mathbf{B}_{\frac{n_2}{2}}^{(n^2)} \mathbf{B}_{2n}^{(n^2)}$ . Combined with the factor matrices from Step 2, these form a butterfly matrix $\mathbf{B}$ of size $n^2$ .
+
+In all, we see that the 2-D DFT may be realized as multiplication by a permutation matrix $\mathbf{P}$ followed by multiplication by a butterfly matrix $\mathbf{B}$ . The same argument as Lemma J.1 shows that $\mathbf{F}_n^2 \in (\mathcal{BB}^*)^2$ .
+
+Remark J.11. An analogous argument (using the separation property of the respective transforms) can be used to argue that 2-D Discrete Sine and Discrete Cosine transforms are in $(\mathcal{BB}^{*})^{2}$ , and that 2-D Hadamard Transforms are in $\mathcal{BB}^{*}$ .
+
+Lemma J.12. Let $\mathbf{C}_n^2$ be a 2-dimensional convolution matrix. Then $\mathbf{C}_n^2\in \mathcal{BB}^*$
+
+Proof. We can express a 2-D convolution matrix as $\mathbf{C}_n^2 = (\mathbf{F}_n^2)^{-1}\mathbf{D}\mathbf{F}_n^2$ , where $\mathbf{D}$ is diagonal, $\mathbf{F}_n^2$ is the 2-D Fourier transform and $(\mathbf{F}_n^2)^{-1}$ is the inverse 2-D Fourier transform. From the proof of Lemma J.10, we see that we can express $\mathbf{F}_n^2$ (and similarly $(\mathbf{F}_n^2)^{-1}$ ) as the product of a butterfly matrix and a permutation matrix. The rest of the argument is analogous to the proof of Lemma J.5.
+
+Remark J.13. Using an inductive argument, we can show that all $k$ -dimensional $(k \in \mathbb{Z})$ variants of the above transforms, expressed as $n^k \times n^k$ matrices are contained in $\mathcal{BB}^*$ or $(\mathcal{BB}^*)^2$ . To do this, we use the separation property of the transforms to break them into a $k-1$ -dimensional transform (the inductive hypothesis) followed by a 1-dimensional transform.
+
+# K THE ORTHOGONAL KALEIDOSCOPE HIERARCHY
+
+Through practical application of the butterfly matrices, it has been found useful to constrain them in orthogonality. In Section K.1 we will modify the existing kaleidoscope hierarchy to create the orthogonal kaleidoscope hierarchy $\mathcal{O}BB$ . Then, in Section K.2, we will argue that all orthogonal matrices, and as a result all matrices, can also be expressed in this hierarchy in $O(n)$ width. Lastly, in Section K.3, we will argue that permutation matrices and sparse matrices also exist in this hierarchy in $O(1)$ width, which in turn implies a corresponding result for matrices with low-depth arithmetic circuits.
+
+# K.1 DEFINITION
+
+The definition of the orthogonal butterfly is identical to the original butterfly, with the constraint that all butterfly factors are orthogonal. We specify this definition below:
+
+Definition K.1 (Analog of Definition 2.1). An orthogonal butterfly factor of size $k \geq 2$ (denoted as $\overline{\mathbf{B}}_k$ ) is a butterfly factor that is also orthogonal.
+
+Definition K.2 (Analog of Definition 2.3). An orthogonal butterfly matrix of size $n$ (denoted as $\widetilde{\mathbf{B}}^{(n)}$ ) is a butterfly matrix with all butterfly factor matrices being orthogonal.
+
+Note that the above definition implies that an orthogonal butterfly matrix, as well as its conjugate transpose, is orthogonal.
+
+The orthogonal hierarchy definition nearly mimics the original hierarchy Definition 2.4, as follows:
+
+# Definition K.3.
+
+- We say that an $n \times n$ matrix $\mathbf{M} \in \widetilde{\mathcal{B}}$ if we can express $\mathbf{M} = {\widetilde{\mathbf{B}}}^{\left( n\right) }$ .
+- We say that an $n \times n$ matrix $\mathbf{M} \in \widetilde{\mathcal{B}}^*$ if we can express $\mathbf{M} = \left[\widetilde{\mathbf{B}}^{(n)}\right]^*$ .
+- We say that an $n \times n$ matrix $\mathbf{M} \in \mathcal{OBB}$ if we can express $\mathbf{M} = \mathbf{M}_1\mathbf{DM}_2$ for some $\mathbf{M}_1 \in \widetilde{\mathcal{B}}, \mathbf{M}_2 \in \widetilde{\mathcal{B}}^*$ , and diagonal matrix $\mathbf{D}$ . Note that $\mathbf{D}$ need not be full rank.
+- Width $w$ and expansion $e$ in $(\mathcal{O}\mathcal{B}\mathcal{B})_e^w$ mimic the same definition as in the original hierarchy, using $\mathcal{O}\mathcal{B}\mathcal{B}$ instead of $\mathcal{BB}^*$ , such that $\mathbf{E} \in (\mathcal{O}\mathcal{B}\mathcal{B})^w$ .
+
+By padding if necessary, we will assume that $n$ is a power of 2.
+
+# K.2 EXPRESSIVITY
+
+In this subsection we prove that all orthogonal (resp. unitary) matrices are contained in $\mathcal{O}\mathcal{B}\mathcal{B}^n$ . To do this, we consider the class of Householder reflections, given by $\mathbf{I} - 2\mathbf{u}\mathbf{u}^{*}$ for any unit vector $\mathbf{u}$ (Householder, 1958):
+
+Lemma K.1. All Householder reflections are in $\mathcal{O}\mathcal{B}\mathcal{B}$ with inner diagonal matrix $\mathbf{I}$ .
+
+We will prove this lemma shortly. First, we use this lemma to present a decomposition for all orthogonal (resp. unitary) matrices.
+
+Lemma K.2. Let $\mathbf{M}$ be an $n\times n$ orthogonal/unitary matrix. Then $\mathbf{M}\in (\mathcal{O}\mathcal{B}\mathcal{B})^{n - 1}$ .
+
+Proof. We consider the QR decomposition of $\mathbf{M}$ . It is known that we can compose $\mathbf{M}$ into a product of $n - 1$ Householder reflections and an orthogonal/unitary diagonal matrix (Householder, 1958).10 From Lemma K.1, each Householder reflection is in $\mathcal{OBB}$ .
+
+To complete the proof, we argue that $\mathbf{R}$ can be folded into the rightmost butterfly matrix. Let $\mathbf{Q}_1$ be the rightmost butterfly factor matrix in $\mathbf{Q}$ ( $\in \widetilde{\mathbf{B}}_n^{(n)}$ ). Right multiplication of $\mathbf{Q}_1$ by $\mathbf{R}$ scales each columns of $\mathbf{Q}_1$ by some $c \in \mathbb{C}$ with $||c|| = 1$ ( $\mathbf{R}$ is unitary diagonal). This preserves both the sparsity
+
+pattern of $\mathbf{Q}_1$ and the orthogonality of its columns. Moreover, the norm of each column of $\mathbf{Q}_1\mathbf{R}$ is 1. Therefore, $\mathbf{Q}_1\mathbf{R}$ is an orthogonal butterfly factor matrix, so $\mathbf{M} = \mathbf{QR} \in (\mathcal{O}\mathcal{B}\mathcal{B})^{n-1}$ , as desired.
+
+We now return to the proof of Lemma K.1
+
+Proof of Lemma K.1. Given $\mathbf{u} \in \mathbb{C}^n$ ( $n$ a power of 2), let $\mathbf{u}_0 = \mathbf{u}[: n/2] \in \mathbb{C}^{n/2}$ , $\mathbf{u}_1 = \mathbf{u}[n/2:]\in \mathbb{C}^{n/2}$ denote the first and second halves of $\mathbf{u}$ .
+
+To show that $\mathbf{H} \in \mathcal{OBB}$ with inner diagonal matrix $\mathbf{I}$ , we proceed by induction. The base case for $n = 2$ is trivial. It suffices to show that there exist unitary butterfly factors $\mathbf{L}, \mathbf{R}$ such that $\mathbf{LHR}$ has the form $\begin{bmatrix} \mathbf{I}_{n/2} - 2\mathbf{v}_0\mathbf{v}_0^* & \mathbf{0} \\ \mathbf{0} & \mathbf{I}_{n/2} - 2\mathbf{v}_1\mathbf{v}_1^* \end{bmatrix}$ for some unit vectors $\mathbf{v}_0, \mathbf{v}_1 \in \mathbb{C}^{n/2}$ .
+
+Define
+
+$$
+\left(\mathbf {v} _ {0} [ i ], \mathbf {v} _ {1} [ i ]\right) = \left\{ \begin{array}{l l} \left(\frac {\mathbf {u} _ {0} [ i ]}{\sqrt {| \mathbf {u} _ {0} [ i ] | ^ {2} + | \mathbf {u} _ {1} [ i ] | ^ {2}}}, \frac {\mathbf {u} _ {1} [ i ]}{\sqrt {| \mathbf {u} _ {0} [ i ] | ^ {2} + | \mathbf {u} _ {1} [ i ] | ^ {2}}}\right) & \text {i f} | \mathbf {u} _ {0} [ i ] | ^ {2} + | \mathbf {u} _ {1} [ i ] | ^ {2} \neq 0 \\ (1, 0) & \text {o t h e r w i s e} \end{array} . \right. \tag {5}
+$$
+
+It is easily checked that
+
+$$
+\mathbf {v} _ {0} [ i ] ^ {*} \mathbf {v} _ {0} [ i ] + \mathbf {v} _ {1} [ i ] ^ {*} \mathbf {v} _ {1} [ i ] = 1
+$$
+
+$$
+\mathbf {v} _ {0} [ i ] ^ {*} \mathbf {u} _ {0} [ i ] + \mathbf {v} _ {1} [ i ] ^ {*} \mathbf {u} _ {1} [ i ] = \sqrt {\left| \mathbf {u} _ {0} [ i ] \right| ^ {2} + \left| \mathbf {u} _ {1} [ i ] \right| ^ {2}}. \tag {6}
+$$
+
+$$
+\mathbf {v} _ {1} [ i ] \mathbf {u} _ {0} [ i ] - \mathbf {v} _ {0} [ i ] ^ {*} \mathbf {u} _ {1} [ i ] = 0
+$$
+
+We choose
+
+$$
+\mathbf {L} = \left[ \begin{array}{c c} \operatorname {D i a g} (\mathbf {v} _ {0} ^ {*}) & \operatorname {D i a g} (\mathbf {v} _ {1} ^ {*}) \\ \operatorname {D i a g} (\mathbf {v} _ {1}) & \operatorname {D i a g} (- \mathbf {v} _ {0}) \end{array} \right]
+$$
+
+and $\mathbf{R} = \mathbf{L}^{*}$ . $\mathbf{L},\mathbf{R}$ are (permuted) direct sums of blocks of the form $\left[ \begin{array}{cc}\mathbf{v}_0[i]^* & \mathbf{v}_1[i]^*\\ \mathbf{v}_1[i] & -\mathbf{v}_0[i] \end{array} \right]$ , which are orthogonal by construction (via (5)). Hence, $\mathbf{L}\in \widetilde{\mathbf{B}}_n^{(n)}$ and $\mathbf{R}\in (\widetilde{\mathbf{B}}^*)_n^{(n)}$ . Further,
+
+$$
+\begin{array}{l} \mathbf {L H R} = \left[ \begin{array}{c c} \operatorname {D i a g} (\mathbf {v} _ {0} ^ {*}) & \operatorname {D i a g} (\mathbf {v} _ {1} ^ {*}) \\ \operatorname {D i a g} (\mathbf {v} _ {1}) & \operatorname {D i a g} (- \mathbf {v} _ {0}) \end{array} \right] \left(\mathbf {I} - 2 \left[ \begin{array}{c} \mathbf {u} _ {0} \\ \mathbf {u} _ {1} \end{array} \right] \left[ \begin{array}{c} \mathbf {u} _ {0} \\ \mathbf {u} _ {1} \end{array} \right] ^ {*}\right) \left[ \begin{array}{c c} \operatorname {D i a g} (\mathbf {v} _ {0} ^ {*}) & \operatorname {D i a g} (\mathbf {v} _ {1} ^ {*}) \\ \operatorname {D i a g} (\mathbf {v} _ {1}) & \operatorname {D i a g} (- \mathbf {v} _ {0}) \end{} \right] ^ {*} \\ = \mathbf {I} - 2 \left[ \begin{array}{c c} \operatorname {D i a g} (\mathbf {v} _ {0} ^ {*}) & \operatorname {D i a g} (\mathbf {v} _ {1} ^ {*}) \\ \operatorname {D i a g} (\mathbf {v} _ {1}) & \operatorname {D i a g} (- \mathbf {v} _ {0}) \end{array} \right] \left[ \begin{array}{c} \mathbf {u} _ {0} \\ \mathbf {u} _ {1} \end{array} \right] \left[ \begin{array}{c} \mathbf {u} _ {0} \\ \mathbf {u} _ {1} \end{array} \right] ^ {*} \left[ \begin{array}{c c} \operatorname {D i a g} (\mathbf {v} _ {0} ^ {*}) & \operatorname {D i a g} (\mathbf {v} _ {1} ^ {*}) \\ \operatorname {D i a g} (\mathbf {v} _ {1}) & \operatorname {D i a g} (- \mathbf {v} _ {0}) \end{} \right] ^ {*} \\ = \mathbf {I} - 2 \underbrace {\left[ \begin{array}{c} \mathbf {v} _ {0} ^ {*} \circ \mathbf {u} _ {0} + \mathbf {v} _ {1} ^ {*} \circ \mathbf {u} _ {1} \\ \mathbf {v} _ {1} \circ \mathbf {u} _ {0} - \mathbf {v} _ {0} \circ \mathbf {u} _ {1} \end{array} \right]} _ {\mathbf {w}} \underbrace {\left[ \begin{array}{c} \mathbf {v} _ {0} ^ {*} \circ \mathbf {u} _ {0} + \mathbf {v} _ {1} ^ {*} \circ \mathbf {u} _ {1} \\ \mathbf {v} _ {1} \circ \mathbf {u} _ {0} - \mathbf {v} _ {0} \circ \boldsymbol {\mathbf {u}} _ {1} \end{array} \right]} _ {\mathbf {w}} ^ {*}, \\ \end{array}
+$$
+
+where $\circ$ denotes the Hadamard product. From (6)
+
+$$
+\mathbf {w} [ i ] = \left\{ \begin{array}{l l} \sqrt {| \mathbf {u} _ {0} [ i ] | ^ {2} + | \mathbf {u} _ {1} [ i ] | ^ {2}} & i \in [ n / 2 ] \\ 0 & i \in [ n / 2: n ] \end{array} \right.
+$$
+
+Denoting the first half of this vector by $\mathbf{w}_0\in \mathbb{C}^{n / 2}$ , we have
+
+$$
+\mathbf {L H R} = \left[ \begin{array}{c c} \mathbf {I} - 2 \mathbf {w} _ {0} \mathbf {w} _ {0} ^ {*} & \mathbf {0} \\ \mathbf {0} & \mathbf {I} \end{array} \right],
+$$
+
+where $\| \mathbf{w}_0\| _2 = \| \mathbf{u}\| _2 = 1$ . The result follows inductively.
+
+
+
+As an immediate corollary, we can use Singular Value Decomposition to obtain a factorization for an arbitrary $n \times n$ matrix.
+
+Corollary K.3. Let $\mathbf{M}$ be an arbitrary $n\times n$ matrix. Then, $\mathbf{M}\in (\mathcal{O}\mathcal{B}\mathcal{B})^{2n - 1}$ , where all but one matrix in the decomposition is orthogonal (unitary).
+
+Proof. By employing Singular Value Decomposition, we can decompose $\mathbf{M}$ as $\mathbf{M} = \mathbf{U}\boldsymbol{\Sigma}\mathbf{V}^{*}$ , where $\mathbf{U},\mathbf{V}^{*}$ are orthogonal and $\pmb{\Sigma}$ is diagonal. By Lemma K.2, $\mathbf{U},\mathbf{V}^{*}\in (\mathcal{O}\mathcal{B}\mathcal{B})^{n - 1}$ , and trivially $\pmb{\Sigma}\in \mathcal{O}\mathcal{B}\mathcal{B}$ . Hence, $\mathbf{M}\in (\mathcal{O}\mathcal{B}\mathcal{B})^{2n - 1}$ . Note that $\pmb{\Sigma}$ is the only matrix in the decomposition that is not orthogonal (unitary).
+
+# K.3 CONSTRUCTIONS
+
+We show that we can construct $s$ -sparse matrices in the $\mathcal{O}\mathcal{B}\mathcal{B}$ hierarchy with the same width as the $\mathcal{B}\mathcal{B}^*$ hierarchy. The proof follows a structure to that of Theorem 3. We begin by arguing about permutation and step matrices, then using the same factorization to argue that matrices with at most $n$ NNZ are contained in $(\mathcal{B}\mathcal{B}^{*})^{4}$ . Then, we will appeal to a modified sum closure lemma to extend the argument to matrices of general $s$ NNZ. Similar to Appendix F, we can use these results to place all matrices with low-depth circuits for matrix vector multiplication in the $\mathcal{O}\mathcal{B}\mathcal{B}$ hierarchy.
+
+# K.3.1 PERMUTATIONS
+
+We begin by presenting the argument that permutations are included in $\mathcal{O}\mathcal{B}\mathcal{B}$ as a corollary to Theorem 2.
+
+Corollary K.4. Let $\mathbf{P}$ be a permutation matrix. Then $\mathbf{P} \in \widetilde{\mathcal{B}}\widetilde{\mathcal{B}}^*$ .
+
+Proof. We appeal to the decomposition from Theorem 2, noting that all butterfly factor matrices constructed in the proofs of Lemmas G.3 and G.1 are permutation matrices, and thus are orthogonal. Hence, $\mathbf{P} \in \mathcal{OBB}$ where the inner diagonal matrix is $\mathbf{I}$ .
+
+Similarly, the construction of Lemma G.6 also show that permutations are included in $\widetilde{\mathcal{B}}^*\widetilde{\mathcal{B}}$ .
+
+Corollary K.5. Let $\mathbf{P}$ be a permutation matrix. Then $\mathbf{P} \in \widetilde{\mathcal{B}}^{*}\widetilde{\mathcal{B}}$ .
+
+To prove the containment of sparse matrices within the OBB hierarchy, we make use of the following lemma.
+
+Lemma K.6. Let $\mathbf{P}$ be a permutation matrix and $\mathbf{D}$ a diagonal matrix. Then there exist diagonal matrices $\mathbf{D}'$ and $\mathbf{D}''$ such that:
+
+$$
+\mathbf {P} \mathbf {D} = \mathbf {D} ^ {\prime} \mathbf {P} \quad \mathbf {D} \mathbf {P} = \mathbf {P} \mathbf {D} ^ {\prime \prime}.
+$$
+
+Proof. Let $\sigma$ be the permutation such that $\mathbf{P}[i,j] = \delta_{i,\sigma(j)}$ .
+
+Define $\mathbf{D}'$ such that $\mathbf{D}'[\sigma(j), \sigma(j)] = \mathbf{D}[j, j]$ . Then, if $i = \sigma(j)$ :
+
+$$
+(\mathbf {P D}) [ i, j ] = \mathbf {P} [ i, j ] \mathbf {D} [ j, j ] = \mathbf {D} ^ {\prime} [ \sigma (j), \sigma (j) ] \mathbf {P} [ \sigma (j), j ] = (\mathbf {D} ^ {\prime} \mathbf {P}) [ \sigma (j), j ] = (\mathbf {D} ^ {\prime} \mathbf {P}) [ i, j ].
+$$
+
+Otherwise, if $i \neq \sigma(j)$ , then $(\mathbf{PD})[i,j] = 0 = (\mathbf{D}'\mathbf{P})[i,j]$ . Hence, $\mathbf{PD} = \mathbf{D}'\mathbf{P}$ .
+
+Define $\mathbf{D}''$ such that $\mathbf{D}''[j,j] = \mathbf{D}[\sigma(j),\sigma(j)]$ . An analogous argument to above shows that $\mathbf{DP} = \mathbf{PD}''$ .
+
+# K.3.2 STEP MATRICES
+
+In the $\mathcal{BB}^*$ hierarchy (Lemma I.2), we were able to show that horizontal step matrices are butterfly matrices. Here, we present a similar result for the $\mathcal{OBB}$ hierarchy.
+
+Lemma K.7. Let $\mathbf{H}$ be an $n\times n$ horizontal step matrix. Then we can decompose $\mathbf{H} = \mathbf{D}\mathbf{O}$ , where $\mathbf{D}$ is a diagonal matrix and $\mathbf{O}\in \widetilde{\mathcal{B}}$ .
+
+Proof. Throughout the proof, we make reference to the original horizontal step matrix construction given in Lemma I.2 and its proof.
+
+To begin, we show that an arbitrary $2^{k} \times 2^{k}$ butterfly factor $\mathbf{H}_{2^k}$ in the decomposition of $\mathbf{H}$ can be expressed as the product of a diagonal matrix and an orthogonal butterfly factor. Since a butterfly factor is direct sum of $2 \times 2$ matrices, there is a permutation matrix $\mathbf{P}_{2^k}$ such that conjugation of $\mathbf{H}_{2^k}$ by $\mathbf{P}_{2^k}$ gives a block diagonal matrix $\mathbf{H}_{2^k}'$ of $\frac{n}{2} 2 \times 2$ matrices, i.e.
+
+$$
+\mathbf {P} _ {2 ^ {k}} \mathbf {H} _ {2 ^ {k}} \mathbf {P} _ {2 ^ {k}} ^ {*} = \mathbf {H} _ {2 ^ {k}} ^ {\prime}.
+$$
+
+(See Figure 10 for an illustration.) Specifically, $\mathbf{P}_{2^k}$ is the permutation where:
+
+$$
+\mathbf {P} _ {s} [ 2 i,: ] = \mathbf {e} _ {i} ^ {T} \qquad \qquad \mathbf {P} _ {s} [ 2 i + 1,: ] = \mathbf {e} _ {i + \frac {n}{2}} ^ {T}.
+$$
+
+
+Figure 10: Block diagonalization of $\mathbf{H}_8$
+
+
+
+
+
+
+
+We argue that each of these $2 \times 2$ blocks can be decomposed into a diagonal matrix times an orthogonal matrix. Note that the butterfly factor matrices constructed in the proof of Lemma I.2 each have at most one non-zero entry per column. Hence, there are 4 cases to consider. Note that matrices with at most one non-zero entry are exhausted by Cases 1 and 2.
+
+Case 1: $\begin{bmatrix} a & 0 \\ 0 & b \end{bmatrix} = \underbrace{\begin{bmatrix} a & 0 \\ 0 & b \end{bmatrix} \underbrace{\begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}}_{\mathbf{D}}$
+Case 2: $\begin{bmatrix} 0 & a \\ b & 0 \end{bmatrix} = \underbrace{\begin{bmatrix} a & 0 \\ 0 & b \end{bmatrix} \underbrace{\begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix}}_{\mathbf{D}}$
+Case 3: $\begin{bmatrix} a & b \\ 0 & 0 \end{bmatrix} = \underbrace{\left[ \begin{array}{cc}\sqrt{a^2 + b^2} & 0\\ 0 & 0 \end{array} \right]}_{\mathbf{D}}\underbrace{\left[ \begin{array}{cc}\frac{a}{\sqrt{a^2 + b^2}} & \frac{b}{\sqrt{a^2 + b^2}}\\ \frac{b}{\sqrt{a^2 + b^2}} & \frac{-a}{\sqrt{a^2 + b^2}} \end{array} \right]}_{\mathbf{O}},\qquad a,b\neq 0 \end{bmatrix}$
+Case 4: $\begin{bmatrix} 0 & 0 \\ a & b \end{bmatrix} = \underbrace{\begin{bmatrix} 0 & 0 \\ 0 & \sqrt{a^2 + b^2} \end{bmatrix} \underbrace{\begin{bmatrix} \frac{b}{\sqrt{a^2 + b^2}} & \frac{-a}{\sqrt{a^2 + b^2}} \\ \frac{a}{\sqrt{a^2 + b^2}} & \frac{b}{\sqrt{a^2 + b^2}} \end{bmatrix}}_{\mathbf{O}}, \quad a, b \neq 0$
+
+In the last two cases, $\mathbf{O}$ is a $2\times 2$ rotation matrix, which is commonly known to be orthogonal. Assume that we perform the above decomposition on all of the blocks of $\mathbf{H}_{2^k}^\prime$ in parallel, therefore expressing $\mathbf{H}_{2^k}^\prime = \mathbf{D}^\prime \mathbf{O}^\prime$ . We now have
+
+$$
+\mathbf {H} _ {2 ^ {k}} = \mathbf {P} _ {2 ^ {k}} ^ {*} \mathbf {D} ^ {\prime} \mathbf {O} ^ {\prime} \mathbf {P} _ {2 ^ {k}}.
+$$
+
+By Lemma K.6, we can rewrite this as
+
+$$
+\mathbf {H} _ {2 ^ {k}} = \mathbf {D} ^ {\prime \prime} \mathbf {P} _ {2 ^ {k}} ^ {*} \mathbf {O} ^ {\prime} \mathbf {P} _ {2 ^ {k}}.
+$$
+
+Note that $\mathbf{P}_{2^k}^*\mathbf{O}'\mathbf{P}_{2^k}$ is the product of three orthogonal matrices, and thus orthogonal. Additionally, the construction of $\mathbf{P}_{2^k}$ ensures that $\mathbf{P}_{2^k}^*\mathbf{O}'\mathbf{P}_{2^k}$ is butterfly factor. $^{11}$ Hence, $\mathbf{H}_{2^k}$ can be expressed as the product of a diagonal matrix and an orthogonal butterfly factor, as desired.
+
+Now, we show that this decomposition of butterfly factors implies Lemma K.7. By performing this decomposition in parallel on each butterfly factor, we conclude that any butterfly factor matrix $\mathbf{H}_{2^k}^{(n)}$ of $\mathbf{H}$ can be decomposed as $\mathbf{H}_{2^k}^{(n)} = \mathbf{D}_{2^k}\mathbf{O}_{2^k}^{(n)}$ .12
+
+We complete the argument by induction on $n$ . The base case $n = 2$ holds by the observation about butterfly factor matrices above. Assume that any horizontal step matrix of size $\frac{n}{2} \times \frac{n}{2}$ can be expressed as a diagonal matrix times an orthogonal butterfly matrix. Now, consider the $n \times n$ horizontal step matrix $\mathbf{H}$ . From Lemma I.2, $\mathbf{H}$ can be expressed as
+
+$$
+\mathbf {H} = \mathbf {B} _ {n} ^ {(n)} \left[ \begin{array}{c c} \mathbf {H} _ {1} & 0 \\ 0 & \mathbf {H} _ {2} \end{array} \right],
+$$
+
+where $\mathbf{H}_1, \mathbf{H}_2$ are $\frac{n}{2} \times \frac{n}{2}$ horizontal step matrices. By our inductive hypothesis,
+
+$$
+\mathbf {H} = \mathbf {B} _ {n} ^ {(n)} \mathbf {D} _ {1} \left[ \begin{array}{c c} \mathbf {O} _ {1} & 0 \\ 0 & \mathbf {O} _ {2} \end{array} \right],
+$$
+
+where $\mathbf{D}_1$ is diagonal and $\mathbf{O}_1, \mathbf{O}_2$ are $\frac{n}{2} \times \frac{n}{2}$ matrices in $\widetilde{\mathcal{B}}$ . However, $\mathbf{B}_n^{(n)}\mathbf{D}_1$ is a butterfly factor, and therefore can be expressed as $\mathbf{D}_n\mathbf{O}_n^{(n)}$ . Therefore,
+
+$$
+\mathbf {H} = \mathbf {D} _ {n} \mathbf {O} _ {n} ^ {(n)} \left[ \begin{array}{c c} \mathbf {O} _ {1} & 0 \\ 0 & \mathbf {O} _ {2} \end{array} \right] = \mathbf {D} _ {n} \mathbf {O},
+$$
+
+with $\mathbf{O}\in \widetilde{\mathcal{B}}$ , as desired.
+
+
+
+Just as with the $\mathcal{BB}^*$ hierarchy, the decomposition of vertical step matrices falls out as an immediate corollary to the horizontal step matrix proof.
+
+Corollary K.8. Let $\mathbf{V}$ be a vertical step matrix. Then we can decompose $\mathbf{V} = \mathbf{O}^{*}\mathbf{D}$ , where $\mathbf{D}$ is a diagonal matrix and $\mathbf{O}^{*} \in \tilde{\mathcal{B}}^{*}$ .
+
+# K.3.3 SPARSE MATRICES
+
+Now that we have argued about the decomposition of permutation and step matrices in the $OBB$ hierarchy, we can leverage the construction from Lemma I.1 to argue about matrices with at most $n$ NNZ.
+
+Corollary K.9. Let $\mathbf{S}$ be an $n\times n$ matrix with at most $n$ NNZ. Then, $\mathbf{S}\in (\mathcal{O}\mathcal{B}\mathcal{B})^4$ .
+
+Proof. We use the construction from Lemma I.1, along with Lemma K.7 and Corollary K.8, to express $\mathbf{S}$ as:
+
+$$
+\mathbf {S} = \underbrace {\mathbf {O} _ {1} \mathbf {O} _ {1} ^ {\prime}} _ {\mathbf {P} _ {1}} \underbrace {\mathbf {D} _ {2} \mathbf {O} _ {2}} _ {\mathbf {H}} \underbrace {\mathbf {O} _ {3} \mathbf {O} _ {3} ^ {\prime}} _ {\mathbf {P} _ {2}} \underbrace {\mathbf {O} _ {4} ^ {\prime} \mathbf {D} _ {4}} _ {\mathbf {V}} \underbrace {\mathbf {O} _ {5} \mathbf {O} _ {5} ^ {\prime}} _ {\mathbf {P} _ {3}},
+$$
+
+with each $\mathbf{O}_i\in \widetilde{\mathcal{B}}$ , each $\mathbf{O}_j^{\prime}\in \widetilde{\mathcal{B}}^{*}$ , and each $\mathbf{D}_k$ diagonal. Since $\mathbf{P}_2$ is a permutation, by Corollary K.5, we can write it as $\tilde{\mathbf{O}}_3'\tilde{\mathbf{O}}_3$ for some $\tilde{\mathbf{O}}_3' \in \widetilde{\mathcal{B}}^*$ and $\tilde{\mathbf{O}}_3\in \widetilde{\mathcal{B}}$ . Moreover, noting that $\mathbf{O}_1^\prime$ and $\mathbf{O}_5$ are permutations, we make use of Lemma K.6 to re-express S as:
+
+$$
+\mathbf {S} = \underbrace {\mathbf {O} _ {1} \mathbf {D} _ {2} ^ {\prime} \mathbf {O} _ {1} ^ {\prime}} _ {\mathbf {M} _ {1}} \underbrace {\mathbf {O} _ {2} \tilde {\mathbf {O}} _ {3} ^ {\prime}} _ {\mathbf {M} _ {2}} \underbrace {\tilde {\mathbf {O}} _ {3} \mathbf {O} _ {4} ^ {\prime}} _ {\mathbf {M} _ {3}} \underbrace {\mathbf {O} _ {5} \mathbf {D} _ {4} ^ {\prime} \mathbf {O} _ {5} ^ {\prime}} _ {\mathbf {M} _ {4}}.
+$$
+
+Note that each $\mathbf{M}_{\ell} \in \mathcal{O}\mathcal{B}\mathcal{B}$ . Hence, $\mathbf{S} \in (\mathcal{O}\mathcal{B}\mathcal{B})^4$ , as desired.
+
+
+
+Just as in Appendix I, we would like to extend this orthogonal-based construction to capture matrices of general sparsity. To accomplish this, we introduce an addition closure lemma analogous to Lemma K.10 for the $OBB$ hierarchy.
+
+Lemma K.10. Let $\mathbf{A}_1, \ldots, \mathbf{A}_m$ be $k \times k$ matrices in $(\mathcal{O}\mathcal{B}\mathcal{B})_e^w$ then $\sum_{i=1}^{m} \mathbf{A}_i \in (\mathcal{O}\mathcal{B}\mathcal{B})_{4e}^{mw}$ .
+
+With Lemma K.10, we arrive at the following Corollary on general orthogonal sparsity.
+
+Corollary K.11. Let $\mathbf{S}$ be an $n\times n$ matrix with $sNNZ$ . Then, $\mathbf{S}\in (\mathcal{O}\mathcal{B}\mathcal{B})_4^{4\left\lceil \frac{s}{n}\right\rceil}$ .
+
+Proof. Just as in the proof of Theorem 3, we accomplish this using a sum of $\left\lceil \frac{s}{n} \right\rceil$ matrices of at most $n$ NNZ. For handling the sum of matrices, we need to appeal to Lemma K.10.
+
+To conclude the argument, we give the proof of Lemma K.10.
+
+Proof of Lemma K.10. For each $1 \leq i \leq m$ , let $\mathbf{E}_{\mathbf{A}_i} \in \mathbb{F}^{ek \times ek}$ be defined such that $\mathbf{A}_i = \mathbf{S}\mathbf{E}_{\mathbf{A}_i}\mathbf{S}^*$ (with $\mathbf{S}$ as in Definition 2.4). Note that $\mathbf{E}_{\mathbf{A}_i} \in (\mathcal{O}\mathcal{B}\mathcal{B})^w$ . Consider matrices of the form:
+
+$$
+\underbrace {\left[ \begin{array}{c c c c} \mathbf {I} _ {e k} & 0 & 0 & \mathbf {E} _ {\mathbf {A} _ {i}} \\ 0 & \mathbf {I} _ {e k} & 0 & 0 \\ \mathbf {I} _ {e k} & 0 & 0 & - \mathbf {E} _ {\mathbf {A} _ {i}} \\ 0 & \mathbf {I} _ {e k} & 0 & 0 \end{array} \right]} _ {\mathbf {M} _ {i} \in \mathbb {F} ^ {4 e k \times 4 e k}} = \sqrt {2} \underbrace {\left[ \begin{array}{c c c c} \frac {1}{\sqrt {2}} \mathbf {I} _ {2 e k} & \frac {1}{\sqrt {2}} \mathbf {I} _ {2 e k} \\ \frac {1}{\sqrt {2}} \mathbf {I} _ {2 e k} & - \frac {1}{\sqrt {2}} \mathbf {I} _ {2 e k} \end{array} \right]} _ {\mathbf {O} \in \widetilde {\mathbf {B}} _ {4 e k} ^ {(4 e k)}} \underbrace {\left[ \begin{array}{c c c c} \mathbf {I} _ {e k} & 0 & 0 & 0 \\ 0 & \mathbf {I} _ {e k} & 0 & 0 \\ 0 & 0 & \mathbf {E} _ {\mathbf {A} _ {i}} & 0 \\ 0 & 0 & 0 & 0 \end{array} \right]} _ {\mathbf {K}} \underbrace {\left[ \begin{array}{c c c c} \mathbf {I} _ {e k} & 0 & 0 & 0 \\ 0 & \mathbf {I} _ {e k} & 0 & 0 \\ 0 & 0 & 0 & \mathbf {I} _ {e k} \\ 0 & 0 & \mathbf {I} _ {e k} & 0 \end{array} \right]} _ {\mathbf {P} \in \widetilde {\mathbf {B}} _ {2 e k} ^ {(4 e k)}}
+$$
+
+Note that $\mathbf{K}$ , a block diagonal matrix composed of matrices in $(\mathcal{O}\mathcal{B}\mathcal{B})^w$ , is itself in $(\mathcal{O}\mathcal{B}\mathcal{B})^w$ since
+
+$$
+\mathbf {K} = \prod_ {j = 1} ^ {w} \underbrace {\left[ \begin{array}{c c c c} \mathbf {I} _ {e k} & 0 & 0 & 0 \\ 0 & \mathbf {I} _ {e k} & 0 & 0 \\ 0 & 0 & \mathbf {O} _ {j} & 0 \\ 0 & 0 & 0 & \mathbf {I} _ {e k} \end{array} \right]} _ {\mathbf {L} _ {j} \in \widetilde {\mathcal {B}}} \underbrace {\left[ \begin{array}{c c c c} \mathbf {I} _ {e k} & 0 & 0 & 0 \\ 0 & \mathbf {I} _ {e k} & 0 & 0 \\ 0 & 0 & \mathbf {D} _ {j} & 0 \\ 0 & 0 & 0 & 0 \end{array} \right]} _ {\text {D i a g o n a l}} \underbrace {\left[ \begin{array}{c c c c} \mathbf {I} _ {e k} & 0 & 0 & 0 \\ 0 & \mathbf {I} _ {e k} & 0 & 0 \\ 0 & 0 & \mathbf {O} _ {j} ^ {\prime} & 0 \\ 0 & 0 & 0 & \mathbf {I} _ {e k} \end{array} \right]} _ {\mathbf {R} _ {j} \in \widetilde {\mathcal {B}} ^ {*}},
+$$
+
+where each $\mathbf{O}_j$ is a $ek\times ek$ matrix in $\widetilde{\mathcal{B}}$ , and each $\mathbf{O}_j^\prime$ is a $ek\times ek$ matrix in $\widetilde{\mathcal{B}}^*$ . $\mathbf{L}_w$ (the leftmost factor) is a block diagonal matrix composed of $4ek\times ek$ matrices in $\widetilde{\mathcal{B}}$ . Therefore, we can fold $\mathbf{O}$ into this factor (since a butterfly factor in $\widetilde{\mathbf{B}}_{4ek}^{(4ek)}$ was not yet used in $\mathbf{L}_w$ ) to conclude that $\mathbf{OL}_w\in \widetilde{\mathcal{B}}$ . Similarly, since no utterly factor from $\widetilde{\mathbf{B}}_{2ek}^{(4ek)}$ has been used in $\mathbf{R}_1$ , we may fold $\mathbf{P}$ into $\mathbf{R}_1$ to conclude that $\mathbf{R}_1\mathbf{P}\in \widetilde{\mathcal{B}}^*$ . Finally, we address the scalar multiple of $\sqrt{2}$ by multiplying all entries of any diagonal matrix in the decomposition of $\mathbf{K}$ by $\sqrt{2}$ . Hence, we may conclude that $\mathbf{M}_i\in (\mathcal{OB}\mathcal{B})^w$ .
+
+Through repeated application ( $m$ times) of the identity
+
+$$
+\left[ \begin{array}{l l l l} \mathbf {I} & \mathbf {A} _ {1} & 0 & \mathbf {B} _ {1} \\ 0 & \mathbf {I} & 0 & 0 \\ \mathbf {I} & \mathbf {A} _ {2} & 0 & \mathbf {B} _ {2} \\ 0 & \mathbf {I} & 0 & 0 \end{array} \right] \left[ \begin{array}{l l l l} \mathbf {I} & 0 & 0 & \mathbf {C} _ {1} \\ 0 & \mathbf {I} & 0 & 0 \\ \mathbf {I} & 0 & 0 & \mathbf {C} _ {2} \\ 0 & \mathbf {I} & 0 & 0 \end{array} \right] = \left[ \begin{array}{l l l l} \mathbf {I} & \mathbf {A} _ {1} + \mathbf {B} _ {1} & 0 & \mathbf {C} _ {1} \\ 0 & \mathbf {I} & 0 & 0 \\ \mathbf {I} & \mathbf {A} _ {2} + \mathbf {B} _ {2} & 0 & \mathbf {C} _ {1} \\ 0 & \mathbf {I} & 0 & 0 \end{array} \right], \tag {7}
+$$
+
+we see that
+
+$$
+\prod_ {i = 1} ^ {m} \mathbf {M} _ {i} = \underbrace {\left[ \begin{array}{c c c c} \mathbf {I} _ {e k} & \sum_ {i = 2} ^ {m} \mathbf {E} _ {\mathbf {A} _ {i}} & 0 & \mathbf {E} _ {\mathbf {A} _ {1}} \\ 0 & \mathbf {I} _ {e k} & 0 & 0 \\ \mathbf {I} _ {e k} & - \mathbf {E} _ {\mathbf {A} _ {m}} + \sum_ {i = 2} ^ {m - 1} \mathbf {E} _ {\mathbf {A} _ {i}} & 0 & \mathbf {E} _ {\mathbf {A} _ {1}} \\ 0 & \mathbf {I} _ {e k} & 0 & 0 \end{array} \right]} _ {\mathbf {M} \in \mathbb {F} ^ {4 e n \times 4 e n}}.
+$$
+
+Therefore, $\mathbf{M} \in (\mathcal{O}\mathcal{B}\mathcal{B})^{mw}$ . Next, we note that
+
+$$
+\sum_ {i = 1} ^ {m} \mathbf {A} _ {i} = \mathbf {S M} \underbrace {\left[ \begin{array}{l l l l} 0 & \mathbf {I} _ {e k} & 0 & \mathbf {I} _ {e k} \\ \mathbf {I} _ {e k} & 0 & \mathbf {I} _ {e k} & 0 \\ 0 & \mathbf {I} _ {e k} & 0 & - \mathbf {I} _ {e k} \\ \mathbf {I} _ {e k} & 0 & - \mathbf {I} _ {e k} & 0 \end{array} \right]} _ {\mathbf {Q}} \mathbf {S} ^ {T}.
+$$
+
+We would like to show that we can fold $\mathbf{Q}$ into the rightmost $\mathcal{O}\mathcal{B}\mathcal{B}$ factor of $\mathbf{M}$ . The rightmost matrix in the decomposition of $\mathbf{M}$ is $\mathbf{P}$ . Note that
+
+$$
+\mathbf {P Q} = \left[ \begin{array}{c c c c} 0 & \mathbf {I} _ {e k} & 0 & \mathbf {I} _ {e k} \\ \mathbf {I} _ {e k} & 0 & \mathbf {I} _ {e k} & 0 \\ \mathbf {I} _ {e k} & 0 & - \mathbf {I} _ {e k} & 0 \\ 0 & \mathbf {I} _ {e k} & 0 & - \mathbf {I} _ {e k} \end{array} \right] = \sqrt {2} \underbrace {\left[ \begin{array}{c c c c} 0 & \mathbf {I} _ {e k} & 0 & 0 \\ \mathbf {I} _ {e k} & 0 & 0 & 0 \\ 0 & 0 & \mathbf {I} _ {e k} & 0 \\ 0 & 0 & 0 & \mathbf {I} _ {e k} \end{array} \right]} _ {\widetilde {\mathbf {B}} _ {2 e k} ^ {(4 e k)}} \underbrace {\left[ \begin{array}{c c} \frac {1}{\sqrt {2}} \mathbf {I} _ {2 e k} & \frac {1}{\sqrt {2}} \mathbf {I} _ {2 e k} \\ \frac {1}{\sqrt {2}} \mathbf {I} _ {2 e k} & - \frac {1}{\sqrt {2}} \mathbf {I} _ {2 e k} \end{array} \right]} _ {\widetilde {\mathbf {B}} _ {4 e k} ^ {(4 e k)}}.
+$$
+
+Just as earlier, the factor of $\sqrt{2}$ can be multiplied through any diagonal matrix. Also, these two orthogonal butterfly factor matrices can be folded into the rightmost $\mathbf{R}$ matrix (the decomposition of $\mathbf{K}$ above does not use these two, rightmost butterfly factors). Hence, $\sum_{i=1}^{m} \mathbf{A}_i \in (\mathcal{OBB})_{4e}^{mw}$ , as desired.
+
+# K.3.4 ARITHMETIC CIRCUITS
+
+Just as in Theorem 1, we can use the sparsity result in Lemma K.10 to place matrices with low-depth (linear) arithmetic circuits for matrix vector multiplication in the $OBB$ hierarchy.
+
+Corollary K.12. Let $\mathbf{M}$ be an $n\times n$ matrix such that matrix-vector multiplication of $\mathbf{M}$ times an arbitrary vector $\mathbf{v}$ can be represented as a linear arithmetic circuit $C$ comprised of $s$ gates (including inputs) and having depth $d$ . Then, $\mathbf{M}\in (\mathcal{O}\mathcal{B}\mathcal{B})_{O(\frac{s}{n})}^{O(d)}$ .
+
+Proof. We use the construction given in the proof of Theorem 1. Corollaries K.9 and K.4 allow us to recover the same width and expansion factor with the $OBB$ hierarchy. $\square$
+
+# L RELU NETWORK WITH STRUCTURED WEIGHT MATRICES
+
+We show that for any neural network with ReLU nonlinearities and whose weight matrices have arithmetic circuits with few gates, its linear network counterpart (obtained by removing all the ReLU's) also has an arithmetic circuit with not too many more gates. This implies that in trying to find the smallest arithmetic circuit augmented with ReLU gates to represent a ReLU network, one might as well try to find the smallest arithmetic circuits that represent the matrix-vector multiplication of each weight matrix.
+
+Proposition 2. Consider a neural network architecture consisting of $L$ layers with weight matrices $\mathbf{W}_1, \ldots, \mathbf{W}_L \in \mathbb{F}^{n \times n}$ and ReLU nonlinearity in between.
+
+Suppose that matrix-vector multiplication of $\mathbf{W}_i$ times an arbitrary vector $\mathbf{v}$ can be represented as a linear arithmetic circuit with $s_i$ gates (including inputs). Then there exists an arithmetic circuit augmented with ReLU gates with $\sum_{i=1}^{L} s_i + Ln$ total gates that computes the output $\mathrm{ReLU}(\mathbf{W}_L(\ldots \mathrm{ReLU}(\mathbf{W}_1\mathbf{v})))$ of the network for an arbitrary input vector $\mathbf{v}$ .
+
+Conversely, if there is an arithmetic circuit augmented with $ReLU$ gates with $s$ total gates that computes all the activations of the network $\mathrm{ReLU}(\mathbf{W}_1\mathbf{v}),\ldots ,\mathrm{ReLU}(\mathbf{W}_L\dots \mathrm{ReLU}(\mathbf{W}_1\mathbf{v}))$ for an arbitrary input $\mathbf{v}$ , then there exists an arithmetic circuit augmented with $ReLU$ gates with $2s + 2Lm$ total gates that computes the activations of the network without $ReLU\mathbf{W}_1\mathbf{v},\ldots ,\mathbf{W}_L\dots \mathbf{W}_1\mathbf{v}$ .
+
+Proof of Proposition 2. To compute the output of the network $\mathrm{ReLU}(\mathbf{W}_L(\dots \mathrm{ReLU}(\mathbf{W}_1\mathbf{v})))$ , we first compute the matrix-vector product $\mathbf{W}_1\mathbf{v}$ with an arithmetic circuit of $s_1$ gates by assumption, and use $n$ other ReLU gates to compute the pointwise ReLU. Then we repeat the process for layer $2,3,\ldots ,L$ , using the arithmetic circuits of $\mathbf{W}_1,\ldots ,\mathbf{W}_L$ and $Ln$ additional gates for ReLU. In total we obtain an arithmetic circuit augmented with ReLU gates with $\sum_{i = 1}^{L}s_{i} + Ln$ total gates.
+
+Conversely, to build an arithmetic circuit augmented with ReLU gates to compute $\mathbf{W}_1\mathbf{v},\ldots ,\mathbf{W}_L\dots \mathbf{W}_1\mathbf{v}$ , we pass $\mathbf{v}$ and then $-\mathbf{v}$ through the circuit that computes $\mathrm{ReLU}(\mathbf{W}_1\mathbf{x})$ for an arbitrary $\mathbf{x}$ to get $\mathrm{ReLU}(\mathbf{W}_1\mathbf{v})$ and $\mathrm{ReLU}(-\mathbf{W}_1\mathbf{v})$ . Noting that $x = \mathrm{ReLU}(x) - \mathrm{ReLU}(-x)$ , we can use $n$ additional gates to compute $\mathbf{W}_1\mathbf{v}$ from $\mathrm{ReLU}(\mathbf{W}_1\mathbf{v})$ and $\mathrm{ReLU}(-\mathbf{W}_1\mathbf{v})$ .
+
+Repeat the process for layer 2, 3, ..., $L$ (for example, pass $\mathbf{W}_1\mathbf{v}$ and $-\mathbf{W}_1\mathbf{v}$ to the circuit that computes $\mathbf{W}_2\mathbf{x}$ for an arbitrary $\mathbf{x}$ on layer 2). Overall we need to double the circuits that compute all the activations of the network $\mathrm{ReLU}(\mathbf{W}_1\mathbf{v}), \ldots, \mathrm{ReLU}(\mathbf{W}_L \ldots \mathrm{ReLU}(\mathbf{W}_1\mathbf{v}))$ , requiring $2s$ gates. We also need $n$ additional gates per layer to compute the negation of the input to that layer (e.g. computing $-\mathbf{v}$ from $\mathbf{v}$ ), and $n$ additional gates per layer to subtract the output of the ReLU circuit (e.g. computing $\mathbf{W}_1\mathbf{v}$ from $\mathrm{ReLU}(\mathbf{W}_1\mathbf{v})$ and $\mathrm{ReLU}(-\mathbf{W}_1\mathbf{v})$ ). Therefore we can construct an arithmetic circuit augmented with ReLU gates with $2s + 2L$ total gates that computes the activations of the network without $\mathrm{ReLU}(\mathbf{W}_1\mathbf{v}, \ldots, \mathbf{W}_L \ldots \mathbf{W}_1\mathbf{v}$ .
+
+We now prove an asymptotic bound on the VC dimension of a ReLU network whose weight matrices are kaleidoscope matrices with bounded width and expansion.
+
+Proposition 3. Let $\mathcal{F}$ be the class of ReLU neural networks consisting of $L$ layers, where each layer is a $K$ -matrix with width and expansion bounded by some constant $C$ . Suppose that the network has $W$ total parameters. Let $\operatorname{sign} \mathcal{F}$ denote the corresponding classification functions: $\{x \mapsto \operatorname{sign} f(x) : f \in \mathcal{F}\}$ . Then this class has VC dimension:
+
+$$
+\operatorname {V C d i m} (\operatorname {s i g n} \mathcal {F}) = O (L W \log W).
+$$
+
+We leverage the result from Thomas et al. (2018) for the case where the entries of the weight matrices interact multiplicatively, but with polynomially bounded degrees. This proof is similar to the VC bound for ReLU networks whose weight matrices are butterfly matrices (Dao et al., 2019).
+
+Proof. To use Theorem 3 of Thomas et al. (2018), we simply need to check that the entries of the linear layer, as polynomials of the parameters, has degree at most $c_{1}m_{l}^{c_{2}}$ for some universal constant $c_{1}, c_{2} > 0$ , where $m_{l}$ is the size of output of the $l$ -th layer. If the network weight matrices are K-matrices with bounded width and expansion, each weight matrix is a product of at most $c_{3}\log m_{l}$ sparse factors, for some universal constant $c_{3} > 0$ . This means that the degree is polynomially bounded, which satisfies the condition of the theorem. Therefore the VC dimension is bounded to be almost linear in the number of parameters:
+
+$$
+\operatorname {V C d i m} (\operatorname {s i g n} \mathcal {F}) = O (L W \log W).
+$$
+
+
+
+# M ARITHMETIC CIRCUIT PRIMER
+
+We give a quick overview of arithmetic circuits. This is a model of computation that has been studied for numerous computational problems (and is the basic model for algebraic complexity theory). For our purposes, we will exclusively focus on arithmetic circuits for the matrix-vector multiplication problem. For a more detailed exposition, the reader is referred to the standard book on this topic (Bürgisser et al., 2013).
+
+Definition M.1 (Arithmetic Circuits). An arithmetic circuit that computes $\mathbf{y} = \mathbf{A}\mathbf{x}$ (for $\mathbf{A} \in \mathbb{F}^{m \times n}$ ) has $n$ input gates (corresponding to $\mathbf{x}[0], \ldots, \mathbf{x}[n-1]$ ) and $m$ output gates (corresponding to $\mathbf{y}[0], \ldots, \mathbf{y}[m-1]$ ). All the internal gates correspond to addition, subtraction, multiplication and division $^{13}$ over the underlying field $\mathbb{F}$ . The circuit is also allowed to use constants from $\mathbb{F}$ for 'free.' The definition of the internal gates can depend on $\mathbf{A}$ (as well as $\mathbf{x}$ of course). In other words, one can 'bake' the knowledge about $\mathbf{A}$ into the circuit.
+
+The size $s$ of a circuit is $n$ plus the number of addition, multiplication, subtraction and division gates used in the circuit. The depth $d$ of a circuit is the minimum number of layers such that all gates in a given layer take as its input gates from previous layers.[14]
+
+One drawback of arithmetic circuits (especially for infinite fields e.g. $\mathbb{F} = \mathbb{R}$ , which is our preferred choice in this work) is that they assume operations over $\mathbb{F}$ can be performed exactly. In particular, it ignores precision issues involved with real arithmetic. Nonetheless, this model turns out to be a very useful model in reasoning about the complexity of doing matrix-vector multiplication for any family of matrices.
+
+Perhaps the strongest argument in support of arithmetic circuits is that a large (if not an overwhelming) majority of matrix-vector multiplication algorithm also imply an arithmetic circuit of size comparable to the runtime of the algorithm (and the depth of the circuit roughly corresponds to the time taken to compute it by a parallel algorithm). For example consider the obvious algorithm to compute $\mathbf{A}\mathbf{x}$ (i.e. for each $i\in [m]$ , compute $\mathbf{y}[i]$ as the sum $\sum_{i = 0}^{n - 1}\mathbf{A}[i,j]\mathbf{x}[j]$ ). It is easy to see that this algorithm implies an arithmetic circuit of size $O(nm)$ and depth $O(\log n)$ .15
+
+One thing to note about the arithmetic circuit above is that all the multiplications involve at least one input that is a constant from $\mathbb{F}$ (recall that we can assume that the entries of $\mathbf{A}$ are constants that can be used to build the circuit). This leads to the following important sub-class of arithmetic circuits:
+
+Definition M.2 (Linear Arithmetic Circuits). An arithmetic circuit is called a linear arithmetic circuit if it only uses addition, subtraction and multiplication. Further, every multiplication has a fixed constant from $\mathbb{F}$ as at least one of its two inputs. In other words, all gates in the circuit are linear functions of their inputs (i.e. of the form $ax + by$ for fixed constants $a, b \in \mathbb{F}$ ).
+
+Intuitively for the matrix-vector multiplication, it makes sense to consider linear arithmetic circuits since the final function we want to compute $\mathbf{A}\mathbf{x}$ is indeed a linear function of its inputs. For infinite fields (e.g. $\mathbb{F} = \mathbb{R}$ or $\mathbb{F} = \mathbb{C}$ ), it turns out that this is essentially without loss of generality:
+
+Theorem 4 ((Bürgisser et al., 2013)). Let $\mathbb{F}$ be an infinite field. Any (general) arithmetic circuit to compute $\mathbf{A}\mathbf{x}$ over $\mathbb{F}$ of size $s$ and depth $d$ can be converted into a linear arithmetic circuit of size $O(s)$ and depth $O(d)$ .
+
+The above result implies that for asymptotic considerations, linear arithmetic circuits for matrix-vector multiplication are equivalent to general arithmetic circuits. $^{16}$
+
+One important property of linear arithmetic circuits of depth $d$ , which we will use in our arguments, is that such a circuit can be equivalently represented as product of $d$ sparse matrices (see the proof of Theorem 1 for the precise derivation $^{17}$ ).
+
+As mentioned earlier, a vast majority of efficient matrix vector multiplication algorithms are equivalent to small (both in size and depth) linear arithmetic circuit. For example the FFT can be thought of as an efficient arithmetic circuit to compute the Discrete Fourier Transform (indeed when one converts the linear arithmetic circuit for FFT into a matrix decomposition,[18] then each matrix in the decomposition is a butterfly factor, with each block matrix in each factor being the same). For an illustration of this consider the DFT with $n = 4$ as illustrated in Figure 11.
+
+
+Figure 11: DFT of order 4.
+
+Figure 12 represent the arithmetic circuit corresponding to FFT with $n = 4$ .
+
+
+Figure 12: Arithmetic circuit for 4-DFT from Figure 11.
+
+Finally, Figure 13 is representation of the arithmetic circuit of Figure 12 as a product of a butterfly matrix and (the bit-reversal) permutation. We note that our generic arithmetic circuit to decomposition into $\mathcal{BB}^*$ is not as tight as in Figure 13.
+
+
+Figure 13: Decomposition of DFT of Figure 11 via the arithmetic circuit of Figure 12.
+
+One reason for the vast majority of existing efficient matrix vector algorithms leading to (linear) arithmetic circuits is that they generally are divide and conquer algorithms that use polynomial operations such as polynomial multiplication or evaluation (both of which themselves are divide and conquer algorithms that use FFT as a blackbox) or polynomial addition. Each of these pieces are well known to have small (depth and size) linear arithmetic circuits (since FFT has these properties). Finally, the divide and conquer structure of the algorithms leads to the circuit being of low depth. See the book of Pan (Pan, 2001) for a more elaborate description of this connection.
+
+In fact, the recent work of De Sa et al. (De Sa et al., 2018) makes this fact explicit and presents the most general known structure on matrices that imply near-linear size linear arithmetic circuits for the corresponding matrix vector multiplication. Their work combines two separate classes of structures matrices- orthogonal polynomial transforms (Driscoll et al., 1997; Szegö, 1967) as well as matrices with low displacement rank (Kailath et al., 1979; Olshevsky & Shokrollahi, 2000)- and presents a linear class of linear arithmetic circuits to solve their matrix vector multiplication problem. We note that structured matrices with low displacement rank have been used to replace fully connected layers in some neural network architectures (Sainath et al., 2013; Thomas et al., 2018).
\ No newline at end of file
diff --git a/kaleidoscopeanefficientlearnablerepresentationforallstructuredlinearmaps/images.zip b/kaleidoscopeanefficientlearnablerepresentationforallstructuredlinearmaps/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..1102a461679d1fa09a08ced7b57d221f1e648613
--- /dev/null
+++ b/kaleidoscopeanefficientlearnablerepresentationforallstructuredlinearmaps/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f36b1bdf34577e6ee78cd9dec28a7b3bd9337bb7f59aa8d483581e82a4f159cf
+size 1223476
diff --git a/kaleidoscopeanefficientlearnablerepresentationforallstructuredlinearmaps/layout.json b/kaleidoscopeanefficientlearnablerepresentationforallstructuredlinearmaps/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..c7b585aa100f6aea3077b5a08d1ac8280ae13de4
--- /dev/null
+++ b/kaleidoscopeanefficientlearnablerepresentationforallstructuredlinearmaps/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c1d0929b4911dd2ea156a86ffc4a0756ef124b296b4e58e2081a8458318e0ef9
+size 2340152
diff --git a/kernelizedwassersteinnaturalgradient/9b9acc7b-0fdc-4c48-9e10-0015882fbce8_content_list.json b/kernelizedwassersteinnaturalgradient/9b9acc7b-0fdc-4c48-9e10-0015882fbce8_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..c79319cb58b38c3f1cc30065b7f0334a72e029d0
--- /dev/null
+++ b/kernelizedwassersteinnaturalgradient/9b9acc7b-0fdc-4c48-9e10-0015882fbce8_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0775043d7b6343d2f0d49cf7645aff23d5957ea120023d4948b54c740d680e2e
+size 244601
diff --git a/kernelizedwassersteinnaturalgradient/9b9acc7b-0fdc-4c48-9e10-0015882fbce8_model.json b/kernelizedwassersteinnaturalgradient/9b9acc7b-0fdc-4c48-9e10-0015882fbce8_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..8ee2419037582eb0364948c5940b83bc6fd49339
--- /dev/null
+++ b/kernelizedwassersteinnaturalgradient/9b9acc7b-0fdc-4c48-9e10-0015882fbce8_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e2afdfcc01c6a2e812e168b2ac5e3e6146f7a9774db7eb5b1753661836c1b644
+size 279622
diff --git a/kernelizedwassersteinnaturalgradient/9b9acc7b-0fdc-4c48-9e10-0015882fbce8_origin.pdf b/kernelizedwassersteinnaturalgradient/9b9acc7b-0fdc-4c48-9e10-0015882fbce8_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..3f6c3079f84455d4a781bfa3be70181dd0e9f5d4
--- /dev/null
+++ b/kernelizedwassersteinnaturalgradient/9b9acc7b-0fdc-4c48-9e10-0015882fbce8_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:5068179c9d4b0dbcb9021ce180fba6152d7d090bd5630df2811fba7a0b433a82
+size 1236615
diff --git a/kernelizedwassersteinnaturalgradient/full.md b/kernelizedwassersteinnaturalgradient/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..f772474006907a2c55a3fd953db49cc5545af11f
--- /dev/null
+++ b/kernelizedwassersteinnaturalgradient/full.md
@@ -0,0 +1,1333 @@
+# KERNELIZED WASSERSTEIN NATURAL GRADIENT
+
+Michael Arbel, Arthur Gretton
+
+Gatsby Computational Neuroscience Unit
+
+University College London
+
+{michael.n.arbel,arthur.gretton}@gmail.com
+
+Wuchen Li
+
+University of California, Los Angeles
+
+wcli@math.ucla.edu
+
+Guido Montúfar
+
+University of California, Los Angeles, and Max Planck Institute for Mathematics in the Sciences
+
+montufar@mis.mpg.de
+
+# ABSTRACT
+
+Many machine learning problems can be expressed as the optimization of some cost functional over a parametric family of probability distributions. It is often beneficial to solve such optimization problems using natural gradient methods. These methods are invariant to the parametrization of the family, and thus can yield more effective optimization. Unfortunately, computing the natural gradient is challenging as it requires inverting a high dimensional matrix at each iteration. We propose a general framework to approximate the natural gradient for the Wasserstein metric, by leveraging a dual formulation of the metric restricted to a Reproducing Kernel Hilbert Space. Our approach leads to an estimator for gradient direction that can trade-off accuracy and computational cost, with theoretical guarantees. We verify its accuracy on simple examples, and show the advantage of using such an estimator in classification tasks on Cifar10 and Cifar100 empirically.
+
+# 1 INTRODUCTION
+
+The success of machine learning algorithms relies on the quality of an underlying optimization method. Many of the current state-of-the-art methods rely on variants of Stochastic Gradient Descent (SGD) such as AdaGrad (Duchi et al., 2011), RMSProp (Hinton et al., 2012), and Adam (Kingma and Ba, 2014). While generally effective, the performance of such methods remains sensitive to the curvature of the optimization objective. When the Hessian matrix of the objective at the optimum has a large condition number, the problem is said to have a pathological curvature (Martens, 2010; Sutskever et al., 2013). In this case, the first-order optimization methods tend to have poor performance. Using adaptive step sizes can help when the principal directions of curvature are aligned with the coordinates of the vector parameters. Otherwise, an additional rotation of the basis is needed to achieve this alignment. One strategy is to find an alternative parametrization of the same model that has a better-behaved curvature and is thus easier to optimize with standard first-order optimization methods. Designing good network architectures (Simonyan and Zisserman, 2014; He et al., 2015) along with normalization techniques (LeCun et al., 2012; Ioffe and Szegedy, 2015; Salimans and Kingma, 2016) is often critical for the success of such optimization methods.
+
+The natural gradient method (Amari, 1998) takes a related but different perspective. Rather than reparametrizing the model, the natural gradient method tries to make the optimizer itself invariant to reparameterizations by directly operating on the manifold of probability distributions. This requires endowing the parameter space with a suitable notion of proximity formalized by a metric. An important metric in this context is the Fisher information metric (Fisher and Russell, 1922; Rao, 1992), which induces the Fisher-Rao natural gradient (Amari, 1985). Another important metric in probability space is the Wasserstein metric (Villani, 2009; Otto, 2001), which induces the Wasserstein natural gradient (Li and Montufar, 2018a;b; Li, 2018); see similar formulations in Gaussian families (Malagò et al., 2018; Modin, 2017). In spite of their numerous theoretical advantages, applying natural gradient methods is challenging in practice. Indeed, each parameter update requires inverting the metric tensor. This becomes infeasible for current deep learning models, which typically have millions of parameters. This has motivated research into finding efficient algorithms to estimate the natural gradient (Martens and Grosse, 2015; Grosse and Martens, 2016; George et al., 2018;
+
+Heskes, 2000; Bernacchia et al., 2018). Such algorithms often address the case of the Fisher metric and either exploit a particular structure of the parametric family or rely on a low rank decomposition of the information matrix. Recently, Li et al. (2019) proposed to estimate the metric based on a dual formulation and used this estimate in a proximal method. While this avoids explicitly computing the natural gradient, the proximal method also introduces an additional optimization problem to be solved at each update of the model's parameters. The quality of the solver will thus depend on the accuracy of this additional optimization.
+
+In this paper, we use the dual formulation of the metric to directly obtain a closed form expression of the natural gradient as a solution to a convex functional optimization problem. We focus on the Wasserstein metric as it has the advantage of being well defined even when the model doesn't admit a density. The expression remains valid for general metrics including the Fisher-Rao metric. We leverage recent work on Kernel methods (Sriperumbudur et al., 2017; Arbel and Gretton, 2017; Sutherland et al., 2017; Mroueh et al., 2019) to compute an estimate of the natural gradient by restricting the functional space appearing in the dual formulation to a Reproducing Kernel Hilbert Space. We demonstrate empirically the accuracy of our estimator on toy examples, and show how it can be effectively used to approximate the trajectory of the natural gradient descent algorithm. We also analyze the effect of the dimensionality of the model on the accuracy of the proposed estimator. Finally, we illustrate the benefits of our proposed estimator for solving classification problems when the model has an ill-conditioned parametrization.
+
+The paper is organized as follows. In Section 2, after a brief description of natural gradients, we discuss Legendre duality of metrics, and provide details on the Wasserstein natural gradient. In Section 3, we present our kernel estimator of the natural gradient. In Section 4 we present experiments to evaluate the accuracy of the proposed estimator and demonstrate its effectiveness in supervised learning tasks.
+
+# 2 NATURAL GRADIENT DESCENT
+
+We first briefly recall the natural gradient descent method in Section 2.1, and its relation to metrics on probability distribution spaces in Section 2.2. We next present Legendre dual formulations for metrics in Section 2.3 where we highlight the Fisher-Rao and Wasserstein metrics as important examples.
+
+# 2.1 GENERAL FORMULATION
+
+It is often possible to formulate learning problems as the minimization of some cost functional $\rho \mapsto \mathcal{F}(\rho)$ over probability distributions $\rho$ from a parametric model $\mathcal{P}_{\Theta}$ . The set $\mathcal{P}_{\Theta}$ contains probability distributions defined on an open sample space $\Omega \subset \mathbb{R}^d$ and parametrized by some vector $\theta \in \Theta$ , where $\Theta$ is an open subset of $\mathbb{R}^q$ . The learning problem can thus be formalized as finding an optimal value $\theta^*$ that locally minimizes a loss function $\mathcal{L}(\theta) \coloneqq \mathcal{F}(\rho_{\theta})$ defined over the parameter space $\Theta$ . One convenient way to solve this problem approximately is by gradient descent, which uses the Euclidean gradient of $\mathcal{L}$ w.r.t. the parameter vector $\theta$ to produce a sequence of updates $\theta_t$ according to the following rule:
+
+$$
+\theta_ {t + 1} = \theta_ {t} - \gamma_ {t} \nabla \mathcal {L} (\theta_ {t}).
+$$
+
+Here the step-size $\gamma_{t}$ is a positive real number. The Euclidean gradient can be viewed as the direction in parameter space that leads to the highest decrease of some linear model $\mathcal{M}_t$ of the cost function $\mathcal{L}$ per unit of change of the parameter. More precisely, the Euclidean gradient is obtained as the solution of the optimization problem:
+
+$$
+\nabla \mathcal {L} \left(\theta_ {t}\right) = - \underset {u \in \mathbb {R} ^ {q}} {\operatorname {a r g m i n}} \mathcal {M} _ {t} (u) + \frac {1}{2} \| u \| ^ {2}. \tag {1}
+$$
+
+The linear model $\mathcal{M}_t$ is an approximation of the cost function $\mathcal{L}$ in the neighborhood of $\theta_t$ and is simply obtained by a first order expansion: $\mathcal{M}_t(u) = \mathcal{L}(\theta_t) + \nabla \mathcal{L}(\theta_t)^\top u$ . The quadratic term $\|u\|^2$ penalizes the change in the parameter and ensures that the solution remains in the neighborhood where the linear model is still a good approximation of the cost function.
+
+This particular choice of quadratic term is what defines the Euclidean gradient descent algorithm, which can often be efficiently implemented for neural network models using back-propagation. The performance of this algorithm is highly dependent on the parametrization of the model $\mathcal{P}_{\Theta}$ , however (Martens, 2010; Sutskever et al., 2013). To obtain an algorithm that is robust to parametrization, one can take advantage of the structure of the cost function $\mathcal{L}(\theta)$ which is obtained as the composition of the functional $\mathcal{F}$ and the model $\theta \mapsto \rho_{\theta}$ and define a generalized natural gradient (Amari and Cichocki, 2010). We first provide
+
+a conceptual description of the general approach to obtain such gradient. The starting point is to choose a divergence $D$ between probability distributions and use it as a new penalization term:
+
+$$
+- \operatorname * {a r g m i n} _ {u \in \mathbb {R} ^ {q}} \mathcal {M} _ {t} (u) + \frac {1}{2} D \left(\rho_ {\theta_ {t}}, \rho_ {\theta_ {t} + u}\right). \tag {2}
+$$
+
+Here, changes in the model are penalized directly in probability space rather than parameter space as in (1). In the limit of small $u$ , the penalization term can be replaced by a quadratic term $u^{\top}G_{D}(\theta)u$ where $G_{D}(\theta)$ contains second order information about the model as measured by $D$ . This leads to the following expression for the generalized natural gradient $\nabla^{D}\mathcal{L}(\theta_{t})$ where the dependence in $D$ is made explicit:
+
+$$
+\nabla^ {D} \mathcal {L} (\theta_ {t}) := - \underset {u \in \mathbb {R} ^ {q}} {\operatorname {a r g m i n}} \mathcal {M} _ {t} (u) + \frac {1}{2} u ^ {\top} G _ {D} (\theta_ {t}) u. \tag {3}
+$$
+
+From (3), it is possible to express the generalized natural gradient by means of the Euclidean gradient: $\nabla^{D}\mathcal{L}(\theta_{t}) = G_{D}(\theta_{t})^{-1}\nabla \mathcal{L}(\theta_{t})$ . The parameter updates are then obtained by the new update rule:
+
+$$
+\theta_ {t + 1} = \theta_ {t} - \gamma_ {t} G _ {D} \left(\theta_ {t}\right) ^ {- 1} \nabla \mathcal {L} \left(\theta_ {t}\right). \tag {4}
+$$
+
+Equation (4) leads to a descent algorithm which is invariant to parametrization in the continuous-time limit:
+
+Proposition 1. Let $\Psi$ be an invertible and smoothly differentiable re-parametrization $\psi = \Psi(\theta)$ and denote by $\bar{\mathcal{L}}(\psi) \coloneqq \mathcal{L}(\Psi^{-1}(\psi))$ . Consider the continuous-time natural gradient flows:
+
+$$
+\dot {\theta} _ {s} = - \nabla_ {\theta} ^ {D} \mathcal {L} (\theta_ {s}), \qquad \dot {\psi} _ {s} = - \nabla_ {\psi} ^ {D} \bar {\mathcal {L}} (\psi_ {s}), \qquad \psi_ {0} = \Psi (\theta_ {0})
+$$
+
+Then $\psi_s$ and $\theta_s$ are related by the equation $\psi_s = \Psi(\theta_s)$ at all times $s \geq 0$ .
+
+This result implies that an ill-conditioned parametrization of the model has little effect on the optimization when (4) is used. It is a consequence of the transformation properties of the natural gradient by change of parametrization: $\nabla_{\psi}^{D}\bar{\mathcal{L}} (\psi) = \nabla_{\theta}\Psi (\theta)\nabla_{\theta}^{D}\mathcal{L}(\theta)$ which holds in general for any covariant gradient. We provide a proof of Proposition 1 in Appendix C.1 in the particular case when $D$ is either Kullback-Leibler divergence $F$ , or the squared Wasserstein-2 distance $W$ using notions introduced later in Section 2.3 and refer to Ollivier et al. (2011) for a detailed discussion.
+
+The approach based on (2) for defining the generalized natural gradient is purely conceptual and can be formalized using the notion of metric tensor from differential geometry which allows for more generality. In Section 2.2, we provide such formal definition in the case when $D$ is either the Kullback-Leibler divergence $F$ , or the squared Wasserstein-2 distance $W$ .
+
+# 2.2 INFORMATION MATRIX VIA DIFFERENTIAL GEOMETRY
+
+When $D$ is the Kullback-Leibler divergence or relative entropy $F$ , then (3) defines the Fisher-Rao natural gradient $\nabla^{F}\mathcal{L}(\theta)$ (Amari, 1985) and $G_{F}(\theta)$ is called the Fisher information matrix. $G_{F}(\theta)$ is well defined when the probability distributions in $\mathcal{P}_{\Theta}$ all have positive densities, and when some additional differentiability and integrability assumptions on $\rho_{\theta}$ are satisfied. In fact, it has an interpretation in Riemannian geometry as the pull-back of a metric tensor $g^{F}$ defined over the set of probability distributions with positive densities and known as the Fisher-Rao metric (see Definition 4 in Appendix B.1; see also Holbrook et al. 2017):
+
+Definition 1 (Fisher information matrix). Assume $\theta \mapsto \rho_{\theta}(x)$ is differentiable for all $x$ on $\Omega$ and that $\int \frac{\|\nabla\rho_{\theta}(x)\|^2}{\rho_{\theta}(x)}\mathrm{d}x < \infty$ . Then the Fisher information matrix is defined as the pull-back of the Fisher-Rao metric $g^{F}$ :
+
+$$
+G _ {F} (\theta) _ {i j} = g _ {\rho_ {\theta}} ^ {F} \left(\partial_ {i} \rho_ {\theta}, \partial_ {j} \rho_ {\theta}\right) := \int f _ {i} (x) f _ {j} (x) \rho_ {\theta} (x) d x,
+$$
+
+where the functions $f_{i}$ on $\Omega$ are given by: $f_{i} = \frac{\partial_{i}\rho_{\theta}}{\rho_{\theta}}$ .
+
+Definition 1 directly introduces $G_{F}$ using the Fisher-Rao metric tensor which captures the infinitesimal behavior of the KL. This approach can be extended to any metric tensor $g$ defined on a suitable space of probability distributions containing $\mathcal{P}_{\Theta}$ . In particular, when $D$ is the Wasserstein-2, the Wasserstein information matrix is obtained directly by means of the Wasserstein-2 metric tensor $g^{W}$ (Otto and Villani, 2000; Lafferty and Wasserman, 2008) as proposed in Li and Montufar (2018a); Chen and Li (2018):
+
+Definition 2 (Wasserstein information matrix). The Wasserstein information matrix (WIM) is defined as the pull-back of the Wasserstein 2 metric $g^{W}$ :
+
+$$
+G _ {W} (\theta) _ {i j} = g _ {\rho_ {\theta}} ^ {W} \left(\partial_ {i} \rho_ {\theta}, \partial_ {j} \rho_ {\theta}\right) := \int \phi_ {i} (x) ^ {\top} \phi_ {j} (x) \mathrm {d} \rho_ {\theta} (x),
+$$
+
+where $\phi_{i}$ are vector valued functions on $\Omega$ that are solutions to the partial differential equations with Neumann boundary condition:
+
+$$
+\partial_ {i} \rho_ {\theta} = - d i v \left(\rho_ {\theta} \phi_ {i}\right), \quad \forall 1 \leq i \leq q.
+$$
+
+Moreover, $\phi_{i}$ are required to be in the closure of the set of gradients of smooth and compactly supported functions in $L_{2}(\rho_{\theta})^{d}$ . In particular, when $\rho_{\theta}$ has a density, $\phi_{i} = \nabla_{x}f_{i}$ , for some real valued function $f_{i}$ on $\Omega$ .
+
+The partial derivatives $\partial_i\rho_\theta$ should be understood in distribution sense, as discussed in more detail in Section 2.3. This allows to define the Wasserstein natural gradient even when the model $\rho_{\theta}$ does not admit a density. Moreover, it allows for more generality than the conceptual approach based on (2) which would require performing a first order expansion of the Wasserstein distance in terms of its linearized version known as the Negative Sobolev distance. We provide more discussion of those two approaches and their differences in Appendix B.3. From now on, we will focus on the above two cases of the natural gradient $\nabla^D\mathcal{L}(\theta)$ , namely $\nabla^{F}\mathcal{L}(\theta)$ and $\nabla^{W}\mathcal{L}(\theta)$ . When the dimension of the parameter space is high, directly using equation (4) becomes impractical as it requires storing and inverting the matrix $G(\theta)$ . In Section 2.3 we will see how equation (3) can be exploited along with Legendre duality to get an expression for the natural gradient that can be efficiently approximated using kernel methods.
+
+# 2.3 LEGENDRE DUALITY FOR METRICS
+
+In this section we provide an expression for the natural gradient defined in (3) as the solution of a saddle-point optimization problem. It exploits Legendre duality for metrics to express the quadratic term $u^{\top}G(\theta)u$ as a solution to a functional optimization problem over $C_c^\infty (\Omega)$ , the set of smooth and compactly supported functions on $\Omega$ . The starting point is to extend the notion of gradient $\nabla \rho_{\theta}$ which appears in Definitions 1 and 2 to the distributional sense of Definition 3 below.
+
+Definition 3. Given a parametric family $\mathcal{P}_{\Theta}$ of probability distributions, we say that $\rho_{\theta}$ admits a distributional gradient at point $\theta$ if there exists a linear continuous map $\nabla \rho_{\theta}:C_c^{\infty}(\Omega)\to \mathbb{R}^q$ such that:
+
+$$
+\int f (x) \mathrm {d} \rho_ {\theta + \epsilon u} (x) - \int f (x) \mathrm {d} \rho_ {\theta} (x) = \epsilon \nabla \rho_ {\theta} (f) ^ {\top} u + \epsilon \delta (\epsilon , f, u) \quad \forall f \in C _ {c} ^ {\infty} (\Omega), \quad \forall u \in \mathbb {R} ^ {q}
+$$
+
+where $\delta (\epsilon ,f,u)$ depends on $f$ and $u$ and converges to 0 as $\epsilon$ approaches 0. $\nabla \rho_{\theta}$ is called the distributional gradient of $\rho_{\theta}$ at point $\theta$ .
+
+When the distributions in $\mathcal{P}_{\Theta}$ have a density, written $x \mapsto \rho_{\theta}(x)$ by abuse of notation, that is differentiable w.r.t. $\theta$ and with a jointly continuous gradient in $\theta$ and $x$ then $\nabla \rho_{\theta}(f)$ is simply given by $\int f(x) \nabla_{\theta} \rho_{\theta}(x) \mathrm{d}x$ as shown in Proposition 12 of Appendix C.1. In this case, the Fisher-Rao natural gradient admits a formulation as a saddle point solution involving $\nabla \rho_{\theta}$ and provided in Proposition 2 with a proof in Appendix C.1.
+
+Proposition 2. Under the same assumptions as in Definition 1, the Fisher information matrix admits the dual formulation:
+
+$$
+\frac {1}{2} u ^ {\top} G _ {F} (\theta) u := \sup _ { \begin{array}{c} f \in C _ {c} ^ {\infty} (\Omega) \\ \int f (x) \mathrm {d} \rho_ {\theta} (x) = 0 \end{array} } \nabla \rho_ {\theta} (f) ^ {\top} u - \frac {1}{2} \int f (x) ^ {2} \mathrm {d} \rho_ {\theta} (x) \mathrm {d} x. \tag {5}
+$$
+
+Moreover, defining $\mathcal{U}_{\theta}(f) \coloneqq \nabla \mathcal{L}(\theta) + \nabla \rho_{\theta}(f)$ , the Fisher-Rao natural gradient satisfies:
+
+$$
+\nabla^{F}\mathcal{L}(\theta) = -\operatorname *{argmin}_{u\in \mathbb{R}^{q}}\sup_{\substack{f\in C_{c}^{\infty}(\Omega)\\ \int f(x)\mathrm{d}\rho_{\theta}(x) = 0}}\mathcal{U}_{\theta}(f)^{\top}u - \frac{1}{2}\int f(x)^{2}\mathrm{d}\rho_{\theta}(x)\mathrm{d}x,
+$$
+
+Another important case is when $\mathcal{P}_{\Theta}$ is defined as an implicit model. In this case, any sample $x$ from a distribution $\rho_{\theta}$ in $\mathcal{P}_{\Theta}$ is obtained as $x = h_{\theta}(z)$ , where $z$ is a sample from a fixed latent distribution $\nu$
+
+defined over a latent space $\mathcal{Z}$ and $(\theta, z) \mapsto h_{\theta}(z)$ is a deterministic function with values in $\Omega$ . This can be written in a more compact way as the push-forward of $\nu$ by the function $h_{\theta}$ :
+
+$$
+\mathcal {P} _ {\Theta} := \left\{\rho_ {\theta} := \left(h _ {\theta}\right) _ {\#} \nu \mid \theta \in \Omega \right\}. \tag {6}
+$$
+
+A different expression for $\nabla \rho_{\theta}$ is obtained in the case of implicit models when $\theta \mapsto h_{\theta}(z)$ is differentiable for $\nu$ -almost all $z$ and $\nabla h_{\theta}$ is square integrable under $\nu$ :
+
+$$
+\nabla \rho_ {\theta} (f) = \int \nabla h _ {\theta} (z) ^ {\top} \nabla_ {x} f (h _ {\theta} (z)) \mathrm {d} \nu (z). \tag {7}
+$$
+
+Equation (7) is also known as the re-parametrization trick (Kingma et al., 2015) and allows to derive a dual formulation of the Wasserstein natural gradient in the case of implicit models. Proposition 3 below provides such formulation under mild assumptions stated in Appendix A.2 along with a proof in Appendix C.1.
+
+Proposition 3. Assume $\mathcal{P}_{\Theta}$ is defined by (6) such that $\nabla \rho_{\theta}$ is given by (7). Under Assumptions $(B)$ and $(C)$ , the Wasserstein information matrix satisfies:
+
+$$
+\frac {1}{2} u ^ {\top} G _ {W} (\theta) u = \sup _ {f \in C _ {c} ^ {\infty} (\Omega)} \nabla \rho_ {\theta} (f) ^ {\top} u - \frac {1}{2} \int \| \nabla_ {x} f (x) \| ^ {2} \mathrm {d} \rho_ {\theta} (x) \tag {8}
+$$
+
+and the Wasserstein natural gradient satisfies:
+
+$$
+\nabla^ {W} \mathcal {L} (\theta) = - \underset {u \in \mathbb {R} ^ {q}} {\operatorname {a r g m i n}} \sup _ {f \in C _ {c} ^ {\infty} (\Omega)} \mathcal {U} _ {\theta} (f) ^ {\top} u - \frac {1}{2} \int \| \nabla_ {x} f (x) \| ^ {2} \mathrm {d} \rho_ {\theta} (x). \tag {9}
+$$
+
+The similarity between the variational formulations provided in Propositions 2 and 3 is worth noting. A first difference however, is that Proposition 3 doesn't require the test functions $f$ to have 0 mean under $\rho_{\theta}$ . This is due to the form of the objective in (8) which only depends on the gradient of $f$ . More importantly, while (8) is well defined, the expression in (5) can be infinite when $\nabla \rho_{\theta}$ is given by (7). Indeed, if the $\rho_{\theta}$ doesn't admit a density, it is always possible to find an admissible function $f \in C_c^\infty(\Omega)$ with bounded second moment under $\rho_{\theta}$ but for which $\nabla \rho_{\theta}(f)$ is arbitrarily large. This is avoided in (8) since the quadratic term directly penalizes the gradient of functions instead. For similar reasons, the dual formulation of the Sobolev distance considered in Mroueh et al. (2019) can also be infinite in the case of implicit models as discussed in Appendix B.3 although formally similar to (8). Nevertheless, a similar estimator as in Mroueh et al. (2019) can be considered using kernel methods which is the object of Section 3.
+
+# 3 KERNELIZED WASSERSTEIN NATURAL GRADIENT
+
+In this section we propose an estimator for the Wasserstein natural gradient using kernel methods and exploiting the formulation in (9). We restrict to the case of the Wasserstein natural gradient (WNG), denoted by $\nabla^W\mathcal{L}(\theta)$ , as it is well defined for implicit models, but a similar approach can be used for the Fisher-Rao natural gradient in the case of models with densities. We first start by presenting the kernelized Wasserstein natural gradient (KWNG) in Section 3.1, then we introduce an efficient estimator for KWNG in Section 3.2. In Section 3.4 we provide statistical guarantees and discuss practical considerations in Section 3.3.
+
+# 3.1 GENERAL FORMULATION AND MINIMAX THEOREM
+
+Consider a Reproducing Kernel Hilbert Space (RKHS) $\mathcal{H}$ which is a Hilbert space endowed with an inner product $\langle .,.\rangle_{\mathcal{H}}$ along with its norm $\| .\|_{\mathcal{H}}$ . $\mathcal{H}$ has the additional property that there exists a symmetric positive semi-definite kernel $k:\Omega \times \Omega \mapsto \mathbb{R}$ such that $k(x,.)\in \mathcal{H}$ for all $x\in \Omega$ and satisfying the Reproducing property for all functions $f$ in $\mathcal{H}$ :
+
+$$
+f (x) = \langle f, k (x,) \rangle_ {\mathcal {H}}, \quad \forall x \in \Omega . \tag {10}
+$$
+
+The above property is central in all kernel methods as it allows to obtain closed form expressions for some class of functional optimization problems. In order to take advantage of such property for estimating the natural gradient, we consider a new saddle problem obtained by restricting (9) to functions in the RKHS $\mathcal{H}$ and adding some regularization terms:
+
+$$
+\widetilde {\nabla} ^ {W} \mathcal {L} (\theta) := - \min _ {u \in \mathbb {R} ^ {q}} \sup _ {f \in \mathcal {H}} \mathcal {U} _ {\theta} (f) ^ {\top} u - \frac {1}{2} \int \| \nabla_ {x} f (x) \| ^ {2} \mathrm {d} \rho_ {\theta} (x) + \frac {1}{2} (\epsilon u ^ {\top} D (\theta) u - \lambda \| f \| _ {\mathcal {H}} ^ {2}). \tag {11}
+$$
+
+The kernelized Wasserstein natural gradient is obtained by solving (11) and is denoted by $\widetilde{\nabla}^W\mathcal{L}(\theta)$ . Here, $\epsilon$ is a positive real number, $\lambda$ is non-negative while $D(\theta)$ is a diagonal matrix in $\mathbb{R}^q$ with positive diagonal elements whose choice will be discussed in Section 3.3. The first regularization term makes the problem strongly convex in $u$ , while the second term makes the problem strongly concave in $f$ when $\lambda > 0$ . When $\lambda = 0$ , the problem is still concave in $f$ . This allows us to use a version of the minimax theorem (Ekeland and Témam, 1999, Proposition 2.3, Chapter VI) to exchange the order of the supremum and minimum which also holds true when $\lambda = 0$ . A new expression for the kernelized natural gradient is therefore obtained:
+
+Proposition 4. Assume that $\epsilon >0$ and $\lambda >0$ , then the kernelized natural gradient is given by:
+
+$$
+\widetilde {\nabla} ^ {W} \mathcal {L} (\theta) = \frac {1}{\epsilon} D (\theta) ^ {- 1} \mathcal {U} _ {\theta} (f ^ {*}), \tag {12}
+$$
+
+where $f^{*}$ is the unique solution to the quadratic optimization problem:
+
+$$
+\inf _ {f \in \mathcal {H}} \mathcal {J} (f) := \int \| \nabla_ {x} f (x) \| ^ {2} \mathrm {d} \rho_ {\theta} (x) + \frac {1}{\epsilon} \mathcal {U} _ {\theta} (f) ^ {\top} D (\theta) ^ {- 1} \mathcal {U} _ {\theta} (f) + \lambda \| f \| _ {\mathcal {H}} ^ {2}. \tag {13}
+$$
+
+When $\lambda = 0$ , $f^{*}$ might not be well defined, still, we have: $\widetilde{\nabla}^W\mathcal{L}(\theta) = \lim_{j\to \infty}\frac{1}{\epsilon} D(\theta)^{-1}\mathcal{U}_\theta (f_j)$ for any limiting sequence of (13).
+
+Proposition 4 allows to compute the kernelized natural gradient directly, provided that the functional optimization (13) can be solved. This circumvents the direct computation and inversion of the metric as suggested by (11). In Section 3.2, we propose a method to efficiently compute an approximate solution to (13) using Nyström projections. We also show in Section 3.4 that restricting the space of functions to $\mathcal{H}$ can still lead to a good approximation of the WNG provided that $\mathcal{H}$ enjoys some denseness properties.
+
+# 3.2 NYSTRÖM METHODS FOR THE KERENALIZED NATURAL GRADIENT
+
+We are interested now in finding an approximate solution to (13) which will allow to compute an estimator for the WNG using Proposition 4. Here we consider $N$ samples $(Z_{n})_{1\leq n\leq N}$ from the latent distribution $\nu$ which are used to produce $N$ samples $(X_{n})_{1\leq n\leq N}$ from $\rho_{\theta}$ using the map $h_\theta$ , i.e., $X_{n} = h_{\theta}(Z_{n})$ . We also assume we have access to an estimate of the Euclidean gradient $\nabla \mathcal{L}(\theta)$ which is denoted by $\widehat{\nabla L(\theta)}$ . This allows us to compute an empirical version of the cost function in (13),
+
+$$
+\hat {\mathcal {J}} (f) := \frac {1}{N} \sum_ {n = 1} ^ {N} \| \nabla_ {x} f \left(X _ {n}\right) \| ^ {2} + \frac {1}{\epsilon} \widehat {\mathcal {U} _ {\theta}} (f) ^ {\top} D (\theta) ^ {- 1} \widehat {\mathcal {U} _ {\theta}} (f) + \lambda \| f \| _ {\mathcal {H}} ^ {2}, \tag {14}
+$$
+
+where $\widehat{\mathcal{U}_{\theta}}(f)$ is given by: $\widehat{\mathcal{U}_{\theta}}(f) = \widehat{\nabla\mathcal{L}(\theta)} + \frac{1}{N}\sum_{n=1}^{N}\nabla h_{\theta}(Z_n)$ and $\nabla_x f(X_n)$ . (14) has a similar structure as the empirical version of the kernel Sobolev distance introduced in Mroueh et al. (2019), it is also similar to another functional arising in the context of score estimation for infinite dimensional exponential families (Sriperumbudur et al., 2017; Sutherland et al., 2017; Arbel and Gretton, 2017). It can be shown using the generalized Representer Theorem (Schölkopf et al., 2001) that the optimal function minimizing (14) is a linear combination of functions of the form $x \mapsto \partial_i k(X_n, x)$ with $1 \leq n \leq N$ and $1 \leq i \leq d$ and $\partial_i k(y, x)$ denotes the partial derivative of $k$ w.r.t. $y_i$ . This requires solving a system of size $Nd \times Nd$ which can be prohibitive when both $N$ and $d$ are large. Nyström methods provide a way to improve such computational cost by further restricting the optimal solution to belong to a finite dimensional subspace $\mathcal{H}_M$ of $\mathcal{H}$ called the Nyström subspace. In the context of score estimation, Sutherland et al. (2017) proposed to use a subspace formed by linear combinations of the basis functions $x \mapsto \partial_i k(Y_m, x)$ :
+
+$$
+\operatorname {s p a n} \{x \mapsto \partial_ {i} k \left(Y _ {m}, x\right) \mid 1 \leq m \leq M; \quad 1 \leq i \leq d \}, \tag {15}
+$$
+
+where $(Y_{m})_{1\leq m\leq M}$ are basis points drawn uniformly from $(X_{n})_{1\leq n\leq N}$ with $M\leq N$ . This further reduces the computational cost when $M\ll N$ but still has a cubic dependence in the dimension $d$ since all partial derivatives of the kernel are considered to construct (15). Here, we propose to randomly sample one component of $(\partial_i k(Y_m,))_{1\leq i\leq d}$ for each basis point $Y_{m}$ . Hence, we consider $M$ indices $(i_m)_{1\leq m\leq M}$ uniformly drawn form $\{1,\dots,d\}$ and define the Nyström subspace $\mathcal{H}_M$ to be:
+
+$$
+\mathcal {H} _ {M} := \operatorname {s p a n} \{x \mapsto \partial_ {i _ {m}} k (Y _ {m}, x) | 1 \leq m \leq M \}.
+$$
+
+An estimator for the kernelized Wasserstein natural gradient (KWNG) is then given by:
+
+$$
+\widehat {\nabla^ {W} \mathcal {L} (\theta)} = \frac {1}{\epsilon} D (\theta) ^ {- 1} \widehat {\mathcal {U} _ {\theta}} (\hat {f} ^ {*}), \quad \hat {f} ^ {*} := \underset {f \in \mathcal {H} _ {M}} {\operatorname {a r g m i n}} \hat {\mathcal {J}} (f). \tag {16}
+$$
+
+By definition of the Nyström subspace $\mathcal{H}_M$ , the optimal solution $\hat{f}^*$ is necessarily of the form: $\hat{f}^*(x) = \sum_{m=1}^{M} \alpha_m \partial_{i_m} k(Y_m, x)$ , where the coefficients $(\alpha_m)_{1 \leq m \leq M}$ are obtained by solving a finite dimensional quadratic optimization problem. This allows to provide a closed form expression for (17) in Proposition 5.
+
+Proposition 5. The estimator in (16) is given by:
+
+$$
+\widehat {\nabla^ {W} \mathcal {L} (\theta)} = \frac {1}{\epsilon} \left(D (\theta) ^ {- 1} - D (\theta) ^ {- 1} T ^ {\top} \left(T D (\theta) ^ {- 1} T ^ {\top} + \lambda \epsilon K + \frac {\epsilon}{N} C C ^ {\top}\right) ^ {\dagger} T D (\theta) ^ {- 1}\right) \widehat {\nabla \mathcal {L} (\theta)}, \tag {17}
+$$
+
+where $C$ and $K$ are matrices in $\mathbb{R}^{M\times Nd}$ and $\mathbb{R}^{M\times M}$ given by
+
+$$
+C _ {m, (n, i)} = \partial_ {i _ {m}} \partial_ {i + d} k \left(Y _ {m}, X _ {n}\right), \quad K _ {m, m ^ {\prime}} = \partial_ {i _ {m}} \partial_ {i _ {m ^ {\prime}} + d} k \left(Y _ {m}, Y _ {m ^ {\prime}}\right), \tag {18}
+$$
+
+while $T$ is a matrix in $\mathbb{R}^{M\times q}$ obtained as the Jacobian of $\theta \mapsto \tau (\theta)\in \mathbb{R}^M$ , i.e., $T\coloneqq \nabla \tau (\theta)$ , with
+
+$$
+(\tau (\theta)) _ {m} = \frac {1}{N} \sum_ {n = 1} ^ {N} \partial_ {i _ {m}} k (Y _ {m}, h _ {\theta} (Z _ {n})).
+$$
+
+In (18), we used the notation $\partial_{i + d}k(y,x)$ for the partial derivative of $k$ w.r.t. $x_{i}$ . A proof of Proposition 5 is provided in Appendix C.2 and relies on the reproducing property (10) and its generalization for partial derivatives of functions. The estimator in Proposition 5 is in fact a low rank approximation of the natural gradient obtained from the dual representation of the metric (9). While low-rank approximations for the Fisher-Rao natural gradient were considered in the context of variational inference and for a Gaussian variational posterior (Mishkin et al., 2018), (17) can be applied as a plug-in estimator for any family $\mathcal{P}_{\Theta}$ obtained as an implicit model. We next discuss a numerically stable expression of (17), its computational cost and the choice of the damping term in Section 3.3. We then provide asymptotic rates of convergence for (17) in Section 3.4.
+
+# 3.3 PRACTICAL CONSIDERATIONS
+
+Numerically stable expression. When $\lambda = 0$ , the estimator in (17) has an additional structure which can be exploited to get more accurate solutions. By the chain rule, the matrix $T$ admits a second expression of the form $T = CB$ where $B$ is the Jacobian matrix of $(h_{\theta}(Z_n))_{1\leq n\leq N}$ . Although this expression is impractical to compute in general, it suggests that $C$ can be 'simplified'. This simplification can be achieved in practice by computing the SVD of $CC^{\top} = USU^{T}$ and pre-multiplying $T$ by $S^{\dagger}U^{T}$ . The resulting expression is given in Proposition 6 and falls into the category of Ridgless estimators (Liang and Rakhlin (2019)).
+
+Proposition 6. Consider an SVD decomposition of $CC^T$ of the form $CC^\top = USU^T$ , then (17) is equal to:
+
+$$
+\widehat {\nabla^ {W} \mathcal {L} (\theta)} = \frac {1}{\epsilon} \left(D (\theta) ^ {- 1} - D (\theta) ^ {- 1} \widetilde {T} ^ {\top} \left(\widetilde {T} D (\theta) ^ {- 1} \widetilde {T} ^ {\top} + \frac {\epsilon}{N} P\right) ^ {\dagger} \widetilde {T} D (\theta) ^ {- 1}\right) \widehat {\nabla \mathcal {L} (\theta)}, \tag {19}
+$$
+
+where $P\coloneqq S^{\dagger}S$ and $\widetilde{T}\coloneqq S^{\dagger}U^{T}T.$
+
+Choice of damping term. So far, we only required $D(\theta)$ to be a diagonal matrix with positive coefficients. While a natural choice would be the identity matrix, this doesn't necessarily represent the best choice. As discussed by Martens and Sutskever (2012, Section 8.2), using the identity breaks the self-rescaling properties enjoyed by the natural gradient. Instead, we consider a scale-sensitive choice by setting $(D(\theta))_i = ||\widetilde{T}_{.,i}||$ where $\widetilde{T}$ is defined in Proposition 6. When the sample-size is limited, as it is often the case when $N$ is the size of a mini-batch, larger values for $\epsilon$ might be required. That is to prevent the KWNG from over-estimating the step-size in low curvature directions. Indeed, these directions are rescaled by the inverse of the smallest eigenvalues of the information matrix which are harder to estimate accurately. To adjust $\epsilon$ dynamically during training, we use a variant of the Levenberg-Marquardt heuristic as in Martens and Sutskever (2012) which seems to perform well in practice; see Section 4.
+
+Computational cost. The number of basis points $M$ controls the computational cost of both (17) and (19) which is dominated by the cost of computing $T$ and $C$ , solving an $M \times M$ linear system and performing an SVD of $CC^T$ in the case of (19). This gives an overall cost of $O(dNM^2 + qM^2 + M^3)$ . In practice, $M$ can be chosen to be small ( $M \leq 20$ ) while $N$ corresponds to the number of samples in a mini-batch. Hence, in a typical deep learning model, most of the computational cost is due to computing $T$ as the typical number of parameters $q$ is of the order of millions. In fact, $T$ can be computed using automatic differentiation and would require performing $M$ backward passes on the model to compute the gradient for each component of $\tau$ . Overall, the proposed estimator can be efficiently implemented and used for typical deep learning problems as shown in Section 4.
+
+Choice of the kernel. We found that using either a gaussian kernel or a rational quadratic kernel to work well in practice. We also propose a simple heuristic to adapt the bandwidth of those kernels to the data by setting it to $\sigma = \sigma_0\sigma_{N,M}$ , where $\sigma_{N,M}$ is equal to the average square distance between samples $(X_{n})_{1\leq n\leq N}$ and the basis points $(Y_{m})_{1\leq m\leq M}$ and $\sigma_0$ is fixed a priori. Another choice is the median heuristic Garreau et al. (2018).
+
+# 3.4 THEORY
+
+In this section we are interested in the behavior of the estimator in the limit of large $N$ and $M$ and when $\lambda > 0$ ; we leave the case when $\lambda = 0$ for future work. We work under Assumptions (A) to (G) in Appendix A.2 which state that $\Omega$ is a non-empty subset, $k$ is continuously twice differentiable with bounded second derivatives, $\nabla h_{\theta}(z)$ has at most a linear growth in $z$ and $\nu$ satisfies some standard moments conditions. Finally, we assume that the estimator of the euclidean gradient $\widehat{\nabla L(\theta)}$ satisfies Chebychev's concentration inequality which is often the case in Machine learning problems as discussed in Remark 1 of Appendix A.2. We distinguish two cases: the well-specified case and the miss-specified case. In the well-specified case, the vector valued functions $(\phi_i)_{1 \leq i \leq q}$ involved in Definition 2 are assumed to be gradients of functions in $\mathcal{H}$ and their smoothness is controlled by some parameter $\alpha \geq 0$ with worst case being $\alpha = 0$ . Under this assumption, we obtain smoothness dependent convergence rates as shown in Theorem 14 of Appendix C.3 using techniques from Rudi et al. (2015); Sutherland et al. (2017). Here, we will only focus on the miss-specified which relies on a weaker assumption:
+
+Assumption 1. There exists two constants $C > 0$ and $c \geq 0$ such that for all $\kappa > 0$ and all $1 \leq i \leq q$ , there is a function $f_i^\kappa$ satisfying:
+
+$$
+\left\| \phi_ {i} - \nabla f _ {i} ^ {\kappa} \right\| _ {L _ {2} \left(\rho_ {\theta}\right)} \leq C \kappa , \quad \left\| f _ {i} ^ {\kappa} \right\| _ {\mathcal {H}} \leq C \kappa^ {- c}. \tag {20}
+$$
+
+The left inequality in (20) represents the accuracy of the approximation of $\phi_{i}$ by gradients of functions in $\mathcal{H}$ while the right inequality represents the complexity of such approximation. Thus, the parameter $c$ characterizes the difficulty of the problem: a higher value of $c$ means that a more accurate approximation of $\phi_{i}$ comes at a higher cost in terms of its complexity. Theorem 7 provides convergences rates for the estimator in Proposition 5 under Assumption 1:
+
+Theorem 7. Let $\delta$ be such that $0 \leq \delta \leq 1$ and $b := \frac{1}{2 + c}$ . Under Assumption 1 and Assumptions (A) to (G) listed in Appendix A.2, for $N$ large enough, $M \sim (dN^{\frac{1}{2b + 1}}\log(N))$ , $\lambda \sim N^{\frac{1}{2b + 1}}$ and $\epsilon \lesssim N^{-\frac{b}{2b + 1}}$ , it holds with probability at least $1 - \delta$ that:
+
+$$
+\widehat {\| \nabla^ {W} \mathcal {L} (\theta) - \nabla^ {W} \mathcal {L} (\theta) \| ^ {2}} = \mathcal {O} \left(N ^ {- \frac {2}{4 + c}}\right).
+$$
+
+A proof of Theorem 7 is provided in Appendix C.3. In the best case where $c = 0$ , we recover a convergence rate of $\frac{1}{\sqrt{N}}$ as in the well specified case for the worst smoothness parameter value $\alpha = 0$ . Hence, Theorem 7 is a consistent extension of the well-specified case. For harder problems where $c > 0$ more basis points are needed, with $M$ required to be of order $dN\log(N)$ in the limit when $c \to \infty$ in which case the Nyström approximation loses its computational advantage.
+
+# 4 EXPERIMENTS
+
+This section presents an empirical evaluation of (KWNG) based on (19). Code for the experiments is available at https://github.com/MichaelArbel/KWNG.
+
+# 4.1 CONVERGENCE ON SYNTHETIC MODELS
+
+To empirically assess the accuracy of KWNG, we consider three choices for the parametric model $\mathcal{P}_{\Theta}$ : the multivariate normal model, the multivariate log-normal model and uniform distributions on hyper-spheres. All have the advantage that the WNG can be computed in closed form (Chen and Li, 2018; Malagò et al., 2018). While the first models admit a density, the third one doesn't, hence the Fisher natural gradient is not defined in this case. While this choice of models is essential to obtain closed form expressions for WNG, the proposed estimator is agnostic to such choice of family. We also assume we have access to the exact Euclidean Gradient (EG) which is used to compute both of WNG and KWNG.
+
+
+Figure 1: Relative error of KWNG averaged over 100 runs for varying dimension form $d = 1$ (yellow) to $d = 10$ (dark red) for the hyper-sphere model. (a): box-plot of the relative error as $d$ increases while $N = 5000$ and $M = \left\lfloor d\sqrt{N}\right\rfloor$ . (b) Relative error as the sample size $N$ increases and $M = \left\lfloor d\sqrt{N}\right\rfloor$ . (c): Relative error as $M$ increases and $N = 5000$ . A gaussian kernel is used with a fixed bandwidth $\sigma = 1$ .
+
+
+
+
+
+
+Figure 2: Left (a): Training error per iteration for KWNG, WNG, and EG. Right (b): projection of the sequence of updates obtained using KWNG, WNG and EG along the first two PCA directions of the WNG trajectory. The dimension of the sample space is fixed to $d = 10$ . Exact valued for the gradient are used for EG and WNG. For KWNG, $N = 128$ samples and $M = 100$ basis points are used. The regularization parameters are set to: $\lambda = 0$ and $\epsilon = 10^{-10}$ . An optimal step-size $\gamma_{t}$ is used: $\gamma_{t} = 0.1$ for both KWNG and WNG while $\gamma_{t} = 0.0001$ for EG.
+
+
+
+Figure 1 shows the evolution of the relative error w.r.t. the sample-size $N$ , the number of basis points $M$ and the dimension $d$ in the case of the hyper-sphere model. As expected from the consistency results provided in Section 3.4, the relative error decreases as the samples size $N$ increases. The behavior in the number of basis points $M$ shows a clear threshold beyond which the estimator becomes consistent and where increasing $M$ doesn't decrease the relative error anymore. This threshold increases with the dimension $d$ as discussed in Section 3.4. In practice, using the rule $M = \left\lfloor d\sqrt{N}\right\rfloor$ seems to be a good heuristic as shown in Figure 1 (a). All these observations persist in the case of the normal and log-normal model as shown in Figure 4 of Appendix D.1. In addition we report in Figure 5 the sensitivity to the choice of the bandwidth $\sigma$ which shows a robustness of the estimator to a wide choice of $\sigma$ .
+
+We also compare the optimization trajectory obtained using KWNG with the trajectories of both the exact WNG and EG in a simple setting: $\mathcal{P}_{\Theta}$ is the multivariate normal family and the loss function $\mathcal{L}(\theta)$ is the squared Wasserstein 2 distance between $\rho_{\theta}$ and a fixed target distribution $\rho_{\theta^{*}}$ . Figure 2 (a), shows the evolution of the loss function at every iteration. There is a clear advantage of using the WNG over EG as larger step-sizes are allowed leading to faster convergence. Moreover, KWNG maintains this properties while being agnostic to the choice of the model. Figure 2 (b) shows the projected dynamics of the three methods along the two PCA directions of the WNG trajectory with highest variance. The dynamics of WNG seems to be well approximated by the one obtained using KWNG.
+
+# 4.2 APPROXIMATE INVARIANCE TO PARAMETRIZATION
+
+We illustrate now the approximate invariance to parametrization of the KWNG and show its benefits for training deep neural networks when the model is ill-conditioned. We consider a classification task on two datasets Cifar10 and Cifar100 with a Residual Network He et al. (2015). To use the KWNG
+
+
+
+
+
+
+
+
+
+
+Figure 3: Test accuracy and Training accuracy for classification on Cifar10 (top) and Cifar100 (bottom) in both the ill-conditioned case (left side) and well-conditioned case (right side) for different optimization methods. on Cifar10 Results are averaged over 5 independent runs except for KFAC and eKFAC.
+
+
+
+
+
+
+
+estimator, we view the input RGB image as a latent variable $z$ with probability distribution $\nu$ and the output logits of the network $x\coloneqq h_{\theta}(z)$ as a sample from the model distribution $\rho_{\theta}\in \mathcal{P}_{\Theta}$ where $\theta$ denotes the weights of the network. The loss function $\mathcal{L}$ is given by:
+
+$$
+\mathcal {L} (\theta) := \int y (z) ^ {\top} \log (S M (U h _ {\theta} (z))) \mathrm {d} \nu (z),
+$$
+
+where $SM$ is the Softmax function, $y(z)$ denotes the one-hot vector representing the class of the image $z$ and $U$ is a fixed invertible diagonal matrix which controls how well the model is conditioned. We consider two cases, the Well-conditioned case (WC) in which $U$ is the identity and the Ill-conditioned case (IC) where $U$ is chosen to have a condition number equal to $10^{7}$ . We compare the performance of the proposed method with several variants of SGD: plain SGD, SGD + Momentum, and SGD + Momentum + Weight decay. We also compare with Adam Kingma and Ba (2014), KFAC optimizer (Martens and Grosse, 2015; Grosse and Martens, 2016) and eKFAC (George et al., 2018) which implements a fast approximation of the empirical Fisher Natural Gradient. We emphasize that gradient clipping by norm was used for all experiments and was crucial for a stable optimization using KWNG. Details of the experiments are provided in Appendix D.2. Figure 3 shows the training and test accuracy at each epoch on Cifar10 in both (WC) and (IC) cases. While all methods achieve a similar test accuracy in the (WC) case on both datasets, methods based on the Euclidean gradient seem to suffer a drastic drop in performance in the (IC) case. This doesn't happen for KWNG (red line) which achieves a similar test accuracy as in (WC) case. Moreover, a speed-up in convergence in number of iterations can be obtained by increasing the number of basis points $M$ (brown line). The time cost is also in favor of KWNG (Figure 6). On Cifar100, KWNG is also less affected by the ill-conditioning, albeit to a lower extent. Indeed, the larger number of classes in Cifar100 makes the estimation of KWNG harder as discussed in Section 4.1. In this case, increasing the batch-size can substantially improve the training accuracy (pink line). Moreover, methods that are used to improve optimization using the Euclidean gradient can also be used for KWNG. For instance, using Momentum leads to an improved performance in the (WC) case (grey line). Interestingly, KFAC seems to also suffer a drop in performance in the (IC) case. This might result from the use of an isotropic damping term $D(\theta) = I$ which would be harmful in this case. We also observe a drop in performance when a different choice of damping is used for KWNG. More importantly, using only a diagonal pre-conditioning of the gradient doesn't match the performance of KWNG (Figure 7).
+
+# ACKNOWLEDGEMENT
+
+GM has received funding from the European Research Council (ERC) under the European Union's Horizon 2020 research and innovation programme (grant agreement $\mathrm{n}^{\mathrm{o}}$ 757983).
+
+REFERENCES
+Amari, S. and Cichocki, A. (2010). Information geometry of divergence functions. Bulletin of the Polish Academy of Sciences: Technical Sciences, 58(No 1):183-195.
+Amari, S.-i. (1985). Differential-Geometrical Methods in Statistics. Lecture Notes in Statistics. Springer-Verlag, New York.
+Amari, S.-i. (1998). Natural Gradient Works Efficiently in Learning. Neural Computation, 10(2):251-276.
+Ambrosio, L., Gigli, N., and Savaré, G. (2004). Gradient flows with metric and differentiable structures, and applications to the Wasserstein space. Atti della Accademia Nazionale dei Lincei. Classe di Scienze Fisiche, Matematiche e Naturali. Rendiconti Lincei. Matematica e Applicazioni, 15(3-4):327-343.
+Arbel, M. and Gretton, A. (2017). Kernel Conditional Exponential Family. arXiv:1711.05363 [stat]. arXiv: 1711.05363.
+Arbel, M., Korba, A., Salim, A., and Gretton, A. (2019). Maximum Mean Discrepancy Gradient Flow. arXiv:1906.04370 [cs, stat]. arXiv: 1906.04370.
+Benamou, J.-D. and Brenier, Y. (2000). A computational fluid mechanics solution to the Monge-Kantorovich mass transfer problem. Numerische Mathematik, 84(3):375-393.
+Bernacchia, A., Lengyel, M., and Hennequin, G. (2018). Exact natural gradient in deep linear networks and its application to the nonlinear case. In Bengio, S., Wallach, H., Larochelle, H., Grauman, K., Cesa-Bianchi, N., and Garnett, R., editors, Advances in Neural Information Processing Systems 31, pages 5941-5950. Curran Associates, Inc.
+Chen, Y. and Li, W. (2018). Natural gradient in Wasserstein statistical manifold. arXiv:1805.08380 [cs, math]. arXiv: 1805.08380.
+Duchi, J., Hazan, E., and Singer, Y. (2011). Adaptive Subgradient Methods for Online Learning and Stochastic Optimization. Journal of Machine Learning Research, 12(Jul):2121-2159.
+Ekeland, I. and Temam, R. (1999). Convex Analysis and Variational Problems. Classics in Applied Mathematics. Society for Industrial and Applied Mathematics.
+Fisher, R. A. and Russell, E. J. (1922). On the mathematical foundations of theoretical statistics. Philosophical Transactions of the Royal Society of London. Series A, Containing Papers of a Mathematical or Physical Character, 222(594-604):309-368.
+Garreau, D., Jitkrittum, W., and Kanagawa, M. (2018). Large sample analysis of the median heuristic. arXiv:1707.07269 [math, stat]. arXiv: 1707.07269.
+George, T., Laurent, C., Bouthillier, X., Ballas, N., and Vincent, P. (2018). Fast Approximate Natural Gradient Descent in a Kronecker-factored Eigenbasis. arXiv:1806.03884 [cs, stat]. arXiv: 1806.03884.
+Grosse, R. and Martens, J. (2016). A Kronecker-factored Approximate Fisher Matrix for Convolution Layers. In Proceedings of the 33rd International Conference on International Conference on Machine Learning - Volume 48, ICML'16, pages 573-582. JMLR.org. event-place: New York, NY, USA.
+He, K., Zhang, X., Ren, S., and Sun, J. (2015). Deep Residual Learning for Image Recognition. 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 770-778.
+Heskes, T. (2000). On "Natural" Learning and Pruning in Multilayered Perceptrons. Neural Computation, 12(4):881-901.
+Hinton, G., Srivastava, N., and Swersky, K. (2012). Lecture 6a overview of mini-batch gradient descent.
+Holbrook, A., Lan, S., Streets, J., and Shahbaba, B. (2017). The nonparametric Fisher geometry and the chi-square process density prior. arXiv:1707.03117 [stat]. arXiv: 1707.03117.
+Ioffe, S. and Szegedy, C. (2015). 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, pages 448-456. JMLR.org. event-place: Lille, France.
+
+Kingma, D. P. and Ba, J. (2014). Adam: A Method for Stochastic Optimization. arXiv:1412.6980 [cs]. arXiv: 1412.6980.
+Kingma, D. P., Salimans, T., and Welling, M. (2015). Variational Dropout and the Local Reparameterization Trick. ArXiv, abs/1506.02557. arXiv: 1506.02557.
+Klenke, A. (2008). *Probability Theory: A Comprehensive Course*. World Publishing Corporation.
+Lafferty, J. and Wasserman, L. (2008). Rodeo: sparse, greedy nonparametric regression. The Annals of Statistics, 36(1):28-63.
+LeCun, Y. A., Bottou, L., Orr, G. B., and Müller, K.-R. (2012). Efficient BackProp. In Montavon, G., Orr, G. B., and Müller, K.-R., editors, Neural Networks: Tricks of the Trade: Second Edition, Lecture Notes in Computer Science, pages 9-48. Springer Berlin Heidelberg, Berlin, Heidelberg.
+Li, W. (2018). Geometry of probability simplex via optimal transport. arXiv:1803.06360 [math]. arXiv: 1803.06360.
+Li, W., Lin, A. T., and Montufar, G. (2019). Affine natural proximal learning.
+Li, W. and Montufar, G. (2018a). Natural gradient via optimal transport. arXiv:1803.07033 [cs, math]. arXiv: 1803.07033.
+Li, W. and Montufar, G. (2018b). Ricci curvature for parametric statistics via optimal transport. arXiv:1807.07095 [cs, math, stat]. arXiv: 1807.07095.
+Liang, T. and Rakhlin, A. (2019). Just Interpolate: Kernel "Ridgeless" Regression Can Generalize. arXiv:1808.00387 [cs, math, stat]. arXiv: 1808.00387.
+Malagò, L., Montrucchio, L., and Pistone, G. (2018). Wasserstein Riemannian Geometry of Positive Definite Matrices. arXiv:1801.09269 [math, stat]. arXiv: 1801.09269.
+Martens, J. (2010). Deep Learning via Hessian-free Optimization. In Proceedings of the 27th International Conference on International Conference on Machine Learning, ICML'10, pages 735-742, USA. Omnipress. event-place: Haifa, Israel.
+Martens, J. and Grosse, R. (2015). Optimizing Neural Networks with Kronecker-factored Approximate Curvature. arXiv:1503.05671 [cs, stat]. arXiv: 1503.05671.
+Martens, J. and Sutskever, I. (2012). Training Deep and Recurrent Networks with Hessian-Free Optimization. In Montavon, G., Orr, G. B., and Müller, K.-R., editors, Neural Networks: Tricks of the Trade: Second Edition, Lecture Notes in Computer Science, pages 479-535. Springer Berlin Heidelberg, Berlin, Heidelberg.
+Mishkin, A., Kunstner, F., Nielsen, D., Schmidt, M., and Khan, M. E. (2018). SLANG: Fast Structured Covariance Approximations for Bayesian Deep Learning with Natural Gradient. arXiv:1811.04504 [cs, stat]. arXiv: 1811.04504.
+Modin, K. (2017). Geometry of Matrix Decompositions Seen Through Optimal Transport and Information Geometry. Journal of Geometric Mechanics, 9(3):335-390. arXiv: 1601.01875.
+Mroueh, Y., Sercu, T., and Raj, A. (2019). Sobolev Descent. In The 22nd International Conference on Artificial Intelligence and Statistics, pages 2976-2985.
+Ollivier, Y., Arnold, L., Auger, A., and Hansen, N. (2011). Information-geometric optimization algorithms: A unifying picture via invariance principles. J. Mach. Learn. Res., 18:18:1-18:65.
+Otto, F. (2001). The Geometry of Dissipative Evolution Equations: The Porous Medium Equation. Communications in Partial Differential Equations, 26(1-2):101-174.
+Otto, F. and Villani, C. (2000). Generalization of an Inequality by Talagrand and Links with the Logarithmic Sobolev Inequality. Journal of Functional Analysis, 173(2):361-400.
+
+Rao, C. R. (1992). Information and the Accuracy Attainable in the Estimation of Statistical Parameters. In Kotz, S. and Johnson, N. L., editors, Breakthroughs in Statistics: Foundations and Basic Theory, Springer Series in Statistics, pages 235-247. Springer New York, New York, NY.
+Rudi, A., Camoriano, R., and Rosasco, L. (2015). Less is more: Nyström computational regularization.
+Salimans, T. and Kingma, D. P. (2016). Weight Normalization: A Simple Reparameterization to Accelerate Training of Deep Neural Networks. arXiv:1602.07868 [cs]. arXiv: 1602.07868.
+Schölkopf, B., Herbrich, R., and Smola, A. J. (2001). A generalized representer theorem. In Helmbold, D. and Williamson, B., editors, Computational Learning Theory, pages 416-426, Berlin, Heidelberg. Springer Berlin Heidelberg.
+Simonyan, K. and Zisserman, A. (2014). Very Deep Convolutional Networks for Large-Scale Image Recognition. arXiv:1409.1556 [cs]. arXiv: 1409.1556.
+Sriperumbudur, B., Fukumizu, K., Kumar, R., Gretton, A., and Hyvarinen, A. (2017). Density estimation in infinite dimensional exponential families. Journal of Machine Learning Research.
+Steinwart, I. and Christmann, A. (2008). Support Vector Machines. Springer Publishing Company, Incorporated, 1st edition.
+Sutherland, D. J., Strathmann, H., Arbel, M., and Gretton, A. (2017). Efficient and principled score estimation.
+Sutskever, I., Martens, J., Dahl, G., and Hinton, G. (2013). On the importance of initialization and momentum in deep learning. In International Conference on Machine Learning, pages 1139-1147.
+Villani, C. (2003). Topics in Optimal Transportation. American Mathematical Soc. Google-Books-ID: R_nWqjq89oEC.
+Villani, C. (2009). Optimal transport: Old and new. Technical report.
+
+# A PRELIMINARIES
+
+# A.1 NOTATION
+
+We recall that $\Omega$ is an open subset of $\mathbb{R}^d$ while $\Theta$ is an open subset of parameters in $\mathbb{R}^q$ . Let $\mathcal{Z}\subset \mathbb{R}^p$ be a latent space endowed with a probability distribution $\nu$ over $\mathcal{Z}$ . Additionally, $(\theta ,z)\mapsto h_{\theta}(z)\in \Omega$ is a function defined over $\Theta \times \mathcal{Z}$ . We consider a parametric set of probability distributions $\mathcal{P}_{\Theta}$ over $\Omega$ defined as the implicit model:
+
+$$
+\mathcal {P} _ {\Theta} := \left\{\rho_ {\theta} := \left(h _ {\theta}\right) _ {\#} \nu \quad ; \quad \theta \in \Theta \right\},
+$$
+
+where by definition, $\rho_{\theta} = (h_{\theta})_{\#}\nu$ means that any sample $x$ from $\rho_{\theta}$ can be written as $x = h_{\theta}(z)$ where $z$ is a sample from $\nu$ . We will write $B$ to denote the jacobian of $h_{\theta}$ w.r.t. $\theta$ viewed as a linear map from $\mathbb{R}^q$ to $L_2(\nu)^d$ without explicit reference to $\theta$ :
+
+$$
+B u (z) = \nabla h _ {\theta} (z). u; \quad \forall u \in \mathbb {R} ^ {q}.
+$$
+
+As in the main text, $\mathcal{L}:\Theta \to \mathbb{R}$ is a loss functions which is assumed to be of the form $\mathcal{L} = \mathcal{F}(\rho_{\theta})$ , with $\mathcal{F}$ being a real valued functional over the set of probability distributions. $\nabla \mathcal{L}(\theta)$ denotes the euclidean gradient of $\mathcal{L}$ w.r.t $\theta$ while $\widehat{\nabla\mathcal{L}(\theta)}$ is an estimator of $\nabla \mathcal{L}(\theta)$ using $N$ samples from $\rho_{\theta}$ .
+
+We also consider a Reproducing Kernel Hilbert Space $\mathcal{H}$ of functions defined over $\Omega$ with inner product $\langle .,.\rangle_{\mathcal{H}}$ and norm $\| .\|_{\mathcal{H}}$ and with a kernel $k:\Omega \times \Omega \to \mathbb{R}$ . The reproducing property for the derivatives (Steinwart and Christmann, 2008, Lemma 4.34) will be important: $\partial_if(x) = \langle f,\partial_ik(x,.)\rangle_{\mathcal{H}}$ for all $x\in \Omega$ . It holds as long as $k$ is differentiable.
+
+$C_b^\infty (\Omega)$ denotes the space of smooth bounded real valued functions on $\Omega$ , and $C_c^\infty (\Omega)\subset C_b^\infty (\Omega)$ denotes the subset of compactly supported functions. For any measured space $\mathcal{Z}$ with probability distribution $\nu$ we denote by $L_{2}(\nu)$ the space of real valued and square integrable functions under $\nu$ and by $L_{2}(\nu)^{d}$ the space of square integrable vector valued functions under $\nu$ and with values in $\mathbb{R}^d$ .
+
+# A.2 ASSUMPTIONS
+
+We make the following set of assumptions:
+
+(A) $\Omega$ is a non-empty open subset of $\mathbb{R}^d$ .
+(B) There exists positive constants $\zeta$ and $\sigma$ such that $\int \| z\| ^p\mathrm{d}\nu (z)\leq \frac{1}{2} p!\zeta^{p - 2}\sigma^2$ for any $p\geq 2$
+(C) For all $\theta \in \Theta$ there exists $C(\theta)$ such that $\| \nabla_{\theta}h_{\theta}(z)\| \leq C(\theta)(1 + \| z\|)$ for all $z\in \mathcal{Z}$
+(D) $k$ is twice continuously differentiable on $\Omega \times \Omega$
+(E) For all $\theta \in \Theta$ it holds that $\int \partial_i\partial_{i + d}k(x,x)\mathrm{d}p_\theta (x) < \infty$ for all $1\leq i\leq d$
+(F) The following quantity is finite: $\kappa^2 = \sup_{\substack{x\in \Omega \\ 1\leq i\leq q}}\partial_i\partial_{i + q}k(x,x)$ .
+(G) For all $0 \leq \delta \leq 1$ , it holds with probability at least $1 - \delta$ that $\|\widehat{\nabla \mathcal{L}(\theta)} - \nabla \mathcal{L}(\theta)\| \lesssim N^{-\frac{1}{2}}$ .
+
+Remark 1. Assumption $(G)$ holds if for instance $\overline{\nabla}\mathcal{L}(\theta)$ can be written as an empirical mean of i.i.d. terms with finite variance:
+
+$$
+\widehat {\nabla \mathcal {L} (\theta)} = \frac {1}{N} \sum_ {i = 1} ^ {N} \nabla_ {\theta} l \left(h _ {\theta} \left(Z _ {i}\right)\right)
+$$
+
+where $Z_{i}$ are i.i.d. samples from the latent distribution $\nu$ where $\int \nabla_{\theta}l(h_{\theta}(z))\mathrm{d}\nu (z) = \mathcal{L}(\theta)$ . This is often the case in the problems considered in machine-learning. In this case, the sum of variances of the vector $\widehat{\nabla\mathcal{L}(\theta)}$ along its coordinates satisfies:
+
+$$
+\int \widehat {\left\| \nabla \mathcal {L} (\theta) - \nabla \mathcal {L} (\theta) \right\| ^ {2}} \mathrm {d} \nu (z) = \frac {1}{N} \int \left\| \nabla_ {\theta} l \left(h _ {\theta} (z)\right) \right\| ^ {2} \mathrm {d} \nu (z) := \frac {1}{N} \sigma^ {2}
+$$
+
+One can then conclude using Cauchy-Schwarz inequality followed by Chebychev's inequality that with probability $1 - \delta$ :
+
+$$
+\widehat {\left\| \nabla \mathcal {L} (\theta) - \nabla \mathcal {L} (\theta) \right\|} \leq \frac {\sigma}{\sqrt {\delta N}}
+$$
+
+Moreover, Assumption $(C)$ is often satisfied when the implicit model is chosen to be a deep networks with ReLU non-linearity.
+
+# A.3 OPERATORS DEFINITION
+
+Differential operators. We introduce the linear $L$ operator and its adjoint $L^{\top}$ :
+
+$$
+L: \mathcal {H} \to L _ {2} (\nu) ^ {d}
+$$
+
+$$
+L ^ {\top}: L _ {2} (\nu) ^ {d} \to \mathcal {H}
+$$
+
+$$
+f \mapsto (\partial_ {i} f \circ h _ {\theta}) _ {1 \leq i \leq d}
+$$
+
+$$
+v \mapsto \int \sum_ {i = 1} ^ {d} \partial_ {i} k (h _ {\theta} (z),.) v _ {i} (z) \mathrm {d} \nu (z)
+$$
+
+This allows to obtain the linear operator $A$ defined in Assumption 2 in the main text by composition $A \coloneqq L^{\top}L$ . We recall here another expression for $A$ in terms of outer product $\otimes$ and its regularized version for a given $\lambda > 0$ ,
+
+$$
+A = \int \sum_ {i = 1} ^ {d} \partial_ {i} k (h _ {\theta} (z),.) \otimes \partial_ {i} k (h _ {\theta} (z),.) \mathrm {d} \nu (z) \quad A _ {\lambda} := A + \lambda I.
+$$
+
+It is easy to see that $A$ is a symmetric positive operator. Moreover, it was established in Sriperumbudur et al. (2017) that $A$ is also a compact operator under Assumption (E).
+
+Assume now we have access to $N$ samples $(Z_{n})_{1\leq n\leq N}$ as in the main text. We define the following objects:
+
+$$
+\hat {A} := \frac {1}{N} \sum_ {n = 1} ^ {N} \sum_ {i = 1} ^ {d} \partial_ {i} k (h _ {\theta} (Z _ {n}),.) \otimes \partial_ {i} k (h _ {\theta} (Z _ {n}),.), \qquad \hat {A} _ {\lambda} := \hat {A} + \lambda I.
+$$
+
+Furthermore, if $v$ is a continuous function in $L_2(\nu)^d$ , then we can also consider an empirical estimator for $L^{\top}v$ :
+
+$$
+\widehat {L ^ {\top} v} := \frac {1}{N} \sum_ {n = 1} ^ {N} \sum_ {i = 1} ^ {d} \partial_ {i} k (h _ {\theta} (Z _ {n}),.) v _ {i} (Z _ {n}).
+$$
+
+Subsampling operators. We consider the operator $Q_{M}$ defined from $\mathcal{H}$ to $\mathbb{R}^{M}$ by:
+
+$$
+Q _ {M} := \frac {\sqrt {q}}{\sqrt {M}} \sum_ {m = 1} ^ {M} e _ {m} \otimes \partial_ {i _ {m}} k \left(Y _ {m},\right) \tag {21}
+$$
+
+where $(e_m)_{1\leq m\leq M}$ is an orthonormal basis of $\mathbb{R}^M$ . $Q_{M}$ admits a singular value decomposition of the form $Q_{M} = U\Sigma V^{\top}$ , with $VV^{\top} \coloneqq P_{M}$ being the orthogonal projection operator on the Nystrom subspace $\mathcal{H}_M$ . Similarly to Rudi et al. (2015); Sutherland et al. (2017), we define the projected inverse function $\mathcal{G}_M(C)$ as:
+
+$$
+\mathcal {G} _ {M} (C) = V \left(V ^ {\top} C V\right) ^ {- 1} V ^ {\top}.
+$$
+
+We recall here some properties of $G_M$ from (Sutherland et al., 2017, Lemma 1):
+
+Lemma 8. Let $A: \mathcal{H} \to \mathcal{H}$ be a positive operator, and define $A_{\lambda} = A + \lambda I$ for any $\lambda > 0$ . The following holds:
+
+1. $\mathcal{G}_M(A)P_M = \mathcal{G}_M(A)$
+2. $P_{M}\mathcal{G}_{M}(A) = \mathcal{G}_{M}(A)$
+3. $\mathcal{G}_M(A_\lambda)A_\lambda P_M = P_M$
+4. $\mathcal{G}_M(A_\lambda) = (P_MAP_M + \lambda I)^{-1}P_M$
+5. $\| A_{\lambda}^{\frac{1}{2}}\mathcal{G}_M(A_\lambda)A_\lambda^{\frac{1}{2}}\|$
+
+Estimators of the Wasserstein information matrix. Here we would like to express the estimator in Proposition 5 in terms of the operators introduced previously. We have the following proposition:
+
+Proposition 9. The estimator defined in Proposition 5 admits the following representation:
+
+$$
+\widehat {\nabla^ {W} \mathcal {L} (\theta)} = \left(\epsilon D (\theta) + G _ {M, N}\right) ^ {- 1} \widehat {\nabla \mathcal {L} (\theta)}
+$$
+
+where $G_{M,N}$ is given by:
+
+$$
+G _ {M, N} := \widehat {(L ^ {\top} B) ^ {\top}} \mathcal {G} _ {M} (\hat {A} _ {\lambda}) \widehat {L ^ {\top} B}.
+$$
+
+Proof. This is a direct consequence of the minimax theorem (Ekeland and Temam, 1999, Proposition 2.3, Chapter VI) and applying (Sutherland et al., 2017, Lemma 3). $\square$
+
+The matrix $G_{M,N}$ is in fact an estimator of the Wasserstein information matrix defined in Definition 2. We will also need to consider the following population version of $G_{M,N}$ defined as:
+
+$$
+G _ {M} := \left(L ^ {\top} B\right) ^ {\top} \mathcal {G} _ {M} \left(A _ {\lambda}\right) L ^ {\top} B \tag {22}
+$$
+
+# B BACKGROUND IN INFORMATION GEOMETRY
+
+# B.1 FISHER-RAO STATISTICAL MANIFOLD
+
+In this section we briefly introduce the non-parametric Fisher-Rao metric defined over the set $\mathcal{P}$ of probability distributions with positive density. More details can be found in Holbrook et al. (2017). By abuse of notation, an element $\rho \in \mathcal{P}$ will be identified with its density which will also be denoted by $\rho$ . Consider $\mathcal{T}_{\rho}$ , the set of real valued functions $f$ defined over $\Omega$ and satisfying
+
+$$
+\int \frac {f (x) ^ {2}}{\rho (x)} \mathrm {d} x < \infty ; \qquad \int f (x) \rho (x) \mathrm {d} x = 0.
+$$
+
+We have the following definition for the Fisher-Rao metric:
+
+Definition 4 (Fisher-Rao metric). The Fisher-Rao metric $g^{F}$ is defined for all $\rho \in \mathcal{P}$ as an inner product over $\mathcal{T}_{\rho}$ of the form:
+
+$$
+g _ {\rho} ^ {F} (f, g) := \int \frac {1}{\rho (x)} f (x) g (x) \mathrm {d} x, \quad \forall f, g \in \mathcal {T} _ {\rho}
+$$
+
+Note that the choice of the set $\mathcal{T}_{\rho}$ is different from the one considered in Holbrook et al. (2017) which replaces the integrability condition by a smoothness one. In fact, it can be shown that these choices result in the same metric by a density argument.
+
+# B.2 WASSERSTEIN STATISTICAL MANIFOLD
+
+In this section we review the theory of Wasserstein statistical manifold introduced in Li and Montufar (2018a); Chen and Li (2018). By analogy to the Fisher-Rao metric which allows to endow the parametric model $\mathcal{P}_{\Theta}$ with the structure of a Riemannian manifold, it is also possible to use a different metric that is derived from the Wasserstein 2 distance. We first start by briefly introducing the Wasserstein 2 distance. Given two probability distributions $\rho$ and $\rho'$ , we consider the set of all joint probability distributions $\Pi(\rho, \rho')$ between $\rho$ and $\rho'$ usually called the set of couplings between $\rho$ and $\rho'$ . Any coupling $\pi$ defines a way of transporting mass from $\rho$ to $\rho'$ . The cost of such transport can be measured as the expected distance between an element of mass of $\rho$ at location $x$ that is mapped to an element of mass of $\rho'$ at location $y$ using the coupling $\pi$ :
+
+$$
+\int | | x - y | | ^ {2} \mathrm {d} \pi (x, y)
+$$
+
+The squared Wasserstein 2 distance between $\rho$ and $\rho^{\prime}$ is defined as the smallest transport cost over all possible couplings:
+
+$$
+W _ {2} ^ {2} (\rho , \rho^ {\prime}) = \inf _ {\pi \in \Pi (\rho , \rho^ {\prime})} \int \| x - y \| ^ {2} \mathrm {d} \pi (x, y).
+$$
+
+A dynamical formulation of $W_{2}$ was provided by the celebrated Benamou-Brenier formula in Benamou and Brenier (2000):
+
+$$
+W _ {2} ^ {2} (\rho , \rho^ {\prime}) = \inf _ {\phi_ {t}} \int_ {0} ^ {1} \int \| \phi_ {l} (x) \| ^ {2} d \rho_ {l} (x) d l
+$$
+
+where the infimum is taken over the set of vector fields $\phi :[0,1]\times \Omega \to \mathbb{R}^d$ . Each vector field of the potential determines a corresponding probability distribution $\rho_{l}$ as the solution of the continuity equation:
+
+$$
+\partial_ {l} \rho_ {l} + d i v \left(\rho_ {l} \phi_ {l}\right) = 0, \quad \rho_ {0} = \rho , \rho_ {1} = \rho^ {\prime}. \tag {23}
+$$
+
+When $\Omega$ is a compact set, a Neumann condition is added on the boundary of $\Omega$ to ensure that the total mass is conserved. Such formulation suggests that $W_{2}(\rho ,\rho^{\prime})$ corresponds in fact to the shortest path from $\rho$ to $\rho^\prime$ . Indeed, given a path $\rho_l$ from $\rho$ to $\rho^{\prime}$ , the infinitesimal displacement direction is given by the distribution $\partial_l\rho_l$ . The length $|\partial_l\rho_l|$ of this direction is measured by: $|\partial_l\rho_l|^2 \coloneqq \int \| \phi_l(x)\| ^2\mathrm{d}\rho_l(x)$ . Hence, $W_{2}^{2}(\rho ,\rho^{\prime})$ can be written as:
+
+$$
+W _ {2} ^ {2} \left(\rho \rho^ {\prime}\right) = \inf _ {\rho_ {l}} \int_ {0} ^ {1} \left| \partial_ {l} \rho_ {l} \right| ^ {2} d l.
+$$
+
+In fact, $\partial_l\rho_l$ can be seen as an element in the tangent space $T_{\rho_l}\mathcal{P}_2$ to $\mathcal{P}_2$ at point $\rho_l$ . To ensure that (23) is well defined, $T_{\rho}\mathcal{P}_{2}$ can be defined as the set of distributions $\sigma$ satisfying $\sigma(1) = 0$ .
+
+$$
+| \sigma (f) | \leq C \| \nabla f \| _ {L _ {2} (\rho)}, \quad \forall f \in C _ {c} ^ {\infty} (\Omega) \tag {24}
+$$
+
+for some positive constant $C$ . Indeed, the condition in (24) guarantees the existence of a vector field $\phi_{\sigma}$ that is a solution to the PDE: $\sigma = -div(\rho \phi_{\sigma})$ .
+
+Moreover, $|\partial_l\rho_l|^2$ can be seen as an inner product of $\partial_l\rho_l$ with itself in $T_{\rho_l}\mathcal{P}_2$ . This inner product defines in turn a metric tensor $g^{W}$ on $\mathcal{P}_2$ called the Wasserstein metric tensor (see Otto and Villani (2000); Ambrosio et al. (2004)):
+
+Definition 5. The Wasserstein metric $g^{W}$ is defined for all $\rho \in \mathcal{P}_2$ as the inner product over $T_{\rho}\mathcal{P}_{2}$ of the form:
+
+$$
+g _ {\rho} ^ {W} (\sigma , \sigma^ {\prime}) := \int \phi_ {\sigma} (x) ^ {\top} \phi_ {\sigma^ {\prime}} (x) \mathrm {d} \rho (x), \quad \forall \sigma , \sigma^ {\prime} \in T _ {\rho} \mathcal {P} _ {2}
+$$
+
+where $\phi_{\sigma}$ and $\phi_{\sigma'}$ are solutions to the partial differential equations:
+
+$$
+\sigma = - d i v \left(\rho \phi_ {\sigma}\right), \quad \sigma^ {\prime} = - d i v \left(\rho \phi_ {\sigma^ {\prime}}\right).
+$$
+
+Moreover, $\phi_{\sigma}$ and $\phi_{\sigma'}$ are required to be in the closure of gradient of smooth and compactly supported functions w.r.t. $L_2(\rho)^d$ .
+
+Definition 5 allows to endow $\mathcal{P}_2$ with a formal Riemannian structure with $W_{2}$ being its geodesic distance:
+
+$$
+W _ {2} ^ {2} (\rho , \rho^ {\prime}) = \inf _ {\rho_ {l}} \int_ {0} ^ {1} g _ {\rho_ {l}} \left(\partial_ {l} \rho_ {l}, \partial_ {l} \rho_ {l}\right) d l.
+$$
+
+# B.3 NEGATIVE SOBOLEV DISTANCE AND LINEARIZATION OF THE WASSERSTEIN DISTANCE
+
+To device the Wasserstein natural gradient, one can exploit a Taylor expansion of $W$ which is given in terms of the Negative Sobolev distance $\| \rho_{\theta +u} - \rho_{\theta}\|_{H^{-1}(\rho_{\theta})}$ as done in Mroueh et al. (2019):
+
+$$
+W _ {2} ^ {2} \left(\rho_ {\theta}, \rho_ {\theta + u}\right) = \left\| \rho_ {\theta + u} - \rho_ {\theta} \right\| _ {H ^ {- 1} \left(\rho_ {\theta}\right)} ^ {2} + o \left(\left\| u \right\| ^ {2}\right).
+$$
+
+Further performing a Taylor expansion of $\| \rho_{\theta + u} - \rho_{\theta}\|_{H^{-1}(\rho_{\theta})}$ in $u$ leads to a quadratic term $u^{\top}G_W(\theta_t)u$ where we call $G_W(\theta_t)$ the Wasserstein information matrix. This two steps approach is convenient conceptually and allows us to use the dual formulation of the Negative Sobolev distance to get an estimate of the quadratic term $u^{\top}G_W(\theta_t)u$ using kernel methods as proposed in Mroueh et al. (2019) for learning non-parametric models. However, with such approach, $\| \rho_{\theta + u} - \rho_{\theta}\|_{H^{-1}(\rho_{\theta})}$ needs to be well defined for $u$ small enough. This requirement does not exploit the parametric nature of the problem and can be restrictive if $\rho_{\theta + u}$ and $\rho_{\theta}$ do not share the same support as we discuss now.
+
+As shown in (Villani, 2003, Theorem 7.26) and discussed in (Arbel et al., 2019, Proposition 17 and 18), the Wasserstein distance between two probability distributions $\rho$ and $\rho^{\prime}$ admits a first order expansion in terms of the Negative Sobolev Distance:
+
+$$
+\lim _ {\epsilon \rightarrow 0} \frac {1}{\epsilon} W _ {2} (\rho , \rho + \epsilon (\rho^ {\prime} - \rho)) = \| \rho - \rho^ {\prime} \| _ {H ^ {- 1} (\rho)}
+$$
+
+when $\rho^{\prime}$ admits a bounded density w.r.t. $\rho$ . When such assumption fails to hold, there are cases when this first order expansion is no longer available. For instance, in the simple case when the parametric family consists of dirac distributions $\delta_{\theta}$ located at a value $\theta$ , the Wasserstein distance admits a closed form expression of the form:
+
+$$
+W _ {2} \left(\delta_ {\theta}, \delta_ {\theta} + \epsilon \left(\delta_ {\theta^ {\prime}} - \delta_ {\theta}\right)\right) = \sqrt {\epsilon} \| \theta - \theta^ {\prime} \|
+$$
+
+Hence, $\frac{1}{\epsilon} W_{2}(\delta_{\theta}, \delta_{\theta} + \epsilon (\delta_{\theta^{\prime}} - \delta_{\theta}))$ diverges to infinity. One can consider a different perturbation of the model $\delta_{\theta + \epsilon u}$ for some vector $u$ which the one we are interested in here. In this case, the Wasserstein distance admits a well-defined asymptotic behavior:
+
+$$
+\lim _ {\epsilon \rightarrow \epsilon} \frac {1}{\delta_ {\theta , \delta_ {\theta + \epsilon u}}} = \| u \|.
+$$
+
+On the other hand the Negative Sobolev Distance is infinite for any value of $\epsilon$ . To see this, we consider its dual formulation as in Mroueh et al. (2019):
+
+$$
+\frac{1}{2}\| \rho -\rho^{\prime}\|_{H^{-1}(\rho)} = \sup_{\substack{f\in C^{c}_{c}^{\infty}(\Omega)\\ \int f(x)\mathrm{d}\rho (x) = 0}}\int f(x)\mathrm{d}\rho (x) - \int f(x)\mathrm{d}\rho^{\prime}(x) - \frac{1}{2}\int \| \nabla_{x}f(x)\|^{2}\mathrm{d}\rho (x)
+$$
+
+Evaluating this expression for $\delta_{\theta}$ and $\delta_{\theta +\epsilon u}$ for any value $\epsilon >0$ and for any $u$ that is non zero, on has:
+
+$$
+\frac {1}{2 \epsilon} \| \delta_ {\theta} - \delta_ {\theta + \epsilon u} \| _ {H ^ {- 1} \left(\delta_ {\theta}\right)} = \sup _ { \begin{array}{c} f \in C _ {c} ^ {\infty} (\Omega) \\ f (\theta) = 0 \end{array} } \frac {1}{\epsilon} (f (\theta) - f (\theta + \epsilon u)) - \frac {1}{2} \| \nabla_ {x} f (\theta) \| ^ {2} \tag {25}
+$$
+
+One can always find a function $f$ such that $\nabla f(\theta) = 0$ , $f(\theta) = 0$ and $-f(\theta + \epsilon u)$ can be arbitrarily large, thus the Negative Sobolev distance is infinite. This is not the case of the metric $u^\top G_W(\theta)u$ which can be computed in closed form:
+
+$$
+\frac {1}{2} u ^ {\top} G _ {W} (\theta) u = \sup _ { \begin{array}{c} f \in C _ {c} ^ {\infty} (\Omega) \\ f (\theta) = 0 \end{array} } \nabla f (\theta) ^ {\top} u - \frac {1}{2} \| \nabla_ {x} f (\theta) \| ^ {2} \tag {26}
+$$
+
+In this case, choosing $f(\theta) = 0$ and $\nabla f(\theta) = u$ achieves the supremum which is simply given by $\frac{1}{2} \| u \|^2$ . Equation (26) can be seen as a limit case of (25) when $\epsilon \to 0$ :
+
+$$
+\frac{1}{2} u^{\top}G_{W}(\theta)u:= \sup_{\substack{f\in C_{c}^{\infty}(\Omega)^{\epsilon \to 0}\\ f(\theta) = 0}}\lim_{\epsilon}\frac{1}{\epsilon} (f(\theta) - f(\theta +\epsilon u)) - \frac{1}{2}\| \nabla_{x}f(\theta)\|^{2}
+$$
+
+However, the order between the supremum and the limit cannot be exchanged in this case, which makes the two objects behave very differently in the case of singular probability distributions.
+
+# C PROOFS
+
+# C.1 PRELIMINARY RESULTS
+
+Here we provide a proof of the invariance properties of the Fisher and Wasserstein natural gradient descent in the continuous-time limit as stated in Proposition 1. Consider an invertible and smoothly differentiable re-parametrization $\Psi$ , satisfying $\psi = \Psi(\theta)$ . Denote by $\bar{\rho}_{\psi} = \rho_{\Psi^{-1}(\psi)}$ the re-parametrized model and $\bar{G}_W(\psi)$ and $\bar{G}_F(\psi)$ their corresponding Wasserstein and Fisher information matrices whenever they are well defined.
+
+Proof of Proposition 1. Here we only consider the case when $\nabla^D\mathcal{L}(\theta)$ is either given by the Fisher natural gradient $\nabla^{F}\mathcal{L}(\theta)$ or the Wasserstein Natural gradient $\nabla^{W}\mathcal{L}(\theta)$ . We will first define $\widetilde{\psi}_s \coloneqq \Psi(\theta_s)$ and show that in fact $\widetilde{\psi}_s = \psi_s$ at all times $s > 0$ . First, let's differentiate $\widetilde{\psi}_s$ in time:
+
+$$
+\dot {\tilde {\psi}} _ {s} = - \nabla_ {\theta} \Psi (\theta_ {s}) ^ {\top} G _ {D} (\theta_ {s}) ^ {- 1} \nabla_ {\theta} \mathcal {L} (\theta_ {s})
+$$
+
+By the chain rule, we have that $\nabla_{\theta}\mathcal{L}(\theta_s) = \nabla_{\theta}\Psi (\theta_s)\nabla_{\psi}\bar{\mathcal{L}} (\widetilde{\psi}_s)$ , hence:
+
+$$
+\dot {\tilde {\psi}} _ {s} = - \nabla_ {\theta} \Psi (\theta_ {s}) ^ {\top} G _ {D} (\theta_ {s}) ^ {- 1} \nabla_ {\theta} \Psi (\theta_ {s}) \nabla_ {\psi} \bar {\mathcal {L}} (\tilde {\psi} _ {s}).
+$$
+
+It is easy to see that $\nabla_{\theta}\Psi^{-1}(\widetilde{\psi}_s) = (\nabla_{\psi}\Psi^{-1}(\psi_s))^{-1}$ by definition of $\Psi$ and $\widetilde{\psi}_s$ , hence by Lemma 10 one can conclude that:
+
+$$
+\dot {\widetilde {\psi}} _ {s} = - G _ {D} (\widetilde {\psi} _ {s}) ^ {- 1} \nabla_ {\psi} \bar {\mathcal {L}} (\widetilde {\psi} _ {s}).
+$$
+
+Hence, $\widetilde{\psi}_s$ satisfies the same differential equation as $\psi_s$ . Now keeping in mind that $\psi_0 = \widetilde{\psi}_0 = \Psi(\theta_0)$ , it follows that $\psi_0 = \widetilde{\psi}_0 = \Psi(\theta_0)$ by uniqueness of differential equations.
+
+Lemma 10. Under conditions of Propositions 2 and 3, the informations matrices $\bar{G}_W(\psi)$ and $\bar{G}_F(\psi)$ are related to $G_W(\theta)$ and $G_F(\theta)$ by the relation:
+
+$$
+\bar {G} _ {W} (\psi) = \nabla_ {\psi} \Psi^ {- 1} (\psi) ^ {\top} G _ {W} (\theta) \nabla_ {\psi} \Psi^ {- 1} (\psi)
+$$
+
+$$
+\bar {G} _ {F} (\psi) = \nabla_ {\psi} \Psi^ {- 1} (\psi) ^ {\top} G _ {F} (\theta) \nabla_ {\psi} \Psi^ {- 1} (\psi)
+$$
+
+Proof. Let $v \in R^q$ and write $u = \nabla_{\theta} \Psi^{-1}(\psi)v$ , then by the dual formulations of $G_W(\theta)$ and $G_F(\theta)$ in Proposition 2 we have that:
+
+$$
+\frac{1}{2} v^{\top}\nabla_{\psi}\Psi^{-1}(\psi)^{\top}G_{F}(\theta)\nabla_{\psi}\Psi^{-1}(\psi)v = \sup_{\substack{f\in C^{ \infty}_{c}(\Omega)\\ \int f(x)\mathrm{d}\rho_{\theta}(x) = 0}}\nabla \rho_{\theta}(f)^{\top}\nabla_{\theta}\Psi^{-1}(\psi)v - \frac{1}{2}\int f(x)^{2}\mathrm{d}\rho_{\theta}(x)\mathrm{d}x,
+$$
+
+Now recalling that $\nabla_{\psi}\bar{\rho}_{\psi} = \nabla_{\theta}\rho_{\theta}\nabla_{\psi}\Psi^{-1}(\psi)$ by Lemma 11, it follows that:
+
+$$
+\frac{1}{2} v^{\top}\nabla_{\psi}\Psi^{-1}(\psi)^{\top}G_{F}(\theta)\nabla_{\psi}\Psi^{-1}(\psi)v = \sup_{\substack{f\in C^{ \infty}_{c}(\Omega)\\ \int f(x)\mathrm{d}\rho_{\theta}(x) = 0}}\nabla_{\psi}\bar{\rho}_{\psi}(f)^{\top}v - \frac{1}{2}\int f(x)^{2}\mathrm{d}\rho_{\theta}(x)\mathrm{d}x,
+$$
+
+Using again Proposition 2 for the reparametrized model $\bar{\rho}_{\psi}$ , we directly have that:
+
+$$
+\frac{1}{2} v^{\top}G_{F}(\psi)v = \sup_{\substack{f\in C_{c}^{\infty}(\Omega)\\ \int f(x)\mathrm{d}\rho_{\theta}(x) = 0}}\nabla_{\psi}\bar{\rho}_{\psi}(f)^{\top}v - \frac{1}{2}\int f(x)^{2}\mathrm{d}\rho_{\theta}(x)\mathrm{d}x,
+$$
+
+The result follows by equating both expression. The same procedure can be applied for the case the Wasserstein information matrix using Proposition 3.
+
+Lemma 11. The distributional gradients $\nabla_{\psi}\bar{\rho}_{\psi}$ and $\nabla_{\theta}\rho_{\theta}$ are related by the expression:
+
+$$
+\nabla_ {\psi} \bar {\rho} _ {\psi} = \nabla_ {\theta} \rho_ {\theta} \nabla_ {\psi} \Psi^ {- 1} (\psi)
+$$
+
+Proof. The proof follows by considering a fixed direction $u \in \mathbb{R}^q$ and a test function $f \in \mathcal{C}_c^\infty(\Omega)$ and the definition of distributional gradient in Definition 3:
+
+$$
+\begin{array}{l} \nabla \bar {\rho} _ {\psi} (f) ^ {\top} u = \lim _ {\epsilon \rightarrow 0} \frac {1}{\epsilon} \int f (x) \mathrm {d} \bar {\rho} _ {\psi + \epsilon u} (x) - \int f (x) \mathrm {d} \bar {\rho} _ {\psi} (x) \\ = \lim _ {\epsilon \rightarrow 0} \frac {1}{\epsilon} \int f (x) \mathrm {d} \rho_ {\Psi^ {- 1} (\psi + \epsilon u)} (x) - \int f (x) \mathrm {d} \rho_ {\Psi^ {- 1} (\psi)} (x) \\ \end{array}
+$$
+
+Now by differentiability of $\Psi^{-1}$ , we have the following first order expansion:
+
+$$
+\Psi^ {- 1} (\psi + \epsilon u) = \Psi^ {- 1} (\psi) + \epsilon \nabla \Psi^ {- 1} (\psi) ^ {\top} u + \epsilon v (\epsilon)
+$$
+
+where $v(\epsilon)$ converges to 0 when $\epsilon \to 0$ . Now using again the definition Definition 3 for $\rho_{\Psi^{\psi}}$ one has:
+
+$$
+\begin{array}{l} \frac {1}{\epsilon} \left(\int f (x) \mathrm {d} \rho_ {\Psi^ {- 1} (\psi + \epsilon u)} (x) - \int f (x) \mathrm {d} \rho_ {\Psi^ {- 1} (\psi)} (x)\right) = \nabla \rho_ {\Psi^ {- 1} (\psi)} (f) ^ {\top} \nabla \Psi^ {- 1} (\psi) ^ {\top} u \\ + \epsilon v (\epsilon) + \delta (\epsilon , f, (\nabla \Psi^ {- 1} (\psi) u + v (\epsilon))) \\ \end{array}
+$$
+
+The last two terms converge to 0 as $\epsilon \to 0$ , hence leading to the desired expression.
+
+
+
+Proposition 12. When $\rho_{\theta}$ admits a density that is continuously differentiable w.r.t $\theta$ and such that $x \mapsto \nabla \rho_{\theta}(x)$ is continuous, then the distributional gradient is of the form:
+
+$$
+\nabla \rho_ {\theta} (f) = \int f (x) \nabla \rho_ {\theta} (x) \mathrm {d} x, \quad \forall f \in \mathcal {C} _ {c} ^ {\infty} (\Omega)
+$$
+
+where $\nabla \rho_{\theta}(x)$ denotes the gradient of the density of $\rho_{\theta}(x)$ at $x$ .
+
+Proof. Let $\epsilon > 0$ and $u \in \mathbb{R}^q$ , we define the function $\nu(\epsilon, u, f)$ as follows:
+
+$$
+\nu (\epsilon , u, f) = \int f (x) \left(\frac {1}{\epsilon} (\rho_ {\theta + \epsilon u}) - \rho_ {\theta} - \nabla \rho_ {\theta} ^ {\top} u\right) \mathrm {d} x
+$$
+
+we just need to show that $\nu(\epsilon, u, f) \to 0$ as $\epsilon \to 0$ . This follows from the differentiation lemma (Klenke, 2008, Theorem 6.28) applied to the function $(\theta, x) \mapsto f(x)\rho_{\theta}(x)$ . Indeed, this function is integrable in $x$ for any $\theta'$ in a neighborhood $U$ of $\theta$ that is small enough, it is also differentiable on that neighborhood $U$ and satisfies the domination inequality:
+
+$$
+|f(x)\nabla \rho_{\theta}(x)^{\top}u|\leq |f(x)|\sup_{x\in \operatorname{Supp}(f),\theta \in U}\nabla \rho_{\theta}(x)^{\top}u|.
+$$
+
+The inequality follows from continuity of $(\theta ,x)\nabla \rho_{\theta}(x)$ and recalling that $f$ is compactly supported. This concludes the proof.
+
+We fist provide a proof of the dual formulation for the Fisher information matrix.
+
+Proof of Proposition 2. Consider the optimization problem:
+
+$$
+\sup _ { \begin{array}{l} f \in C _ {c} ^ {\infty} (\Omega) \\ \int f (x) \mathrm {d} \rho_ {\theta} (x) = 0 \end{array} } \left(\int f (x) \nabla \rho_ {\theta} (x) \mathrm {d} x\right) ^ {\top} u - \frac {1}{2} \int f (x) ^ {2} \rho_ {\theta} (x) \mathrm {d} x \tag {27}
+$$
+
+Recalling that the set of smooth and compactly supported functions $C_c^\infty (\infty)$ is dense in $L_{2}(\rho_{\theta})$ and that the objective function in (27) is continuous and coercive in $f$ , it follows that (27) admits a unique solution $f^{*}$ in $L_{2}(\rho_{\theta})$ which satisfies the optimality condition:
+
+$$
+\int f (x) \left(\nabla \rho_ {\theta} (x)\right) ^ {\top} u d x = \int f (x) f ^ {*} (x) \rho_ {\theta} (x) d x \quad \forall f \in L _ {2} (\rho_ {\theta})
+$$
+
+Hence, it is easy to see that $f^{*} = (\nabla \rho_{\theta})^{\top}u / \rho_{\theta}$ and that the optimal value of (27) is given by:
+
+$$
+\frac {1}{2} \int \frac {\left(\left(\nabla \rho_ {\theta} (x)\right) ^ {\top} u\right) ^ {2}}{\rho_ {\theta} (x)} d x.
+$$
+
+This is equal to $u^{\top}G_{F}(\theta)u$ by Definition 1.
+
+The next proposition ensures that the Wasserstein information matrix defined in Definition 2 is well-defined and has a dual formulation.
+
+Proposition 13. Consider the model defined in (6) and let $(e_s)_{1\leq s\leq q}$ be an orthonormal basis of $\mathbb{R}^q$ . Under Assumptions $(B)$ and $(C)$ , there exists an optimal solution $\Phi = (\phi_s)_{1\leq s\leq q}$ with $\phi_s$ in $L_2(\rho_\theta)^d$ satisfying the PDE:
+
+$$
+\partial_ {s} \rho_ {\theta} = - d i v \left(\rho_ {\theta} \phi_ {s}\right)
+$$
+
+The elliptic equations also imply that $L^{\top}\nabla h_{\theta} = L^{\top}(\Phi \circ h_{\theta})$ . Moreover, the Wasserstein information matrix $G_W(\theta)$ on $\mathcal{P}_{\Theta}$ at point $\theta$ can be written as $G_W(\theta) = \Phi^\top \Phi$ where the inner-product is in $L_2(\rho_\theta)^d$ and satisfies:
+
+$$
+\frac{1}{2} u^{\top}G_{W}(\theta)u = \sup_{\substack{f\in C^{c}_{c}^{\infty}(\Omega)\\ \int f(x)\mathrm{d}\rho_{\theta}(x) = 0}}\nabla \rho_{\theta}(f)^{\top}u - \frac{1}{2}\int \| \nabla_{x}f(h_{\theta}(z))\|^{2}\mathrm{d}\nu (z).
+$$
+
+for all $u\in \mathbb{R}^q$
+
+Proof. Let $(e_s)_{1\leq s\leq q}$ be an orthonormal basis of $\mathbb{R}^q$ . For all $1\leq s\leq q$ , we will establish the existence of an optimal solution $\phi_s$ in $L_2(\rho_\theta)^d$ satisfying the PDE:
+
+$$
+\partial_ {s} \rho_ {\theta} = - d i v \left(\rho_ {\theta} \phi_ {s}\right) \tag {28}
+$$
+
+Consider the variational problem:
+
+$$
+\sup _ {\phi \in S} \int \phi \left(h _ {\theta} (z)\right) ^ {\top} \partial_ {\theta_ {s}} h _ {\theta} (z) - \frac {1}{2} \| \phi \| _ {L _ {2} (\rho_ {\theta})} ^ {2} \tag {29}
+$$
+
+where $\mathcal{S}$ is a Hilbert space obtained as the closure in $L_{2}(\rho_{\theta})^{d}$ of functions of the form $\phi = \nabla_{x}f$ with $f\in C_c^\infty (\Omega)$ :
+
+$$
+\mathcal {S} := \overline {{\{\nabla_ {x} f \quad | \quad f \in C _ {c} ^ {\infty} (\Omega) \}}} _ {L _ {2} (\rho_ {\theta} ^ {d})}.
+$$
+
+We have by Assumption (C) that:
+
+$$
+\int \phi (h _ {\theta} (z)) ^ {\top} \partial_ {\theta_ {s}} h _ {\theta} (z) \mathrm {d} \nu (z) \leq \leq C (\theta) \sqrt {\int (1 + \| z \| ^ {2}) \mathrm {d} \nu (z)} \int \| \phi \| _ {L _ {2} (\rho_ {\theta})}.
+$$
+
+Moreover, by Assumption (B), we know that $\sqrt{\int(1 + \|z\|^2)\mathrm{d}\nu(z)} < \infty$ . This implies that the objective in (29) is continuous in $\phi$ while also being convex. It follows that (29) admits a unique solution $\phi_s^* \in S$ which satisfies for all $\phi \in S$ :
+
+$$
+\int \phi (h _ {\theta} (z)) ^ {\top} \phi_ {s} ^ {*} (h _ {\theta} (z)) \mathrm {d} \nu (z) = \int \phi (h _ {\theta} (z)) ^ {\top} \partial_ {\theta_ {s}} h _ {\theta} (z)) \mathrm {d} \nu (z)
+$$
+
+In particular, for any $f \in C_c^\infty(\Omega)$ , it holds that:
+
+$$
+\int \nabla_ {x} f (h _ {\theta} (z)) ^ {\top} \phi_ {s} ^ {*} (h _ {\theta} (z)) \mathrm {d} \nu (z) = \int \nabla_ {x} f (h _ {\theta} (z)) ^ {\top} \partial_ {\theta_ {s}} h _ {\theta} (z)) \mathrm {d} \nu (z)
+$$
+
+which is equivalent to (28) and implies directly that $L^T\nabla h_\theta = L^T\Phi \circ h_\theta$ where $\Phi \coloneqq (\phi_s^*)_{1\leq s\leq q}$ . The variational expression for $\frac{1}{2} u^\top G_Wu$ follows by noting that (29) admits the same optimal value as
+
+$$
+\sup_{\substack{f\in C_{c}^{\infty}(\Omega)\\ \int f(x)\mathrm{d}\rho_{\theta}(x) = 0}}\nabla \rho_{\theta}(f)^{\top}u - \frac{1}{2}\int \| \nabla_{x}f(h_{\theta}(z))\|^{2}\mathrm{d}\nu (z).
+$$
+
+That is because $S$ is by definition the closure in $L_2(\rho_\theta)^d$ of the set of gradients of smooth and compactly supported functions on $\Omega$ .
+
+Proof of Proposition 3. This is a consequence of Proposition 13.
+
+# C.2 EXPRESSION OF THE ESTIMATOR
+
+We provide here a proof of Proposition 5
+
+Proof of Proposition 5. Here, to simplify notations, we simply write $D$ instead of $D(\theta)$ . First consider the following optimization problem:
+
+$$
+\inf _ {f \in \mathcal {H} _ {M}} \frac {1}{N} \sum_ {n = 1} ^ {N} \| \nabla f (X _ {n}) \| ^ {2} + \lambda \| f \| _ {\mathcal {H}} ^ {2} + \frac {1}{\epsilon} \mathcal {R} (f) ^ {\top} D ^ {- 1} \mathcal {R} (f) + \frac {2}{\epsilon} \mathcal {R} (f) ^ {\top} D ^ {- 1} \widehat {\nabla \mathcal {L} (\theta)}
+$$
+
+with $\mathcal{R}(f)$ given by $\mathcal{R}(f) = \frac{1}{N}\sum_{n=1}^{N}\nabla f(X_n)^\top B(Z_n)$ . Now, recalling that any $f\in \mathcal{H}_M$ can be written as $f = \sum_{m=1}^{M}\alpha_m\partial_{i_m}k(Y_{m},.)$ , and using the reproducing property $\partial_i f(x) = \langle f,\partial_i k(x,.)\rangle_{\mathcal{H}}$ (Steinwart and Christmann, 2008, Lemma 4.34), it is easy to see that:
+
+$$
+\frac{1}{N}\sum_{n = 1}^{N}\| \nabla f(X_{n})\|^{2} = \frac{1}{N}\sum_{\substack{1\leq n\leq N\\ 1\leq i\leq d}}(\sum_{m = 1}^{M}\alpha_{m}\partial_{i_{m}}\partial_{i + d}k(Y_{m},X_{n}))^{2}.
+$$
+
+$$
+\| f \| _ {\mathcal {H}} ^ {2} = \sum_ {1 \leq m, m ^ {\prime} \leq M} \alpha_ {m} \alpha_ {m ^ {\prime}} \partial_ {i _ {m}} \partial_ {i _ {m ^ {\prime}} + d} k \left(Y _ {m}, Y _ {m ^ {\prime}}\right)
+$$
+
+$$
+\mathcal{R}(f) = \frac{1}{N}\sum_{\substack{1\leq n\leq N\\ 1\leq i\leq d\\ 1\leq m\leq M}}\alpha_{m}\partial_{i_{m}}\partial_{i + d}k(Y_{m},X_{n})B_{i}(Z_{n})
+$$
+
+The above can be expressed in matrix form using the matrices defined in Proposition 5:
+
+$$
+\frac {1}{N} \sum_ {n = 1} ^ {N} \| \nabla f (X _ {n}) \| ^ {2} = \alpha^ {\top} C C ^ {\top} \alpha ; \qquad \| f \| _ {\mathcal {H}} ^ {2} = \alpha^ {\top} K \alpha ; \qquad \mathcal {R} (f) = \alpha^ {\top} C B.
+$$
+
+Hence the optimal solution $\hat{f}^*$ is of the form $\hat{f}^* = \sum_{m=1}^{M} \alpha_m^* \partial_{i_m} k(Y_m, \cdot)$ , with $\alpha^*$ obtained as a solution to the finite dimensional problem in $\mathbb{R}^M$ :
+
+$$
+\min _ {\alpha \in \mathbb {R} ^ {M}} \alpha^ {\top} (\epsilon C C ^ {\top} + \epsilon \lambda K + C B D ^ {- 1} B ^ {\top} C ^ {\top}) \alpha + 2 \alpha^ {\top} C B D ^ {- 1} \widehat {\nabla \mathcal {L} (\theta)}
+$$
+
+It is easy to see that $\alpha^{*}$ are given by:
+
+$$
+\alpha^ {*} = - \left(\epsilon C C ^ {T} + \epsilon \lambda K + C B D ^ {- 1} B ^ {T} C ^ {T}\right) ^ {\dagger} C B D ^ {- 1} \widehat {\nabla \mathcal {L} (\theta)}.
+$$
+
+Now recall that the estimator in Proposition 5 is given by: $\widehat{\nabla^{W}\mathcal{L}(\theta)} = \frac{1}{\epsilon} D^{-1}\mathcal{U}_{\theta}(\hat{f}^{*})$ . Hence, $\frac{1}{\epsilon} D^{-1}(\widehat{\nabla\mathcal{L}(\theta)} -B^{T}C^{T}\alpha^{*})$ The desired expression is obtained by noting that $CB = T$ using the chain rule.
+
+
+
+# C.3 CONSISTENCY RESULTS
+
+Well-specified case. Here, we assume that the vector valued functions $(\phi_i)_{1\leq i\leq q}$ involved in Definition 2 can be expressed as gradients of functions in $\mathcal{H}$ . More precisely:
+
+Assumption 2. For all $1 \leq i \leq q$ , there exists functions $f_i \in \mathcal{H}$ such that $\phi_i = \nabla f_i$ . Additionally, $f_i$ are of the form $f_i = A^\alpha v_i$ for some fixed $\alpha \geq 0$ , with $v_i \in \mathcal{H}$ and $A$ being the differential covariance operator defined on $\mathcal{H}$ by $A \colon f \mapsto \int \sum_{i=1}^{d} \partial_i k(h_\theta(z),.) \partial_i f(h_\theta(z)) \, \mathrm{d}\nu(z)$ .
+
+The parameter $\alpha$ characterizes the smoothness of $f_{i}$ and therefore controls the statistical complexity of the estimation problem. Using a similar analysis as Sutherland et al. (2017) we obtain a convergence rate for the estimator in Proposition 5
+
+the following convergence rates for the estimator in Proposition 5:
+
+Theorem 14. Let $\delta$ be such that $0 \leq \delta \leq 1$ and $b := \min(1, \alpha + \frac{1}{2})$ . Under Assumption 2 and Assumptions (A) to (G) listed in Appendix A.2, for $N$ large enough, $M \sim (dN^{\frac{1}{2b+1}} \log(N))$ , $\lambda \sim N^{-\frac{1}{2b+1}}$ and $\epsilon \lesssim N^{-\frac{b}{2b+1}}$ , it holds with probability at least $1 - \delta$ that:
+
+$$
+\left\| \widehat {\nabla^ {W} \mathcal {L} (\theta)} - \nabla^ {W} \mathcal {L} (\theta) \right\| ^ {2} = \mathcal {O} \left(N ^ {- \frac {2 b}{2 b + 1}}\right).
+$$
+
+In the worst case where $\alpha = 0$ , the proposed estimator needs at most $M \sim (d\sqrt{N}\log(N))$ to achieve a convergence rate of $N^{-\frac{1}{2}}$ . The smoothest case requires only $M \sim (dN^{\frac{1}{3}}\log(N))$ to achieve a rate of $N^{-\frac{2}{3}}$ . Thus, the proposed estimator enjoys the same statistical properties as the ones proposed by Striperumbudur et al. (2017); Sutherland et al. (2017) while maintaining a computational advantage1 tNow we provide a proof for Theorem 14 which relies on the same techniques used by Rudi et al. (2015); Sutherland et al. (2017).
+
+Proof of Theorem 14. The proof is a direct consequence of Proposition 15 under Assumption 2.
+
+Proof of Theorem 7. The proof is a direct consequence of Proposition 15 under Assumption 1.
+
+Proposition 15. Under Assumptions (A) to (G) and for $0 \leq \delta \leq 1$ and $N$ large enough, it holds with probability at least $1 - \delta$ :
+
+$$
+\| \widehat {\nabla^ {W} \mathcal {L}} - \nabla^ {W} \mathcal {L} \| = \mathcal {O} \left(N ^ {- \frac {b}{2 b + 1}}\right)
+$$
+
+provided that $M \sim dN^{\frac{1}{2b + 1}}\log N$ , $\lambda \sim N^{\frac{1}{2b + 1}}$ and $\epsilon \lesssim N^{-\frac{b}{2b + 1}}$ where $b \coloneqq \min(1, \alpha + \frac{1}{2})$ when Assumption 2 holds and $b = \frac{1}{2 + c}$ when Assumption 1 holds instead.
+
+Proof. Here for simplicity we assume that $D(\theta) = I$ without loss of generality and we omit the dependence in $\theta$ and write $\nabla^{W}\mathcal{L}$ and $\nabla \mathcal{L}$ instead of $\nabla^{W}\mathcal{L}(\theta)$ and $\nabla \mathcal{L}(\theta)$ and $\nabla^{W}\mathcal{L}(\theta)$ . We also define $\hat{G}_{\epsilon} = \epsilon I + G_{M,N}$ and $G_{\epsilon} = \epsilon I + G_{W}$ . By Proposition 9, we know that $\widehat{\nabla^{W}\mathcal{L}} = \hat{G}_{\epsilon}^{-1}\widehat{\nabla\mathcal{L}}$ . We use the following decomposition:
+
+$$
+\| \widehat {\nabla^ {W} \mathcal {L}} - \nabla^ {W} \mathcal {L} \| \leq \| \hat {G} _ {\epsilon} ^ {- 1} (\widehat {\nabla \mathcal {L}} - \nabla \mathcal {L}) \| + \| \hat {G} _ {\epsilon} ^ {- 1} (G _ {M, N} - G _ {W}) G _ {W} ^ {- 1} \nabla \mathcal {L} \| + \epsilon \| \hat {G} _ {\epsilon} ^ {- 1} G _ {W} ^ {- 1} \nabla \mathcal {L} \|
+$$
+
+To control the norm of $\hat{G}_{\epsilon}^{-1}$ we write $\hat{G}_{\epsilon}^{-1} = G_{\epsilon}^{-\frac{1}{2}}(H + I)^{-1}G_{\epsilon}^{-\frac{1}{2}}$ , where $H$ is given by $H := G_{\epsilon}^{-\frac{1}{2}}(G_{M,N} - G_W)G_{\epsilon}^{-\frac{1}{2}}$ . Hence, provided that $\mu := \lambda_{\max}(H)$ , the highest eigenvalue of $H$ , is smaller than 1, it holds that:
+
+$$
+\left\| (H + I) ^ {- 1} \right\| \leq (1 - \mu) ^ {- 1}.
+$$
+
+Moreover, since $G_W$ is positive definite, its smallest eigenvalue $\eta$ is strictly positive. Hence, $\| G_{\epsilon}^{-1}\| \leq (\eta +\epsilon)^{-1}$ . Therefore, we have $\| \hat{G}_{\epsilon}^{-1}\| \leq (\eta +\epsilon)(1 - \mu))^{-1}$ , which implies:
+
+$$
+\left. \left\| \widehat {\nabla^ {W} \mathcal {L}} - \nabla^ {W} \mathcal {L} \right\| \leq (\eta + \epsilon) ^ {- 1} \left(\frac {\left\| \widehat {\nabla \mathcal {L}} - \nabla \mathcal {L} \right\|}{1 - \mu} + \eta^ {- 1} \| \nabla \mathcal {L} \| \| G _ {M, N} - G _ {W} \| + \epsilon \eta^ {- 1} \| \nabla \mathcal {L} \|\right). \right.
+$$
+
+Let $0 \leq \delta \leq 1$ . We have by Assumption (G) that $\|\widehat{\nabla\mathcal{L}} - \nabla\mathcal{L}\| = \mathcal{O}(N^{-\frac{1}{2}})$ with probability at least $1 - \delta$ . Similarly, by Proposition 16 and for $N$ large enough, we have with probability at least $1 - \delta$ that $\|G_{M,N} - G_W\| = \mathcal{O}(N^{-\frac{b}{2b + 1}})$ where $b$ is defined in Proposition 16. Moreover, for $N$ large enough, one can ensure that $\mu \leq \frac{1}{2}$ so that the following bound holds with probability at least $1 - \delta$ :
+
+$$
+\left\| \widehat {\nabla^ {W} \mathcal {L}} - \nabla^ {W} \mathcal {L} \right\| \lesssim (\eta + \epsilon) ^ {- 1} \left(2 N ^ {- \frac {1}{2}} + \eta^ {- 1} \| \nabla \mathcal {L} \| \left(N ^ {- \frac {b}{2 b + 1}} + \epsilon\right)\right).
+$$
+
+Thus by setting $\epsilon \lesssim N^{-\frac{b}{2b + 1}}$ we get the desired convergence rate.
+
+
+
+Proposition 16. For any $0 \leq \delta \leq 1$ , we have with probability as least $1 - \delta$ and for $N$ large enough that:
+
+$$
+\left\| G _ {M, N} - G _ {W} \right\| = \mathcal {O} \left(N ^ {- \frac {b}{2 b + 1}}\right).
+$$
+
+provided that $M \sim dN^{\frac{1}{2b + 1}}\log N$ where $b \coloneqq \min(1, \alpha + \frac{1}{2})$ when Assumption 2 holds and $b = \frac{1}{2 + c}$ when Assumption 1 holds instead.
+
+Proof. To control the error $\| G_{M,N} - G_W\|$ we decompose it into an estimation error $\| G_{M,N} - G_M\|$ and approximation error $\| G_M - G_W\|$ :
+
+$$
+\left\| G _ {M, N} - G _ {W} \right\| \leq \left\| G _ {M} - G _ {W} \right\| + \left\| G _ {M} - G _ {M, N} \right\|
+$$
+
+were $G_{M}$ is defined in (22) and is obtained by taking the number of samples $N$ to infinity while keeping the number of basis points $M$ fixed.
+
+The estimation error $\| G_M - G_{M,N}\|$ is controlled using Proposition 17 where, for any $0\leq \delta \leq 1$ , we have with probability at least $1 - \delta$ and as long as $N\geq M(1,\lambda ,\delta)$ ..
+
+$$
+\left\| G _ {M, N} - G _ {M} \right\| \leq \frac {\| B \|}{\sqrt {N \lambda}} \left(a _ {N, \delta} + \sqrt {2 \gamma_ {1} \kappa} + 2 \gamma_ {1} \frac {\lambda + \kappa}{\sqrt {N \lambda}}\right) + \frac {1}{N \lambda} a _ {N, \delta} ^ {2}.
+$$
+
+In the limit where $N \to \infty$ and $\lambda \to 0$ , only the dominant terms in the above equation remain which leads to an error $\| G_{M,N} - G_M\| = \mathcal{O}\big((N\lambda)^{-\frac{1}{2}}\big)$ . Moreover, the condition on $N$ can be expressed as $\lambda^{-1}\log \lambda^{-1} \lesssim N$ .
+
+To control the error approximation error $\| G_M - G_W\|$ we consider two cases: the well-specified case and the miss-specified case.
+
+- Well-specified case. Here we work under Assumption 2 which allows us to use Proposition 19. Hence, for any $0 \leq \delta \leq 1$ and if $M \geq M(d, \lambda, \delta)$ , it holds with probability at least $1 - \delta$ :
+
+$$
+\left\| G _ {M} - G _ {W} \right\| \lesssim \lambda^ {\min (1, \alpha + \frac {1}{2})}
+$$
+
+- Miss-specified case. Here we work under Assumption 1 which allows to use Proposition 18. Hence, for any $0 \leq \delta \leq 1$ and if $M \geq M(d, \lambda, \delta)$ , it holds with probability at least $1 - \delta$ :
+
+$$
+\left\| G _ {M} - G _ {W} \right\| \lesssim \lambda^ {\frac {1}{2 + c}}
+$$
+
+Let's set $b \coloneqq \min(1, \alpha + \frac{1}{2})$ for the well-specified case and $b = \frac{1}{2 + c}$ for the miss-specified case. In the limit where $M \to \infty$ and $\lambda \to 0$ the condition on $M$ becomes: $M \sim d\lambda^{-1}\log \lambda^{-1}$ . Hence, when $M \sim d\lambda^{-1}\log \lambda^{-1}$ and $\lambda^{-1}\log \lambda^{-1} \lesssim N$ it holds with probability as least $1 - \delta$ that
+
+$$
+\left\| G _ {M, N} - G _ {W} \right\| = \mathcal {O} \left(\lambda^ {b} + (\lambda N) ^ {- \frac {1}{2}}\right).
+$$
+
+One can further choose $\lambda$ of the form $\lambda = N^{-\theta}$ . This implies a condition on $M$ of the form $dN^{\theta}\log (N)\lesssim M$ and $N^{\theta}\log (N)\lesssim N$ . After optimizing over $\theta$ to get the tightest bound, the optimal value is obtained when $\theta = 1 / (2b + 1)$ and the requirement on $N$ is always satisfied once $N$ is large enough. Moreover, one can choose $M\sim dN^{\frac{1}{2b + 1}}\log N$ so that the requirement on $M$ is satisfied for $N$ large enough. In this case we get the following convergence rate:
+
+$$
+\left\| G _ {M, N} - G _ {W} \right\| = \mathcal {O} \left(N ^ {- \frac {b}{2 b + 1}}\right).
+$$
+
+
+
+Proposition 17. For any $0 \leq \delta \leq 1$ , provided that $N \geq M(1, \lambda, \delta)$ , we have with probability as least $1 - \delta$ :
+
+$$
+\left\| G _ {M, N} - G _ {M} \right\| \leq \frac {\| B \|}{\sqrt {N \lambda}} \left(2 a _ {N, \delta} + \sqrt {2 \gamma_ {1} \kappa} + 2 \gamma_ {1} \frac {\lambda + \kappa}{\sqrt {N \lambda}}\right) + \frac {1}{N \lambda} a _ {N, \delta} ^ {2}.
+$$
+
+with:
+
+$$
+a _ {N, \delta} := \sqrt {2 \sigma_ {1} ^ {2} \log {\frac {2}{\delta}}} + \frac {2 a \log {\frac {2}{\delta}}}{\sqrt {N}}
+$$
+
+Proof. For simplicity, we define $E = \widehat{L}^{\top}\overline{B} - L^{\top}B$ . By definition of $G_{M,N}$ and $G_{M}$ we have the following decomposition:
+
+$$
+\begin{array}{l} G _ {M, N} - G _ {M} = \underbrace {E ^ {\top} \mathcal {G} _ {M} (\hat {A} _ {\lambda}) E} _ {\mathfrak {E} _ {0}} + \underbrace {E ^ {\top} \mathcal {G} _ {M} (\hat {A} _ {\lambda}) L ^ {\top} B} _ {\mathfrak {E} _ {1}} + \underbrace {B ^ {\top} L \mathcal {G} _ {M} (\hat {A} _ {\lambda}) E} _ {\mathfrak {E} _ {2}} \\ - \underbrace {B ^ {\top} L \mathcal {G} _ {M} (A _ {\lambda}) P _ {M} (\hat {A} - A) P _ {M} \mathcal {G} _ {M} (\hat {A} _ {\lambda}) L ^ {\top} B} _ {\mathfrak {E} _ {3}} \\ \end{array}
+$$
+
+The first three terms can be upper-bounded in the following way:
+
+$$
+\begin{array}{l} \| \mathfrak {E} _ {0} \| = \| E ^ {\top} \hat {A} _ {\lambda} ^ {- \frac {1}{2}} \hat {A} _ {\lambda} ^ {\frac {1}{2}} \mathcal {G} _ {M} (\hat {A} _ {\lambda}) \hat {A} _ {\lambda} ^ {\frac {1}{2}} \hat {A} _ {\lambda} ^ {- \frac {1}{2}} E \| \\ \leq \| E \| ^ {2} \underbrace {\| \hat {A} _ {\lambda} ^ {- 1} \| \| \hat {A} _ {\lambda} ^ {\frac {1}{2}} \mathcal {G} _ {M} (\hat {A} _ {\lambda}) \hat {A} _ {\lambda} ^ {\frac {1}{2}} \|} _ {\leq 1 / \lambda} \\ \| \mathfrak {E} _ {1} \| = \| \mathfrak {E} _ {2} \| = \| E ^ {\top} A _ {\lambda} ^ {- \frac {1}{2}} A _ {\lambda} ^ {\frac {1}{2}} \mathcal {G} _ {M} (A _ {\lambda}) A _ {\lambda} ^ {\frac {1}{2}} A _ {\lambda} ^ {- \frac {1}{2}} L ^ {\top} B \| \\ \leq \| B \| \| E \| \underbrace {\| \hat {A} _ {\lambda} ^ {- \frac {1}{2}} \| \| \hat {A} _ {\lambda} ^ {\frac {1}{2}} \mathcal {G} _ {M} (\hat {A} _ {\lambda}) \hat {A} _ {\lambda} ^ {\frac {1}{2}} \| \| A _ {\lambda} ^ {- \frac {1}{2}} L ^ {\top} \| \| \hat {A} _ {\lambda} ^ {- \frac {1}{2}} A _ {\lambda} ^ {\frac {1}{2}} \|} _ {\leq 1 / \sqrt {\lambda}} \\ \end{array}
+$$
+
+For the last term $\mathfrak{E}_3$ , we first recall that by definition of $G_M(A_\lambda)$ we have:
+
+$$
+\mathcal {G} _ {M} (A _ {\lambda}) P _ {M} (\hat {A} - A) P _ {M} \mathcal {G} _ {M} (A _ {\lambda}) = \mathcal {G} _ {M} (A _ {\lambda}) (\hat {A} - A) \mathcal {G} _ {M} (A _ {\lambda}).
+$$
+
+Therefore, one can write:
+
+$$
+\begin{array}{l} \left\| \mathfrak {E} _ {3} \right\| = \left\| B ^ {\top} L A _ {\lambda} ^ {- \frac {1}{2}} A _ {\lambda} ^ {\frac {1}{2}} \mathcal {G} _ {M} (A _ {\lambda}) A _ {\lambda} ^ {\frac {1}{2}} A _ {\lambda} ^ {- \frac {1}{2}} (\hat {A} - A) A _ {\lambda} ^ {- \frac {1}{2}} A _ {\lambda} ^ {\frac {1}{2}} \hat {A} _ {\lambda} ^ {- \frac {1}{2}} \hat {A} _ {\lambda} ^ {\frac {1}{2}} \mathcal {G} _ {M} (\hat {A} _ {\lambda}) \hat {A} _ {\lambda} ^ {\frac {1}{2}} \hat {A} _ {\lambda} ^ {- \frac {1}{2}} A _ {\lambda} ^ {\frac {1}{2}} A _ {\lambda} ^ {- \frac {1}{2}} L ^ {\top} B \right\| \\ \leq \| B \| ^ {2} \underbrace {\| L A _ {\lambda} ^ {- \frac {1}{2}} \| ^ {2} \| A _ {\lambda} ^ {\frac {1}{2}} \mathcal {G} _ {M} (A _ {\lambda}) A _ {\lambda} ^ {\frac {1}{2}} \| \| \hat {A} _ {\lambda} ^ {\frac {1}{2}} \mathcal {G} _ {M} (\hat {A} _ {\lambda}) \hat {A} _ {\lambda} ^ {\frac {1}{2}} \| \| A _ {\lambda} ^ {\frac {1}{2}} \hat {A} _ {\lambda} ^ {\frac {1}{2}} \| ^ {2} \| A _ {\lambda} ^ {- \frac {1}{2}} (\hat {A} - A) A _ {\lambda} ^ {- \frac {1}{2}} \|} _ {\leq 1} \\ \leq \| B \| ^ {2} \| A _ {\lambda} ^ {\frac {1}{2}} \hat {A} _ {\lambda} ^ {\frac {1}{2}} \| ^ {2} \| A _ {\lambda} ^ {- \frac {1}{2}} (\hat {A} - A) A _ {\lambda} ^ {- \frac {1}{2}} \| \\ \end{array}
+$$
+
+We recall now (Rudi et al., 2015, Proposition 7.) which allows to upper-bound $\| A_{\lambda}^{\frac{1}{2}} \hat{A}_{\lambda}^{\frac{1}{2}} \|$ by $(1 - \eta)^{-\frac{1}{2}}$ where $\eta = \lambda_{\max}(A_{\lambda}^{\frac{1}{2}}(A - \hat{A})A_{\lambda}^{\frac{1}{2}})$ provided that $\eta < 1$ . Moreover, (Rudi et al., 2015, Proposition 8.) allows to control both $\eta$ and $\| A_{\lambda}^{-\frac{1}{2}}(\hat{A} - A)A_{\lambda}^{-\frac{1}{2}} \|$ under Assumption (F). Indeed, for any $0 \leq \delta \leq 1$ and provided that $0 < \lambda \leq \| A \|$ it holds with probability $1 - \delta$ that:
+
+$$
+\| A _ {\lambda} ^ {- \frac {1}{2}} (\hat {A} - A) A _ {\lambda} ^ {- \frac {1}{2}} \| \leq 2 \gamma_ {1} \frac {1 + \kappa / \lambda}{3 N} + \sqrt {\frac {2 \gamma_ {1} \kappa}{N \lambda}}; \qquad \eta \leq \frac {2 \gamma_ {2}}{3 N} + \sqrt {\frac {2 \gamma_ {2} \kappa}{N \lambda}}
+$$
+
+where $\gamma_{1}$ and $\gamma_{2}$ are given by:
+
+$$
+\gamma_ {1} = \log (\frac {8 T r (A)}{\lambda \delta}); \quad \gamma_ {2} = \log (\frac {4 T r (A)}{\lambda \delta}).
+$$
+
+Hence, for $N\geq M(1,\lambda ,\delta)$ we have that $(1 - \eta)^{-\frac{1}{2}}\leq 2$ and one can therefore write:
+
+$$
+\left\| \mathfrak {E} _ {3} \right\| \leq 4 \| B \| ^ {2} \left(2 \gamma_ {1} \frac {1 + \kappa / \lambda}{3 N} + \sqrt {\frac {2 \gamma_ {1} \kappa}{N \lambda}}\right)
+$$
+
+$$
+\left\| \mathfrak {E} _ {1} \right\| = \left\| \mathfrak {E} _ {1} \right\| \leq \frac {2 \| B \|}{\sqrt {\lambda}} \| E \|
+$$
+
+The error $\| E \|$ is controlled by Proposition 22 where it holds with probability greater or equal to $1 - \delta$ that:
+
+$$
+\| E \| \leq \frac {1}{\sqrt {N}} \left(\sqrt {2 \sigma_ {1} ^ {2} \log \frac {2}{\delta}} + \frac {2 a \log \frac {2}{\delta}}{\sqrt {N}}\right) := \frac {1}{\sqrt {N}} a _ {N, \delta}.
+$$
+
+Finally, we have shown that provided that $N \geq M(1,\lambda,\delta)$ then with probability greater than $1 - \delta$ one has:
+
+$$
+\| G _ {M, N} - G _ {M} \| \leq \frac {\| B \|}{\sqrt {N \lambda}} (2 a _ {N, \delta} + \sqrt {2 \gamma_ {1} \kappa} + 2 \gamma_ {1} \frac {\lambda + \kappa}{\sqrt {N \lambda}}) + \frac {1}{N \lambda} a _ {N, \delta} ^ {2}.
+$$
+
+Proposition 18. Let $0 \leq \lambda \leq \|A\|$ and define $M(d, \lambda, \delta) \coloneqq \frac{128}{9} \log \frac{4Tr(A)}{\lambda\delta} (d\kappa \lambda^{-1} + 1)$ . Under Assumption 1 and Assumption $(F)$ , for any $\delta \geq 0$ such that $M \geq M(d, \lambda, \delta)$ the following holds with probability $1 - \delta$ :
+
+$$
+\left\| G _ {M} - G _ {W} \right\| \lesssim \lambda^ {\frac {1}{2 + c}}
+$$
+
+Proof. We consider the error $\| G_M - G_W\|$ . Recall that $G_{W}$ is given by $G_{W} = \Phi^{\top}\Phi$ with $\Phi$ defined in Proposition 13. Let $\kappa$ be a positive real number, we know by Assumption 1 that there exists $F^{\kappa} \coloneqq (f_s^\kappa)_{1 \leq s \leq q}$ with $f_s^\kappa \in \mathcal{H}$ such that $\| \Phi - F^{\kappa} \|_{L_2(\rho_\theta)} \leq C\kappa$ and $\| f_s^\kappa \|_{\mathcal{H}} \leq C\kappa^{-c}$ for some fixed positive constant $C$ . Therefore, we use $F^{\kappa}$ to control the error $\| G_M - G_W\|$ . Let's call $E = \Phi \circ h_\theta - LF^\kappa$ . We consider the following decomposition:
+
+$$
+\begin{array}{l} G _ {M} - G _ {W} = \left(L ^ {\top} \Phi \circ h _ {\theta}\right) ^ {\top} \mathcal {G} _ {M} \left(A _ {\lambda}\right) L ^ {\top} \Phi \circ h _ {\theta} - \Phi^ {\top} \Phi \\ = \underbrace {E ^ {\top} L \mathcal {G} _ {M} (A _ {\lambda}) L ^ {\top} E} _ {\mathfrak {E} _ {1}} - \underbrace {E ^ {\top} E} _ {\mathfrak {E} _ {2}} \\ + \underbrace {F _ {\kappa} ^ {\top} \left(L ^ {\top} L \mathcal {G} _ {M} (A _ {\lambda}) - I\right) L ^ {\top} \Phi \circ h _ {\theta}} _ {\mathfrak {E} _ {3}} + \underbrace {E ^ {\top} L \left(\mathcal {G} _ {M} (A _ {\lambda}) L ^ {\top} L - I\right) F ^ {\kappa}} _ {\mathfrak {E} _ {4}} \\ \end{array}
+$$
+
+First we consider the term $\mathfrak{E}_1$ one simply has:
+
+$$
+\| \mathfrak {E} _ {1} \| \leq \kappa^ {2} \underbrace {\| L A _ {\lambda} ^ {- \frac {1}{2}} \| \| A _ {\lambda} ^ {\frac {1}{2}} \mathcal {G} _ {M} (A _ {\lambda}) A _ {\lambda} ^ {\frac {1}{2}} \| \| A _ {\lambda} ^ {- \frac {1}{2}} L ^ {\top} \|} _ {\leq 1} \leq \kappa^ {2}
+$$
+
+The second term also satisfies $\| \mathfrak{E}_1\| \leq \kappa^2$ by definition of $F_{\kappa}$ . For the last two terms $\mathfrak{E}_3$ and $\mathfrak{E}_4$ we use Lemma 20 which allows to control the operator norm of $L(\mathcal{G}_M(A_\lambda)L^\top L - I)$ . Hence, for any $\delta \geq 0$ and $M$ such that $M\geq M(d,\lambda ,\delta)$ and for $\kappa \leq 1$ it holds with probability $1 - \delta$ that:
+
+$$
+\| \mathfrak {E} _ {3} \| \lesssim \sqrt {\lambda} \kappa^ {- c}; \quad \| \mathfrak {E} _ {4} \| \lesssim \sqrt {\lambda} \kappa^ {- c}
+$$
+
+We have shown so far that $\| G_M - G_W\| \lesssim (\kappa^2 +2\kappa^{-c}\sqrt{\lambda})$ . One can further optimize over $\kappa$ on the interval [0,1] to get a tighter bound. The optimal value in this case is $\kappa^{*} = \min (1,(c\lambda^{\frac{1}{2}})^{\frac{1}{2 + c}})$ . By considering $\lambda >0$ such that $(c\lambda^{\frac{1}{2}})^{\frac{1}{2 + c}})\leq 1$ , it follows directly that $\| G_M - G_W\| \lesssim \lambda^{\frac{1}{2 + c}}$ which shows the desired result.
+
+Proposition 19. Let $0 \leq \lambda \leq \|A\|$ and define $M(d, \lambda, \delta) \coloneqq \frac{128}{9} \log \frac{4Tr(A)}{\lambda\delta} (d\kappa \lambda^{-1} + 1)$ . Under Assumption 2 and Assumption $(F)$ , for any $\delta \geq 0$ such that $M \geq M(d, \lambda, \delta)$ the following holds with probability $1 - \delta$ :
+
+$$
+\left\| G _ {M} - G _ {W} \right\| \lesssim \lambda^ {\min \left(1, \alpha + \frac {1}{2}\right)}
+$$
+
+Proof. Recall that $G_W$ is given by $G_W = \Phi^\top \Phi$ with $\Phi$ defined in Proposition 13. By Assumption 2, we have that $\Phi = \nabla (A^\alpha V)$ with $V \coloneqq (v_s)_{1 \leq s \leq q} \in \mathcal{H}^q$ . Hence, one can write
+
+$$
+\begin{array}{l} G _ {M} - G _ {W} = \left(L ^ {\top} \Phi \circ h _ {\theta}\right) ^ {\top} \mathcal {G} _ {M} \left(A _ {\lambda}\right) L ^ {\top} \Phi \circ h _ {\theta} - \Phi^ {\top} \Phi \\ = V ^ {\top} \left(A ^ {\alpha} \left(A \mathcal {G} _ {M} \left(A _ {\lambda}\right) A - A\right) A ^ {\alpha} V \right. \\ \end{array}
+$$
+
+we can therefore directly apply Lemma 20 and get $\| G_M - G_W\| \lesssim \lambda^{\min (1,\alpha +\frac{1}{2})}$ with probability $1 - \delta$ for any $\delta \geq 0$ such that $M\geq M(d,\lambda ,\delta)$ .
+
+Lemma 20. Let $0 \leq \lambda \leq \|A\|$ , $\alpha \geq 0$ and define $M(d, \lambda, \delta) \coloneqq \frac{128}{9} \log \frac{4Tr(A)}{\lambda\delta} (d\kappa \lambda^{-1} + 1)$ . Under Assumption $(F)$ , for any $\delta \geq 0$ such that $M \geq M(d, \lambda, \delta)$ the following holds with probability $1 - \delta$ :
+
+$$
+\| L (\mathcal {G} _ {M} (A _ {\lambda}) L ^ {\top} L - I) A ^ {\alpha} \| \lesssim \lambda^ {\min \left(1, \alpha + \frac {1}{2}\right)}
+$$
+
+Proof. We have the following identities:
+
+$$
+\begin{array}{l} L \left(\mathcal {G} _ {M} \left(A _ {\lambda}\right) L ^ {\top} L - I\right) A ^ {\alpha} = L \left(\mathcal {G} _ {M} \left(A _ {\lambda}\right) A _ {\lambda} - I - \lambda \mathcal {G} _ {M} \left(A _ {\lambda}\right)\right) A ^ {\alpha} \\ = \underbrace {L A _ {\lambda} ^ {- \frac {1}{2}} A _ {\lambda} ^ {\frac {1}{2}} \left(\mathcal {G} _ {M} \left(A _ {\lambda}\right) A _ {\lambda} P _ {M} - I\right) A ^ {\alpha}} _ {\mathfrak {E} _ {1}} - \underbrace {\lambda L A _ {\lambda} ^ {- \frac {1}{2}} A _ {\lambda} ^ {\frac {1}{2}} \mathcal {G} _ {M} \left(A _ {\lambda}\right) A _ {\lambda} ^ {\frac {1}{2}} A _ {\lambda} ^ {- \frac {1}{2}} A ^ {\alpha}} _ {\mathfrak {E} _ {3}} \\ + \underbrace {L A _ {\lambda} ^ {- \frac {1}{2}} A _ {\lambda} ^ {\frac {1}{2}} \mathcal {G} _ {M} (A _ {\lambda}) A _ {\lambda} ^ {\frac {1}{2}} A _ {\lambda} ^ {\frac {1}{2}} (I - P _ {M}) A ^ {\alpha}} _ {\mathfrak {E} _ {2}}. \\ \end{array}
+$$
+
+For the first $\mathfrak{E}_1$ we use (Sutherland et al., 2017, Lemma 1 (iii)) which implies that $\mathcal{G}_M(A_\lambda)A_\lambda P_M = P_M$ . Thus $\mathfrak{E}_1 = LA_\lambda^{-\frac{1}{2}}A_\lambda^{\frac{1}{2}}(P_M - I)A^\alpha$ . Moreover, by Lemma 21 we have that $\| A_{\lambda}^{\frac{1}{2}}(I - P_M)\| \leq 2\sqrt{\lambda}$ with probability $1 - \delta$ for $M > M(d,\lambda ,\delta)$ . Therefore, recalling that $(I - P_M)^2 = I - P_M$ since $P_M$ is a projection, one can further write:
+
+$$
+\| \mathfrak {E} _ {\mathbf {1}} \| \leq \underbrace {\| L A _ {\lambda} ^ {- \frac {1}{2}} \| \| A _ {\lambda} ^ {\frac {1}{2}} (P _ {M} - I) \| ^ {2}} _ {\leq 1} \| A _ {\lambda} ^ {- \frac {1}{2}} A ^ {\alpha} \|
+$$
+
+$$
+\| \mathfrak {E} _ {2} \| \leq \underbrace {\| L A _ {\lambda} ^ {- \frac {1}{2}} \| \| A _ {\lambda} ^ {\frac {1}{2}} \mathcal {G} _ {M} (A _ {\lambda}) A _ {\lambda} ^ {\frac {1}{2}}} _ {\leq 1} \| \| A _ {\lambda} ^ {\frac {1}{2}} (P _ {M} - I) \| ^ {2} \| A _ {\lambda} ^ {- \frac {1}{2}} A ^ {\alpha} \|
+$$
+
+$$
+\| \mathfrak {E} _ {3} \| \leq \lambda \underbrace {\| L A _ {\lambda} ^ {- \frac {1}{2}} \| \| A _ {\lambda} ^ {\frac {1}{2}} \mathcal {G} _ {M} (A _ {\lambda}) A _ {\lambda} ^ {\frac {1}{2}} \| \| A _ {\lambda} ^ {- \frac {1}{2}} A ^ {\alpha} \|} _ {\leq 1}
+$$
+
+It remains to note that $\| A_{\lambda}^{-\frac{1}{2}}A^{\alpha}\| \leq \lambda^{\alpha -\frac{1}{2}}$ when $0\leq \alpha \leq \frac{1}{2}$ and that $\| A_{\lambda}^{-\frac{1}{2}}A^{\alpha}\| \leq \| A\|^{\alpha -\frac{1}{2}}$ for $\alpha >\frac{1}{2}$ which allows to conclude.
+
+# C.4 AUXILIARY RESULTS
+
+Lemma 21. Let $0 \leq \lambda \leq \|A\|$ . Under Assumption $(F)$ , for any $\delta \geq 0$ such that $M \geq M(d, \lambda, \delta) := \frac{128}{9} \log \frac{4Tr(A)}{\lambda\delta} (\kappa \lambda^{-1} + 1)$ the following holds with probability $1 - \delta$ :
+
+$$
+\left\| A _ {\lambda} ^ {\frac {1}{2}} \left(I - P _ {M}\right) \right\| \leq 2 \sqrt {\lambda}
+$$
+
+Proof. The proof is an adaptation of the results in Rudi et al. (2015); Sutherland et al. (2017). Here we recall $Q_{M}$ defined in (21). Its transpose $Q_{M}^{\top}$ sends vectors in $\mathbb{R}^{M}$ to elements in the span of the Nyström basis
+
+points, hence $P_M$ and $Q_M^\top$ have the same range, i.e.: $\text{range}(P_M) = \text{range}(Q_M^\top)$ . We are in position to apply (Rudi et al., 2015, Proposition 3.) which allows to find an upper-bound on $A_{\lambda}^{\frac{1}{2}}(P_M - I)$ in terms of $Q_M$ :
+
+$$
+\left\| A _ {\lambda} ^ {\frac {1}{2}} \left(P _ {M} - I\right) \right\| \leq \sqrt {\lambda} \left\| A _ {\lambda} ^ {\frac {1}{2}} \left(Q _ {M} ^ {\top} Q _ {M} + \lambda I\right) ^ {- \frac {1}{2}} \right\|.
+$$
+
+For simplicity we write $\hat{A}_M\coloneqq Q_M^\top Q_M$ and $E_2\coloneqq A_\lambda^{-\frac{1}{2}}(A - \hat{A}_M)A_\lambda^{-\frac{1}{2}}$ . We also denote by $\beta = \lambda_{max}(E_2)$ the highest eigenvalue of $E_2$ . We can therefore control $\| A_{\lambda}^{\frac{1}{2}}(\hat{A}_{M} + \lambda I)^{-\frac{1}{2}}\|$ in terms of $\beta$ using (Rudi et al., 2015, Proposition 7) provided that $\beta < 1$ :
+
+$$
+\left\| A _ {\lambda} ^ {\frac {1}{2}} \left(P _ {M} - I\right) \right\| \leq \sqrt {\lambda} \frac {1}{\sqrt {1 - \beta}}.
+$$
+
+Now we need to make sure that $\beta < 1$ for $M$ large enough. To this end, we will apply (Rudi et al., 2015, Proposition 8.) to $\hat{A}_M$ . Denote by $v_m = \sqrt{d}\partial_{i_m}k(Y_m,)$ . Hence, by definition of $\hat{A}_M$ it follows that $\hat{A}_M = \frac{1}{M}\sum_{m=1}^{M}v_m \otimes v_m$ . Moreover, $(v_m)_{1 \leq m \leq M}$ are independent and identically distributed and satisfy:
+
+$$
+\mathbb {E} [ v _ {m} \otimes v _ {m} ] = \int \sum_ {i = 1} ^ {q} \partial_ {i} k (y,) \otimes \partial_ {i} k (y,) \mathrm {d} p _ {\theta} (y) = A.
+$$
+
+We also have by Assumption (F) that $\langle v_m, A_\lambda^{-1}v_m \rangle \leq \frac{d\kappa}{\lambda}$ almost surely and for all $\lambda > 0$ . We can therefore apply (Rudi et al., 2015, Proposition 8.) which implies that for any $1 \geq \delta \geq 0$ and with probability $1 - \delta$ it holds that:
+
+$$
+\beta \leq \frac {2 \gamma}{3 M} + \sqrt {\frac {2 \gamma d \kappa}{M \lambda}}
+$$
+
+with $\gamma = \log \frac{4Tr(A)}{\lambda\delta}$ provided that $\lambda \leq \| A\|$ . Thus by choosing $M \geq \frac{128\gamma}{9} (d\kappa \lambda^{-1} + 1)$ we have that $\beta \leq \frac{3}{4}$ with probability $1 - \delta$ which allows to conclude.
+
+Proposition 22. There exist $a > 0$ and $\sigma_1 > 0$ such that for any $0 \leq \delta \leq 1$ , it holds with probability greater of equal than $1 - \delta$ that:
+
+$$
+\widehat {\| L ^ {\top} B - L ^ {\top} B \|} \leq \frac {2 a \log^ {2} \frac {2}{\delta}}{N} + \sqrt {\frac {2 \sigma_ {1} ^ {2} \log^ {2} \frac {2}{\delta}}{N}}
+$$
+
+Proof. denote by $v_{n} = \sum_{i=1}^{d} \partial_{i} k(X_{n},.) B_{i}(Z_{n})$ , we have that $\mathbb{E}[v_{n}] = L^{\top}B$ . We will apply Bernstein's inequality for sum of random vectors. For this we first need to find $a > 0$ and $\sigma_{1} > 0$ such that $\mathbb{E}[||z_{n} - L^{\top}B||_{\mathcal{H}}^{p}] \leq \frac{1}{2} p! \sigma_{1}^{2} a^{p-2}$ . To simplify notations, we write $x$ and $x'$ instead of $h_{\theta}(z)$ and $h_{\theta}(z')$ . We have that:
+
+$$
+\begin{array}{l} \mathbb {E} [ \| z _ {n} - L ^ {\top} B \| _ {\mathcal {H}} ^ {p} ] = \int \left\| \sum_ {i = 1} ^ {d} \partial_ {i} k (x,.) B _ {i} (z) - \int \sum_ {i = 1} ^ {d} \partial_ {i} k (x ^ {\prime},.) B _ {i} (z ^ {\prime}) \mathrm {d} \nu (z ^ {\prime}) \right\| ^ {p} \mathrm {d} \nu (z) \\ \leq 2 ^ {p - 1} \underbrace {\int \left\| \sum_ {i = 1} ^ {d} \int (\partial_ {i} k (x , .) - \partial_ {i} k (x ^ {\prime} , .)) B _ {i} (z) \mathrm {d} \nu (z ^ {\prime}) \right\| ^ {p} \mathrm {d} \nu (z)} _ {\mathfrak {E} _ {1}} \\ + 2 ^ {p - 1} \underbrace {\int \left\| \int \sum_ {i = 1} ^ {d} \partial_ {i} k (x , .) \left(B _ {i} (z) - B _ {i} \left(z ^ {\prime}\right)\right) \mathrm {d} \nu \left(z ^ {\prime}\right) \right\| ^ {p} \mathrm {d} \nu (z)} _ {\mathfrak {E} _ {2}} \\ \end{array}
+$$
+
+We used the convexity of the norm and the triangular inequality to get the last line. We introduce the notation $\gamma_{i}(x)\coloneqq \partial_{i}k(x,.) - \int \partial_{i}k(h_{\theta}(z^{\prime}),.)\mathrm{d}\nu (z^{\prime})$ and by $\Gamma (x)$ we denote the matrix whose components are given by $\Gamma (x)_{ij}\coloneqq \langle \gamma_i(x),\gamma_j(x)\rangle_{\mathcal{H}}$ . The first term $\mathfrak{E}_1$ can be upper-bounded as follows:
+
+$$
+\begin{array}{l} \mathfrak {E} _ {1} = \int \left| T r (B (z) B (z) ^ {\top} \Gamma (x)) \right| ^ {\frac {p}{2}} \\ \leq \int \left| \| B (z) \| ^ {2} T r (\Gamma (x) ^ {2}) ^ {\frac {1}{2}} \right| ^ {\frac {p}{2}}. \\ \end{array}
+$$
+
+Moreover, we have that $Tr(\Gamma(x)^2)^{\frac{1}{2}} = (\sum_{1 \leq i,j \leq d} \langle \gamma_i(x), \gamma_j(x) \rangle_{\mathcal{H}}^2)^{\frac{1}{2}} \leq \sum_{i=1}^{d} \| \gamma_i(x) \|^2$ . We further have that $\| \gamma_i(x) \| \leq \partial_i \partial_{i+d} k(x,x)^{\frac{1}{2}} + \int \partial_i \partial_{i+d} k(h_\theta(z), h_\theta(z))^{\frac{1}{2}} \mathrm{d}\nu(z)$ and by Assumption (F) it follows that $\| \gamma_i(x) \| \leq 2\sqrt{\kappa}$ . Hence, one can directly write that: $\mathfrak{E}_1 \leq (2\sqrt{\kappa d})^p \int \| B(z) \|^p \mathrm{d}\nu(z)$ . Recalling Assumptions (B) and (C) we get:
+
+$$
+\mathfrak {E} _ {1} \leq 2 ^ {p - 1} (2 \sqrt {\kappa d}) ^ {p} C (\theta) ^ {p} \left(1 + \frac {1}{2} p! \zeta^ {p - 2} \sigma^ {2}\right)
+$$
+
+Similarly, we will find an upper-bound on $\mathfrak{E}_2$ . To this end, we introduce the matrix $Q(x',x'')$ whose components are given by $Q(x',x'')_{i,j} = \partial_i\partial_{i + d}k(x',x'')$ . One, therefore has:
+
+$$
+\begin{array}{l} \mathfrak {E} _ {2} = \int \left| \iint T r ((B (z) - B (z ^ {\prime})) (B (z) - B (z ^ {\prime})) ^ {\top} Q (x ^ {\prime}, x ^ {\prime \prime}) \mathrm {d} \nu (z ^ {\prime}) \mathrm {d} \nu (z ^ {\prime \prime}) \right| ^ {\frac {p}{2}} \mathrm {d} \nu (z) \\ \leq \int \left| \iint \| B (z) - B (z ^ {\prime}) \| \| B (z) - B (z ^ {\prime \prime}) \| T r (Q (x ^ {\prime}, x ^ {\prime \prime}) ^ {2}) ^ {\frac {1}{2}} \mathrm {d} \nu (z ^ {\prime}) \mathrm {d} \nu (z ^ {\prime \prime}) \right| ^ {\frac {p}{2}} \mathrm {d} \nu (z) \\ \end{array}
+$$
+
+Once again, we have that $Tr(Q(x', x'')^2)^{\frac{1}{2}} \leq \left( \sum_{i=1}^{d} \partial_i \partial_{i+d} k(x', x') \right)^{\frac{1}{2}} \left( \sum_{i=1}^{d} \partial_i \partial_{i+d} k(x'', x'') \right)^{\frac{1}{2}} \leq d\kappa$ thanks to Assumption (F). Therefore, it follows that:
+
+$$
+\begin{array}{l} \mathfrak {E} _ {2} \leq (\sqrt {d \kappa}) ^ {p} \int | \int \| B (z) - B \left(z ^ {\prime}\right) \| \mathrm {d} \nu (z) | ^ {p} \mathrm {d} \nu (z) \\ \leq 3 ^ {p - 1} (\sqrt {d \kappa}) ^ {p} C (\theta) ^ {p} (2 ^ {p} + \int \| z \| ^ {p} \mathrm {d} \nu (z) + \left(\int \| z \| \mathrm {d} \nu (z)\right) ^ {p}) \\ \leq 3 ^ {p - 1} (\sqrt {d \kappa}) ^ {p} C (\theta) ^ {p} (2 ^ {p} + \frac {1}{2} p! \zeta^ {p - 2} \sigma^ {2} + \left(\int \| z \| \mathrm {d} \nu (z)\right) ^ {p}). \\ \end{array}
+$$
+
+The second line is a consequence of Assumption (C) while the last line is due to Assumption (B). These calculations, show that it is possible to find constants $a$ and $\sigma_{1}$ such that $\mathbb{E}[\| z_n - L^\top B\|_{\mathcal{H}}^p ]\leq \frac{1}{2} p!\sigma_1^2 a^{p - 2}$ . Hence one concludes using Bernstein's inequality for a sum of random vectors (see for instance Rudi et al., 2015, Proposition 11).
+
+# D EXPERIMENTAL DETAILS
+
+# D.1 NATURAL WASSERSTEIN GRADIENT FOR THE MULTIVARIATE NORMAL MODEL
+
+Multivariate Gaussian. Consider a multivariate gaussian with mean $\mu \in \mathbb{R}^d$ and covariance matrix $\Sigma \in \mathbb{R}^d\times \mathbb{R}^d$ parametrized using its lower triangular components $s = T(\Sigma)$ . We denote by $\Sigma = T^{-1}(s)$ the inverse operation that maps any vector $s\in \mathbb{R}^{\frac{d(d + 1)}{2}}$ to its corresponding symmetric matrix in $\mathbb{R}^d\times \mathbb{R}^d$ . The concatenation of the mean $\mu$ and $s$ will be denoted as $\theta :\theta = (\mu ,s)$ . Given two parameter vectors $u = (m,T(S))$ and $v = (m^{\prime},T(S^{\prime}))$ where $m$ and $m^{\prime}$ are vectors in $\mathbb{R}^d$ and $S$ and $S^{\prime}$ are symmetric matrices in $\mathbb{R}^d\times \mathbb{R}^d$ the metric evaluated at $u$ and $v$ is given by:
+
+$$
+u ^ {\top} G (\theta) v = m ^ {\top} m ^ {\prime} + T r \left(A \Sigma A ^ {\prime}\right)
+$$
+
+where $A$ and $A^{\prime}$ are symmetric matrices that are solutions to the Lyapunov equation:
+
+$$
+S = A \Sigma + \Sigma A, \qquad S ^ {\prime} = A ^ {\prime} \Sigma + \Sigma A ^ {\prime}.
+$$
+
+$A$ and $A^{\prime}$ can be computed in closed form using standard routines making the evaluation of the metric easy to perform. Given a loss function $\mathcal{L}(\theta)$ and gradient direction $\nabla_{\theta}\mathcal{L}(\theta) = \nabla_{\mu}\mathcal{L}(\theta),\nabla_{s}\mathcal{L}(\theta)$ , the corresponding natural gradient $\nabla_{\theta}^{W}\mathcal{L}(\theta)$ can also be computed in closed form:
+
+$$
+\nabla_ {\theta} ^ {W} \mathcal {L} (\theta) = \left(\nabla_ {\mu} \mathcal {L} (\theta), T \left(\Sigma (A + d i a g (A)) + (A + d i a g (A)) \Sigma\right)\right),
+$$
+
+where $A = T^{-1}(\nabla_s\mathcal{L}(\theta))$ . To use the estimator proposed in Proposition 5 we take advantage of the parametrization of the Gaussian distribution as a push-forward of a standard normal vector:
+
+$$
+X \sim \mathcal {N} (\mu , \Sigma) \Longleftrightarrow X = \Sigma^ {\frac {1}{2}} Z + \mu , Z \sim \mathcal {N} (0, I _ {d})
+$$
+
+
+
+
+
+
+
+
+Figure 4: Evolution of the relative error of KWNG averaged over 100 runs for varying dimension form $d = 1$ (yellow) to $d = 10$ (dark red). For each run, a random value for the parameter $\theta$ and for the Euclidean gradient $\nabla \mathcal{L}(\theta)$ is sampled from a centered Gaussian with variance 0.1. In all cases, $\lambda = 0$ and $\epsilon = 10^{-5}$ . Top row: multivariate normal model, bottom row: multivariate log-normal. Left (a): box-plot of the relative error as $d$ increases with $N = 5000$ and the number of basis points is set to $M = \left\lfloor d\sqrt{N}\right\rfloor$ . (b) Relative error as the sample size $N$ increases and the number of basis points is set to $M = \left\lfloor d\sqrt{N}\right\rfloor$ . Right (c): Relative error as $M$ increases and $N$ fixed to 5000.
+
+
+
+
+
+
+Figure 5: Relative error of the KWNG for varying bandwidth of the kernel. Results are averaged over 100 runs for varying dimension form $d = 1$ (yellow) to $d = 10$ (dark red). For each run, a random value for the parameter $\theta$ and for the Euclidean gradient $\nabla \mathcal{L}(\theta)$ is sampled from a centered Gaussian with variance 0.1. In all cases, $\lambda = \epsilon = 10^{-10}$ . The sample size is fixed to $N = 5000$ and the number of basis points is set to $M = \left\lfloor d\sqrt{N}\right\rfloor$ . Left: uniform distributions on a hyper-sphere, middle: multivariate normal, and right: multivariate log-normal.
+
+
+
+
+
+# D.2 CLASSIFICATION ON CIFAR10 AND CIFAR100
+
+Architecture. We use a residual network with one convolutional layer followed by 8 residual blocks and a final fully connected layer. Each residual block consists of two $3 \times 3$ convolutional layers each and ReLU nonlinearity. We use batch normalization for all methods. Details of the intermediate output shapes and kernel size are provided in Table 1.
+
+Hyper-parameters. For all methods, we used a batch-size of 128. The optimal step-size $\gamma$ was selected in $\{10,1,10^{-1},10^{-2},10^{-3},10^{-4}\}$ for each method. In the case of SGD with momentum, we used a momentum parameter of 0.9 and a weight decay of either 0 or $5\times 10^{-4}$ . For KFAC and EKFAC, we used a damping coefficient of $10^{-3}$ and a frequency of reparametrization of 100 updates. For KWGN we set $M = 5$ and $\lambda = 0$ while the initial value for $\epsilon$ is set to $\epsilon = 10^{-5}$ and is adjusted using an adaptive scheme based on the Levenberg-Marquardt dynamics as in (Martens and Grosse, 2015, Section 6.5). More
+
+ | Kernel size | Output shape |
| z | | 32 × 32 × 3 |
| Conv | 3 × 3 | 64 |
| Residual block | [3 × 3] × 2 | 64 |
| Residual block | [3 × 3] × 2 | 128 |
| Residual block | [3 × 3] × 2 | 256 |
| Residual block | [3 × 3] × 2 | 512 |
| Linear | - | Number of classes |
+
+Table 1: Network architecture.
+
+precisely, we use the following update equation for $\epsilon$ after every 5 iterations of the optimizer:
+
+$$
+\begin{array}{l l} \epsilon \leftarrow \omega \epsilon , & \text {i f} r > \frac {3}{4} \\ \epsilon \leftarrow \omega^ {- 1} \epsilon , & \text {i f} r < \frac {1}{4}. \end{array}
+$$
+
+Here, $r$ is the reduction ratio:
+
+$$
+r = \max _ {t _ {k - 1} \leq t \leq t _ {k}} \left(2 \frac {\mathcal {L} (\theta_ {t})) - \mathcal {L} (\theta_ {t + 1})}{\nabla^ {W} \mathcal {L} (\theta) ^ {\top} \nabla \mathcal {L} (\theta) ^ {\top}}\right)
+$$
+
+where $(t_k)_k$ are the times when the updates occur. and $\omega$ is the decay constant chosen to $\omega = 0.85$ .
+
+# D.3 ADDITIONAL EXPERIMENTS
+
+Figure 6 reports the time cost in seconds for each methods, while Figure 7 compares KWNG to diagonal conditioning.
+
+
+
+
+
+
+Figure 6: Training accuracy (left) and test accuracy (right) as a function of time for classification on Cifar10 in both the ill-conditioned case (top) and well-conditioned case (bottom) for different optimization methods.
+
+
+
+
+Figure 7: KWNG vs Diagonal conditioning in the ill-conditioned case on Cifar10. In red and blue, the euclidean gradient is preconditioned using a diagonal matrix $D$ either given by $D_{i} = \| T_{.,i}\|$ or $D_{i} = \| \widetilde{T}_{.,i}\|$ , where $T$ and $\widetilde{T}$ are defined in Propositions 5 and 6. The rest of the traces are obtained using the stable version of KWNG in Proposition 6 with different choices for the damping term $D = I$ , $D = \| T_{.,i}\|$ and $\| \widetilde{T}_{.,i}\|$ . All use a gaussian kernel except the yellow traces which uses a rational quadratic kernel.
+
+
\ No newline at end of file
diff --git a/kernelizedwassersteinnaturalgradient/images.zip b/kernelizedwassersteinnaturalgradient/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..c3b726de72b38b5c7acfa5848e622274a4098c40
--- /dev/null
+++ b/kernelizedwassersteinnaturalgradient/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:5cee6fdad65735af2e0fa497f3b5bc80c5c7ae15e231d692cfde0e4088ed2e7b
+size 1573269
diff --git a/kernelizedwassersteinnaturalgradient/layout.json b/kernelizedwassersteinnaturalgradient/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..f6fec880b7cf7c6442daec2fedaa71132867db7f
--- /dev/null
+++ b/kernelizedwassersteinnaturalgradient/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:80476c7fc9d23aa06d1f69f0ff4afde747a5e044419d0b5d24a6d33256143168
+size 1795865
diff --git a/learningcompositionalkoopmanoperatorsformodelbasedcontrol/f50cc883-3730-4c3a-9d04-d502dd53885e_content_list.json b/learningcompositionalkoopmanoperatorsformodelbasedcontrol/f50cc883-3730-4c3a-9d04-d502dd53885e_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..6e369ba80315367b88b6ead102723ba86dcdf9eb
--- /dev/null
+++ b/learningcompositionalkoopmanoperatorsformodelbasedcontrol/f50cc883-3730-4c3a-9d04-d502dd53885e_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ee9ab6ee9d5dcea51b6fc3729cf8486608a53a93c024745154f61625eb1011dd
+size 85531
diff --git a/learningcompositionalkoopmanoperatorsformodelbasedcontrol/f50cc883-3730-4c3a-9d04-d502dd53885e_model.json b/learningcompositionalkoopmanoperatorsformodelbasedcontrol/f50cc883-3730-4c3a-9d04-d502dd53885e_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..cbb1789512836172d63ebb7db505fe0ce934c00f
--- /dev/null
+++ b/learningcompositionalkoopmanoperatorsformodelbasedcontrol/f50cc883-3730-4c3a-9d04-d502dd53885e_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:1f4476956b917538894dd634a4c77df3d0f8d00112d2b934ec87d5ac0b4495cc
+size 104676
diff --git a/learningcompositionalkoopmanoperatorsformodelbasedcontrol/f50cc883-3730-4c3a-9d04-d502dd53885e_origin.pdf b/learningcompositionalkoopmanoperatorsformodelbasedcontrol/f50cc883-3730-4c3a-9d04-d502dd53885e_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..d02faebc1efc076296ff348b295fcd974c741d2a
--- /dev/null
+++ b/learningcompositionalkoopmanoperatorsformodelbasedcontrol/f50cc883-3730-4c3a-9d04-d502dd53885e_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:166c94ed165852839f2a4e1cc16dccf03ee7fb7895ee6b0f2c6693a0dba9767e
+size 1526457
diff --git a/learningcompositionalkoopmanoperatorsformodelbasedcontrol/full.md b/learningcompositionalkoopmanoperatorsformodelbasedcontrol/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..654e7a289901b944bbc5586c6aad4356a7538055
--- /dev/null
+++ b/learningcompositionalkoopmanoperatorsformodelbasedcontrol/full.md
@@ -0,0 +1,335 @@
+# LEARNING COMPOSITIONAL KOOPMAN OPERATORS FOR MODEL-BASED CONTROL
+
+Yunzhu Li*
+
+MIT CSAIL
+
+Hao He*
+
+MIT CSAIL
+
+Jiajun Wu
+
+MIT CSAIL
+
+Dina Katabi
+
+MIT CSAIL
+
+Antonio Torralba
+
+MIT CSAIL
+
+# ABSTRACT
+
+Finding an embedding space for a linear approximation of a nonlinear dynamical system enables efficient system identification and control synthesis. The Koopman operator theory lays the foundation for identifying the nonlinear-to-linear coordinate transformations with data-driven methods. Recently, researchers have proposed to use deep neural networks as a more expressive class of basis functions for calculating the Koopman operators. These approaches, however, assume a fixed dimensional state space; they are therefore not applicable to scenarios with a variable number of objects. In this paper, we propose to learn compositional Koopman operators, using graph neural networks to encode the state into object-centric embeddings and using a block-wise linear transition matrix to regularize the shared structure across objects. The learned dynamics can quickly adapt to new environments of unknown physical parameters and produce control signals to achieve a specified goal. Our experiments on manipulating ropes and controlling soft robots show that the proposed method has better efficiency and generalization ability than existing baselines.
+
+# 1 INTRODUCTION
+
+Simulating and controlling complex dynamical systems, such as ropes or soft robots, relies on two key features of the dynamics model: first, it needs to be efficient for system identification and motor control; second, it needs to be generalizable to a complex, constantly evolving environments.
+
+In practice, computational models for complex, nonlinear dynamical systems are often not efficient enough for real-time control (Mayne, 2000). The Koopman operator theory suggests that identifying nonlinear-to-linear coordinate transformations allows efficient linear approximation of nonlinear systems (Williams et al., 2015; Mauroy & Goncalves, 2016). Fast as they are, however, existing papers on Koopman operators focus on a single dynamical system, making it hard to generalize to cases where there are a variable number of components.
+
+In contrast, recent advances in approximating dynamics models with deep nets have demonstrated its power in characterizing complex, generic environments. In particular, a few recent papers have explored the use of graph nets in dynamics modeling, taking into account the state of each object as well as their interactions. This allows their models to generalize to scenarios with a variable number of objects (Battaglia et al., 2016; Chang et al., 2017). Despite their strong generalization power, they are not as efficient in system identification and control, because deep nets are heavily over-parameterized, making optimization time-consuming and sample-inefficient.
+
+In this paper, we propose compositional Koopman operators, integrating Koopman operators with graph networks for generalizable and efficient dynamics modeling. We build on the idea of encoding states into object-centric embeddings with graph neural networks, which ensures generalization power. But instead of using over-parameterized neural nets to model state transition, we identify the Koopman matrix and control matrix from data as a linear approximation of the nonlinear dynamical system. The linear approximation allows efficient system identification and control synthesis.
+
+The main challenge of extending Koopman theory to multi-object systems is scalability. The number of parameters in the Koopman matrix scales quadratically with the number of objects, which harms the learning efficiency and leads to overfitting. To tackle this issue, we exploit the structure of the
+
+
+Figure 1: Overview of our model. A graph neural network $\phi$ takes in the current state of the physical system $\boldsymbol{x}^t$ , and generates object-centric representations in the Koopman space $\boldsymbol{g}^t$ . We then use the block-wise Koopman matrix $K$ and control matrix $L$ identified from equation 6 or equation 8 to predict the Koopman embeddings in the next time step $\boldsymbol{g}^{t + 1}$ . Note that in $K$ and $L$ , object pairs of the same relation share the same sub-matrix. Another graph neural network $\psi$ maps $\boldsymbol{g}^{t + 1}$ back to the original state space, i.e., $\boldsymbol{x}^{t + 1}$ . The mapping between $\boldsymbol{g}^t$ and $\boldsymbol{g}^{t + 1}$ is linear and is shared across all time steps, where we can iteratively apply $K$ and $L$ to the Koopman embeddings and roll multiple steps into the future. The formulation enables efficient system identification and control synthesis.
+
+underlying system and use the same block-wise Koopman sub-matrix for object pairs of the same relation. This significantly reduces the number of parameters that need to be identified by making it independent of the size of the system.
+
+Our experiments include simulating and controlling ropes of variable lengths and soft robots of different shapes. The compositional Koopman operators are significantly more accurate than the state-of-the-art learned physics engines (Battaglia et al., 2016; Li et al., 2019b), and faster when adapting to new environments of unknown physical parameters. Our method also outperforms vanilla deep Koopman methods (Lusch et al., 2018; Morton et al., 2018) and Koopman models with manually-designed basis functions, which shows the advantages of using a structured Koopman matrix and graph neural networks. Please see our project page for demonstrating videos.
+
+# 2 RELATED WORK
+
+Koopman operators. The Koopman operator formalism of dynamical systems is rooted in the seminal works of Koopman and Von Neumann in the early 1930s (Koopman, 1931; Koopman & Neumann, 1932). The core idea is to map the state of a nonlinear dynamical system to an embedding space, over which we can linearly propagate into the future. Researchers have proposed various algorithms to explore the Koopman spectral properties from data. A large portion of them are in the class of dynamic mode decomposition (DMD) (Rowley et al., 2009; Schmid, 2010; Tu et al., 2014; Williams et al., 2015; Arbabi & Mezic, 2017). The linear representation will enable efficient prediction, estimation, and control using tools from linear dynamical systems (Williams et al., 2016; Proctor et al., 2018; Mauroy & Goncalves, 2019; Korda & Mezic, 2018). People have been using hand-designed Koopman observables for various modeling and control tasks (Brunton et al., 2016; Kaiser et al., 2017; Abraham et al., 2017; Bruder et al., 2019b; Arbabi et al., 2018). Some recent works have applied the method to the real world and successfully control soft robots with great precision (Bruder et al., 2019a; Mamakoukas et al., 2019).
+
+However, hand-crafted basis functions sometimes fail to generalize to more complex environments. Learning these functions from data using neural nets turns out to generate a more expressive invariant subspace (Lusch et al., 2018; Takeishi et al., 2017) and has achieved successes in fluid control (Morton et al., 2018). Morton et al. (2019) has also extended the framework to account for uncertainty in the system by inferring a distribution over observations. Our model differs by explicitly modeling the compositionality of the underlying system with graph networks. It generalizes better to environments of a variable number of objects or soft robots of different shapes.
+
+Learning-based physical simulators. Battaglia et al. (2016) and Chang et al. (2017) first explored learning a simulator from data by approximating object interactions with neural networks. These models are no longer bounded to hard-coded physical rules, and can adapt to scenarios where the underlying physics is unknown. Please refer to Battaglia et al. (2018) for a full review. Recently, Mrowca et al. (2018) and Li et al. (2019a) extended these models to approximate particle dynamics of deformable shapes and fluids. Flexible as they are, these models become less efficient during model adaptation in complex scenarios, because the optimization of neural networks usually needs a lot of
+
+samples and compute, which limits its use in an online setting. Nagabandi et al. (2019a;b) proposed to use meta-learning for online adaptation, and have shown to be effective in simulated robots and a real legged millirobot. However, it is not clear whether their methods can generalize to systems with variable numbers of instances. The use of graph nets and Koopman operators in our model allows better generalization ability and enables efficient system identification as we only need to identify the transition matrices, which is essentially a least-square problem and can be solved very efficiently.
+
+People have also used the learned physics engines for planning and control. Many previous papers in this direction learn a latent dynamics model together with a policy in a model-based reinforcement learning setup (Racanière et al., 2017; Hamrick et al., 2017; Pascanu et al., 2017; Hafner et al., 2019); a few alternatives use the learned model in model-predictive control (MPC) (Sanchez-Gonzalez et al., 2018; Li et al., 2019b; Janner et al., 2019). In this paper, we leverage the fact that the embeddings in the Koopman space are propagating linearly through time, which allows us to formulate the control problem as quadratic programming and optimize the control signals much more efficiently.
+
+# 3 APPROACH
+
+We first present the basics of Koopman operators: for a nonlinear dynamical system, the Koopman observation functions can map the state space to an embedding space where the dynamics become linear. We then discuss the compositional nature of physical systems and show how graph networks can be used to capture the compositionality.
+
+# 3.1 THE KOOPMAN OPERATORS
+
+Let $\boldsymbol{x}^t \in \mathcal{X} \subset \mathbb{R}^n$ be the state vector for the system at time step $t$ . We consider a non-linear discrete-time dynamical system described by $\boldsymbol{x}^{t + 1} = F(\boldsymbol{x}^t)$ . The Koopman operator (Koopman, 1931), denoted as $\mathcal{K}: \mathcal{F} \to \mathcal{F}$ , is a linear transformation defined by $\mathcal{K}g \triangleq g \circ F$ , where $\mathcal{F}$ is the collection of all functions (also referred to as observables) that form an infinite-dimensional Hilbert space. For every function $g: \mathcal{X} \to \mathbb{R}$ belonging to $\mathcal{F}$ , we have
+
+$$
+\left(\mathcal {K} g\right) \left(\boldsymbol {x} ^ {t}\right) = g \left(F \left(\boldsymbol {x} ^ {t}\right)\right) = g \left(\boldsymbol {x} ^ {t + 1}\right), \tag {1}
+$$
+
+making the function space $\mathcal{F}$ invariant under the action of the Koopman operator.
+
+Although the theory guarantees the existence of the Koopman operator, its use in practice is limited by its infinite dimensionality. Most often, we assume there is an invariant subspace $\mathcal{G}$ of the Koopman operator. It spans by a set of base observation functions $\{g_1,\dots ,g_m\}$ and satisfies that $\mathcal{K}g\in \mathcal{G}$ for any $g\in \mathcal{G}$ . With a slightly abuse of the notation, we now use $g(\pmb {x}^t):\mathbb{R}^n\to \mathbb{R}^m$ to represent $[g_{1}(\pmb{x}^{t}),\dots ,g_{m}(\pmb{x}^{t})]^{T}$ . By constraining the Koopman operator on this invariant subspace, we get a finite-dimensional linear operator $K\in \mathbb{R}^{m\times m}$ that we refer as the Koopman matrix.
+
+Traditionally, people hand-craft base observation functions from the knowledge of underlying physics. The system identification problem is then reduced to finding the Koopman matrix $K$ , which can be solved by linear regression given historical data of the system. Recently, researchers have also explored data-driven methods that automatically find the Koopman invariant subspace via representing the base observation functions $g(\pmb{x})$ via deep neural networks.
+
+Although the original Koopman theory does not consider the system with external control inputs, researchers have found that linearly injecting control signals to the Koopman observation space can give us good numerical performance (Brunton et al., 2016; Bruder et al., 2019a). Mathematically, considering a dynamical system, $\boldsymbol{x}^{t + 1} = F(\boldsymbol{x}^t,\boldsymbol{u}^t)$ , with an external control input $\boldsymbol{u}^t$ , we aim to find the Koopman observation functions and the linear dynamics model in the form of
+
+$$
+g \left(\boldsymbol {x} ^ {t + 1}\right) = K g \left(\boldsymbol {x} ^ {t}\right) + L \boldsymbol {u} ^ {t}, \tag {2}
+$$
+
+where the coefficient matrix $L$ is referred to as the control matrix.
+
+# 3.2 COMPOSITIONAL KOOPMAN OPERATORS
+
+The dynamics of a physical system are governed by physical rules, which are usually shared across different subcomponents in the system. Explicitly modeling such compositionality enables more efficient system identification and control synthesis and provides better generalization ability.
+
+Motivating example. Consider a system with $N$ balls moving in a 2D plane, each pair connected by a linear spring. Assume all balls have mass 1 and all springs share the same stiffness coefficient $k$ . We denote the $i$ 's ball's position as $(x_i, y_i)$ and its velocity as $(\dot{x}_i, \dot{y}_i)$ . For ball $i$ , equation 3 describes its dynamics, where $\boldsymbol{x}_i \triangleq [x_i, y_i, \dot{x}_i, \dot{y}_i]^T$ denotes ball $i$ 's state:
+
+$$
+\dot {\boldsymbol {x}} _ {i} = \left[ \begin{array}{c} \dot {x} _ {i} \\ \dot {y} _ {i} \\ \ddot {x} _ {i} \\ \ddot {y} _ {i} \end{array} \right] = \left[ \begin{array}{c} \dot {x} _ {i} \\ \dot {y} _ {i} \\ \sum_ {j = 1} ^ {N} k (x _ {j} - x _ {i}) \\ \sum_ {j = 1} ^ {N} k (y _ {j} - y _ {i}) \end{array} \right] = \underbrace {\left[ \begin{array}{c c c c} 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \\ k - N k & 0 & 0 & 0 \\ 0 & k - N k & 0 & 0 \end{array} \right]} _ {\triangleq A} \underbrace {\left[ \begin{array}{c} x _ {i} \\ y _ {i} \\ \dot {x} _ {i} \\ \dot {y} _ {i} \end{array} \right]} _ {\triangleq B} + \sum_ {j \neq i} \underbrace {\left[ \begin{array}{c c c c} 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 \\ k & 0 & 0 & 0 \\ 0 & k & 0 & 0 \end{array} \right]} _ {\triangleq B} \left[ \begin{array}{c} x _ {j} \\ y _ {j} \\ \dot {x} _ {j} \\ \dot {y} _ {j} \end{array} \right]. \tag {3}
+$$
+
+We can represent the state of the whole system using the union of every ball's state, where $\pmb{x} = [x_1,\dots ,x_N]^T$ . Then the transition matrix is essentially a block matrix, where the matrix parameters are shared among the diagonal or off-diagonal blocks as shown in equation 4:
+
+$$
+\dot {\boldsymbol {x}} = \left[ \begin{array}{c} \dot {\boldsymbol {x}} _ {1} \\ \dot {\boldsymbol {x}} _ {2} \\ \vdots \\ \dot {\boldsymbol {x}} _ {N} \end{array} \right] = \left[ \begin{array}{c c c c} A & B & \dots & B \\ B & A & \dots & B \\ \vdots & \vdots & \ddots & \vdots \\ B & B & \dots & A \end{array} \right] \left[ \begin{array}{c} \boldsymbol {x} _ {1} \\ \boldsymbol {x} _ {2} \\ \vdots \\ \boldsymbol {x} _ {N} \end{array} \right]. \tag {4}
+$$
+
+Based on the linear spring system, we make three observations for multi-object systems.
+
+- The system state is composed of the state of each individual object. The dimension of the whole system scales linearly with the number of objects. We formulate the system state by concatenating the state of every object, corresponding to an object-centric state representation.
+- The transition matrix has a block-wise substructure. After assuming an object-centric state representation, the transition matrix naturally has a block-wise structure as shown in equation 4.
+- The same physical interactions share the same transition block. The blocks in the transition matrix encode actual interactions and generalize across systems. $A$ and $B$ govern the dynamics of the linear spring system, and are shared by systems with a different number of objects.
+
+These observations inspire us to exploit the structure of multi-object systems, instead of learning separate models for systems that contains different numbers of balls.
+
+Compositional Koopman operators. Motivated by the linear spring system, we want to inject a good inductive bias to incorporate compositionality when applying the Koopman theory. This allows better generalization ability and more efficient system identification and better controller design. Figure 1 shows an overview of our model.
+
+Considering a system with $N$ objects, we denote $\pmb{x}^t$ as the system state at time $t$ and $\pmb{x}_i^t$ is the state of the $i$ 'th object. We further denote $\pmb{g}^t \triangleq g(\pmb{x}^t)$ as the embedding of the state in the Koopman invariant space. In the rest of the paper, we call $\pmb{g}^t$ the Koopman embedding. Based on the observation we made in the case of linear spring system, we propose the following assumptions on the compositional structure of the Koopman embedding and the Koopman matrix.
+
+- The Koopman embedding of the system is composed of the Koopman embedding of every objects. Similar to the decomposition in the state space, we assume the Koopman embedding can be divided into object-centric sub-embeddings, i.e. $\pmb{g}^t \in \mathbb{R}^{Nm}$ denoting the concatenation of $g_1^t, \dots, g_N^t$ , where we use $g_i^t = g_i(\pmb{x}^t) \in \mathbb{R}^m$ as the Koopman embedding for the $i$ 'th object.
+- The Koopman matrix has a block-wise structure. It is natural to think the Koopman matrix is composed of block matrices after assuming an object-centric Koopman embeddings. In equation 5, $K_{ij} \in \mathbb{R}^{m \times m}$ and $L_{ij} \in \mathbb{R}^{m \times l}$ are blocks of the Koopman matrix and the control matrix, where $l$ is the dimension of the action for each object and $\boldsymbol{u}^t \in \mathbb{R}^{Nl}$ is the concatenation of $\boldsymbol{u}_1^t, \dots, \boldsymbol{u}_N^t$ denoting the total control signal at time $t$ :
+
+$$
+\left[ \begin{array}{c} \boldsymbol {g} _ {1} ^ {t + 1} \\ \vdots \\ \boldsymbol {g} _ {N} ^ {t + 1} \end{array} \right] = \left[ \begin{array}{c c c} K _ {1 1} & \dots & K _ {1 N} \\ \vdots & \ddots & \vdots \\ K _ {N 1} & \dots & K _ {N N} \end{array} \right] \left[ \begin{array}{c} \boldsymbol {g} _ {1} ^ {t} \\ \vdots \\ \boldsymbol {g} _ {N} ^ {t} \end{array} \right] + \left[ \begin{array}{c c c} L _ {1 1} & \dots & L _ {1 N} \\ \vdots & \ddots & \vdots \\ L _ {N 1} & \dots & L _ {N N} \end{array} \right] \left[ \begin{array}{c} \boldsymbol {u} _ {1} ^ {t} \\ \vdots \\ \boldsymbol {u} _ {N} ^ {t} \end{array} \right]. \tag {5}
+$$
+
+As we have seen in the case of linear spring system, those matrix blocks are not independent, but some of them share the same set of values.
+
+- The same physical interactions shall share the same transition block. The equivalence between the blocks should reflect the equivalence of the interactions, where we use the same transition sub-matrix for object pairs of the same relation. For example, if the system is composed of $N$ identical objects interacting with the same relation, then, by symmetry, all the diagonal blocks should be the same, while all the off-diagonal blocks should also be the same. The repetitive structure allows us to efficiently identify the values using least squares regression.
+
+# 3.3 LEARNING THE KOOPMAN EMBEDDINGS USING GRAPH NEURAL NETWORKS
+
+For a physical system that contains $N$ objects, we represent the system at time $t$ using a directed graph $G^{t} = (O^{t},R)$ , where vertices $O^{t} = \{\pmb{o}_{i}^{t}\}_{i = 1}^{N}$ represent objects and edges $R = \{\pmb{r}_k\}_{k = 1}^{N^2}$ represent pair-wise relations. Specifically, $\pmb{o}_i^t = (\pmb{x}_i^t,\pmb{a}_i^o)$ , where $\pmb{x}_i^t$ is the state of object $i$ and $\pmb{a}_i^o$ is a one-hot vector indicating the object type, e.g., fixed or movable. For relation, we have $\pmb{r}_k = (u_k,v_k,\pmb{a}_k^r)$ , $1\leq u_{k},v_{k}\leq N$ , where $u_{k}$ and $v_{k}$ are integers denoting the end points of this directed edge, and $\pmb{a}_k^r$ is a one-hot vector denoting the type of the relation $k$ .
+
+We use a graph neural network similar to Interaction Networks (IN) (Battaglia et al., 2016) to generate object-centric Koopman embeddings. IN defines an object function $f_{O}$ and a relation function $f_{R}$ to model objects and their relations in a compositional way. Similar to a message passing procedure, we calculate the edge effect $e_k^t = f_R(\pmb{o}_{u_k}^t,\pmb{o}_{v_k}^t,\pmb{a}_k^r)_{k = 1\dots N^2}$ , and node effect $g_i^t = f_O(\pmb{o}_i^t,\sum_{k\in \mathcal{N}_i}\pmb {e}_k^t)_{i = 1\dots N}$ , where $\mathcal{N}_i$ denotes the relations that point to the object $i$ and $\{\pmb {g}_i^t\}$ are the derived Koopman embeddings. We use this graph neural network, denoted as $\phi$ , to represent our Koopman observation function.
+
+System identification. For a sequence of observations $\widetilde{\pmb{x}} = [\pmb{x}^1,\dots ,\pmb{x}^T]$ from time 1 to time $T$ we first map them to the Koopman space as $\widetilde{\pmb{g}} = [g^{1},\dots ,g^{T}]$ using the graph encoder $\phi$ where $\pmb{g}^{t} = \phi (\pmb{x}^{t})$ . We use $\pmb{g}^{i:j}$ to denote the sub-sequence $[g^i,\dots ,g^j ]$ . To identify the Koopman matrix, we solve the linear regression $\min_K\| Kg^{1:T - 1} - g^{2:T}\| _2$ . As a result, $K = g^{2:T}(g^{1:T - 1})^{\dagger}$ will asymptotically approach the Koopman operator $\mathcal{K}$ with an increasing $T$ . For cases where there are control inputs $\widetilde{\pmb{u}} = [\pmb{u}^1,\dots ,\pmb{u}^{T - 1}]$ , the calculation of the Koopman matrix and the control matrix is essentially solving a least squares problem w.r.t. the objective
+
+$$
+\min _ {K, L} \| K g ^ {1: T - 1} + L \widetilde {\boldsymbol {u}} - g ^ {2: T} \| _ {2}. \tag {6}
+$$
+
+As we mentioned in the Section 3.2, the dimension of the Koopman space is linear to the number of objects in the system, i.e., $\widetilde{\pmb{g}}\in \mathbb{R}^{Nm\times T}$ and $K\in \mathbb{R}^{Nm\times Nm}$ . If we do not enforce any structure on the Koopman matrix $K$ , we will have to identify $N^2 m^2$ parameters. Instead, we can significantly reduce the number by leveraging the assumption on the structure of $K$ . Assume we know some blocks ( $\{K_{ij}\}$ ) of the matrix $K$ are shared and in total there are $h$ different kinds of blocks, which we denote as $\hat{K}\in \mathbb{R}^{h\times m\times m}$ . Then, the number of parameters to be identified reduces to $hm^2$ . Usually, $h$ does not depend on $N$ , and is much smaller than $N^2$ . Now, for each block $K_{ij}$ , we have a one-hot vector $\sigma_{ij}\in \{0,1\}^h$ indicating its type, i.e., $K_{ij} = \sigma_{ij}\hat{K}\in \mathbb{R}^{m\times m}$ . Finally, as shown in equation 7, we represent the Koopman matrix as the product of the index tensor $\sigma$ and the parameter tensor $\hat{K}$ :
+
+$$
+K = \sigma \otimes \hat {K} = \left[ \begin{array}{c c c} \sigma_ {1 1} \hat {K} & \dots & \sigma_ {1 N} \hat {K} \\ \vdots & \ddots & \vdots \\ \sigma_ {N 1} \hat {K} & \dots & \sigma_ {N N} \hat {K} \end{array} \right], \text {w h e r e} \quad \sigma = \left[ \begin{array}{c c c} \sigma_ {1 1} & \dots & \sigma_ {1 N} \\ \vdots & \ddots & \vdots \\ \sigma_ {N 1} & \dots & \sigma_ {N N} \end{array} \right] \in \mathbb {R} ^ {N \times N \times h}. \tag {7}
+$$
+
+Similar to the Koopman matrix, we assume the same block structure in the control matrix $L$ and denote its parameter as $\hat{L} \in \mathbb{R}^{h \times m \times l}$ . The least squares problem of identifying $\hat{K}$ and $\hat{L}$ becomes
+
+$$
+\min _ {\hat {K}, \hat {L}} \| (\sigma \otimes \hat {K}) \boldsymbol {g} ^ {1: T - 1} + (\sigma \otimes \hat {L}) \widetilde {\boldsymbol {u}} - \boldsymbol {g} ^ {2: T} \| _ {2}, \tag {8}
+$$
+
+where $\sigma \otimes \hat{K} \in \mathbb{R}^{Nm \times Nm}$ , $\sigma \otimes \hat{L} \in \mathbb{R}^{Nm \times Nl}$ , $g^{1:T-1} \in \mathbb{R}^{Nm \times (T-1)}$ and $\widetilde{\boldsymbol{u}} \in \mathbb{R}^{Nl \times (T-1)}$ . Since the linear least squares problems described in equation 6 and equation 8 have analytical solutions, performing system identification using our method is very efficient.
+
+Training GNN models. To make predictions on the states, we use a graph decoder $\psi$ to map the Koopman embeddings back to the original state space. In total, we have three losses to train the graph encoder and decoder. The first term is the auto-encoding loss
+
+$$
+\mathcal {L} _ {\mathrm {a e}} = \frac {1}{T} \sum_ {i} ^ {T} \| \psi \left(\phi \left(\boldsymbol {x} ^ {i}\right)\right) - \boldsymbol {x} ^ {i} \|. \tag {9}
+$$
+
+The second term is the prediction loss. To calculate it, we rollout in the Koopman space and denote the embeddings as $\hat{\pmb{g}}^1 = \pmb{g}^1$ , and $\hat{\pmb{g}}^{t + 1} = K\hat{\pmb{g}}^t +Lu^t$ , for $t = 1,\dots ,T - 1$ . The prediction loss is defined as the difference between the decoded states and the actual states, i.e.,
+
+$$
+\mathcal {L} _ {\text {p r e d}} = \frac {1}{T} \sum_ {i = 1} ^ {T} \| \psi (\hat {\boldsymbol {g}} ^ {i}) - \boldsymbol {x} ^ {i} \|. \tag {10}
+$$
+
+Third, we employ a metric loss to encourage the Koopman embeddings preserving the distance in the original state space. The loss is defined as the absolute error between the distances measured in the Koopman space and that in the original space, i.e.,
+
+$$
+\mathcal {L} _ {\text {m e t r i c}} = \sum_ {i j} \left| \| \boldsymbol {g} ^ {i} - \boldsymbol {g} ^ {j} \| - \| \boldsymbol {x} ^ {i} - \boldsymbol {x} ^ {j} \| \right|. \tag {11}
+$$
+
+Having Koopman embeddings that perserves the distance in the state space is important as we are using the distance in the Koopman space to define the cost function for downstream control tasks.
+
+The final training loss is simply the combination of all the terms above: $\mathcal{L} = \mathcal{L}_{\mathrm{ae}} + \lambda_1\mathcal{L}_{\mathrm{pred}} + \lambda_2\mathcal{L}_{\mathrm{metric}}$ . We then minimize the loss $\mathcal{L}$ by optimizing the parameters in the graph encoder $\phi$ and graph decoder $\psi$ using stochastic gradient descent. Once the model is trained, it can be used for system identification, future prediction, and control synthesis.
+
+# 3.4 CONTROL
+
+For a control task, the goal is to synthesize a sequence of control inputs $\pmb{u}^{1:T}$ that minimize $C = \sum_{t=1}^{T} c_t(\pmb{x}^t, \pmb{u}^t)$ , the total incurred cost, where $c_t(\pmb{x}^t, \pmb{u}^t)$ is the instantaneous cost. For example, considering the control task of reaching a desired state $\pmb{x}^*$ at time $T$ , we can design the following instantaneous cost, $c_t(\pmb{x}^t, \pmb{u}^t) = \mathbb{1}_{[t=T]} \| \pmb{x}^t - \pmb{x}^* \|_2^2 + \lambda \| \pmb{u}^t \|_2^2$ . The first term promotes the control sequence that matches the state to the goal, while the second term regularizes the control signals.
+
+Open-loop control via quadratic programming (QP). Our model maps the original nonlinear dynamics to a linear dynamical system. We can then solve the control task by solving a linear control problem. With the assumption that the Koopman embeddings preserve the distance measure, we define the control cost as $c_{t}(\pmb{g}^{t}, \pmb{u}^{t}) = \mathbb{1}_{[t=T]} \| \pmb{g}^{t} - \pmb{g}^{*} \|_{2}^{2} + \lambda \| \pmb{u}^{t} \|_{2}^{2}$ . As a result, we reduce the problem to minimizing a quadratic cost function $C = \sum_{t=1}^{T} c_{t}(\pmb{g}^{t}, \pmb{u}^{t})$ over variables $\{\pmb{g}^{t}, \pmb{u}^{t}\}_{t=1}^{T}$ under linear constrains $\pmb{g}^{t+1} = K \pmb{g}^{t} + L \pmb{u}^{t}$ , where $\pmb{g}^{1} = \phi(\pmb{x}^{1})$ and $\pmb{g}^{*} = \phi(\pmb{x}^{*})$ .
+
+Model predictive control (MPC). Solving the QP gives us control signals, which might not be good enough for long-term control as the prediction error accumulates. We can combine it with Model Predictive Control, assuming feedback from the environment every $\tau$ steps.
+
+# 4 EXPERIMENTS
+
+**Environments.** We evaluate our method by assessing how well it can simulate and control ropes and soft robots. Specifically, we consider three environments. (1) **Rope** (Figure 2a): the top mass of a rope is fixed to a specific height. We apply force to the top mass to move it in a horizontal line. The rest of the masses are free to move according to internal force and gravity. (2) **Soft** (Figure 2b): we aim to control a soft robot that is consist of soft blocks. Blocks in dark grey are rigid and those in light blue are soft blocks. Each one of the dark blue blocks is soft but have an actuator inside that can contract or expand the block. One of the blocks is pinned to the ground, as shown using the red dots. (3) **Swim** (Figure 2c): instead of pinning the soft robot to the ground, we let the robot swim in fluids. The colors shown in this environment have the same meaning as in **Soft**.
+
+
+Figure 2: Qualitative results. Top: our model prediction matches the ground truth over a long period. Bottom: for control, we use red dots or frames to indicate the goal. We apply the control signals generated from our identified model to the original simulator, which allows the agent to achieve the goal accurately. Please refer to our supplementary video for more results.
+
+Observation space. In the Rope environment, each mass on the rope is considered as an object. The observation of each mass is its position and velocity in the 2D plane, which has a dimension of 4. In total, a rope with $N$ masses has an observation space of dimension $4N$ . In both the Soft and the Swim environments, each quadrilateral is considered as an object. For each quadrilateral, we have access to the positions and velocities of the four corners. Thus for a soft robot containing $N$ quadrilaterals, we have a $4 \times 4 \times N = 16N$ dimensional observation.
+
+Baselines. We compare our model to the following baselines: Interaction Networks (Battaglia et al., 2016) (IN), Propagation Networks (Li et al., 2019b) (PN) and Koopman method with handcrafted Koopman base functions (KPM). IN and PN are the state-of-the-art learning-based physical simulators, and we evaluate their adaptation ability by finetuning their parameters on a small sequence of observations from the testing environment. Similar to our method, KPM fits a linear dynamics in the Koopman space. Instead of learning Koopman observations from data, KPM uses polynomials of the original states as the basis functions. In our setting, we set the maximum order of the polynomials to be three to make the dimension of the hand-crafted Koopman embeddings match our model's.
+
+Data generation. We generate 10,000 episodes for Rope and 50,000 episodes for Soft and Swim. Among them, $90\%$ are used for training, and the rest for testing. Each episode has 100 time steps. In the dataset, the physical systems have a various number of objects from 5 to 9, i.e. the ropes have 5 to 9 masses while the soft robots in Soft and Swim environments have 5 to 9 quadrilaterals. To evaluate the model's extrapolating generalization ability, for each environment, we generate an extra dataset with the same size as the test set while containing systems consist of 10 to 14 objects.
+
+
+(a) Rope
+
+
+(b) Soft
+
+
+(c) Swim
+
+
+Figure 3: Quantitative results on simulation. The $x$ axis shows time steps. The solid lines indicate medians and the transparent regions are the interquartile ranges of simulation errors. Our method significantly outperforms the baselines in all testing environments.
+(a) Rope
+Figure 4: Quantitative results on control and ablation studies on model hyperparameters. Left: box-plots show the distributions of control errors. The yellow line in the box indicates the median. Our model consistently achieves smaller errors in all environments against KPM. Right: our model's simulation errors with different amount of data for system identification (d) and different dimensions of the Koopman space (e).
+
+
+(b) Soft
+
+
+(c) Swim
+
+
+(d) Number of samples for identifying $K$ and $L$
+
+
+(e) The size of object-centric embeddings
+
+Training and evaluation protocols. All models are trained using Adam optimizer (Kingma & Ba, 2015) with a learning rate of $10^{-4}$ and a batch size of 8. $\lambda_{1}$ and $\lambda_{2}$ are 1.0 and 0.3, respectively, for our model. For both our model and the baselines, we apply 400K iterations of gradient steps in the Rope environment and 580K iterations in the Soft and Swim environment. Our model is trained on the sub-sequence of length 64 from the training set, and IN/PN aims at minimizing the L1 distance between their prediction and the ground truth. During test time, the models have to adapt to a new environment of unknown physical parameters, where they have access to a short sequence of observations and the opportunity to adjust their models' parameters. Our model uses 8 episodes to identify the transition matrix via least-square regression. IN/PN update the model's parameters by minimizing the distance between the model's prediction and the actual observation using a gradient step of length $10^{-4}$ for 5 iterations. For evaluation, we use two metrics: simulation error and control error. For a given episode, the simulation error at time step $t$ is defined as the mean squared error between the model prediction $\hat{\pmb{x}}^t$ and the ground truth $\pmb{x}^t$ . For control, we pick the initial frame $\pmb{x}^0$ and the $t$ 'th frame $\pmb{x}^t$ from a episode. Then we ask the model to generate a control sequence of length $t$ to transfer the system from the initial state $\pmb{x}^0$ to the target state $\pmb{x}^t$ . The control error is defined as the mean squared distance between the target state and the state of the system at time $t$ .
+
+# 4.1 SIMULATION
+
+Figure 2 shows qualitative results on simulation. Our model accurately predicts system dynamics for more than 100 steps. For Rope, the small prediction error comes from the slight delay of the force propagation inside the rope; hence, the tail of the rope usually has a larger error. For Soft, our model captures the interaction between the body parts and generates accurate prediction over the global movements of the robot. The error mainly comes from the misalignment of some local components.
+
+We evaluate the models by predicting 100 steps into the future on 500 trajectories and Figure 3 shows quantitative results. IN and PN do not work well in the Rope and Swim environments due to insufficient system identification ability. The KPM baseline performs poorly in the Rope and
+
+Soft environments indicating the limited power of polynomial Koopman base functions. Our model significantly outperforms all the baselines.
+
+# 4.2 CONTROL
+
+We compare our model with KPM, the Koopman baseline using polynomial basis. In Rope, we ask the models to perform open-loop control where it only solves the QP once at the beginning. The length of the control sequence is 40. When it comes to Soft/Swim, each model is asked to generate control signals of 64 steps, and we allow the model to receive feedback after 32 steps. Thus every model has a second chance to correct its control sequence by solving the QP again at the time step 32.
+
+As shown in Figure 2, our model leverages the inertia of the rope and matches the target state accurately. As for controlling a soft body swinging on the ground or swimming in the water, our model can move each part (the boxes) of the body to the exact target position. The small control error comes from the slight misalignment of the orientation and the size of the body parts. Figure 4 shows that quantitatively our model outperforms KPM, too.
+
+# 4.3 ABLATION STUDY
+
+Structure of the Koopman matrix. We explore three different structures of the Koopman matrix, Block, Diag and None, to understand its effect on the learned dynamics. None assumes no structure in the Koopman matrix. Diag assumes a diagonal block structure of $K$ : all off-diagonal blocks ( $K_{ij}$ where $i \neq j$ ) are zeros and all diagonal blocks share the same values. Block predefines a block-wise structure, decided by the relation between the objects as introduced in Section 3.3.
+
+Table 1 includes our model's simulation error and control error with different Koopman matrix structures in Rope. All models are trained in the Rope environment with 5 to 9 masses. Besides the result on the test set, we also report models' extrapolation performance in parentheses, where the model is evaluated on systems with more masses than training, i.e., 10 to 14 masses.
+
+Our model with Block structure consistently achieves a smaller error in all settings. Diag assumes an overly simplified structure, leading to larger errors and failing to make reasonable controls. None has comparable simulation errors but larger control errors. Without the structure in the Koopman matrix, it overfits the data and makes the resulting linear dynamics less amiable to the control.
+
+Table 1: Ablation study results on the Koopman matrix structure (Rope environment). For simulation, we show the Mean Squared Error between the prediction and the ground truth at $T = 100$ , whereas for control, we show the performance with a horizon of length 40. The numbers in parentheses show the performance on extrapolation.
+
+ | Simulation | Control |
| Diag | 0.133 (0.174) | 2.337 (2.809) |
| None | 0.117 (0.083) | 1.522 (1.288) |
| Block | 0.105 (0.075) | 0.854 (1.101) |
+
+Hyperparameters. In our main experiments, we set the dimension of the Koopman embedding to $m = 32$ per object. Online system identification requires 800 data samples for each training/test case. To understand our model's performance under different hyperparameters, we vary the dimension of the Koopman embedding from 8 to 64 and the number of data samples used for system identification from 200 to 1,600. Figure 4d shows that more data for system identification leads to better simulation results. Figure 4e shows that dimension 16 gives the best results on simulation. It may suggest that the intrinsic dimension of the Koopman invariant space of the Rope system is around 16 per object.
+
+# 5 CONCLUSION
+
+Compositionality is common in our daily life. Many ordinary objects contain repetitive subcomponents: ropes and soft robots, as shown in this paper, granular materials such as coffee beans and lego blocks, and deformable objects such as cloth and modeling clay. These objects are known to be very challenging for manipulation using traditional methods, while our formulation opens up a new direction by combining deep Koopman operators with graph neural networks. By leveraging the compositional structure in the Koopman operator via graph neural nets, our model can efficiently manipulate deformable objects such as ropes and soft robots, and generalize to systems with variable numbers of components. We hope this work could encourage more endeavors in modeling larger and more complex systems by integrating the power of the Koopman theory and the expressiveness of neural networks.
+
+# REFERENCES
+
+Ian Abraham, Gerardo De La Torre, and Todd D Murphey. Model-based control using koopman operators. In RSS, 2017.
+Hassan Arbabi and Igor Mezic. Ergodic theory, dynamic mode decomposition, and computation of spectral properties of the koopman operator. SIAM Journal on Applied Dynamical Systems, 16(4): 2096-2126, 2017.
+Hassan Arbabi, Milan Korda, and Igor Mezic. A data-driven koopman model predictive control framework for nonlinear flows. In CDC, 2018.
+Peter W. Battaglia, Razvan Pascanu, Matthew Lai, Danilo Rezende, and Koray Kavukcuoglu. Interaction networks for learning about objects, relations and physics. In NeurIPS, 2016.
+Peter W Battaglia, Jessica B Hamrick, Victor Bapst, Alvaro Sanchez-Gonzalez, Vinicius Zambaldi, Mateusz Malinowski, Andrea Tacchetti, David Raposo, Adam Santoro, Ryan Faulkner, et al. Relational inductive biases, deep learning, and graph networks. arXiv:1806.01261, 2018.
+Daniel Bruder, Brent Gillespie, C David Remy, and Ram Vasudevan. Modeling and control of soft robots using the koopman operator and model predictive control. In RSS, 2019a.
+Daniel Bruder, C David Remy, and Ram Vasudevan. Nonlinear system identification of soft robot dynamics using koopman operator theory. In ICRA, 2019b.
+Steven L Brunton, Bingni W Brunton, Joshua L Proctor, and J Nathan Kutz. Koopman invariant subspaces and finite linear representations of nonlinear dynamical systems for control. PloS one, 11(2):e0150171, 2016.
+Michael B Chang, Tomer Ullman, Antonio Torralba, and Joshua B Tenenbaum. A compositional object-based approach to learning physical dynamics. In ICLR, 2017.
+Herve Delingette. Toward realistic soft-tissue modeling in medical simulation. Proceedings of the IEEE, 86(3):512-523, 1998.
+Danijar Hafner, Timothy Lillicrap, Ian Fischer, Ruben Villegas, David Ha, Honglak Lee, and James Davidson. Learning latent dynamics for planning from pixels. In ICML, 2019.
+Jessica B Hamrick, Andrew J Ballard, Razvan Pascanu, Oriol Vinyals, Nicolas Heess, and Peter W Battaglia. Metacontrol for adaptive imagination-based optimization. In ICLR, 2017.
+Michael Janner, Sergey Levine, William T Freeman, Joshua B Tenenbaum, Chelsea Finn, and Jiajun Wu. Reasoning about physical interactions with object-oriented prediction and planning. In *ICLR*, 2019.
+Eurika Kaiser, J Nathan Kutz, and Steven L Brunton. Data-driven discovery of koopman eigenfunctions for control. arXiv:1707.01146, 2017.
+Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In ICLR, 2015.
+Bernard O Koopman. Hamiltonian systems and transformation in hilbert space. PNAS, 17(5):315, 1931.
+BO Koopman and J v Neumann. Dynamical systems of continuous spectra. PNAS, 18(3):255, 1932.
+Milan Korda and Igor Mezić. Linear predictors for nonlinear dynamical systems: Koopman operator meets model predictive control. Automatica, 93:149-160, 2018.
+Yunzhu Li, Jiajun Wu, Russ Tedrake, Joshua B Tenenbaum, and Antonio Torralba. Learning particle dynamics for manipulating rigid bodies, deformable objects, and fluids. In ICLR, 2019a.
+Yunzhu Li, Jiajun Wu, Jun-Yan Zhu, Joshua B Tenenbaum, Antonio Torralba, and Russ Tedrake. Propagation networks for model-based control under partial observation. In ICRA, 2019b.
+
+Bethany Lusch, J Nathan Kutz, and Steven L Brunton. Deep learning for universal linear embeddings of nonlinear dynamics. Nature Communications, 9(1):4950, 2018.
+Giorgos Mamakoukas, Maria Castano, Xiaobo Tan, and Todd Murphey. Local koopman operators for data-driven control of robotic systems. In RSS, 2019.
+Alexandre Mauroy and Jorge Goncalves. Linear identification of nonlinear systems: A lifting technique based on the koopman operator. In CDC, 2016.
+Alexandre Mauroy and Jorge Goncalves. Koopman-based lifting techniques for nonlinear systems identification. IEEE Transactions on Automatic Control, 2019.
+David Mayne. Nonlinear model predictive control: Challenges and opportunities. In *Nonlinear Model Predictive Control*, pp. 23-44. Springer, 2000.
+Jeremy Morton, Freddie D Witherden, Antony Jameson, and Mykel J Kochenderfer. Deep dynamical modeling and control of unsteady fluid flows. In NeurIPS, 2018.
+Jeremy Morton, Freddie D Witherden, and Mykel J Kochenderfer. Deep variational koopman models: Inferring koopman observations for uncertainty-aware dynamics modeling and control. In *IJCAI*, 2019.
+Damian Mrowca, Chengxu Zhuang, Elias Wang, Nick Haber, Li Fei-Fei, Joshua B Tenenbaum, and Daniel LK Yamins. Flexible neural representation for physics prediction. In NeurIPS, 2018.
+Anusha Nagabandi, Ignasi Clavera, Simin Liu, Ronald S Fearing, Pieter Abbeel, Sergey Levine, and Chelsea Finn. Learning to adapt in dynamic, real-world environments through meta-reinforcement learning. In ICLR, 2019a.
+Anusha Nagabandi, Chelsea Finn, and Sergey Levine. Deep online learning via meta-learning: Continual adaptation for model-based rl. In ICLR, 2019b.
+Razvan Pascanu, Yujia Li, Oriol Vinyals, Nicolas Heess, Lars Buesing, Sebastien Racanière, David Reichert, Théophane Weber, Daan Wierstra, and Peter Battaglia. Learning model-based planning from scratch. arXiv:1707.06170, 2017.
+Joshua L Proctor, Steven L Brunton, and J Nathan Kutz. Generalizing koopman theory to allow for inputs and control. SIAM Journal on Applied Dynamical Systems, 17(1):909-930, 2018.
+Sebastien Racanière, Théophane Weber, David Reichert, Lars Buesing, Arthur Guez, Danilo Jimenez Rezende, Adrià Puigdomènech Badia, Oriol Vinyals, Nicolas Heess, Yujia Li, Razvan Pascanu, Peter Battaglia, David Silver, and Daan Wierstra. Imagination-augmented agents for deep reinforcement learning. In NeurIPS, 2017.
+Clarence W Rowley, Igor Mezić, Shervin Bagheri, Philipp Schlatter, and Dan S Henningson. Spectral analysis of nonlinear flows. Journal of Fluid Mechanics, 641:115-127, 2009.
+Alvaro Sanchez-Gonzalez, Nicolas Heess, Jost Tobias Springenberg, Josh Merel, Martin Riedmiller, Raia Hadsell, and Peter Battaglia. Graph networks as learnable physics engines for inference and control. In ICML, 2018.
+Peter J Schmid. Dynamic mode decomposition of numerical and experimental data. Journal of Fluid Mechanics, 656:5-28, 2010.
+Jasper Snoek, Hugo Larochelle, and Ryan P Adams. Practical bayesian optimization of machine learning algorithms. In NeurIPS, 2012.
+Naoya Takeishi, Yoshinobu Kawahara, and Takehisa Yairi. Learning koopman invariant subspaces for dynamic mode decomposition. In NeurIPS, 2017.
+Jonathan H Tu, Clarence W Rowley, Dirk M Luchtenburg, Steven L Brunton, and J Nathan Kutz. On dynamic mode decomposition: Theory and applications. Journal of Computational Dynamics, 1 (2):391-421, 2014.
+
+Matthew O Williams, Ioannis G Kevrekidis, and Clarence W Rowley. A data-driven approximation of the koopman operator: Extending dynamic mode decomposition. Journal of Nonlinear Science, 25(6):1307-1346, 2015.
+Matthew O Williams, Maziar S Hemati, Scott TM Dawson, Ioannis G Kevrekidis, and Clarence W Rowley. Extending data-driven koopman analysis to actuated systems. IFAC-PapersOnLine, 49 (18):704-709, 2016.
+
+# A ENVIRONMENT AND MODEL DETAILS
+
+Interaction types. In our experiments, interactions are considered different if the types are different or the objects involved have different physical properties.
+
+In the Rope environment, the top mass has a fixed height and is considered differently from the other masses. Thus, we have 2 types of self-interactions for the top mass and the non-top masses. In addition, we have 8 types of interactions between different objects. The objects on a relation could be either top mass or non-top mass. It is a combination of 4. And the interaction may happen between two nearby masses or masses that are two-hop away. In total, the number of interactions between different objects is $4 \times 2 = 8$ .
+
+In the Soft environments, there are four types of quadrilaterals: rigid, soft, actuated, and fixed. We have four types of self-interactions correspondingly. For the interactions between objects, we add edges between two quadrilaterals only if they are connected by a point or edge. Connection from different directions are considered as different relations. There are 8 different directions, up, down, left, right, up-left, down-left, up-right, down-right. The relation types also encode the type of receiver object. Thus, in total, there are $(8 + 1) \times 4 = 36$ types of relations between different objects.
+
+In the Swim environment, there are three types of quadrilaterals: rigid, soft, and actuated. Similar to the Soft environment, we use different edge types for different connecting directions; hence, the number of edge type is $(8 + 1)\times 3 = 27$
+
+# B ADDITIONAL EXPERIMENTS
+
+Comparison with a classical physical simulator optimized using back-box optimization. We have performed comparisons with a classical physical simulator optimized using black-box optimization (Delingette, 1998) by assuming different levels of knowledge over the ground truth model.
+
+If we assume that we know the ground truth model, where we only need to identify relevant physical parameters during the system identification stage, Bayesian Optimization (Snoek et al., 2012) (BO) can give us a reasonable estimate of the physical parameters. However, BO requires much more time to achieve a comparable performance with our method in the Rope environment: 0.43 vs. 180 seconds averaged over 100 trails (Ours vs. BO).
+
+If we are unsure about the ground truth model and we approximate the system using a set of points linked by springs and dampers, BO does not work as well. In our additional experiments, we approximate the Rope environment using a chained spring-mass system, say $n$ masses and $n - 1$ springs. While taking much more time, BO still cannot give us a satisfying result: simulation error 0.046 vs. 0.084 and control error 0.854 vs. 2.547 (Ours vs. BO).
+
+Ablation study on the effectiveness of the metric loss. The internal linear structure allows us to solve the control problem using quadratic programming, where the objective function for control is defined in the embedding space (Section 3.4); hence, it is desirable to have Koopman embeddings that preserve the distance in the original state space. In Section 3.3, we introduce a metric loss to promote learning a Koopman embedding that keeps the distance measurement.
+
+To demonstrate the effect of the metric loss, we compare the models trained with and without the metric loss. We establish the comparison using two measurements, the distance preservation and the prediction accuracy. To evaluate how well the Koopman embeddings preserve the distance, we compute the distribution of the log-ratio of the distance in the Koopman space and in the original state space, i.e., $\log \left(\frac{\|g^i - g^j\|_2}{\|x^i - x^j\|_2}\right)$ . For the model prediction accuracy, we show the simulation errors.
+
+We perform the experiments in the Rope environment and show the result in Figure 5. On the left, we show the ratio of distance in the learned Koopman space and the distance in the original state space. The model trained with metric loss has a log distance ratio that significantly more concentrates on 0. It means the metric loss effectively regularizes the model to preserve the distance. On the right, we show the simulation errors of the two models, which indicate that two models have comparable prediction performance. Metric loss effectively enhances the property of distance-preserving while not making a big sacrifice on the accuracy of the dynamics modeling.
+
+
+(a) Distance Preservation
+
+
+(b) Simulation
+
+
+(c) Control
+
+
+Figure 5: Ablation study on the metric loss in the Rope environment. (a) shows the distributions of the logarithm distance ratio, i.e., $\log \left(\frac{\|g^i - g^j\|_2}{\|x^i - x^j\|_2}\right)$ . The model trained with metric loss has a distance ratio much more concentrated to 1, which indicates it preserves the distance much better than the counterpart. (b) illustrates the simulation error of two models, where their performance is on par. (c) shows that the model trained using the metric loss performs better control.
+Figure 6: Modeling rope with known physical parameters. We show the comparison between our model and IN/PN in scenarios where we have access to the ground truth physical parameters. In this case, IN and PN slightly outperform our method due to the internal linear structure in our model. However, in the real world, we do not always know the physical parameters and their values, which makes our method preferable when adapting to new environments.
+
+Experiments in a known physical parameter setting. Our setting is different from the settings in the original IN and PN papers that we do not assume we know the physical parameters and their values, such as stiffness, mass, and gravity. Instead, the parameters are embedded in the transition matrices during the system identification stage (Section 3.3). If the model has access to the underlying physical parameters, as expected, IN and PN slightly outperform our method as the internal linear structure limits our model's expressiveness, as shown in Figure 6. In the real world, however, the underlying physical parameters are not always known, which makes our model a better choice when adapting to unseen environments.
\ No newline at end of file
diff --git a/learningcompositionalkoopmanoperatorsformodelbasedcontrol/images.zip b/learningcompositionalkoopmanoperatorsformodelbasedcontrol/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..c2f02d9babf4a8c83f4397d79518ad2fcb0d2452
--- /dev/null
+++ b/learningcompositionalkoopmanoperatorsformodelbasedcontrol/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:676a746f108eb813fc47710ff4dee482f675b59b8f18ab22127ceff6e46ae20b
+size 343196
diff --git a/learningcompositionalkoopmanoperatorsformodelbasedcontrol/layout.json b/learningcompositionalkoopmanoperatorsformodelbasedcontrol/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..dba74b2d9bfb5ba7793c0c09b7f882e9b692e868
--- /dev/null
+++ b/learningcompositionalkoopmanoperatorsformodelbasedcontrol/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:373be8bba6bb61e15cf5317d347d6b83f6cc53f4470e32289376d4646e4fa506
+size 492943
diff --git a/learningfromrulesgeneralizinglabeledexemplars/c42d1dec-2056-4c41-b1fb-bed5507c0b0e_content_list.json b/learningfromrulesgeneralizinglabeledexemplars/c42d1dec-2056-4c41-b1fb-bed5507c0b0e_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..5398e9bb554ee141890f8b3113326accbec719f6
--- /dev/null
+++ b/learningfromrulesgeneralizinglabeledexemplars/c42d1dec-2056-4c41-b1fb-bed5507c0b0e_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d8e48696ac3665ef2b0c097bc0c7468e2dfee1a2423421b4960e6bfa938c779a
+size 103041
diff --git a/learningfromrulesgeneralizinglabeledexemplars/c42d1dec-2056-4c41-b1fb-bed5507c0b0e_model.json b/learningfromrulesgeneralizinglabeledexemplars/c42d1dec-2056-4c41-b1fb-bed5507c0b0e_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..da97a09bcb916e2c64a96f15f9dfb9a05291aa22
--- /dev/null
+++ b/learningfromrulesgeneralizinglabeledexemplars/c42d1dec-2056-4c41-b1fb-bed5507c0b0e_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:48dce43aad970ae9d2adf10cf4c6c2766f4fa4ca04d0def618a5fa17f9214402
+size 121034
diff --git a/learningfromrulesgeneralizinglabeledexemplars/c42d1dec-2056-4c41-b1fb-bed5507c0b0e_origin.pdf b/learningfromrulesgeneralizinglabeledexemplars/c42d1dec-2056-4c41-b1fb-bed5507c0b0e_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..f9dd28858613db31a727e30f251dfb3766fcb769
--- /dev/null
+++ b/learningfromrulesgeneralizinglabeledexemplars/c42d1dec-2056-4c41-b1fb-bed5507c0b0e_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:266ccc3f74fb81e9a5805df503256917b7af38caae6c5f1eec1353d1d3bd000e
+size 578295
diff --git a/learningfromrulesgeneralizinglabeledexemplars/full.md b/learningfromrulesgeneralizinglabeledexemplars/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..639f16b6774e6220faaa63eaa82fcd3ad928d3ec
--- /dev/null
+++ b/learningfromrulesgeneralizinglabeledexemplars/full.md
@@ -0,0 +1,418 @@
+# LEARNING FROM RULES GENERALIZING LABELED EXEMPLARS
+
+Abhijeet Awasthi Sabyasachi Ghosh Rasna Goyal Sunita Sarawagi
+
+Department of Computer Science and Engineering
+
+Indian Institute of Technology Bombay
+
+Mumbai, Maharashtra 400076, India
+
+{awasthi, sghosh, goyalrasna, sunita}@cse.iitb.ac.in
+
+# ABSTRACT
+
+In many applications labeled data is not readily available, and needs to be collected via pain-staking human supervision. We propose a rule-exemplar method for collecting human supervision to combine the efficiency of rules with the quality of instance labels. The supervision is coupled such that it is both natural for humans and synergistic for learning. We propose a training algorithm that jointly denoises rules via latent coverage variables, and trains the model through a soft implication loss over the coverage and label variables. The denoised rules and trained model are used jointly for inference. Empirical evaluation on five different tasks shows that (1) our algorithm is more accurate than several existing methods of learning from a mix of clean and noisy supervision, and (2) the coupled rule-exemplar supervision is effective in denoising rules.
+
+# 1 INTRODUCTION
+
+With the ever-increasing reach of machine learning, a common hurdle to new adoptions is the lack of labeled data and the pain-staking process involved in collecting human supervision. Over the years, several strategies have evolved. On the one hand are methods like active learning and crowd-consensus learning that seek to reduce the cost of supervision in the form of per-instance labels. On the other hand is the rich history of rule-based methods (Appelt et al., 1993; Cunningham, 2002) where humans code-up their supervision as labeling rules. There is growing interest in learning from such efficient, albiet noisy, supervision (Ratner et al., 2016; Pal & Balasubramanian, 2018; Bach et al., 2019; Sun et al., 2018; Kang et al., 2018). However, clean task-specific instance labels continue to be critical for reliable results (Goh et al., 2018; Bach et al., 2019) in spite of easy availability of pre-trained models (Sun et al., 2017; Devlin et al., 2018).
+
+In this paper we propose a unique blend of cheap coarse-grained supervision in the form of rules and expensive fine-grained supervision in the form of labeled instances. Instead of supervising rules and instance labels independently, we propose that each labeling rule be attached with exemplars of where the rule correctly 'fires'. Thus, the rule can be treated as a noisy generalization of those exemplars. Often rules are coded up only after inspecting data. As a human inspects instances, he labels them, and then generalizes them to rules. Thus, humans provide paired supervision of rules and exemplars demonstrating correct deployment of that rule. We explain further with two illustrative applications. Our examples below are from the text domain because rules have been traditionally used in many NLP tasks, but our learning algorithm is agnostic to how rules are expressed.
+
+Sentiment Classification Consider an instance I highly recommend this modest priced cellular phone that a human inspects for a sentiment labeling task. After labeling it as positive, he can easily generalize it to a rule Contains 'highly recommend' $\rightarrow$ positive label. This rule generalizes to several more instances, thereby eliminating the need of per-instance labeling on those. However, the label assigned by this rule on unseen instances may not be as reliable as the explicit label on this specific exemplar it generalized. For example, it misfires on I would highly recommend this phone if it weren't for their poor service.
+
+Slot-filling Consider a slot-filling task on restaurant reviews over labels like cuisine, location, and time. When an annotator sees an instance like: what chinese restaurants in this city have good reviews?, after labeling token chinese as cuisine, he generalizes it to a rule: (.esel. iian|mexican) restaurants $\rightarrow$ (cuisine) restaurants. This rule matches hundreds of instances in the unlabeled set, but could wrongly label a phrase like these restaurants. Our focus in this paper is developing algorithms for training models under such coupled rule-exemplar supervision. Our main challenge is that the labels induced by the rules are more noisy than instance-level supervised labels because humans tend to over generalize (Tessler & Goodman, 2019) as we saw in the illustrations above. Learning with noisy labels with or without additional clean data has been a problem of long-standing interest in ML (Khetan et al., 2018; Zhang & Sabuncu, 2018; Ren et al., 2018b; Veit et al., 2017; Shen & Sanghavi, 2019). However, we seek to design algorithms that better capture rule-specific noise with the help of exemplars around which we have supervision that the rule fired correctly. We associate a latent random variable on whether a rule correctly 'covers' an instance, and jointly learn the distribution among the label and all cover variables. This way we simultaneously train the classifier with corrected rule-label examples, and restrict over-generalized rules. The denoised rules are used during inference to further boost accuracy of the trained model. In summary our contributions in this paper are as follows:
+
+Our contributions (1) We propose the paradigm of supervision in the form of rules generalizing labeled exemplars that is natural in several applications. (2) We design a training method that simultaneously denoises over-generalized rules via latent coverage variables, and trains a classification model with a soft implication loss that we introduce. (3) Through experiments on five tasks spanning question classification, spam detection, sequence labeling, and record classification we show that our proposed paradigm of supervision enables an effective synergy between rule-level and instance-level supervision. (4) We compare our algorithm to several recent frameworks for learning with noisy supervision and constraints, and show much better results with our method.
+
+# 2 TRAINING WITH RULES AND EXEMPLARS
+
+We first formally describe the problem of learning from rules generalizing exemplars on a classification task. Let $\mathcal{X}$ denote the space of instances and $\mathcal{Y} = \{1, \dots, K\}$ denote the space of class labels. Let the set of labeled examples be $L = \{(\mathbf{x}_1, \ell_1, e_1), \dots, (\mathbf{x}_n, \ell_n, e_n)\}$ where $\mathbf{x}_i \in \mathcal{X}$ is an instance, $\ell_i \in \mathcal{Y}$ is its user-provided label, and $e_i \in \{R_1, \dots, R_m, \emptyset\}$ denotes that $\mathbf{x}_i$ is an exemplar for rule $e_i$ . Some labeled instances may not be generalized to rules and for them $e_i = \emptyset$ . Also, a rule can have more than one exemplar associated with it. Each rule $R_j$ could be a blackbox function $R_j: \mathbf{x} \mapsto \{\ell_j, \emptyset\}$ that takes as input an instance $\mathbf{x} \in \mathcal{X}$ and assigns it either label $\ell_j$ or no-label. When the $i$ th labeled instance is an exemplar for rule $R_j$ (that is, $e_i = R_j$ ), the label of the instance $\ell_i$ should be $\ell_j$ . Additionally, we have a different set of unlabeled instances $U = \{\mathbf{x}_{n+1}, \dots, \mathbf{x}_N\}$ . The cover set $H_j$ of rule $R_j$ is the set of all instances in $U \cup L$ for which $R_j$ assigns a noisy label $\ell_j$ . An instance may be covered by more than one rule or no rule at all, and the labels provided by these rules may be conflicting. Our goal is to train a classification model $P_\theta(y|\mathbf{x})$ using $L$ and $U$ to maximize accuracy on unseen test instances. A baseline solution is to use $R_j$ to noisily label the covered $U$ instances using majority or other consensus method of resolving conflicts. We then train $P_\theta(y|\mathbf{x})$ on the noisy labels using existing algorithms for learning from noisy and clean labels (Veit et al., 2017; Ren et al., 2018b). However, we expect to be able to do better by learning the systematic pattern of noise in rules along with the classifier $P_\theta(y|\mathbf{x})$ .
+
+Our noise model on $R_{j}$ A basic premise of our learning paradigm is that the noise induced by a rule $R_{j}$ is due to over-generalizing the exemplar(s) seen when creating the rule. And, there exists a smaller neighborhood closer to the exemplar(s) where the noise is zero. We model this phenomenon by associating a latent Bernoulli random variable $r_{ji}$ for each instance $\mathbf{x}_i$ in the stated cover set $H_{j}$ of each rule $R_{j}$ . When $r_{ji} = 1$ , rule $R_{j}$ has not over-generalized on $\mathbf{x}_i$ , and there is no noise in the label $\ell_{j}$ that $R_{j}$ assigns to $\mathbf{x}_i$ . When $r_{ji} = 0$ we flag an over-generalization, and abstain from labeling $\mathbf{x}_i$ as $\ell_{j}$ suspecting it to be too noisy. We call $r_{ji}$ s as the latent coverage variables. We propose to learn the distribution of $r_{j}$ using another network with parameters $\phi$ that outputs the probability $P_{j\phi}(r_j|\mathbf{x})$ that $r_{j} = 1$ . We then seek to jointly learn $P_{\theta}(y|\mathbf{x})$ and $P_{j\phi}(r_j|\mathbf{x})$ to model the distribution over the true label $y$ and true coverage $r_{j}$ for each rule $j$ and each $\mathbf{x}$ in $H_{j}$ . Thus
+
+$P_{j\phi}$ plays the role of restricting a rule $R_{j}$ so that $r_j$ is not necessarily 1 for all instances in its cover set $H_{j}$
+
+An example We make our discussion concrete with an example. Figure 1 shows a two-dimensional $\mathcal{X}$ space with labeled points $L$ denoted as red crosses and blue circles, unlabeled points as dots, and the true labels as background color of the region. We show two rule-exemplar pairs: $(\mathbf{x}_1,y_1 = \text{red}, R_1)$ , $(\mathbf{x}_2,y_2 = \text{blue}, R_2)$ with bold boundaries. Clearly, both rules $R_1,R_2$ have over-generalized to the wrong region. If we train a classifier with many examples in $H_{1} \cup H_{2}$ wrongly labeled by rules, then even with a noise tolerant loss function like Zhang &
+
+
+Figure 1: Restricting over-generalized rules
+
+Sabuncu (2018), the classifier $P_{\theta}(y|\mathbf{x})$ might be misled. In contrast, what we hope to achieve is to learn the $P_{j\phi}(r_j|\mathbf{x})$ distribution using the limited labeled data and the overlap among the rules such that $\operatorname{Pr}(r_j|\mathbf{x})$ predicts a value of 0 for examples wrongly covered. Such examples are then excluded from training $P_{\theta}$ . The dashed boundaries indicate the revised boundaries of $R_{j}$ s that we can hope to learn based on consensus on the labeled data and the set of rules. Even after such restriction, $R_{j}$ s are useful for training the classifier because of the unlabeled points inside the dashed regions that get added to the labeled set.
+
+# 2.1 HOW WE JOINTLY LEARN $P_{\theta}$ AND $P_{j\phi}$
+
+In general we will be provided with several rules with arbitrary overlap in the set of labeled $L$ and unlabeled examples $U$ that they cover. Intuitively, we want the label distribution $P_{\theta}(y|\mathbf{x})$ to correctly restrict the coverage distribution $P_{j\phi}(r_j|\mathbf{x})$ , which in turn can provide clean labels to instances in $U$ that can be used to train $P_{\theta}(y|\mathbf{x})$ . We have two types of supervision in our setting. First, individually for each of $P_{\theta}(y|\mathbf{x})$ and $P_{j\phi}(r_j|\mathbf{x})$ we have ground truth values of $y$ and $r_j$ for some instances. For the $P_{\theta}(y|\mathbf{x})$ distribution, supervision on $y$ is provided by the human labeled data $L$ , and we use these to define the usual log-likelihood as one term in our training objective:
+
+$$
+\max _ {\theta} L L (\theta) = \max _ {\theta} \sum_ {(\mathbf {x} _ {i}, \ell_ {i}) \in L} \log P _ {\theta} \left(\ell_ {i} | \mathbf {x} _ {i}\right) \tag {1}
+$$
+
+For learning the distribution $P_{j\phi}(r_j|\mathbf{x})$ over the coverage variables, the only sure-shot labeled data is that $r_{ji} = 1$ for any $\mathbf{x}_i$ that is an exemplar of rule $R_j$ and $r_{ji} = 0$ for any $\mathbf{x}_i \in H_j$ whose label $\ell_i$ is different from $\ell_j$ . For other labeled instances $\mathbf{x}_i$ covered with rules $R_j$ with agreeing labels, that is $\ell_i = \ell_j$ we do not strictly require that $r_{ji} = 1$ . In the example above the corrected dashed red boundary excludes a red labeled point to reduce its noise on other points. However, if the number of labeled exemplars are too few, we regularize the networks towards more rule firings, by adding a noise tolerant $r_{ji} = 1$ loss on the instances with agreeing labels. We use the generalized cross entropy loss of Zhang & Sabuncu (2018).
+
+$$
+\begin{array}{l} L L (\phi) = \sum_ {(\mathbf {x} _ {i}, \ell_ {i}, e _ {i}) \in L} \big (\log P _ {e _ {i} \phi} (r _ {e _ {i} i} = 1 | \mathbf {x} _ {i}) + \sum_ {j: \mathbf {x} _ {i} \in H _ {j} \land \ell_ {i} \neq \ell_ {j}} \log P _ {j \phi} (r _ {j i} = 0 | \mathbf {x} _ {i}) \\ - \sum_ {j: \mathbf {x} _ {i} \in H _ {j} \wedge \ell_ {i} = \ell_ {j}} \text {G e n e r a l i z e d - X E N T} \left(P _ {j \phi} \left(r _ {j} | \mathbf {x} _ {i}\right), r _ {j i} = 1\right)) \\ \end{array}
+$$
+
+Note for other instances $\mathbf{x}_i$ in $R_{j}$ 's cover $H_{j}$ , value of $r_{ji}$ is unknown and latent. The second type of supervision is on the relationship between $r_{ji}$ and $y_{i}$ for each $\mathbf{x}_i\in H_j$ . A rule $R_{j}$ imposes a causal constraint that when $r_{ji} = 1$ , the label $y_{i}$ has to be $\ell_{j}$ .
+
+$$
+r _ {j i} = 1 \Longrightarrow y _ {i} = \ell_ {j} \quad \forall \mathbf {x} _ {i} \in H _ {j} \tag {3}
+$$
+
+We convert this hard constraint into a (log) probability of the constraint being satisfied under the $P_{\theta}(y|\mathbf{x})$ and $P_{j\phi}(r_j|\mathbf{x})$ distributions as:
+
+$$
+\log \left(1 - P _ {j \phi} \left(r _ {j} = 1 | \mathbf {x}\right) \left(1 - P _ {\theta} \left(\ell_ {j} | \mathbf {x}\right)\right)\right) \tag {4}
+$$
+
+Figure 2 shows a surface plot of the above log probability as a function of $P_{\theta}(\ell_j|\mathbf{x})$ (shown as axis $\mathrm{P(y)}$ in figure) and $P_{j\phi}(r_j = 1|\mathbf{x})$ (shown as axis $\mathrm{P(r)}$ in figure) for a single rule.
+
+Observe that likelihood drops sharply as $P(r_{j}|\mathbf{x})$ is close to 1 but $P(y = \ell_{j}|\mathbf{x})$ is close to zero. For all other values of these probabilities the log-likelihood is flat and close to zero. Specifically, when $P_{j\phi}$ predicts low values of $r_{j}$ for a $\mathbf{x}$ , the log-likelihood surface is flat, effectively withdrawing the $(\mathbf{x},\ell_{j})$ supervision from training the classifier $P_{\theta}$ . Thus maximizing this likelihood provides a soft enforcement of the constraint without unwanted biases. We call this the negative implication loss.
+
+We do not need to explicitly model the conflict among rules, that is when an $\mathbf{x}_i$ is covered by two rules $R_{j}$ and $R_{k}$ of differing labels $(\ell_j\neq$ $\ell_k)$ , then both $r_{ji}$ and $r_{ki}$ cannot be 1. This is
+
+
+Figure 2: Negative implication loss
+
+because the constraint among pairs $(y_{i},r_{ji})$ and $(y_{i},r_{ki})$ as stated in Equation 3 subsumes this one.
+
+During training we then seek to maximize the log of the above probability along with normal data likelihood terms. Putting the terms in Equations 1, 2 and 4 together our final training objective is:
+
+$$
+\min _ {\theta , \phi} - L L (\theta) - L L (\phi) - \gamma \sum_ {j; \mathbf {x} \in H _ {j} \cap U} \log \left(1 - P _ {j \phi} \left(r _ {j} = 1 \mid \mathbf {x}\right) \left(1 - P _ {\theta} \left(\ell_ {j} \mid \mathbf {x}\right)\right)\right) \tag {5}
+$$
+
+We refer to our training loss as a denoised rule-label implication loss or ImplyLoss for short. The $LL(\phi)$ term seeks to denoise rule coverage which then influence the $y$ distribution via the implication loss. We explored several other methods of enforcing the constraint among $y$ and $r_j$ in the training of the $P_{\theta}$ and $P_{j\phi}$ networks. Our method ImplyLoss consistently performed the best among several methods we tried including the recent posterior regularization (Ganchev et al., 2010; Hu et al., 2016) method of enforcing soft constraints and co-training (Blum & Mitchell, 1998).
+
+Network Architecture Our network has three modules. (1) A shared embedding layer that provides the feature representation of the input. When labeled data is scarce, this will typically be a pre-trained layer from a related task. The embedding module is task-specific and is described in the experiment section. (2) A classification network that models $P_{\theta}(y|\mathbf{x})$ with parameters $\theta$ . The embedding of an input $\mathbf{x}$ is passed through multiple non-linear layers with ReLU activation, a last linear layer followed by Softmax to output a distribution over the class labels. (3) A rule network that models $P_{j\phi}(r_j = 1|\mathbf{x})$ whose parameters $\phi$ are shared across all rules. The input to the network is rule-specific and concatenates the embedding of the input instance $\mathbf{x}$ , and a one-hot encoding of the rule id 'j'. The input is passed through multiple non-linear layers with ReLU activation before passing through a Sigmoid activation which outputs the probability $P_{j\phi}(r_j = 1|\mathbf{x})$ .
+
+Inference During prediction, joint inference over the label $y$ and coverage variables $r_j$ provides slight gains over depending solely on $P_{\theta}(y|\mathbf{x})$ . For any test example $\mathbf{x}$ , consider the set of rules $G$ covering $\mathbf{x}$ such that $P_{j\phi}(1|\mathbf{x}) > 0.5$ . Probabilities from the label and coverage variables are combined to obtain a score $s(y)$ for each label $y$ as:
+
+$$
+s (y | \mathbf {x}) = P _ {\theta} (y | \mathbf {x}) + \frac {\sum_ {R _ {j} \in G} \delta (\ell_ {j} = y) P _ {j \phi} (1 | \mathbf {x}) + \delta (\ell_ {j} \neq y) P _ {j \phi} (0 | \mathbf {x})}{| G |} \tag {6}
+$$
+
+The above can be viewed as a soft voting over the trained classifier $P_{\theta}$ and labels provided by rules with uncertain coverage. Because we also learned to denoise rules along with training the classifier, the labels assigned by the rules have higher precision than original rules.
+
+# 3 EXPERIMENTS
+
+We compare our training algorithms against simple baselines, existing error-tolerant learning algorithms, and existing constraint-based learning in deep networks.
+
+We evaluate across five datasets spanning three task types: text classification, sequence labeling, and record classification. We augment the datasets with rules, that we obtained manually in three
+
+| Dataset | |L| | |U| | #Rules | %Cover | Precision | %Conflict | Avg |Hj| | #Rules Per In-stance | Valid| | |Test| |
| Question | 68 | 4884 | 68 | 95 | 63.8 | 22.5 | 124 | 1.8 | 500 | 500 |
| MIT-R | 1842 | 64888 | 15 | 14 | 80.7 | 2.5 | 634 | 1.1 | 4091 | 14256 |
| SMS | 69 | 4502 | 73 | 40 | 97.3 | 0.6 | 31 | 1.3 | 500 | 500 |
| YouTube | 100 | 1586 | 10 | 87 | 78.6 | 30.2 | 258 | 1.9 | 120 | 250 |
| Census | 83 | 10000 | 83 | 100 | 84.1 | 27.5 | 540 | 4.5 | 5561 | 16281 |
+
+Table 1: Statistics of datasets and their rules. %Cover is fraction of instances in $U$ covered by at least one rule. Precision refers to micro precision of rules. Conflict denotes the fraction of instances covered by conflicting rules among all the covered instances. Avg $|H_{j}|$ is average cover size of a rule in $U$ . Rules Per Instance is average number of rules covering an instance in $U$ .
+
+cases, from pre-existing public sources in one case, and automatically in another. Table 1 presents statistics summarizing the datasets and rules. A brief description of each appears below.
+
+Question Classification (Li & Roth, 2002): This is a TREC-6 dataset to classify a question to one of six categories: {Abbreviation, Entity, Description, Human, Location, Numeric-value}. The training set has 5452 instances which are split as 68 for $L$ , 500 for validation, and the remaining as $U$ . Each example in $L$ is generalized as a rule represented by a regular expression. E.g. After labeling How do you throw a housewarming party? as Description we define a rule
+
+(how|How|what|What)(does|do|to|can).* $\longrightarrow$ Description.
+
+More rules in Table 4 of supplementary. Although, creating such 68 generalised rules required 90 minutes, the generalizations cover 4637 instances in $U$ , almost two orders of magnitude more instances than in $L$ ! On an average each of our rule covered 124 instances ( $|H_{j}|$ column in Table 1). But the precision of labels assigned by rules was only $63.8\%$ . $22.5\%$ of covered instances had an inter-rule conflict, demonstrating noise in the rule labelings. Accuracy is used as the performance metric.
+
+MIT-R $^1$ (Liu et al., 2013): This is a slot-filling task on sentences about restaurant search and the task is to label each token as one of {Location, Hours, Amenity, Price, Cuisine, Dish, Restaurant_Name, Rating, Other}. The training data is randomly split into 200 sentences (1842 tokens) as $L$ , 500 sentences (4k tokens) as validation and remaining 6.9k sentences (64.9k tokens) as $U$ . We manually generalize 15 examples in $L$ . E.g. After inspecting the sentence where can i get the highest rated burger within ten miles and labeling highest rated as Rating, we provide the rule:
+
+$\ast$ (highly|high|good|top|highest)(rate|rating|rated).* $\rightarrow$ Rating
+
+to the matched positions. More examples in Table 7 of supplementary. Although, creating 15 generalizing rules took 45 minutes of annotator effort, the rules covered roughly 9k tokens in $U$ . F1 metric is used for evaluation on the default test set of 14.2k tokens over 1.5k sentences.
+
+SMS Spam Classification (Almeida et al., 2011): This dataset contains $5.5\mathrm{k}$ text messages labeled as spam/not-spam, out of which 500 were held out for validation and 500 for testing. We manually generalized 69 exemplars to rules. Remaining examples go in the $U$ set. The rules here check for presence of keywords or phrases in the SMS $\star$ guaranteed gift $\star \rightarrow$ spam. A rule covers 31 examples on an average and has a precision of $97.3\%$ . However, in this case only $40\%$ of the unlabeled set is covered by a rule. We report F1 here since class is skewed. More examples in Table 5 of supplementary.
+
+Youtube Spam Classification (Alberto et al., 2015): Here the task is to classify comments on YouTube videos as Spam or Not-Spam. We obtain this from Snorkel's Github page2, which provides 10 labeling functions which we use as rules, an unlabeled train set which we use as $U$ , a labeled dev set to guide the creation of their labeling functions which we use as $L$ , and labeled test and validation sets which we use in the same roles. Their labeling functions have a large coverage (258 on average), and a precision of $78.6\%$ .
+
+Census Income (Dua & Graff, 2019): This UCI dataset is extracted from the 1994 U.S. census. It lists a total of 13 features of an individual such as age, education level, marital status, country of
+
+| Methods | Datasets |
| Question (Accuracy) | MIT-R (F1) | YouTube (Accuracy) | SMS (F1) | Census (Accuracy) |
| Majority (No parameters trained) | 60.9 (0.7) | 40.9 (0.1) | 82.2 (0.9) | 48.4 (1.2) | 80.1 (0.1) |
| Only-L | 72.9 (0.6) | 73.5 (0.3) | 90.9 (1.8) | 89.0 (1.6) | 79.4 (0.5) |
| L+Umaj | -1.4 (1.5) | +0.0 (0.3) | +0.8 (1.9) | +3.5 (1.2) | +0.9 (0.1) |
| Noise-tolerant (Zhang et al., 2018) | -0.5 (1.1) | +0.0 (0.2) | +1.7 (1.1) | +2.9 (1.2) | +1.0 (0.2) |
| L2R (Ren et al., 2018b) | +0.3 (2.1) | -15.4 (1.0) | +2.5 (0.5) | +2.3 (0.8) | +2.9 (0.3) |
| L+Usnorkel (Ratner et al., 2016) | -0.7 (3.0) | +0.0 (0.2) | +2.7 (0.7) | +3.5 (1.3) | +1.0 (0.4) |
| Snorkel-Noise-Tolerant | -1.4 (1.6) | +0.0 (0.3) | +2.0 (0.7) | +2.7 (1.5) | +0.2 (0.5) |
| Posterior Reg. (Hu et al., 2016) | -0.8 (1.0) | -0.1 (0.4) | -2.9 (1.9) | +1.8 (1.5) | -0.8 (0.5) |
| ImplyLoss (Ours) | +11.7 (1.5) | +0.8 (0.3) | +3.2 (1.1) | +4.2 (1.0) | +1.7 (0.2) |
+
+Table 2: Comparison of ImplyLoss (our method) with various methods (described in Section 3.1) on five different datasets. The numbers reported for all methods after the double-line are gains over the baseline (Only-L) that does not use rules at all. Higher is better. NOTE: Numbers in brackets represent standard deviation of the original accuracy and not of gains.
+
+origin etc. The primary task on it is binary classification - whether a person earns more than $50\mathrm{K}$ or not. The train data consists of 32563 records. We choose 83 random data points as $L$ , 10k points as $U$ and 5561 points as validation data. For this case we created the rules synthetically as follows: We hold out disjoint 16k random points from the training dataset as a proxy for human knowledge and extract a PART decision list (Frank & Witten, 1998) from it as our set of rules. We retain only those rules which fire on $L$ .
+
+Network Architecture Since our labeled data is small we depend on pre-trained resources. As the embedding layer we use a pretrained ELMO (Peters et al., 2018) network where 1024 dimensional contextual token embeddings serve as representations of tokens in the MIT-R sentences, and their average serve as representation for sentences in Question and SMS dataset. Parameters of the embedding network are held fixed during training. For sentences in the YouTube dataset, we use Snorkel's² architecture of a simple bag-of-words feature representation marking the frequent unigrams and bi-grams present in a sentence using a few-hot vector. For the Census dataset categorical features are represented as one hot vectors, while real valued features are simply normalized. For MIT-R, Question and SMS both classification and rule-weight network contain two 512 dimensional hidden layers with ReLU activation. For Census, both the networks contain two 256 dimensional hidden layers with ReLU activation. For YouTube, the classifier network is a simple logistic regression like in Snorkel's code. The rule network has one 32-dimensional hidden layer with ReLU activation.
+
+Each reported number is obtained by averaging over ten random initializations. Whenever a method involved hyper-parameters to weigh the relative contribution of various terms in the objective, we used a validation dataset to tune the value of the hyper-parameter. Hyperparameters used are provided in Section C of supplementary.
+
+# 3.1 COMPARISON WITH DIFFERENT METHODS
+
+In Table 2 we compare our method with the following alternatives on each of the five datasets:
+
+Majority: that predicts via majority vote among the rules that cover an instance. This baseline indicates the stand-alone quality of rules, no network is learned here. Ties are broken arbitrarily for class-balanced datasets or by using a default class. Table 2, shows that the accuracy of majority is quite poor indicating either poor precision or poor coverage of the rule sets. $^3$ .
+
+Only-L: Here we train the classifier $P_{\theta}(y|\mathbf{x})$ only on the labeled data $L$ using the standard cross-entropy loss (Equation 1). Rule generalisations are not utilized at all in this case. We observe in Table 2 that even with the really small labeled set we used for each dataset, the accuracy of a classifier learned with clean labeled data is much higher than noisy majority labels of rules. We consider this method as our baseline and report the gains on remaining methods.
+
+$\mathbf{L} + \mathbf{U}\mathbf{m}\mathbf{a}\mathbf{j}$ : Next we train the classifier on $L$ along with $U_{\mathrm{maj}}$ obtained by labeling instances in $U$ with the majority label among the rules applicable to the instance. Loss corresponding to the examples labeled by rules is weighted as follows:
+
+$$
+\min _ {\theta} \sum_ {(\mathbf {x} _ {j}, \ell_ {j}) \in L} - \log P _ {\theta} (\ell_ {j} | \mathbf {x} _ {j}) + \gamma \sum_ {(\mathbf {x} _ {j}, y _ {j}) \in U _ {\mathrm {m a j}}} - \log P _ {\theta} (y _ {j} | \mathbf {x} _ {j}) \tag {7}
+$$
+
+The row corresponding to $\mathrm{L} + \mathrm{Umaj}$ in Table 2 provides the gains of this method over Only-L. We observe gains with the noisily labeled $U$ in three out of the five cases.
+
+Noise-tolerant: Since labels in $U_{\mathrm{maj}}$ are noisy, we next use Zhang & Sabuncu (2018)'s noise tolerant generalized cross entropy loss on them with regular cross-entropy loss on the clean $L$ as follows:
+
+$$
+\min _ {\theta} \sum_ {(\mathbf {x} _ {j}, \ell_ {j}) \in L} - \log P _ {\theta} \left(\ell_ {j} | \mathbf {x} _ {j}\right) + \gamma \sum_ {(\mathbf {x} _ {j}, y _ {j}) \in U _ {\mathrm {m a j}}} \frac {\left(1 - P _ {\theta} \left(y _ {j} | \mathbf {x}\right)\right) ^ {q}}{q} \tag {8}
+$$
+
+Parameter $q \in [0,1]$ controls the noise tolerance which we tune as a hyper-parameter. We observe that in three cases minimizing the above objective improves beyond $\mathrm{L} + \mathrm{Umaj}$ validating that noise-tolerant loss functions can be useful for learning from noisy labels on $U_{\mathrm{maj}}$ .
+
+Learning to Reweight (L2R) (Ren et al., 2018b): is a recent method for training with a mix of clean and noisy labeled data. They train the classifier by meta-learning to re-weight the loss on the noisily labelled instances $(U_{\mathrm{maj}})$ with the help of the clean examples $(L)$ . This method provides significant accuracy gains over Only-L in three out the five datasets. However, it fails in the multiclass classification task of slot-filling which has a very high class imbalance and rules of smaller coverage.
+
+All the above methods employ no extra parameters to denoise or weight individual rules. We next compare with a number of methods that do.
+
+$\mathbf{L} + \mathbf{U}$ snorkel: This method replaces Majority-based consensus with Snorkel's generative model (Ratner et al., 2016) that assigns weights to rules and labels examples in $U$ . Thereafter we use the same approach as in $\mathbf{L} + \mathbf{U}$ maj with just Snorkel's soft-labels instead of Majority on $U$ . We also compare with using noise-tolerant loss on $U$ labeled by Snorkel (Eqn:8) which we call Snorkel-Noise-Tolerant. Like previous methods, both of these methods provide improvements over Only-L on three of the five datasets where the rules are less noisy. $\mathbf{L} + \mathbf{U}$ snorkel performs slightly better than Noise-Tolerant on $U_{\mathrm{maj}}$ .
+
+We next compare with a method that simultaneously learns two sets of networks $P_{\theta}$ and $P_{j\phi}$ like ours but with different loss function and training schedule.
+
+Posterior Regularization (PR): This method proposed in Hu et al. (2016) also treats rules as soft-constraints and has been used for training neural networks for structured outputs. They use Ganchev et al. (2010)'s posterior regularization framework to train the two networks in a teacher-student setup. We adapt the same framework and get a procedure as follows: The student proposes a distribution over $y$ and $r_j$ s using current $P_{\theta}$ and $P_{j\phi}$ , the teacher uses the constraint in Eq 3 to revise the distributions so as to minimize the probability of violations, the student updates parameters $\theta$ and $\phi$ to minimize KL distance with the revised distribution. The detailed formulation appears in the Section A of supplementary. We find that this method is no better than Only-L in most of the cases and worse than the noise-tolerant method that does not train extra $\phi$ parameters.
+
+**ImplyLoss(Ours):** Overall our approach of training with denoised rule-label implication loss provides much better accuracy than all the above eight methods and we get consistent gains over Only-L on all datasets. On the Question dataset we get 11.7 points gain over Only-L whereas the best gain by existing method was 0.3. A useful property of our method compared to the PR method above is that the training process is simple and fits into the batch stochastic gradient training template. In contrast, PR requires special alternating computations. We next perform a number of diagnostics experiments to explain the reasons for the superior performance of our method.
+
+Diagnostics: Effectiveness of learning true coverage via $P_{j\phi}$ An important part of our method is the rule-specific denoising learned via the $P_{j\phi}$ network. In the chart alongside we plot the original precision of rules on the test data, and the precision after suppressing those rule labelings where $P_{j\phi}(r_j|\mathbf{x})$ predicts 0 instead of 1. Observe now that the precision is more than $91\%$ on all datasets. For the Question dataset, the precision jumped from $64\%$ to $98\%$ . The percentage of labelings suppressed (shown by the dashed line) is higher on datasets with noisier rules (e.g. compare Question and
+
+SMS). This shows that $P_{j\phi}$ is able to denoise rules by capturing the distribution of the latent true coverage variables with the limited $LL(\phi)$ loss and indirectly via the implication loss.
+
+
+Figure 3: Rule-specific denoising by our method.
+
+Effect of rule precision Rules in the Census dataset are of higher quality in terms of precision as well as coverage. Superior performance of the L2R method on this dataset motivated us to inspect how well our method performs on the same dataset in the absence of high precision rules. We created four new versions of the rule sets by successively removing high precision rules from the original rule set. We observe that our method performs better than L2R when rules have low precision. Because ImplyLoss denoises rules, it is better able to handle low-precision rules.
+
+
+Figure 4: Effect of rule precision
+
+Role of Exemplars in Rules We next evaluate the importance of the exemplar-rule pairs in learning the $P_{j\phi}$ and $P_{\theta}$ networks. The exemplars of a rule give an interesting new form of supervision about an instance where a labeling rule must fire. To evaluate the importance of this supervision, we exclude the $r_j = 1$ likelihood on rule-exemplar pairs from $LL(\phi)$ , that is, the first term in Equation 2 is dropped. In the table below we see that performance of ImplyLoss usually drops when the exemplar-rule supervision is removed. Interestingly, even after this drop, the performance of ImplyLoss surpasses most of the methods in Table 2 indicating that even without exemplar-rule pairs our training objective is effective in learning from rules and labeled instances.
+
+ | Question | MIT-R | SMS | Census |
| rj=1 for rule-exemplar pairs | 84.5 (1.5) | 73.7 (0.3) | 93.2 (1.0) | 81.0 (0.2) |
| No rj=1 for rule-exemplar pairs | 83.8 (0.7) | 73.5 (0.5) | 93.5 (1.2) | 80.8 (0.3) |
+
+Table 3: Effect of removing rule-exemplar supervision from ${LL}\left( \phi \right)$
+
+Effect of increasing labeled data $L$ We increase $L$ while keeping the number of rules fixed on the Question dataset. In the attached plot we see the accuracy of our method (ImplyLoss) against Only-L, L+Usnorkel and Posterior Reg. We observe the expected trend that the gap between the method narrows as labeled data increases.
+
+# 4 RELATED WORK
+
+Learning from noisily labeled data has been extensively studied in settings like crowdsourcing. One category of these algorithms
+
+
+Figure 5: Effect of increasing labeled data
+
+upper-bound the loss function to make it robust to noise. These include methods like MAE (Ghosh
+
+et al., 2017), Generalized Cross Entropy (CE)(Zhang & Sabuncu, 2018), and Ramp loss (Collobert et al., 2006). Most of these assume that noise is independent of the input given the true label. In our model noise is systematic and instance-dependent.
+
+A second category assume that a small clean dataset is available along with noisily labeled data. This is also true in our case, and we compared with a state of the art method in that category Ren et al. (2018b) that chooses a descent direction that aligns with a clean validation set using meta-learning. Others in this category include: Shen & Sanghavi (2019)'s method of iteratively selecting examples with smallest loss, and Veit et al. (2017)'s method of learning a separate network to transform noisy labels to cleaned ones which are used to impose a cross-entropy loss on $P_{\theta}(y|\mathbf{x})$ . In contrast, we perform rule-specific cleaning via latent coverage variables and a flexible implication loss which withdraws $y$ supervision when $P_{j\phi}(r_{ji}|\mathbf{x})$ assumes low values. Another way of relating clean and noisy labels is via an instance-independent confusion matrix learned jointly with the classifier (Khetan et al., 2018; Goldberger & Ben-Reuven, 2016; Han et al., 2018b;a). These works assume that the confusion matrix is instance independent, which does not hold for our case. Tanaka et al. (2018) uses confidence from the classifier to eliminate noise but they need to ensure that the network does not memorize noise. Our learning setup also has the advantage of extracting confidence from a different network. There is growing interest in integrating logical rules with labeled examples for training networks, specifically for structured outputs (Manhaeve et al., 2018; Xu et al., 2018; Fischer et al., 2019; Sun et al., 2018; Ren et al., 2018a). Xu et al. (2018); Fischer et al. (2019) convert rules on output nodes of network, to (almost differentiable) loss functions during training. The primary difference of these methods from ours is that they assume that rules are correct whereas we assume them to be noisy. Accordingly, we simultaneously correct the rules and use them to improve the classifier, whereas they use the rules as-is to train the network outputs.
+
+A well-known framework for working with soft rules is posterior regularization (Ganchev et al., 2010) which is used in Hu et al. (2016) to train deep structured output networks while harnessing logic rules. Ratner et al. (2016) works only with noisy rules treating them as black-box labeling functions and assigns a linear weight to each rule based on an agreement objective. Our learning model is more powerful that attempts to learn a non-linear network to restrict rule boundaries rather than just weight their outputs. We presented a comparison with both these approaches in the experimental section, and showed superior performance.
+
+To the best of our knowledge, our proposed paradigm of coupled rule-exemplar supervision is novel, and our proposed training algorithm is able to harness them in ways not possible by existing frameworks for learning from rules or noisy supervision.
+
+# 5 CONCLUSION
+
+We proposed a new rule-exemplar model for collecting human supervision to combine the scalability of top-level rules with the quality of instance-level labels. We show that such supervision is natural since humans typically inspect examples to code rules. Furthermore, such coupled examples provide supervision on correct firing of rules which help to denoise rules. We propose to train the classifier while jointly denoising rules via latent coverage variables imposing a soft-implication constraint on the true label. Empirically on five datasets we show that our training algorithm that performs rule-specific denoising is better than generic noise-tolerant learning. In future we plan to deploy this framework on other applications where human supervision is a scarce resource.
+
+Reproducibility Code and Data for the experiments available at https://github.com/awasthiabhijeet/Learning-From-Rules
+
+Acknowledgements We thank the anonymous reviewers for their constructive feedback on this work. This research was partly sponsored by a Google India AI/ML Research Award and partly by the IBM AI Horizon Networks - IIT Bombay initiative. Abhijeet is supported by Google PhD Fellowship in Machine Learning.
+
+# REFERENCES
+
+Túlio C Alberto, Johannes V Lochter, and Tiago A Almeida. Tubespam: Comment spam filtering on youtube. In 2015 IEEE 14th International Conference on Machine Learning and Applications (ICMLA), pp. 138-143. IEEE, 2015.
+Tiago A Almeida, José María G Hidalgo, and Akebo Yamakami. Contributions to the study of sms spam filtering: new collection and results. In Proceedings of the 11th ACM symposium on Document engineering, pp. 259-262. ACM, 2011.
+Douglas E. Appelt, Jerry R. Hobbs, John Bear, David J. Israel, and Mabry Tyson. Fastus: A finite-state processor for information extraction from real-world text. In *IJCAI*, pp. 1172-1178, 1993.
+Stephen H. Bach, Daniel Rodriguez, Yintao Liu, Chong Luo, Haidong Shao, Cassandra Xia, Souvik Sen, Alexander Ratner, Braden Hancock, Houman Alborzi, Rahul Kuchhal, Christopher Ré, and Rob Malkin. Snorkel drybell: A case study in deploying weak supervision at industrial scale. In Proceedings of the 2019 International Conference on Management of Data, SIGMOD Conference 2019, Amsterdam, The Netherlands, June 30 - July 5, 2019., pp. 362-375, 2019.
+Avrim Blum and Tom Mitchell. Combining labeled and unlabeled data with co-training. In $COLT$ , 1998.
+R. Collobert, F. Sinz, J. Weston, and L. Bottou. Trading convexity for scalability. In ICML 2006, 2006.
+Hamish Cunningham. Gate: A framework and graphical development environment for robust nlp tools and applications. In Proc. 40th Annual Meeting of the Association for Computational Linguistics (ACL 2002), pp. 168-175, 2002.
+Arthur P Dempster, Nan M Laird, and Donald B Rubin. Maximum likelihood from incomplete data via the em algorithm. Journal of the Royal Statistical Society: Series B (Methodological), 39(1): 1-22, 1977.
+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.
+Dheeru Dua and Casey Graff. UCI machine learning repository, 2019. URL http://archive.ics.uci.edu/ml.
+Marc Fischer, Mislav Balunovic, Dana Drachsler-Cohen, Timon Gehr, Ce Zhang, and Martin Vechev. DL2: Training and querying neural networks with logic. In Proceedings of the 36th International Conference on Machine Learning, pp. 1931-1941, 2019.
+Eibe Frank and Ian H. Witten. Generating accurate rule sets without global optimization. In J. Shavlik (ed.), Fifteenth International Conference on Machine Learning, pp. 144-151. Morgan Kaufmann, 1998.
+Kuzman Ganchev, Jennifer Gillenwater, Ben Taskar, et al. Posterior regularization for structured latent variable models. Journal of Machine Learning Research, 11(Jul):2001-2049, 2010.
+Aritra Ghosh, Himanshu Kumar, and PS Sastry. Robust loss functions under label noise for deep neural networks. In Thirty-First AAAI Conference on Artificial Intelligence, 2017.
+Garrett B. Goh, Charles Siegel, Abhinav Vishnu, and Nathan Hodas. Using rule-based labels for weak supervised learning: A chemnet for transferable chemical property prediction. In Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, KDD '18, 2018.
+Jacob Goldberger and Ehud Ben-Reuven. Training deep neural-networks using a noise adaptation layer. 2016.
+Bo Han, Jiangchao Yao, Gang Niu, Mingyuan Zhou, Ivor Tsang, Ya Zhang, and Masashi Sugiyama. Masking: A new perspective of noisy supervision. In Advances in Neural Information Processing Systems, pp. 5841-5851, 2018a.
+
+Bo Han, Quanming Yao, Xingrui Yu, Gang Niu, Miao Xu, Weihua Hu, Ivor Tsang, and Masashi Sugiyama. Co-teaching: Robust training of deep neural networks with extremely noisy labels. In Advances in Neural Information Processing Systems 31, pp. 8536-8546. 2018b.
+Zhiting Hu, Xuezhe Ma, Zhengzhong Liu, Eduard Hovy, and Eric Xing. Harnessing deep neural networks with logic rules. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), August 2016.
+Dongyeop Kang, Tushar Khot, Ashish Sabharwal, and Eduard Hovy. Adventure: Adversarial training for textual entailment with knowledge-guided examples. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers). Association for Computational Linguistics, 2018.
+Ashish Khetan, Zachary C. Lipton, and Anima Anandkumar. Learning from noisy singly-labeled data. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id=H1sUHgb0Z.
+Xin Li and Dan Roth. Learning question classifiers. In Proceedings of the 19th international conference on Computational linguistics-Volume 1, pp. 1-7. Association for Computational Linguistics, 2002.
+Jingjing Liu, Panupong Pasupat, Yining Wang, Scott Cyphers, and Jim Glass. Query understanding enhanced by hierarchical parsing structures. In 2013 IEEE Workshop on Automatic Speech Recognition and Understanding, pp. 72-77. IEEE, 2013.
+Robin Manhaeve, Sebastijan Dumancic, Angelika Kimmig, Thomas Demeester, and Luc De Raedt. Deepproblog: Neural probabilistic logic programming. In Advances in Neural Information Processing Systems 31, pp. 3749-3759. 2018.
+Arghya Pal and Vineeth N. Balasubramanian. Adversarial data programming: Using gans to relax the bottleneck of curated labeled data. In 2018 IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2018, Salt Lake City, UT, USA, June 18-22, 2018, pp. 1556-1565, 2018.
+Matthew E Peters, Mark Neumann, Mohit Iyyer, Matt Gardner, Christopher Clark, Kenton Lee, and Luke Zettlemoyer. Deep contextualized word representations. arXiv preprint arXiv:1802.05365, 2018.
+Alexander J Ratner, Christopher M De Sa, Sen Wu, Daniel Selsam, and Christopher Ré. Data programming: Creating large training sets, quickly. In Advances in Neural Information Processing Systems 29. 2016.
+Hongyu Ren, Russell Stewart, Jiaming Song, Volodymyr Kuleshov, and Stefano Ermon. Learning with weak supervision from physics and data-driven constraints. AI Magazine, 39(1):27-38, 2018a.
+Mengye Ren, Wenyuan Zeng, Bin Yang, and Raquel Urtasun. Learning to reweight examples for robust deep learning. arXiv preprint arXiv:1803.09050, 2018b.
+Yanyao Shen and Sujay Sanghavi. Learning with bad training data via iterative trimmed loss minimization. In Proceedings of the 36th International Conference on Machine Learning, pp. 5739-5748, 2019.
+Chen Sun, Abhinav Shrivastava, Saurabh Singh, and Abhinav Gupta. Revisiting unreasonable effectiveness of data in deep learning era. In IEEE International Conference on Computer Vision, ICCV 2017, Venice, Italy, October 22-29, 2017, pp. 843-852, 2017.
+Haitian Sun, William W Cohen, and Lidong Bing. Semi-supervised learning with declaratively specified entropy constraints. In Advances in Neural Information Processing Systems 31, pp. 4425-4435. 2018.
+Daiki Tanaka, Daiki Ikami, Toshihiko Yamasaki, and Kiyoharu Aizawa. Joint optimization framework for learning with noisy labels. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 5552-5560, 2018.
+
+Michael Henry Tessler and Noah D. Goodman. The language of generalization. Psychological Review, 126(3):395-436, 2019.
+Andreas Veit, Neil Alldrin, Gal Chechik, Ivan Krasin, Abhinav Gupta, and Serge Belongie. Learning from noisy large-scale datasets with minimal supervision. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 839-847, 2017.
+Jingyi Xu, Zilu Zhang, Tal Friedman, Yitao Liang, and Guy Van den Broeck. A semantic loss function for deep learning with symbolic knowledge. In Proceedings of the 35th International Conference on Machine Learning, pp. 5502-5511, 2018.
+Zhilu Zhang and Mert Sabuncu. Generalized cross entropy loss for training deep neural networks with noisy labels. In Advances in Neural Information Processing Systems 31. 2018.
+
+# Supplementary Material: Learning from Rules Generalizing Labeled Exemplars
+
+# A POSTERIOR REGULARIZATION METHOD
+
+We model a joint distribution $Q(y, r_1, \ldots, r_n | \mathbf{x})$ to capture the interaction among the label random variable $y$ and coverage random variables $r_1, \ldots, r_n$ of any instance $\mathbf{x}$ . We use $\mathbf{r}$ to compactly represent $r_1, \ldots, r_n$ . Strictly speaking, when a rule $R_j$ does not cover $\mathbf{x}$ , the $r_j$ is not a random variable and its value is pinned to 0 but we use this fixed-tuple notation for clarity. The random variables $r_j$ and $y$ impose a constraint on the joint distribution $Q$ : for a $\mathbf{x} \in H_j$ when $r_j = 1$ , the label $y$ cannot be anything other than $\ell_j$ .
+
+$$
+r _ {j} = 1 \Longrightarrow y = \ell_ {j} \quad \forall \mathbf {x} \in H _ {j} \tag {9}
+$$
+
+We can convert this into a soft constraint on the marginals of the distribution $Q$ by stating the probability of $\sum_{y\neq \ell_j}Q(y,r_j = 1|\mathbf{x})$ should be small.
+
+$$
+\min _ {Q} \sum_ {j} \sum_ {\mathbf {x} \in H _ {j}} \sum_ {y \neq \ell_ {j}} Q (y, r _ {j} = 1 | \mathbf {x}) \tag {10}
+$$
+
+The singleton marginals of $Q$ along the $y$ and $r_j$ variables are tied to the $P_{\theta}$ and $P_{j\phi}(r_j|\mathbf{x})$ we seek to learn. A network with parameters $\theta$ models the classifier $P_{\theta}(y|\mathbf{x})$ , and a separate network with $\phi$ variables (shared across all rules) learns the $P_{j\phi}(r_j|\mathbf{x})$ distribution. The marginals of joint $Q$ should match these trained marginals and we use a KL term for that:
+
+$$
+\min _ {Q, \theta , \phi} \sum_ {\mathbf {x} \in U \cup L} \left(K L (Q (y | \mathbf {x}); P _ {\theta} (y | \mathbf {x})) + \sum_ {j: \mathbf {x} \in H _ {j}} K L (Q \left(r _ {j} | \mathbf {x}\right); P _ {j \phi} \left(r _ {j} | \mathbf {x}\right))\right) \tag {11}
+$$
+
+We call the combined KL term succinctly as $KL(Q, P_{\theta}) + KL(Q, P_{\phi})$ .
+
+Further the $P_{\theta}$ and $P_{j\phi}$ distributions should maximize the log-likelihood on their respective labeled data as provided in Equation 1 and Equation 2 respectively.
+
+Putting all the above objectives together with hyper-parameters $\alpha > 0$ , $\lambda > 0$ we get our final objective as:
+
+$$
+\min _ {Q, \theta , \phi} - \alpha (L L (\theta) + L L (\phi)) + K L (Q, P _ {\theta}) + K L (Q, P _ {\phi}) + \lambda \sum_ {j} \sum_ {\mathbf {x} \in H _ {j}} \sum_ {y \neq \ell_ {j}} Q (y, r _ {j} = 1 | \mathbf {x}) \tag {12}
+$$
+
+We show in Section A.1 that this gives rise to the solution for $Q$ in terms of $P_{\theta}$ , $P_{j\phi}$ and alternately for $P_{\theta}$ , $P_{j\phi}$ in terms of $Q$ as follows.
+
+$$
+Q (y, \mathbf {r} | \mathbf {x}) \propto P _ {\theta} (y | \mathbf {x}) \prod_ {j: \mathbf {x} \in H _ {j}} P _ {j \phi} \left(r _ {j} | \mathbf {x}\right) e ^ {- \lambda \delta \left(y \neq \ell_ {j} \wedge r _ {j} = 1\right)} \tag {13}
+$$
+
+where $\delta(y \neq \ell_j \wedge r_j = 1)$ is an indicator function that is 1 when the constraint inside holds, else it is 0. Computing marginals of the above using straight-forward message passing techniques we get:
+
+$$
+Q (y | \mathbf {x}) \propto P _ {\theta} (y | \mathbf {x}) \prod_ {j: \mathbf {x} \in H _ {j}} \left(P _ {j \phi} (1 | \mathbf {x}) e ^ {- \lambda \delta (y \neq \ell_ {j})} + P _ {j \phi} (0 | \mathbf {x})\right) \tag {14}
+$$
+
+$$
+Q \left(r _ {k} = 1 | \mathbf {x}\right) \propto P _ {k \phi} \left(1 | \mathbf {x}\right) \sum_ {y} e ^ {- \lambda \delta \left(y \neq \ell_ {k}\right)} P _ {\theta} (y | \mathbf {x}) \prod_ {j \neq k, \mathbf {x} \in H _ {j}} \left(P _ {j \phi} (1 | \mathbf {x}) e ^ {- \lambda \delta \left(y \neq \ell_ {j}\right)} + P _ {j \phi} (0 | \mathbf {x})\right) \tag {15}
+$$
+
+Thereafter, we solve for $\theta$ and $\phi$ in terms of a given $Q$ as
+
+$$
+\min _ {\theta , \phi} - L L (\theta) - L L (\phi) - \gamma \sum_ {\mathbf {x} _ {i} \in U} \sum_ {y \in \mathcal {Y}} Q (y | \mathbf {x} _ {i}) \log P _ {\theta} (y | \mathbf {x} _ {i}) + \sum_ {j: \mathbf {x} _ {i} \in H _ {j}} \sum_ {r _ {j} \in \{0, 1 \}} Q (r _ {j} | \mathbf {x} _ {i}) \log P _ {j \phi} (r _ {j} | \mathbf {x} _ {i}) \tag {16}
+$$
+
+Here, $\gamma = \frac{1}{\alpha}$ . This gives rise to an alternating optimization algorithm as in the posterior regularization framework of Ganchev et al. (2010). We initialize $\theta$ and $\phi$ randomly. Then in a loop, we perform the following two steps alternatively much like the EM algorithm (Dempster et al., 1977).
+
+Q Computation step: Here we compute marginals $Q(y|\mathbf{x})$ and $Q(r_j|\mathbf{x})$ from current $P_{\theta}$ and $P_{j\phi}$ using Equations 14 and 15 respectively for each $\mathbf{x}$ in a batch. This computation is straightforward and does not require any neural optimization. We can interpret the $Q(y|\mathbf{x})$ as a small correction of the $P_{\theta}(y|\mathbf{x})$ so as to align better with the constraints imposed by the rules in Equation 3. Likewise $Q(r_j|\mathbf{x})$ is an improvement of current $P_{j\phi}s$ in the constraint preserving direction. For example, the expected $r_j$ values might be reduced for an instance if its probability of $y$ being $\ell_j$ is small.
+
+Parameter update step: We next reoptimize the $\theta$ and $\phi$ parameters to match the corrected $Q$ distribution as shown in Equation 16. This is solved using standard stochastic gradient techniques. The $Q$ terms can just be viewed as weights at this stage which multiply the loss or label likelihood. A pseudocode of our overall training algorithm is described in Algorithm 1.
+
+Algorithm 1 Our Joint Training Algorithm using Posterior Regularization
+Input: $L,U$
+Initialize parameters $\theta ,\phi$ randomly
+for a random training batch from $U\cup L$ do Obtain $P_{\theta}(y|\mathbf{x})$ from the classification network. Obtain $P_{j\phi}(r_j|\mathbf{x})_{j\in [n]}$ from the rule-weight network. Calculate $Q(y|\mathbf{x})$ using Eqn 14 and $Q(r_j|\mathbf{x})_{j\in [n]}$ using Eqn 15. Update $\theta$ and $\phi$ by taking a step in the direction to minimize the loss in Eqn 16.
+end for
+Output: $\theta ,\phi$
+
+# A.1 PROOF: ALTERNATING SOLUTION FOR OPTIMIZATION OBJECTIVE IN EQN 12
+
+Treat each $Q(y, \mathbf{r})$ as an optimization variable with the constraint that $\sum_{y, \mathbf{r}} Q(y, \mathbf{r}) = 1$ . We express this constraint with a Langrangian multiplier $\eta$ in the objective. Also, define a distribution
+
+$$
+P _ {\theta , \phi} (y, \mathbf {r} | \mathbf {x}) = P _ {\theta} (y | \mathbf {x}) \prod_ {j: \mathbf {x} \in H _ {j}} P _ {j \phi} (r _ {j} | \mathbf {x})
+$$
+
+It is easy to verify that the KL terms in our objective 12 can be collapsed as $KL(Q;P_{\theta ,\phi})$ . The rewritten objective (call it $F(Q,\theta ,\phi)$ ) is now:
+
+$$
+\begin{array}{l} - \alpha (L L (\theta) + L L (\phi)) + \sum_ {\mathbf {x}} K L (Q (y, \mathbf {r} | \mathbf {x}), P _ {\theta , \phi} (y, \mathbf {r} | \mathbf {x})) \\ + \lambda \sum_ {j} \sum_ {\mathbf {x} \in H _ {j}} \sum_ {y \neq \ell_ {j}} Q (y, r _ {j} = 1 | \mathbf {x}) + \eta (1 - \sum_ {y, \mathbf {r}} Q (v, r)) \tag {17} \\ \end{array}
+$$
+
+Next we solve for $\frac{\partial F}{\partial Q(y,\mathbf{r})} = 0$ after expressing the marginals in their expanded forms: e.g. $Q(y,r_{j}|\mathbf{x}) = \sum_{r_{1},\ldots ,r_{j - 1},r_{j + 1},\ldots ,r_{n}}Q(y,r_{1},\ldots ,r_{n}|\mathbf{x})$ . This gives us
+
+$$
+\begin{array}{l} \frac {\partial F}{\partial Q (y , \mathbf {r})} = \quad \log Q (y, \mathbf {r}) - \log P _ {\theta , \phi} (y, \mathbf {r} | \mathbf {x}) \\ + \sum_ {j: \mathbf {x} \in H _ {j}} \lambda \delta (y \neq \ell_ {j}, r _ {j} = 1) + \eta + 1 \\ \end{array}
+$$
+
+Equating it to zero and substituting for $P_{\theta, \phi}$ we get the solution for $Q(y, \mathbf{r})$ in Equation 13.
+
+The proof for the optimal $P_{\theta}$ and $P_{j\phi}$ while keeping $Q$ fixed in Equation 17 is easy and we skip here.
+
+# B LIST OF RULES
+
+We provide a list of rules for each task type.
+
+| Rule | Example | Class |
| ( |^ ) (where) [^ \w] * ( \w+ ) {0,1}
+(was|is) [^ \w] * ( | \$) | Where is Trinidad ? | Location |
| ( |^ ) (which|what) [^ \w] * ( \w+ ) {0,1}
+/play|game|movie|book) [^ \w] * ( | $) | What book is the follow-up
+to Future Shock ? | Entity |
| ( |^ ) (what) [^ \w] * ( \w+ ) {0,1}
+(part|division|ratio|percentage)
+[^ \w] * ( | $) | Of children between the
+ages of two and eleven ,
+what percentage watch “
+The Simpsons ” ? | Numeric |
| ( |^ ) (who|who) [^ \w] * ( \w+ ) {0,1}
+(found|discovered|made|built
+|build|invented) [^ \w] * ( | $) | Who invented volleyball ? | Human |
+
+Table 4: Sample rules for TREC Question Classification. Rule fires if the regex matches
+
+| Rule | Example | Class |
| ( |^ ) (free) [^ \w] *
+([^ \s]+ ) * (price) [^ \w] *
+([^ \s]+ ) * (call) [^ \w] * ( |$) | Free video camera phones with
+Half Price line rental for 12 mths
+and 500 cross ntwk mins 100 txts.
+Call MobileUpd8 08001950382 or
+Call2OptOut/674 | Spam |
| ( |^ ) (guaranteed) [^ \w] * ([^ \s]+ ) *
+(gift\.|gift) [^ \w] * ( |$) | Great News! Call FREEFONE
+08006344447 to claim your guaran-
+teed £1000 CASH or £2000 gift. | Spam |
| ( |^ ) (can't) [^ \w] *
+(\w+ ) {0,1} (talk) [^ \w] * ( |$) | sry can't talk on phone, with parents | NotSpam |
| ( |^ ) (that's) [^ \w] *
+(\w+ ) {0,1} (fine! | fine) [^ \w] * ( |$) | Yeah, that's fine! It's £6 to get in,
+is that ok? | NotSpam |
+
+Table 5: Sample rules for Spam Classification. Rule fires if the regex matches
+
+| Rules | Class |
| capital-gain > 6849 | > 50K |
| education-num > 12 AND
+marital-status = Never-married AND
+native-country = United-States AND
+occupation = Exec-managerial | > 50K |
| marital-status = Separated AND
+hours-per-week ≤ 41 | ≤ 50K |
| education-num ≤ 12 AND
+native-country = United-States AND
+age ≤ 30 | ≤ 50K |
+
+Table 6: Sample rules for census dataset. Rule fires if all clauses are True
+
+| Rule | Example | Class |
| ( |^) [^{\w}] * (within|near|next|close|nearby| around|around) [^{\w}] * ([^{\s}]+ ){0,2} (here|city|miles|mile) *[^{\w}]* ( |$) | any kid friendly restaurants around here | Location |
| WordLists:
+cuisine1a=['italian','american', 'japanese','spanish','mexican', 'chinese','vietnamese','vegan']
+cuisine1b=['bistro','delis']
+cuisine2=['barbecue','halal', 'vegetarian', 'bakery'] | can you find me some chi- nese food | Cuisine |
| ([0-9]+|few|under [0-9]+) dollar | i need a family restaurant with meals under 10 dollars and kids eat | Price |
| ((high|highly|good|best|top| well|highest|zagat)
+(rate|rating|rated)) |
+((rated|rate|rating) [0-9]* star) | ([0-9]+ star) | where can i get the highest rated burger within ten miles | Rating |
| ((open|opened)(now|late)) |
+(still (open|opened|closed|close)) | (((open|close|opened|closed) \w+([\\s] | \w* | \w* \w*) *[0-9]+ (am|pm|((a|p)m)|hours|hour)) | where is the nearest italian restaurant that is still open | Hours |
| (outdoor|indoor|group|romantic| family|outside|inside|fine| waterfront|outside|private| business|formal|casual|rooftop| (special occasion))
+([\\s] | \w+ | \w+ \w+) dining | i want to go to a restaurant within 20 miles that got a high rating and is considered fine dining | Amenity |
| [\w+ ]{0,2} (palace|cafe|bar| kitchen|outback|dominoes) | is passims kitchen open at 2 am | Restaurant Name |
| wine|sandwich|pasta|burger| peroggis|burrito| (chicken tikka masala)| appetizer|pizza|wine| cupcake| (onion ring)|tapas | please find me a pub that serves burgers | Dish |
+
+Table 7: Sample rules for MIT-R dataset. Rule fires if the regex matches or sentence contains a word found in the provided word lists.
+
+# C HYPERPARAMETERS
+
+Across all experiments we use Adam optimizer with default values of $\beta_{1},\beta_{2}$ , and $\epsilon$ . Dropout of 0.8 (keep probability) was used in the feed forward layers. All the models were trained for a maximum of 100 epochs and early stopping was used based on a validation set. Best model on the validation set was evaluated on the test set. Each experiment was run with 10 random initializations. A list of hyperparameters used in our experiments is provided below.
+
+ | Noise-tolerant | Snorkel-Noise-Tolerant | Post. Reg. | implication | L+Usnorkel | L+Umaj |
| Question Classification |
| γ | 0.001 | 0.1 | 0.001 | 0.1 | 0.01 | 0.001 |
| q | 0.9 | 0.6 | - | - | - | - |
| lr | 0.0003 |
| bs | 32 (16 for Only-L) |
| MIT-R |
| γ | 0.01 | 0.001 | 0.01 | 0.1 | 0.05 | 0.01 |
| q | 0.6 | 0.6 | - | - | - | - |
| lr | 0.0003 |
| bs | 64 (32 for Only-L) |
| YouTube |
| γ | 0.003 | 0.5 | 0.1 | 0.2 | 0.5 | 0.003 |
| q | 0.6 | 0.6 | - | - | - | - |
| lr | 0.0003 |
| bs | 32 (16 for Only-L) |
| SMS |
| γ | 0.1 | 0.1 | 0.001 | 0.3 | 0.5 | 0.1 |
| q | 0.6 | 0.6 | - | - | - | 0.1 |
| lr | 0.0001 |
| bs | 32 (16 for Only-L) |
| Census |
| γ | 0.5 | 0.1 | 0.001 | 0.1 | 0.01 | 0.5 |
| q | 0.1 | 0.6 | - | - | - | 0.5 |
| lr | 0.0001 | 0.0003 |
| bs | 64 (16 for Only-L) |
+
+Table 8: Hyperparameters for various methods and datasets. $bs$ refers to the batch size and $lr$ refers to the learning rate. For Only-L baseline smaller batch size was used considering the smaller size of $L$ set.
+
+ | Question | MIT-R | YouTube | SMS | Census |
| meta_lr | 0.01 | 0.0001 | 0.001 | 0.0001 | 0.0001 |
| lr | 0.0003 | 0.0001 | 0.0003 |
| bs | 32 | 64 | 32 | 32 | 64 |
+
+Table 9: Meta-learning rate, learning rate and batch size used for L2R (Ren et al., 2018b) for various datasets
\ No newline at end of file
diff --git a/learningfromrulesgeneralizinglabeledexemplars/images.zip b/learningfromrulesgeneralizinglabeledexemplars/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..4828c0f1b87a1b7cd2033a14b49bf303f6ea71e6
--- /dev/null
+++ b/learningfromrulesgeneralizinglabeledexemplars/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:23d07256d81062217538157d194a4ee7bfa5dc6542b7fe7ff50c9fa8bcf728f3
+size 853308
diff --git a/learningfromrulesgeneralizinglabeledexemplars/layout.json b/learningfromrulesgeneralizinglabeledexemplars/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..272eaae504398a338f03171ebef90647495eae93
--- /dev/null
+++ b/learningfromrulesgeneralizinglabeledexemplars/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:9ae7dd687eeab4004a8256e7c552cee7777fd8638869dac9d31f2496fdc5fcdf
+size 647815
diff --git a/learningthedifferencethatmakesadifferencewithcounterfactuallyaugmenteddata/d8377fee-9234-4f27-8d90-fb32820a41a9_content_list.json b/learningthedifferencethatmakesadifferencewithcounterfactuallyaugmenteddata/d8377fee-9234-4f27-8d90-fb32820a41a9_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..f52b6348d9d8ddd66ae41a628ec5f4507083380f
--- /dev/null
+++ b/learningthedifferencethatmakesadifferencewithcounterfactuallyaugmenteddata/d8377fee-9234-4f27-8d90-fb32820a41a9_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ed0021a1e9957ca4d5ab206eddd43885919144f91e541183ea2b18992f5c8b4e
+size 83439
diff --git a/learningthedifferencethatmakesadifferencewithcounterfactuallyaugmenteddata/d8377fee-9234-4f27-8d90-fb32820a41a9_model.json b/learningthedifferencethatmakesadifferencewithcounterfactuallyaugmenteddata/d8377fee-9234-4f27-8d90-fb32820a41a9_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..897eea24bd8356b772d61803fad7d56686ca348f
--- /dev/null
+++ b/learningthedifferencethatmakesadifferencewithcounterfactuallyaugmenteddata/d8377fee-9234-4f27-8d90-fb32820a41a9_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:6a41f5ad577b6138023e7111e2b2483da469e902aef1e1d045b1d0f502baa2f6
+size 100905
diff --git a/learningthedifferencethatmakesadifferencewithcounterfactuallyaugmenteddata/d8377fee-9234-4f27-8d90-fb32820a41a9_origin.pdf b/learningthedifferencethatmakesadifferencewithcounterfactuallyaugmenteddata/d8377fee-9234-4f27-8d90-fb32820a41a9_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..6195d4d7a9d84da60e32c819b4f122011e0e1db5
--- /dev/null
+++ b/learningthedifferencethatmakesadifferencewithcounterfactuallyaugmenteddata/d8377fee-9234-4f27-8d90-fb32820a41a9_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a31fd2ebbed18f1ce12c61f51343371923b35800752c08e64b8d50748d225c99
+size 678122
diff --git a/learningthedifferencethatmakesadifferencewithcounterfactuallyaugmenteddata/full.md b/learningthedifferencethatmakesadifferencewithcounterfactuallyaugmenteddata/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..6ff25324c8af205b5de93d6dccb43106a9c561e5
--- /dev/null
+++ b/learningthedifferencethatmakesadifferencewithcounterfactuallyaugmenteddata/full.md
@@ -0,0 +1,308 @@
+# LEARNING THE DIFFERENCE THAT MAKES A DIFFERENCE WITH COUNTERFACTUALLY-AUGMENTED DATA
+
+Divyansh Kaushik, Eduard Hovy, Zachary C. Lipton
+
+Carnegie Mellon University
+
+Pittsburgh PA, USA
+
+{dkaushik, hovy, zlipton}@cmu.edu
+
+# ABSTRACT
+
+Despite alarm over the reliance of machine learning systems on so-called spurious patterns, the term lacks coherent meaning in standard statistical frameworks. However, the language of causality offers clarity: spurious associations are due to confounding (e.g., a common cause), but not direct or indirect causal effects. In this paper, we focus on natural language processing, introducing methods and resources for training models less sensitive to spurious patterns. Given documents and their initial labels, we task humans with revising each document so that it (i) accords with a counterfactual target label; (ii) retains internal coherence; and (iii) avoids unnecessary changes. Interestingly, on sentiment analysis and natural language inference tasks, classifiers trained on original data fail on their counterfactually-revised counterparts and vice versa. Classifiers trained on combined datasets perform remarkably well, just shy of those specialized to either domain. While classifiers trained on either original or manipulated data alone are sensitive to spurious features (e.g., mentions of genre), models trained on the combined data are less sensitive to this signal. Both datasets are publicly available1.
+
+# 1 INTRODUCTION
+
+What makes a document's sentiment positive? What makes a loan applicant creditworthy? What makes a job candidate qualified? When does a photograph truly depict a dolphin? Moreover, what does it mean for a feature to be relevant to such a determination?
+
+Statistical learning offers one framework for approaching these questions. First, we swap out the semantic question for a more readily answerable associative question. For example, instead of asking what conveys a document's sentiment, we recast the question as which documents are likely to be labeled as positive (or negative)? Then, in this associative framing, we interpret as relevant, those features that are most predictive of the label. However, despite the rapid adoption and undeniable commercial success of associative learning, this framing seems unsatisfying.
+
+Alongside deep learning's predictive wins, critical questions have piled up concerning spurious patterns, artifacts, robustness, and discrimination, that the purely associative perspective appears ill-equipped to answer. For example, in computer vision, researchers have found that deep neural networks rely on surface-level texture (Jo & Bengio, 2017; Geirhos et al., 2018) or clues in the image's background to recognize foreground objects even when that seems both unnecessary and somehow wrong: the beach is not what makes a seagull a seagull. And yet, researchers struggle to articulate precisely why models should not rely on such patterns.
+
+In natural language processing (NLP), these issues have emerged as central concerns in the literature on annotation artifacts and societal biases. Across myriad tasks, researchers have demonstrated that models tend to rely on spurious associations (Poliak et al., 2018; Gururangan et al., 2018; Kaushik & Lipton, 2018; Kiritchenko & Mohammad, 2018). Notably, some models for question-answering tasks may not actually be sensitive to the choice of the question (Kaushik & Lipton, 2018), while in Natural Language Inference (NLI), classifiers trained on hypotheses only (vs hypotheses and premises) perform surprisingly well (Poliak et al., 2018; Gururangan et al., 2018). However, papers
+
+
+Figure 1: Pipeline for collecting and leveraging counterfactually-altered data
+
+seldom make clear what, if anything, spuriousness means within the standard supervised learning framework. ML systems are trained to exploit the mutual information between features and a label to make accurate predictions. The standard statistical learning toolkit does not offer a conceptual distinction between spurious and non-spurious associations.
+
+Causality, however, offers a coherent notion of spuriousness. Spurious associations owe to confounding rather than to a (direct or indirect) causal path. We might consider a factor of variation to be spuriously correlated with a label of interest if intervening upon it would not impact the applicability of the label or vice versa. While our paper does not call upon the mathematical machinery of causality, we draw inspiration from the underlying philosophy to design a new dataset creation procedure in which humans counterfactually revise documents.
+
+Returning to NLP, although we lack automated tools for mapping between raw text and disentangled factors, we nevertheless describe documents in terms of these abstract representations. Moreover, it seems natural to speak of manipulating these factors directly (Hovy, 1987). Consider, for example, the following interventions: (i) Revise the letter to make it more positive; (ii) Edit the second sentence so that it appears to contradict the first. These edits might be thought of as intervening on only those aspects of the text that are necessary to make the counterfactual label applicable.
+
+In this exploratory paper, we design a human-in-the-loop system for counterfactually manipulating documents. Our hope is that by intervening only upon the factor of interest, we might disentangle the spurious and non-spurious associations, yielding classifiers that hold up better when spurious associations do not transport out of domain. We employ crowd workers not to label documents, but rather to edit them, manipulating the text to make a targeted (counterfactual) class applicable. For sentiment analysis, we direct the worker to revise this negative movie review to make it positive, without making any gratuitous changes. We might regard the second part of this directive as a least action principle, ensuring that we perturb only those spans necessary to alter the applicability of the label. For NLI, a 3-class classification task (entailment, contradiction, neutral), we ask the workers to modify the premise while keeping the hypothesis intact, and vice versa, collecting edits corresponding to each of the (two) counterfactual classes. Using this platform, we collect thousands of counterfactually-manipulated examples for both sentiment analysis and NLI, extending the IMDb (Maas et al., 2011) and SNLI (Bowman et al., 2015) datasets, respectively. The result is two new datasets (each an extension of a standard resource) that enable us to both probe fundamental properties of language and train classifiers less reliant on spurious signal.
+
+We show that classifiers trained on original IMDb reviews fail on counterfactually-revised data and vice versa. We further show that spurious correlations in these datasets are even picked up by linear models. However, augmenting the revised examples breaks up these correlations (e.g., genre ceases to be predictive of sentiment). For a Bidirectional LSTM (Graves & Schmidhuber, 2005) trained on IMDb reviews, classification accuracy goes down from $79.3\%$ to $55.7\%$ when evaluated on original vs revised reviews. The same classifier trained on revised reviews achieves an accuracy of $89.1\%$ on revised reviews compared to $62.5\%$ on their original counterparts. These numbers go to $81.7\%$ and $92.0\%$ on original and revised data, respectively, when the classifier is retrained on the combined dataset. Similar patterns are observed for linear classifiers. We discovered that BERT (Devlin et al., 2019) is more resilient to such drops in performance on sentiment analysis.
+
+Additionally, SNLI models appear to rely on spurious associations as identified by Gururangan et al. (2018). Our experiments show that when fine-tuned on original SNLI sentence pairs, BERT fails on pairs with revised premise and vice versa, suffering more than a 30 point drop in accuracy. Fine-tuned on the combined set, BERT's performance improves significantly across all datasets. Similarly, a Bi-LSTM trained on (original) hypotheses alone can accurately classify $69\%$ of pairs correctly but performs worse than the blind classifier when evaluated on the revised dataset. When trained on hypotheses only from the combined dataset, its performance is not appreciably better than random guessing.
+
+# 2 RELATED WORK
+
+Several papers demonstrate cases where NLP systems appear not to learn what humans consider to be the difference that makes the difference. For example, otherwise state-of-the-art models have been shown to be vulnerable to synthetic transformations such as distractor phrases (Jia & Liang, 2017; Wallace et al., 2019), to misclassify paraphrased task (Iyyer et al., 2018; Pfeiffer et al., 2019) and to fail on template-based modifications (Ribeiro et al., 2018). Glockner et al. (2018) demonstrate that simply replacing words by synonyms or hypernyms, which should not alter the applicable label, nevertheless breaks ML-based NLI systems. Gururangan et al. (2018) and Poliak et al. (2018) show that classifiers correctly classified the hypotheses alone in about $69\%$ of SNLI corpus. They further discover that crowd workers adopted specific annotation strategies and heuristics for data generation. Chen et al. (2016) identify similar issues exist with automatically-constructed benchmarks for question-answering (Hermann et al., 2015). Kaushik & Lipton (2018) discover that reported numbers in question-answering benchmarks could often be achieved by the same models when restricted to be blind either to the question or to the passages. Dixon et al. (2018); Zhao et al. (2018) and Kiritchenko & Mohammad (2018) showed how imbalances in training data lead to unintended bias in the resulting models, and, consequently, potentially unfair applications. Shen et al. (2018) substitute words to test the behavior of sentiment analysis algorithms in the presence of stylistic variation, finding that similar word pairs produce significant differences in sentiment score.
+
+Several papers explore richer feedback mechanisms for classification. Some ask annotators to highlight rationales, spans of text indicative of the label (Zaidan et al., 2007; Zaidan & Eisner, 2008; Poulis & Dasgupta, 2017). For each document, Zaidan et al. remove the rationales to generate contrast documents, learning classifiers to distinguish original documents from their contrasting counterparts. While this feedback is easier to collect than ours, how to leverage it for training deep NLP models, where features are not neatly separated, remains less clear.
+
+Lu et al. (2018) programmatically alter text to invert gender bias and combined the original and manipulated data yielding gender-balanced dataset for learning word embeddings. In the simplest experiments, they swap each gendered word for its other-gendered counterpart. For example, the doctor ran because he is late becomes the doctor ran because she is late. However, they do not substitute names even if they co-refer to a gendered pronoun. Building on their work, Zmigrod et al. (2019) describe a data augmentation approach for mitigating gender stereotypes associated with animate nouns for morphologically-rich languages like Spanish and Hebrew. They use a Markov random field to infer how the sentence must be modified while altering the grammatical gender of particular nouns to preserve morpho-syntactic agreement. In contrast, Maudslay et al. (2019) describe a method for probabilistic automatic in-place substitution of gendered words in a corpus. Unlike Lu et al., they propose an explicit treatment of first names by pre-defining name-pairs for swapping, thus expanding Lu et al.'s list of gendered word pairs significantly.
+
+# 3 DATA COLLECTION
+
+We use Amazon's Mechanical Turk crowdsourcing platform to recruit editors to revise each document. To ensure high quality of the collected data, we restricted the pool to U.S. residents that had already completed at least 500 HITs and had an over $97\%$ HIT approval rate. For each HIT, we conducted pilot tests to identify appropriate compensation per assignment, receive feedback from workers and revise our instructions accordingly. A total of 713 workers contributed throughout the whole process, of which 518 contributed edits reflected in the final datasets.
+
+Sentence batch 4
+
+# Instructions
+
+1. The blue box contains a text passage and a label. Please edit this text in the text box below, and a small number of changes such that:
+
+(a) the document remains coherent and
+
+(b) the new label (colored).
+(c) the new description of the revised passage.
+
+Do not charge any portions of the passage unnecessarily.
+
+2. After modifying the passage and checking it over to make sure that the text matches the label, scroll down and click the Submit HIT button.
+
+You will receive a Survey Code upon successful submission. Paste that in the input field on Mechanical Turk.
+
+Next Step
+
+# Dipolar Sentiment Annotation
+
+
+Figure 2: Annotation platform for collecting counterfactually annotated data for sentiment analysis
+
+Table 1: Percentage of inter-editor agreement for counterfactually-revised movie reviews
+
+| Number of tokens |
| Type | 0-50 | 51-100 | 101-150 | 151-200 | 201-250 | 251-300 | 301-329 | Full |
| Replacement | 35.6 | 25.7 | 20.0 | 17.2 | 15.0 | 14.8 | 11.6 | 19.3 |
| Insertion | 27.7 | 20.8 | 14.4 | 12.2 | 11.0 | 11.5 | 07.6 | 14.3 |
| Combined | 41.6 | 32.7 | 26.3 | 23.4 | 21.6 | 20.3 | 16.2 | 25.5 |
+
+Sentiment Analysis The original IMDb dataset consists of $50k$ reviews divided equally across train and test splits. To keep the task of editing from growing unwieldy, we filter out the longest $20\%$ of reviews, leaving $20k$ reviews in the train split from which we randomly sample $2.5k$ reviews, enforcing a 50:50 class balance. Following revision by the crowd workers, we partition this dataset into train/validation/test splits containing 1707, 245 and 488 examples, respectively. We present each review to two workers, instructing them to revise the review such that (a) the counterfactual label applies; (b) the document remains coherent; and (c) no unnecessary modifications are made.
+
+Over a four week period, we manually inspected each generated review and rejected the ones that were outright wrong (sentiment was still the same or the review was a spam). After review, we rejected roughly $2\%$ of revised reviews. For 60 original reviews, we did not approve any among the counterfactually-revised counterparts supplied by the workers. To construct the new dataset, we chose one revised review (at random) corresponding to each original review. In qualitative analysis, we identified eight common patterns among the edits (Table 2).
+
+By comparing original reviews to their counterfactually-revised counterparts we gain insight into which aspects are causally relevant. To analyze inter-editor agreement, we mark indices corresponding to replacements and insertions, representing the edits in each original review by a binary vector. Using these representations, we compute the Jaccard similarity between the two reviews (Table 1), finding it to be negatively correlated with the length of the review.
+
+Natural Language Inference Unlike sentiment analysis, SNLI is 3-way classification task, with inputs consisting of two sentences, a premise and a hypothesis and the three possible labels being entailment, contradiction, and neutral. The label is meant to describe the relationship between the facts stated in each sentence. We randomly sampled 1750, 250, and 500 pairs from the train, validation, and test sets of SNLI respectively, constraining the new data to have balanced classes. In one HIT, we asked workers to revise the hypothesis while keeping the premise intact, seeking edits corresponding to each of the two counterfactual classes. We refer to this data as Revised Hypothesis
+
+Table 2: Most prominent categories of edits performed by humans for sentiment analysis (Original/Revised, in order). Red spans were replaced by Blue spans.
+
+| Types of Revisions | Examples |
| Recasting fact as hoped for | The world of Atlantis, hidden beneath the earth's core, is fantastic
+The world of Atlantis, hidden beneath the earth's core is supposed to be fantastic |
| Suggesting sarcasm | thoroughly captivating thriller-drama, taking a deep and realistic view
+thoroughly mind numbing “thriller-drama”, taking a “deep” and “realistic” (who are they kidding?) view |
| Inserting modifiers | The presentation of simply Atlantis' landscape and setting
+The presentation of Atlantis' predictable landscape and setting |
| Replacing modifiers | “Election” is a highly fascinating and thoroughly captivating thriller-drama
+“Election” is a highly expected and thoroughly mind numbing “thriller-drama” |
| Inserting phrases | Although there's hardly any action, the ending is still shocking.
+Although there's hardly any action (or reason to continue watching past 10 minutes), the ending is still shocking. |
| Diminishing via qualifiers | which, while usually containing some reminder of harshness, become more and more intriguing.
+which, usually containing some reminder of harshness, became only slightly more intriguing. |
| Differing perspectives | Granted, not all of the story makes full sense, but the film doesn't feature any amazing new computer-generated visual effects.
+Granted, some of the story makes sense, but the film doesn't feature any amazing new computer-generated visual effects. |
| Changing ratings | one of the worst ever scenes in a sports movie. 3 stars out of 10.
+one of the wildest ever scenes in a sports movie. 8 stars out of 10. |
+
+(RH). In another HIT, we asked workers to revise the original premise, while leaving the original hypothesis intact, seeking similar edits, calling it Revised Premise (RP).
+
+Following data collection, we employed a different set of workers to verify whether the given label accurately described the relationship between each premise-hypothesis pair. We presented each pair to three workers and performed a majority vote. When all three reviewers were in agreement, we approved or rejected the pair based on their decision, else, we verified the data ourselves. Finally, we only kept premise-hypothesis pairs for which we had valid revised data in both RP and RH, corresponding to both counterfactual labels. As a result, we discarded $\approx 9\%$ data. RP and RH, each comprised of 3332 pairs in train, 400 in validation, and 800 in test, leading to a total of 6664 pairs in train, 800 in validation, and 1600 in test in the revised dataset. In qualitative analysis, we identified some common patterns among hypothesis and premise edits (Table 3, 4).
+
+We collected all data after IRB approval and measured the time taken to complete each HIT to ensure that all workers were paid more than the federal minimum wage. During our pilot studies, workers spent roughly 5 minutes per revised review, and 4 minutes per revised sentence (for NLI). We paid workers $0.65 per revision, and$ 0.15 per verification, totalling $10778.14 for the study.
+
+# 4 MODELS
+
+Our experiments rely on the following five models: Support Vector Machines (SVMs), Naïve Bayes (NB) classifiers, Bidirectional Long Short-Term Memory Networks (Bi-LSTMs; Graves & Schmidhuber, 2005), ELMo models with LSTM, and fine-tuned BERT models (Devlin et al., 2019). For brevity, we discuss only implementation details necessary for reproducibility.
+
+Table 3: Analysis of edits performed by humans for NLI hypotheses. P denotes Premise, OH denotes Original Hypothesis, and NH denotes New Hypothesis.
+
+| Types of Revisions | Examples |
| Modifying/removing actions | P: A young dark-haired woman crouches on the banks of a river while washing dishes.
+OH: A woman washes dishes in the river while camping. (Neutral)
+NH: A woman washes dishes in the river. (Entailment) |
| Substituting entities | P: Students are inside of a lecture hall.
+OH: Students are indoors. (Entailment)
+NH: Students are on the soccer field. (Contradiction) |
| Adding details to entities | P: An older man with glasses raises his eyebrows in surprise.
+OH: The man has no glasses. (Contradiction)
+NH: The man wears bifocals. (Neutral) |
| Inserting relationships | P: A blond woman speaking to a brunette woman with her arms crossed.
+OH: A woman is talking to another woman. (Entailment)
+NH: A woman is talking to a family member. (Neutral) |
| Numerical modifications | P: Several farmers bent over working on the fields while lady with a baby and four other children accompany them.
+OH: The lady has three children. (Contradiction)
+NH: The lady has many children. (Entailment) |
| Using/Removing negation | P: An older man with glasses raises his eyebrows in surprise.
+OH: The man has no glasses. (Contradiction)
+NH: The man wears glasses. (Entailment) |
| Unrelated hypothesis | P: A female athlete in crimson top and dark blue shorts is running on the street.
+OH: A woman is sitting on a white couch. (Contradiction)
+NH: A woman owns a white couch. (Neutral) |
+
+Standard Methods We use scikit-learn (Pedregosa et al., 2011) implementations of SVMs and Naive Bayes for sentiment analysis. We train these models on TF-IDF bag of words feature representations of the reviews. We identify parameters for both classifiers using grid search conducted over the validation set.
+
+Bi-LSTM When training Bi-LSTMs for sentiment analysis, we restrict the vocabulary to the most frequent $20k$ tokens, replacing out-of-vocabulary tokens by UNK. We fix the maximum input length at 300 tokens and pad smaller reviews. Each token is represented by a randomly-initialized 50-dimensional embedding. Our model consists of a bidirectional LSTM (hidden dimension 50) with recurrent dropout (probability 0.5) and global max-pooling following the embedding layer. To generate output, we feed this (fixed-length) representation through a fully-connected hidden layer with ReLU (Nair & Hinton, 2010) activation (hidden dimension 50), and then a fully-connected output layer with softmax activation. We train all models for a maximum of 20 epochs using Adam (Kingma & Ba, 2015), with a learning rate of 1e-3 and a batch size of 32. We apply early stopping when validation loss does not decrease for 5 epochs. We also experimented with a larger Bi-LSTM which led to overfitting. We use the architecture due to Poliak et al. (2018) to evaluate hypothesis-only baselines.
+
+ELMo-LSTM We compute contextualized word representations (ELMo) using character-based word representations and bidirectional LSTMs (Peters et al., 2018). The module outputs a 1024-dimensional weighted sum of representations from the 3 Bi-LSTM layers used in ELMo. We represent each word by a 128-dimensional embedding concatenated to the resulting 1024-dimensional ELMo representation, leading to a 1152-dimensional hidden representation. Following Batch Normalization, this is passed through an LSTM (hidden size 128) with recurrent dropout (probability
+
+Table 4: Analysis of edits performed by humans for NLI premises. OP denotes Original Premise, NP denotes New Premise, and H denotes Hypothesis.
+
+| Types of Revisions | Examples |
| Introducing direct evidence | OP: Man walking with tall buildings with reflections behind him. (Neutral)NP: Man walking away from his friend, with tall buildings with reflections behind him. (Contradiction)H: The man was walking to meet a friend. |
| Introducing indirect evidence | OP: An Indian man standing on the bank of a river. (Neutral)NP: An Indian man standing with only a camera on the bank of a river. (Contradiction)H: He is fishing. |
| Substituting entities | OP: A young man in front of a grill laughs while pointing at something to his left. (Entailment)NP: A young man in front of a chair laughs while pointing at something to his left. (Neutral)H: A man is outside |
| Numerical modifications | OP: The exhaustion in the woman's face while she continues to ride her bicycle in the competition. (Neutral)NP: The exhaustion in the woman's face while she continues to ride her bicycle in the competition for people above 7 ft. (Entailment)H: A tall person on a bike |
| Reducing evidence | OP: The girl in yellow shorts and white jacket has a tennis ball in her left pocket. (Entailment)NP: The girl in yellow shorts and white jacket has a tennis ball. (Neutral)H: A girl with a tennis ball in her pocket. |
| Using abstractions | OP: An elderly woman in a crowd pushing a wheelchair. (Entailment)NP: An elderly person in a crowd pushing a wheelchair. (Neutral)H: There is an elderly woman in a crowd. |
| Substituting evidence | OP: A woman is cutting something with scissors. (Entailment)NP: A woman is reading something about scissors. (Contra-diction)H: A woman uses a tool |
+
+0.2). The output from this LSTM is then passed to a fully-connected output layer with softmax activation. We train this model for up to 20 epochs with same early stopping criteria as for Bi-LSTM, using the Adam optimizer with a learning rate of $1\mathrm{e} - 3$ and a batch size of 32.
+
+BERT We use an off-the-shelf uncased BERT Base model, fine-tuning for each task. To account for BERT's sub-word tokenization, we set the maximum token length is set at 350 for sentiment analysis and 50 for NLI. We fine-tune BERT up to 20 epochs with same early stopping criteria as for Bi-LSTM, using the BERT Adam optimizer with a batch size of 16 (to fit on a Tesla V-100 GPU). We found learning rates of $5\mathrm{e} - 5$ and $1\mathrm{e} - 5$ to work best for sentiment analysis and NLI respectively.
+
+
+(a) Trained on the original dataset
+
+
+Figure 3: Most important features learned by an SVM classifier trained on TF-IDF bag of words.
+
+
+(b) Trained on the revised dataset
+(c) Trained on combined dataset
+
+# 5 EXPERIMENTAL RESULTS
+
+Sentiment Analysis We find that for sentiment analysis, linear models trained on the original $1.7k$ reviews achieve $80\%$ accuracy when evaluated on original reviews but only $51\%$ (level of random guessing) on revised reviews (Table 5). Linear models trained on revised reviews achieve $91\%$ accuracy on revised reviews but only $58.3\%$ on the original test set. We see similar pattern for Bi-LSTMs where accuracy drops substantially in both directions. Interestingly, while BERT models suffer drops too, they are less pronounced, perhaps a benefit of the exposure to a larger dataset where the spurious patterns may not have held. Classifiers trained on combined datasets perform well on both, often within $\approx 3$ pts of models trained on the same amount of data taken only from the original distribution. Thus, there may be a price to pay for breaking the reliance on spurious associations, but it may not be substantial.
+
+We also conduct experiments to evaluate our sentiment models vis-a-vis their generalization out-of-domain to new domains. We evaluate models on Amazon reviews (Ni et al., 2019) on data aggregated over six genres: beauty, fashion, appliances, giftcards, magazines, and software, the Twitter sentiment dataset (Rosenthal et al., 2017),4 and Yelp reviews released as part of the Yelp dataset challenge. We show that in almost all cases, models trained on the counterfactually-augmented IMDb dataset perform better than models trained on comparable quantities of original data.
+
+To gain intuition about what is learnable absent the edited spans, we tried training several models on passages where the edited spans have been removed from training set sentences (but not test set). SVM, Naïve Bayes, and Bi-LSTM achieve $57.8\%$ , $59.1\%$ , $60.2\%$ accuracy, respectively, on this task. Notably, these passages are predictive of the (true) label despite being semantically compatible with the counterfactual label. However, BERT performs worse than random guessing.
+
+In one simple demonstration of the benefits of our approach, we note that seemingly irrelevant words such as: romantic, will, my, has, especially, life, works, both, it, its, lives and gives (correlated with positive sentiment), and horror, own, jesus, cannot, even, instead, minutes, your, effort, script, seems and something (correlated with negative sentiment) are picked up as high-weight features by linear models trained on either original or revised reviews as top predictors. However, because humans never edit these during revision owing to their lack of semantic relevance, combining the original and revised datasets breaks these associations and these terms cease to be predictive of sentiment (Fig 4). Models trained on original data but at the same scale as combined data are able to perform slightly better on the original test set but still fail on the revised reviews. All models trained on $19k$ original reviews receive a slight boost in accuracy on revised data (except Naive Bayes), yet their performance significantly worse compared to specialized models. Retraining models on a combination of the original $19k$ reviews with revised $1.7k$ reviews leads to significant increases in accuracy for all models on classifying revised reviews, while slightly improving the accuracy on classifying the original reviews. This underscores the importance of including counterfactually-revised examples in training data.
+
+Natural Language Inference Fine-tuned on $1.67k$ original sentence pairs, BERT achieves $72.2\%$ accuracy on SNLI dataset but it is only able to accurately classify $39.7\%$ sentence pairs from the RP set (Table 7). Fine-tuning BERT on the full SNLI training set ( $500k$ sentence pairs) results in similar behavior. Fine-tuning it on RP sentence pairs improves its accuracy to $66.3\%$ on RP but causes a drop of roughly 20 pts on SNLI. On RH sentence pairs, this results in an accuracy of $67\%$ on RH and $71.9\%$ on SNLI test set but $47.4\%$ on the RP set. To put these numbers in context, each
+
+Table 5: Accuracy of various models for sentiment analysis trained with various datasets. Orig. denotes original, Rev. denotes revised, and Orig. - Edited denotes the original dataset where the edited spans have been removed.
+
+| Training data | SVM | NB | ELMo | Bi-LSTM | BERT |
| O | R | O | R | O | R | O | R | O | R |
| Orig. (1.7k) | 80.0 | 51.0 | 74.9 | 47.3 | 81.9 | 66.7 | 79.3 | 55.7 | 87.4 | 82.2 |
| Rev. (1.7k) | 58.3 | 91.2 | 50.9 | 88.7 | 63.8 | 82.0 | 62.5 | 89.1 | 80.4 | 90.8 |
| Orig. - Edited | 57.8 | - | 59.1 | - | 50.3 | - | 60.2 | - | 49.2 | - |
| Orig. & Rev. (3.4k) | 83.7 | 87.3 | 86.1 | 91.2 | 85.0 | 92.0 | 81.5 | 92.0 | 88.5 | 95.1 |
| Orig. (3.4k) | 85.1 | 54.3 | 82.4 | 48.2 | 82.4 | 61.1 | 80.4 | 59.6 | 90.2 | 86.1 |
| Orig. (19k) | 87.8 | 60.9 | 84.3 | 42.8 | 86.5 | 64.3 | 86.3 | 68.0 | 93.2 | 88.3 |
| Orig. (19k) & Rev. | 87.8 | 76.2 | 85.2 | 48.4 | 88.3 | 84.6 | 88.7 | 79.5 | 93.2 | 93.9 |
+
+Table 6: Accuracy of various sentiment analysis models on out-of-domain data
+
+| Training data | SVM | NB | ELMo | Bi-LSTM | BERT |
| Accuracy on Amazon Reviews |
| Orig. & Rev. (3.4k) | 77.1 | 82.6 | 78.4 | 82.7 | 85.1 |
| Orig. (3.4k) | 74.7 | 66.9 | 79.1 | 65.9 | 80.0 |
| Accuracy on Semeval 2017 (Twitter) |
| Orig. & Rev. (3.4k) | 66.5 | 73.9 | 70.0 | 68.7 | 82.9 |
| Orig. (3.4k) | 61.2 | 64.6 | 69.5 | 55.3 | 79.3 |
| Accuracy on Yelp Reviews |
| Orig. & Rev. (3.4k) | 87.6 | 89.6 | 87.2 | 86.2 | 89.4 |
| Orig. (3.4k) | 81.8 | 77.5 | 82.0 | 78.0 | 85.3 |
+
+Table 7: Accuracy of BERT on NLI with various train and eval sets.
+
+| Train/Eval | Original | RP | RH | RP & RH |
| Original (1.67k) | 72.2 | 39.7 | 59.5 | 49.6 |
| Revised Premise (RP; 3.3k) | 50.6 | 66.3 | 50.1 | 58.2 |
| Revised Hypothesis (RH; 3.3k) | 71.9 | 47.4 | 67.0 | 57.2 |
| RP & RH (6.6k) | 64.7 | 64.6 | 67.8 | 66.2 |
| Original w/ RP & RH (8.3k) | 73.5 | 64.6 | 69.6 | 67.1 |
| Original (8.3k) | 77.8 | 44.6 | 66.1 | 55.4 |
| Original (500k) | 90.4 | 54.3 | 74.3 | 64.3 |
+
+individual hypothesis sentence in RP is associated with two labels, each in the presence of a different premise. A model that relies on hypotheses only would at best perform slightly better than choosing the majority class when evaluated on this dataset. However, fine-tuning BERT on a combination of RP and RH leads to consistent performance on all datasets as the dataset design forces models to look at both premise and hypothesis. Combining original sentences with RP and RH improves these
+
+Table 8: Accuracy of Bi-LSTM classifier trained on hypotheses only
+
+| Train/Test | Original | RP | RH | RP & RH |
| Majority class | 34.7 | 34.6 | 34.6 | 34.6 |
| RP & RH (6.6k) | 32.4 | 35.1 | 33.4 | 34.2 |
| Original w/ RP & RH (8.3k) | 44.0 | 25.8 | 43.2 | 34.5 |
| Original (8.3k) | 60.2 | 20.5 | 46.6 | 33.6 |
| Original (500k) | 69.0 | 15.4 | 53.2 | 34.3 |
+
+Table 9: Accuracy of models trained to differentiate between original and revised data
+
+| Model | IMDb | SNLI/RP | SNLI/RH |
| Majority class | 50.0 | 66.7 | 66.7 |
| SVM | 67.4 | 46.6 | 51.0 |
| NB | 69.2 | 66.7 | 66.6 |
| BERT | 77.3 | 64.8 | 69.7 |
+
+numbers even further. We compare this with the performance obtained by fine-tuning it on $8.3k$ sentence pairs sampled from SNLI training set, and show that while the two perform roughly within 4 pts of each other when evaluated on SNLI, the former outperforms latter on both RP and RH.
+
+To further isolate this effect, Bi-LSTM trained on SNLI hypotheses only achieves $69\%$ accuracy on SNLI test set, which drops to $44\%$ if it is retrained on combination of original, RP and RH data (Table 8). Note that this combined dataset consists of five variants of each original premise-hypothesis pair. Of these five pairs, three consist of the same hypothesis sentence, each associated with different truth value given the respective premise. Using these hypotheses only would provide conflicting feedback to a classifier during training, thus causing the drop in performance. Further, we notice that the gain of the latter over majority class baseline comes primarily from the original data, as the same model retrained only on RP and RH data experiences a further drop of $11.6\%$ in accuracy, performing worse than just choosing the majority class at all times.
+
+One reasonable concern might be that our models would simply distinguish whether an example were from the original or revised dataset and thereafter treat them differently. The fear might be that our models would exhibit a hypersensitivity (rather than insensitivity) to domain. To test the potential for this behavior, we train several models to distinguish between original and revised data (Table 9). BERT identifies original reviews from revised reviews with $77.3\%$ accuracy. In case of NLI, BERT and Naïve Bayes perform roughly within 3 pts of the majority class baseline $(66.7\%)$ whereas SVM performs substantially worse.
+
+# 6 CONCLUSION
+
+By leveraging humans not only to provide labels but also to intervene upon the data, revising documents to accord with various labels, we can elucidate the difference that makes a difference. Moreover, we can leverage the augmented data to train classifiers less dependent on spurious associations. Our study demonstrates the promise of leveraging human-in-the-loop feedback to disentangle the spurious and non-spurious associations, yielding classifiers that hold up better when spurious associations do not transport out of domain. Our methods appear useful on both sentiment analysis and NLI, two contrasting tasks. In sentiment analysis, expressions of opinion matter more than stated facts, while in NLI this is reversed. SNLI poses another challenge in that it is a 3-class classification task using two input sentences. In future work, we will extend these techniques, leveraging humans in the loop to build more robust systems for question answering and summarization.
+
+# ACKNOWLEDGEMENTS
+
+The authors are grateful to Amazon AWS and NVIDIA for providing GPUs to conduct the experiments, Salesforce Research and Facebook AI for their generous grants that made the data collection possible, Sina Fazelpour, Sivaraman Balakrishnan, Shruti Rijhwani, Shruti Palaskar, Aishwarya Kamath, Michael Collins, Rajesh Ranganath and Sanjoy Dasgupta for their valuable feedback, and Tzu-Hsiang Lin for his generous help in creating the data collection platform. We also thank Abridge AI, UPMC, the Center for Machine Learning in Health, and the AI Ethics and Governance Fund for their support of our broader research on robust machine learning.
+
+# REFERENCES
+
+Samuel R Bowman, Gabor Angeli, Christopher Potts, and Christopher D Manning. A large annotated corpus for learning natural language inference. In Empirical Methods in Natural Language Processing (EMNLP), 2015.
+Danqi Chen, Jason Bolton, and Christopher D Manning. A thorough examination of the cnn/daily mail reading comprehension task. In Association for Computational Linguistics (ACL), 2016.
+Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. In North American Chapter of the Association for Computational Linguistics: Human Language Technologies (NAACL-HLT), 2019.
+Lucas Dixon, John Li, Jeffrey Sorensen, Nithum Thain, and Lucy Vasserman. Measuring and mitigating unintended bias in text classification. In AAAI/ACM Conference on AI, Ethics, and Society. ACM, 2018.
+Robert Geirhos, Patricia Rubisch, Claudio Michaelis, Matthias Bethge, Felix A Wichmann, and Wieland Brendel. Imagenet-trained cnns are biased towards texture; increasing shape bias improves accuracy and robustness. arXiv preprint arXiv:1811.12231, 2018.
+Max Glockner, Vered Shwartz, and Yoav Goldberg. Breaking nli systems with sentences that require simple lexical inferences. In Association for Computational Linguistics (ACL), 2018.
+Alex Graves and Jürgen Schmidhuber. Framewise phoneme classification with bidirectional LSTM and other neural network architectures. Neural networks, 18(5-6), 2005.
+Suchin Gururangan, Swabha Swayamdipta, Omer Levy, Roy Schwartz, Samuel Bowman, and Noah A Smith. Annotation artifacts in natural language inference data. In North American Chapter of the Association for Computational Linguistics: Human Language Technologies (NAACL-HLT), 2018.
+Karl Moritz Hermann, Tomas Kocisky, Edward Grefenstette, Lasse Espeholt, Will Kay, Mustafa Suleyman, and Phil Blunsom. Teaching machines to read and comprehend. In Advances in Neural Information Processing Systems (NeurIPS), 2015.
+Eduard Hovy. Generating natural language under pragmatic constraints. Journal of Pragmatics, 1987.
+Mohit Iyyer, John Wieting, Kevin Gimpel, and Luke Zettlemoyer. Adversarial example generation with syntactically controlled paraphrase networks. In North American Chapter of the Association for Computational Linguistics: Human Language Technologies (NAACL-HLT), 2018.
+Robin Jia and Percy Liang. Adversarial examples for evaluating reading comprehension systems. In Empirical Methods in Natural Language Processing (EMNLP), 2017.
+Jason Jo and Yoshua Bengio. Measuring the tendency of cnns to learn surface statistical regularities. arXiv preprint arXiv:1711.11561, 2017.
+Divyansh Kaushik and Zachary C Lipton. How much reading does reading comprehension require? a critical investigation of popular benchmarks. In Empirical Methods in Natural Language Processing (EMNLP), 2018.
+
+Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In International Conference on Learning Representations (ICLR), 2015.
+Svetlana Kiritchenko and Saif Mohammad. Examining gender and race bias in two hundred sentiment analysis systems. In Joint Conference on Lexical and Computational Semantics (*SEM), 2018.
+Kaiji Lu, Piotr Mardziel, Fangjing Wu, Preetam Amancharla, and Anupam Datta. Gender bias in neural natural language processing. arXiv preprint arXiv:1807.11714, 2018.
+Andrew L Maas, Raymond E Daly, Peter T Pham, Dan Huang, Andrew Y Ng, and Christopher Potts. Learning word vectors for sentiment analysis. In Association for Computational Linguistics: Human Language Technologies (ACL-HLT), 2011.
+Rowan Hall Maudslay, Hila Gonen, Ryan Cotterell, and Simone Teufel. It's all in the name: Mitigating gender bias with name-based counterfactual data substitution. arXiv preprint arXiv:1909.00871, 2019.
+Vinod Nair and Geoffrey E Hinton. Rectified linear units improve restricted boltzmann machines. In International Conference on Machine Learning (ICML), 2010.
+Jianmo Ni, Jiacheng Li, and Julian McAuley. Justifying recommendations using distantly-labeled reviews and fine-grained aspects. In Empirical Methods in Natural Language Processing and International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), 2019. URL https://www.aclweb.org/anthology/D19-1018.
+F. Pedregosa, G. Varoquaux, A. Gramfort, V. Michel, B. Thirion, O. Grisel, M. Blondel, P. Prettenhofer, R. Weiss, V. Dubourg, J. Vanderplas, A. Passos, D. Cournapeau, M. Brucher, M. Perrot, and E. Duchesnay. Scikit-learn: Machine learning in Python. Journal of Machine Learning Research (JMLR), 12, 2011.
+Matthew E Peters, Mark Neumann, Mohit Iyyer, Matt Gardner, Christopher Clark, Kenton Lee, and Luke Zettlemoyer. Deep contextualized word representations. In North American Chapter of the Association for Computational Linguistics: Human Language Technologies (NAACL-HLT), 2018.
+Jonas Pfeiffer, Aishwarya Kamath, Iryna Gurevych, and Sebastian Ruder. What do deep networks like to read? arXiv preprint arXiv:1909.04547, 2019.
+Adam Poliak, Jason Naradowsky, Aparajita Haldar, Rachel Rudinger, and Benjamin Van Durme. Hypothesis Only Baselines in Natural Language Inference. In *Joint Conference on Lexical and Computational Semantics (*Sem), 2018.
+Stefanos Poulis and Sanjoy Dasgupta. Learning with feature feedback: from theory to practice. In Artificial Intelligence and Statistics (AISTATS), 2017.
+Marco Tulio Ribeiro, Sameer Singh, and Carlos Guestrin. Semantically equivalent adversarial rules for debugging nlp models. In Association for Computational Linguistics (ACL), 2018.
+Sara Rosenthal, Noura Farra, and Preslav Nakov. SemEval-2017 task 4: Sentiment analysis in twitter. In International Workshop on Semantic Evaluation (SemEval), 2017. URL https://www.aclweb.org/anthology/S17-2088.
+Judy Hanwen Shen, Lauren Fratamico, Iyad Rahwan, and Alexander M Rush. Darling or babygirl? investigating stylistic bias in sentiment analysis. 5th Workshop on Fairness, Accountability, and Transparency in Machine Learning (FATML), 2018.
+Eric Wallace, Shi Feng, Nikhil Kandpal, Matt Gardner, and Sameer Singh. Universal adversarial triggers for nlp. arXiv preprint arXiv:1908.07125, 2019.
+Omar Zaidan, Jason Eisner, and Christine Piatko. Using annotator rationales to improve machine learning for text categorization. In North American Chapter of the Association for Computational Linguistics: Human Language Technologies (NAACL-HLT), 2007.
+
+Omar F Zaidan and Jason Eisner. Modeling annotators: A generative approach to learning from annotator rationales. In Empirical Methods in Natural Language Processing (EMNLP). Association for Computational Linguistics, 2008.
+Jieyu Zhao, Tianlu Wang, Mark Yatskar, Vicente Ordonez, and Kai-Wei Chang. Gender bias in coreference resolution: Evaluation and debiasing methods. In North American Chapter of the Association for Computational Linguistics: Human Language Technologies (NAACL-HLT), 2018.
+Ran Zmigrod, Sebastian J. Mielke, Hanna Wallach, and Ryan Cotterell. Counterfactual data augmentation for mitigating gender stereotypes in languages with rich morphology. In Association for Computational Linguistics (ACL), 2019.
+
+# APPENDIX
+
+Table 10: Most frequent insertions/deletions by human annotators for sentiment analysis.
+
+| Revision | Removed words | Inserted words |
| Positive to Negative | movie, film, great, like, good, re-ally, would, see, story, love | movie, film, one, like, bad, would, really, even, story, see |
| Negative to Positive | bad, even, worst, waste, nothing, never, much, would, like, little | great, good, best, even, well, amazing, much, many, watch, better |
+
+Table 11: Most frequent insertions/deletions by human annotators for SNLI.
+
+| Revision | Removed words | Inserted words |
| Revising Premise |
| Entailment to Neutral | woman, walking, man, blue, sitting, men, girl, standing, looking, running | person, near, child, something, together, people, tall, vehicle, wall, holding |
| Neutral to Entailment | man, street, black, water, little, front, young, playing, woman, two | waiting, couple, playing, running, getting, making, tall, game, black, happily |
| Entailment to Contradiction | blue, people, standing, girl, front, street, red, young, sitting, band | sitting, standing, inside, young, women, child, red, men, sits, one |
| Contradiction to Entailment | sitting, man, walking, black, blue, people, red, standing, white, street | man, sitting, sleeping, woman, sits, eating, playing, park, two, standing |
| Neutral to Contradiction | man, woman, people, boy, black, red, standing, young, two, water | man, woman, boy, men, alone, sitting, girl, dog, three, one |
| Contradiction to Neutral | man, sitting, black, blue, walking, red, standing, street, white, street | man, sitting, woman, people, person, near, something, something, sits, black |
| Revising Hypothesis |
| Entailment to Neutral | man, wearing, white, blue, black, shirt, one, young, people, woman | people, there, playing, man, person, wearing, outside, two, old, near |
| Neutral to Entailment | white, wearing, shirt, black, blue, man, two, standing, young, red | playing, wearing, man, two, there, woman, people, men, near, person |
| Entailment to Contradiction | man, wearing, white, blue, black, two, shirt, one, young, people | people, man, woman, playing, no, inside, person, two, wearing, women |
| Contradiction to Entailment | wearing, blue, black, man, white, two, red, shirt, young, one | people, there, man, two, wearing, playing, people, men, woman, outside |
| Neutral to Contradiction | white, man, wearing, shirt, black, blue, two, standing, woman, red | woman, man, there, playing, two, wearing, one, men, girl, no |
| Contradiction to Neutral | wearing, blue, black, man, white, two, red, sitting, young, standing | people, playing, man, woman, two, wearing, near, tall, men, old |
+
+
+
+
+(a) Trained on the original dataset
+(b) Trained on the revised dataset
+
+
+(c) Trained on combined dataset
+Figure 4: Thirty most important features learned by an SVM classifier trained on TF-IDF bag of words.
+
+The blue box contains a text passage and a label. Please edit this text in the textbox below, making a small number of changes such that:
+
+(a) the document remains coherent and
+(b) the new label (colored) accurately describes the revised passage.
+
+Do not change any portions of the passage unnecessarily.
+
+After modifying the passage and checking it over to make sure that is coherent and matches the label.
+
+(a) Revising IMDb movie reviews
+
+The upper blue box contains Sentence 1. The lower blue box contains Sentence 2.
+
+Given that Sentence 1 is True, Sentence 2 (by implication), must either be
+
+(a) definitely True, (b) definitely False, or (c) May be True.
+
+You are presented with an initial Sentence 1 and Sentence 2 and the correct initial relationship label (True, False, or May be True).
+
+Please edit Sentence 2 in the textboxes, making a small number of changes such that:
+
+(a) The new sentences are coherent and
+(b) The target labels (in red) accurately describe the truthfulness of the modified Sentence 2 given the original Sentence 1.
+
+Do not change any portions of the sentence unnecessarily.
+
+After modifying the text and checking it over to make sure that it is coherent and matches the target label.
+
+(b) Revising hypothesis in SNLI
+
+The upper blue box contains Sentence 1. The lower blue box contains Sentence 2.
+
+Given that Sentence 1 is True, Sentence 2 (by implication), must either be
+
+(a) definitely True, (b) definitely False, or (c) May be True.
+
+You are presented with an initial Sentence 1 and Sentence 2 and the correct initial relationship label (True, False, or May be True).
+
+Please edit Sentence 1 in the textboxes, making a small number of changes such that:
+
+(a) The new sentences are coherent and
+(b) The target labels (in red) accurately describe the truthfulness of the original Sentence 2 given the modified Sentence 1.
+
+Do not change any portions of the sentence unnecessarily.
+
+After modifying the text and checking it over to make sure that it is coherent and matches the target label.
+
+(c) Revising premise in SNLI
+
+Figure 5: Instructions used on Amazon Mechanical Turk for data collection
\ No newline at end of file
diff --git a/learningthedifferencethatmakesadifferencewithcounterfactuallyaugmenteddata/images.zip b/learningthedifferencethatmakesadifferencewithcounterfactuallyaugmenteddata/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..e5f64a2d1ca50d627b0575b77b36d12fc32fd763
--- /dev/null
+++ b/learningthedifferencethatmakesadifferencewithcounterfactuallyaugmenteddata/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:02d3f9d941b95e72a521694b808d964e0cff9e4a1b622db203ca2c0bbbbaf590
+size 1209679
diff --git a/learningthedifferencethatmakesadifferencewithcounterfactuallyaugmenteddata/layout.json b/learningthedifferencethatmakesadifferencewithcounterfactuallyaugmenteddata/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..026dcb7ddbc60009c9f1335e88f70b231a93fbbd
--- /dev/null
+++ b/learningthedifferencethatmakesadifferencewithcounterfactuallyaugmenteddata/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ddd6b6d674484dd1ec1112ce024ce40d327cce034fb139388ff414d3e856015c
+size 358766
diff --git a/learningtocontrolpdeswithdifferentiablephysics/112aab07-4a46-45ae-b1cb-962283efbabb_content_list.json b/learningtocontrolpdeswithdifferentiablephysics/112aab07-4a46-45ae-b1cb-962283efbabb_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..12c412f214cf3a896dd5912e9f9b5748c96105fd
--- /dev/null
+++ b/learningtocontrolpdeswithdifferentiablephysics/112aab07-4a46-45ae-b1cb-962283efbabb_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e0dda32fbe823af8fcfae081bc1c0443634786e6d4c3df7d17e6538021d2215a
+size 159045
diff --git a/learningtocontrolpdeswithdifferentiablephysics/112aab07-4a46-45ae-b1cb-962283efbabb_model.json b/learningtocontrolpdeswithdifferentiablephysics/112aab07-4a46-45ae-b1cb-962283efbabb_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..3366fb0ecab1b0e0b3d6c1b579ddddbe10c2fe13
--- /dev/null
+++ b/learningtocontrolpdeswithdifferentiablephysics/112aab07-4a46-45ae-b1cb-962283efbabb_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:9946bff897ae0c93c9f5d3d3b0c43ff1981bdb93e1edaa55574d8e8ff3d3327b
+size 191271
diff --git a/learningtocontrolpdeswithdifferentiablephysics/112aab07-4a46-45ae-b1cb-962283efbabb_origin.pdf b/learningtocontrolpdeswithdifferentiablephysics/112aab07-4a46-45ae-b1cb-962283efbabb_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..17111e5d827c0cf26c10a03a7321c01fc0036f55
--- /dev/null
+++ b/learningtocontrolpdeswithdifferentiablephysics/112aab07-4a46-45ae-b1cb-962283efbabb_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a7d50a29c61c8b2553bfa99018da6e1b85cbdb052aedaf22945e78715f9719e8
+size 4673878
diff --git a/learningtocontrolpdeswithdifferentiablephysics/full.md b/learningtocontrolpdeswithdifferentiablephysics/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..b0e1d9d646f73e53d8ecd75f2419dd8e022487a1
--- /dev/null
+++ b/learningtocontrolpdeswithdifferentiablephysics/full.md
@@ -0,0 +1,654 @@
+# LEARNING TO CONTROL PDES WITH DIFFERENTIABLE PHYSICS
+
+Philipp Holl
+
+Technical University of Munich
+
+Vladlen Koltun
+
+Intel Labs
+
+Nils Thuerey
+
+Technical University of Munich
+
+# ABSTRACT
+
+Predicting outcomes and planning interactions with the physical world are long-standing goals for machine learning. A variety of such tasks involves continuous physical systems, which can be described by partial differential equations (PDEs) with many degrees of freedom. Existing methods that aim to control the dynamics of such systems are typically limited to relatively short time frames or a small number of interaction parameters. We present a novel hierarchical predictor-corrector scheme which enables neural networks to learn to understand and control complex nonlinear physical systems over long time frames. We propose to split the problem into two distinct tasks: planning and control. To this end, we introduce a predictor network that plans optimal trajectories and a control network that infers the corresponding control parameters. Both stages are trained end-to-end using a differentiable PDE solver. We demonstrate that our method successfully develops an understanding of complex physical systems and learns to control them for tasks involving PDEs such as the incompressible Navier-Stokes equations.
+
+# 1 INTRODUCTION
+
+Intelligent systems that operate in the physical world must be able to perceive, predict, and interact with physical phenomena (Battaglia et al., 2013). In this work, we consider physical systems that can be characterized by partial differential equations (PDEs). PDEs constitute the most fundamental description of evolving systems and are used to describe every physical theory, from quantum mechanics and general relativity to turbulent flows (Courant & Hilbert, 1962; Smith, 1985). We aim to endow artificial intelligent agents with the ability to direct the evolution of such systems via continuous controls.
+
+Such optimal control problems have typically been addressed via iterative optimization. Differentiable solvers and the adjoint method enable efficient optimization of high-dimensional systems (Toussaint et al., 2018; de Avila Belbute-Peres et al., 2018; Schenck & Fox, 2018). However, direct optimization through gradient descent (single shooting) at test time is resource-intensive and may be difficult to deploy in interactive settings. More advanced methods exist, such as multiple shooting and collocation, but they commonly rely on modeling assumptions that limit their applicability, and still require computationally intensive iterative optimization at test time.
+
+Iterative optimization methods are expensive because they have to start optimizing from scratch and typically require a large number of iterations to reach an optimum. In many real-world control problems, however, agents have to repeatedly make decisions in specialized environments, and reaction times are limited to a fraction of a second. This motivates the use of data-driven models such as deep neural networks, which combine short inference times with the capacity to build an internal representation of the environment.
+
+We present a novel deep learning approach that can learn to represent solution manifolds for a given physical environment, and is orders of magnitude faster than iterative optimization techniques. The core of our method is a hierarchical predictor-corrector scheme that temporally divides the problem into easier subproblems. This enables us to combine models specialized to different time scales in order to control long sequences of complex high-dimensional systems. We train our models using a differentiable PDE solver that can provide the agent with feedback of how interactions at any point in time affect the outcome. Our models learn to represent manifolds containing a large number of solutions, and can thereby avoid local minima that can trap classic optimization techniques.
+
+We evaluate our method on a variety of control tasks in systems governed by advection-diffusion PDEs such as the Navier-Stokes equations. We quantitatively evaluate the resulting sequences on how well they approximate the target state and how much force was exerted on the physical system. Our method yields stable control for significantly longer time spans than alternative approaches.
+
+# 2 BACKGROUND
+
+Physical problems commonly involve nonlinear PDEs, often with many degrees of freedom. In this context, several works have proposed methods for improving the solution of PDE problems (Long et al., 2018; Bar-Sinai et al., 2019; Hsieh et al., 2019) or used PDE formulations for unsupervised optimization (Raissi et al., 2018). Lagrangian fluid simulation has been tackled with regression forests (Ladicky et al., 2015), graph neural networks (Mrowca et al., 2018; Li et al., 2019), and continuous convolutions (Ummenhofer et al., 2020). Data-driven turbulence models were trained with MLPs (Ling et al., 2016). Fully-convolutional networks were trained for pressure inference (Tompson et al., 2017) and advection components were used in adversarial settings (Xie et al., 2018). Temporal updates in reduced spaces were learned via the Koopman operator (Morton et al., 2018). In a related area, deep networks have been used to predict chemical properties and the outcome of chemical reactions (Gilmer et al., 2017; Bradshaw et al., 2019).
+
+Differentiable solvers have been shown to be useful in a variety of settings. Degrave et al. (2019) and de Avila Belbute-Peres et al. (2018) developed differentiable simulators for rigid body mechanics. (See Popovic et al. (2000) for earlier work in computer graphics.) Toussaint et al. (2018) applied related techniques to manipulation planning. Specialized solvers were developed to infer protein structures (Ingraham et al., 2019), interact with liquids (Schenck & Fox, 2018), control soft robots (Hu et al., 2019), and solve inverse problems that involve cloth (Liang et al., 2019). Like ours, these works typically leverage the automatic differentiation of deep learning pipelines (Griewank & Walther, 2008; Maclaurin et al., 2015; Amos & Kolter, 2017; Mensch & Blondel, 2018; van Merrienboer et al., 2018; Chen et al., 2018; Bradbury et al., 2018; Paszke et al., 2019; Tokui et al., 2019). However, while the works above target Lagrangian solvers, i.e. reference frames moving with the simulated material, we address grid-based solvers, which are particularly appropriate for dense, volumetric phenomena.
+
+The adjoint method (Lions, 1971; Pironneau, 1974; Jameson, 1988; Giles & Pierce, 2000; Bewley, 2001; McNamara et al., 2004) is used by most machine learning frameworks, where it is commonly known as reverse mode differentiation (Werbos, 2006; Chen et al., 2018). While a variety of specialized adjoint solvers exist (Griewank et al., 1996; Fournier et al., 2012; Farrell et al., 2013), these packages do not interface with production machine learning frameworks. A supporting contribution of our work is a differentiable PDE solver called $\Phi_{\mathrm{Flow}}$ that integrates with TensorFlow (Abadi et al., 2016) and PyTorch (Paszke et al., 2019). It is publicly available at https://github.com/tumpbs/PhiFlow.
+
+# 3 PROBLEM
+
+Consider a physical system $\pmb{u}(\pmb{x},t)$ whose natural evolution is described by the PDE
+
+$$
+\frac {\partial \boldsymbol {u}}{\partial t} = \mathcal {P} \left(\boldsymbol {u}, \frac {\partial \boldsymbol {u}}{\partial \boldsymbol {x}}, \frac {\partial^ {2} \boldsymbol {u}}{\partial \boldsymbol {x} ^ {2}}, \dots , \boldsymbol {y} (t)\right), \tag {1}
+$$
+
+where $\mathcal{P}$ models the physical behavior of the system and $\pmb{y}(t)$ denotes external factors that can influence the system. We now introduce an agent that can interact with the system by controlling certain parameters of the dynamics. This could be the rotation of a motor or fine-grained control over a field. We factor out this influence into a force term $\pmb{F}$ , yielding
+
+$$
+\frac {\partial \boldsymbol {u}}{\partial t} = \mathcal {P} \left(\boldsymbol {u}, \frac {\partial \boldsymbol {u}}{\partial \boldsymbol {x}}, \frac {\partial^ {2} \boldsymbol {u}}{\partial \boldsymbol {x} ^ {2}}, \dots\right) + \boldsymbol {F} (t). \tag {2}
+$$
+
+The agent can now be modelled as a function that computes $F(t)$ . As solutions of nonlinear PDEs were shown to yield low-dimensional manifolds (Foias et al., 1988; Titi, 1990), we target solution manifolds of $F(t)$ for a given choice of $\mathcal{P}$ with suitable boundary conditions. This motivates our choice to employ deep networks for our agents.
+
+In most real-world scenarios, it is not possible to observe the full state of a physical system. When considering a cloud of smoke, for example, the smoke density may be observable while the velocity field may not be seen directly. We model the imperfect information by defining the observable state of $\pmb{u}$ as $o(\pmb{u})$ . The observable state is problem dependent, and our agent is conditioned only on these observations, i.e. it does not have access to the full state $\pmb{u}$ .
+
+Using the above notation, we define the control task as follows. An initial observable state $\pmb{o}_0$ of the PDE as well as a target state $\pmb{o}^*$ are given (Figure 1a). We are interested in a reconstructed trajectory $\pmb{u}(t)$ that matches these states at $t_0$ and $t_*$ , i.e. $\pmb{o}_0 = \pmb{o}(\pmb{u}(t_0)), \pmb{o}^* = \pmb{o}(\pmb{u}(t_*))$ , and minimizes the amount of force applied within the simulation domain $\mathcal{D}$ (Figure 1b):
+
+$$
+L _ {\boldsymbol {F}} [ \boldsymbol {u} (t) ] = \int_ {t _ {0}} ^ {t _ {*}} \int_ {\mathcal {D}} | \boldsymbol {F} _ {\boldsymbol {u}} (t) | ^ {2} d x d t. \tag {3}
+$$
+
+Taking discrete time steps $\Delta t$ , the reconstructed trajectory $\mathbf{u}$ is a sequence of $n = (t_{*} - t_{0}) / \Delta t$ states.
+
+When an observable dimension cannot be controlled directly, there may not exist any trajectory $\pmb{u}(t)$ that matches both $\pmb{o}_0$ and $\pmb{o}^*$ . This can stem from either physical constraints or numerical limitations. In these cases, we settle for an approximation of $\pmb{o}^*$ . To measure the quality of the approximation of the target, we define an observation loss $L_o^*$ . The form of this loss can be chosen to fit the problem. We combine Eq. 3 and the observation loss into the objective function
+
+$$
+L [ \boldsymbol {u} (t) ] = \alpha \cdot L _ {\boldsymbol {F}} [ \boldsymbol {u} (t) ] + L _ {\boldsymbol {o}} ^ {*} (\boldsymbol {u} \left(t _ {*}\right)), \tag {4}
+$$
+
+
+Figure 1: Illustration of possible trajectories. The grey lines represent the unperturbed evolution of the physical system. The amount of applied force corresponds to how far the trajectory deviates from the natural evolution.
+
+with $\alpha > 0$ . We use square brackets to denote functionals, i.e. functions depending on fields or series rather than single values.
+
+# 4 PRELIMINARIES
+
+Differentiable solvers. Let $\pmb{u}(\pmb{x}, t)$ be described by a PDE as in Eq. 1. A regular solver can move the system forward in time via Euler steps:
+
+$$
+\boldsymbol {u} \left(t _ {i + 1}\right) = \operatorname {S o l v e r} \left[ \boldsymbol {u} \left(t _ {i}\right), \boldsymbol {y} \left(t _ {i}\right) \right] = \boldsymbol {u} \left(t _ {i}\right) + \Delta t \cdot \mathcal {P} \left(\boldsymbol {u} \left(t _ {i}\right), \dots , \boldsymbol {y} \left(t _ {i}\right)\right). \tag {5}
+$$
+
+Each step moves the system forward by a time increment $\Delta t$ . Repeated execution produces a trajectory $u(t)$ that approximates a solution to the PDE. This functionality for time advancement by itself is not well-suited to solve optimization problems, since gradients can only be approximated by finite differencing. For high-dimensional or continuous systems, this method becomes computationally expensive because a full trajectory needs to be computed for each estimizable parameter.
+
+Differentiable solvers resolve this issue by solving the adjoint problem (Pontryagin, 1962) via analytic derivatives. The adjoint problem computes the same mathematical expressions while working with lower-dimensional vectors. A differentiable solver can efficiently compute the derivatives with respect to any of its inputs, i.e. $\partial \pmb{u}(t_{i+1}) / \partial \pmb{u}(t_i)$ and $\partial \pmb{u}(t_{i+1}) / \partial \pmb{y}(t_i)$ . This allows for gradient-based optimization of inputs or control parameters over an arbitrary number of time steps.
+
+Iterative trajectory optimization. Many techniques exist that try to find optimal trajectories by starting with an initial guess for $\mathbf{F}(t)$ and slightly changing it until reaching an optimum. The simplest of these is known as single shooting. In one optimization step, it simulates the full dynamics, then backpropagates the loss through the whole sequence to optimize the controls (Kraft, 1985; Leineweber et al., 2003). Replacing $\mathbf{F}(t)$ with an agent $\mathbf{F}(t|\mathbf{o}_t,o^*)$ , which can be parameterized by a deep network, yields a simple training method. For a sequence of $n$ frames, this setup contains $n$ linked copies of the agent and is depicted in Figure 2. We refer to such an agent as a control force estimator (CFE).
+
+Optimizing such a chain of CFEs is both computationally expensive and causes gradients to pass through a potentially long sequence of highly nonlinear simulation steps. When the reconstruction $u$ is close to an optimal trajectory, this is not a problem because the gradients $\Delta u$ are small and the operations executed by the solver are differentiable by construction. The solver can therefore be locally approximated by a first-order polynomial and the gradients can be safely backpropagated. For large $\Delta u$ , e.g. at the beginning of an optimization, this approximation breaks down, causing the gradients to become unstable while passing through the chain. This instability in the training process can prevent single-shooting approaches from converging and deep networks from learning unless they are initialized near an optimum.
+
+Alternatives to single shooting exist, promising better and more efficient convergence. Multiple shooting (Bock & Plitt, 1984) splits the trajectory into segments with additional defect constraints. Depending on the physical system, this method may have to be adjusted for specific problems (Treuillet al., 2003). Collocation schemes (Hargraves & Paris, 1987) model trajectories with splines. While this works well for particle trajectories, it is poorly suited for Eulerian solvers where the evolution of individual points does not reflect the overall motion. Model reduction can be used to reduce the dimensionality or nonlinearity of the problem, but generally requires domain-specific knowledge. When applicable, these methods can converge faster or in a more stable manner than single shooting. However, as we are focusing on a general optimization scheme in this work, we will use single shooting and its variants as baseline comparisons.
+
+Supervised and differentiable physics losses. One of the key ingredients in training a machine learning model is the choice of loss function. For many tasks, supervised losses are used, i.e. losses that directly compare the output of the model for a specific input with the desired ground truth. While supervised losses can be employed for trajectory optimization, far better loss functions are possible when a differentiable solver is available. We will refer to these as differentiable physics loss functions. In this work, we employ a combination of supervised and differentiable physics losses, as both come with advantages and disadvantages.
+
+One key limitation of supervised losses is that they can only measure the error of a single time step. Therefore, an agent cannot get any measure of how its output would influence future time steps. Another problem arises from the form of supervised training data which comprises input-output pairs, which may be obtained directly from data generation or through iterative optimization. Since optimal control problems are generally not unimodal, there can exist multiple possible outputs for one input. This ambiguity in the supervised training process will lead to suboptimal predictions as the network will try to find a compromise between all possible outputs instead of picking one of them.
+
+Differentiable physics losses solve these problems by allowing the agent to be directly optimized for the desired objective (Eq. 4). Unlike supervised losses, differentiable physics losses require a differentiable solver to backpropagate the gradients through the simulation. Multiple time steps can be chained together, which is a key requirement since the objective (Eq. 4) explicitly depends on all time steps through $L_{F}[\boldsymbol{u}(t)]$ (Eq. 3). As with iterative solvers, one optimization step for a sequence of $n$ frames then invokes the agent $n$ times before computing the loss, each invocation followed by a solver step. The employed differentiable solver backpropagates the gradients through the whole sequence, which gives the model feedback on (i) how its decisions change the future trajectory and
+
+
+Figure 2: Single-shooting optimization with a control force estimator (CFE). (a) The forward pass simulates the full sequence. (b) Backpropagation computes the adjoint problem. (c) Weight updates are accumulated and applied to the CFE.
+
+(ii) how to handle states as input that were reached because of its previous decisions. Since no ground truth needs to be provided, multi-modal problems naturally converge towards one solution.
+
+# 5 METHOD
+
+In order to optimally interact with a physical system, an agent has to (i) build an internal representation of an optimal observable trajectory $\pmb{o}(\pmb{u}(t))$ and (ii) learn what actions to take to move the system along the desired trajectory. These two steps strongly resemble the predictor-corrector method (Press et al., 2007). Given $\pmb{o}(t)$ , a predictor-corrector method computes $\pmb{o}(t + \Delta t)$ in two steps. First, a prediction step approximates the next state, yielding $\pmb{o}^p(t + \Delta t)$ . Then, the correction uses $\pmb{o}^p(t + \Delta t)$ to refine the initial approximation and obtain $\pmb{o}(t + \Delta t)$ . Each step can, to some degree, be learned independently.
+
+This motivates splitting the agent into two neural networks: an observation predictor (OP) network that infers intermediate states $\pmb{o}^p(t_i), i \in \{1, 2, \dots, n-1\}$ , planning out a trajectory, and a corrector network (CFE) that estimates the control force $\pmb{F}(t_i | \pmb{o}(\pmb{u}_i), \pmb{o}_{i+1}^p)$ to follow that trajectory as closely as possible. This splitting has the added benefit of exposing the planned trajectory, which would otherwise be inaccessible. As we will demonstrate, it is crucial for the prediction stage to incorporate knowledge about longer time spans. We address this by modelling the prediction as a temporally hierarchical process, recursively dividing the problem into smaller subproblems.
+
+To achieve this, we let the OP not directly infer $\pmb{o}^p (t_{i + 1}\mid \pmb {o}(\pmb {u}_i),\pmb {o}^*)$ but instead model it to predict the optimal center point between two states at times $t_i,t_j$ , with $i,j\in \{1,2,\dots n - 1\} ,j > i$ , i.e. $o^{p}((t_{i} + t_{j}) / 2\mid o_{i},o_{j})$ . This function is much more general than predicting the state of the next time step since two arbitrary states can be passed as arguments. Recursive OP evaluations can then partition the sequence until a prediction $o^p (t_i)$ for every time step $t_i$ has been made.
+
+This scheme naturally enables scaling to arbitrary time frames or arbitrary temporal resolutions, assuming that the OP can correctly anticipate the physical behavior. Since physical systems often exhibit different behaviors on different time scales and the OP can be called with states separated by arbitrary time spans, we condition the OP on the time scale it is evaluated on by instantiating and training a unique version of the model for every time scale. This simplifies training and does not significantly increase the model complexity as we use factors of two for the time scales, and hence the number of required models scales with $\mathcal{O}(\log_2n)$ . We will refer to one instance of an $\mathrm{OP}_n$ by the time span between its input states, measured in the number of frames $n = (t_j - t_i) / \Delta t$ .
+
+Execution order. With the CFE and $\mathrm{OP}_n$ as building blocks, many algorithms for solving the control problem, i.e. for computing $F(t)$ , can be assembled and trained.
+
+
+(a) Prediction first
+
+
+(b) Staggered
+
+
+(c)Refined
+Figure 3: Overview of the different execution schemes.
+
+We compared a variety of algorithms and found that a scheme we will refer to as prediction refinement produces the best results. It is based on the following principles: (i) always use the finest scale OP possible to make a prediction, (ii) execute the CFE followed by a solver step as soon as possible, (iii) refine predictions after the solver has computed the next state. The algorithm that realizes these goals is shown in Appendix B with an example for $n = 8$ . To understand the algorithm and resulting execution orders, it is helpful to consider simpler algorithms first.
+
+The simplest combination of CFE and $\mathrm{OP}_n$ invocations that solves the full trajectory, shown in Figure 3a, can be described as follows. Initially, all intermediate states are predicted hierarchically. The first prediction is the half-way point $o^p (t_{n / 2}\mid o_0,o^*)$ , generated by the $\mathrm{OP}_n$ . Using that as input to an $\mathrm{OP}_{n / 2}$ results in new predictions at $t_{n / 4}, t_{3n / 4}$ . Continuing with this scheme, a prediction can be made for each $t_i$ , $i\in 1,\ldots ,n - 1$ . Next, the actual trajectory is evaluated step by step. For each step $t_i$ , the CFE computes the control force $F(t_{i})$ conditioned on the state at $t_i$ and the prediction $o^p (t_{i + 1})$ . Once $F(t_{i})$ is known, the solver can step the simulation to the next state at $t_{i + 1}$ . This al
+
+girthm finds a trajectory in time $\mathcal{O}(n)$ since $n$ CFE calls and $n - 1$ OP calls are required in total (see Appendix B). However, there are inherent problems with this algorithm. The physical constraints of the PDE and potential approximation errors of the CFE can result in observations that are only matched partially. This can result in the reconstructed trajectory exhibiting undesirable oscillations, often visible as jittering. When subsequent predictions do not line up perfectly, large forces may be applied by the CFE or the reconstructed trajectory might stop following the predictions altogether.
+
+This problem can be alleviated by changing the execution order of the two-stage algorithm described above. The resulting algorithm is shown in Figure 3b and will be referred to as staggered execution. In this setup, the simulation is advanced as soon as a prediction for the next observable state exists and OPs are only executed when their state at time $t_i$ is available. This staggered execution scheme allows future predictions to take deviations from the predicted trajectory into account, preventing a divergence of the actual evolution $o(\boldsymbol{u}(t))$ from the prediction $o^p(t)$ .
+
+While the staggered execution allows most predictions to correct for deviations from the predicted trajectory $\pmb{o}^p$ , this scheme leaves several predictions unmodified. Most notably, the prediction $\pmb{o}^p (t_{n / 2})$ , which is inferred from just the initial state and the desired target, remains unchanged. This prediction must therefore be able to guide the reconstruction in the right direction without knowing about deviations in the system that occurred up to $t_{n / 2 - 1}$ . As a practical consequence, a network trained with this scheme typically learns to average over the deviations, resulting in blurred predictions (see Appendix D.2).
+
+Algorithm 1: Recursive algorithm computing the prediction refinement. The algorithm is called via Reconstruct $[o_0, o_*, absent]$ to reconstruct a full trajectory from $o_0$ to $o_*$ .
+function Reconstruct $\left[\boldsymbol {o}(\boldsymbol {u}_0),\boldsymbol {o}_n,\boldsymbol {o}_{2n}\right]$
+Input: Initial observation $\boldsymbol {o}(\boldsymbol {u}_0)$ , observation $o_{n}$ , optional observation $o_{2n}$
+Output: Observation of the reconstructed state $\boldsymbol {o}(\boldsymbol {u}_n)$
+if $n = 1$ then
+ $\pmb {F}\gets \mathrm{CFE}[\pmb {o}(\pmb {u}_0),\pmb {o}_1]$ $\pmb {u}_1\gets \mathrm{Solver}[\pmb {u}_0,\pmb {F}]$
+return $\pmb {o}(\pmb {u}_1)$
+else
+ $o_{n / 2}\gets \mathrm{OP}[o(u_0),o_n]$ $o(u_{n / 2})\gets \mathrm{Reconstruc}[o(u_0),o_{n / 2},o_n]$
+if $o_{2n}$ present then
+ $\begin{array}{rl}{\pmb{o}_{3n / 2}} & {\leftarrow \mathrm{OP}[\pmb{o}_{n},\pmb{o}_{2n}]\quad}\\ {\pmb{o}_n} & {\leftarrow \mathrm{OP}[\pmb{o}(\pmb{u}_{n / 2}),\pmb{0}_{3n / 2}]} \end{array}$
+else
+ $\begin{array}{rl}{\pmb{o}_{3n / 2}} & {\leftarrow \mathrm{absent}} \end{array}$
+end
+ $o(u_{n})\gets \mathrm{Reconstruc}[o(u_{n / 2}),o_{n},o_{3n / 2}]$
+return $o(u_{n})$
+end
+
+The prediction refinement scheme, listed in Algorithm 1 and illustrated in Figure 3c, solves this problem by re-evaluating existing predictions whenever the simulation progresses in time. Not all predictions need to be updated, though, and an update to a prediction at a finer time scale can depend on a sequence of other predictions. The prediction refinement algorithm that achieves this in an optimal form is listed in Appendix B. While the resulting execution order is difficult to follow for longer sequences with more than $n = 8$ frames, we give an overview of the algorithm by considering the prediction for time $t_{n/2}$ . After the first center-frame prediction $o^p(t_{n/2})$ of the $n$ -frame sequence is made by $\mathrm{OP}_n$ , the prediction refinement algorithm calls itself recursively until all frames up to frame $n/4$ are reconstructed from the CFE and the solver. The center prediction is then updated using $\mathrm{OP}_{n/2}$ for the next smaller time scale compared to the previous prediction. The call of $\mathrm{OP}_{n/2}$ also depends on $o^p(t_{3n/4})$ , which was predicted using $\mathrm{OP}_{n/2}$ . After half of the remaining distance to the center is reconstructed by the solver, the center prediction at $t_{n/2}$ is updated again, this time by the $\mathrm{OP}_{n/4}$ , including all prediction dependencies. Hence, the center prediction is continually refined every time the temporal distance between the latest reconstruction and the prediction halves, until
+
+
+Figure 4: Trajectories for an example control task using Burger's equation. Initial and target states are plotted with thick dashed lines in red and blue, respectively. Inferred states are shown as solid lines. (a) Natural evolution. (b) Reconstruction using a CFE chain. (c,d) Reconstructed using our hierarchical predictor-corrector scheme. (e) Ground-truth trajectory generated with constant force.
+
+the reconstruction reaches that frame. This way, all final predictions $\pmb{o}^p (t_i)$ are conditioned on the reconstruction of the previous state $\pmb{u}(t_{i - 1})$ and can therefore account for all previous deviations.
+
+The prediction refinement scheme requires the same number of force inferences but an increased number of OP evaluations compared to the simpler algorithms. With a total of $3n - 2\log_2(n) - 3$ OP evaluations (see Appendix B), it is of the same complexity, $\mathcal{O}(n)$ . In practice, this refinement scheme incurs only a small overhead in terms of computation, which is outweighed by the significant gains in quality of the learned control function.
+
+# 6 RESULTS
+
+We evaluate the capabilities of our method to learn to control physical PDEs in three different test environments of increasing complexity. We first target a simple but nonlinear 1D equation, for which we present an ablation study to quantify accuracy. We then study two-dimensional problems: an incompressible fluid and a fluid with complex boundaries and indirect control. Full details are given in Appendix D. Supplemental material containing additional sequences for all of the tests can be downloaded from https://ge.in.tum.de/publications/2020-iclr-holl.
+
+Burger's equation. Burger's equation is a nonlinear PDE that describes the time evolution of a single field, $u$ (LeVeque, 1992). Using Eq. 1, it can be written as
+
+$$
+\mathcal {P} \left(u, \frac {\partial u}{\partial x}, \frac {\partial^ {2} u}{\partial x ^ {2}}\right) = - u \cdot \frac {\partial u}{\partial x} + \nu \frac {\partial^ {2} u}{\partial x ^ {2}}. \tag {6}
+$$
+
+Examples of the unperturbed evolution are shown in Figure 4a. We let the whole state be observable and controllable, i.e. $o(t) = u(t)$ , which implies that $\pmb{o}^*$ can always be reached exactly.
+
+The results of our ablation study with this equation are shown in Table 1. The table compares the resulting forces applied by differently trained models when reconstructing a ground-truth sequence (Figure 4e). The variant denoted by CFE chain uses a neural network to infer the force without any intermediate predictions. With a supervised loss, this method learns to approximate a single step well. However, for longer sequences, results quickly deviate from an ideal trajectory and diverge because the network never learned to account for errors made in previous steps (Figure 4b). Training the network with the objective loss (Eq. 4) using the differentiable solver greatly increases the quality of the reconstructions. On average, it applies only $34\%$ of the force used by the supervised model as it learns to correct the temporal evolution of the PDE model.
+
+Next, we evaluate variants of our predictor-corrector approach, which hierarchically predicts intermediate states. Here, the CFE is implemented as $F(t_{i}) = (o^{p}(t_{i + 1}) - u(t_{i})) / \Delta t$ . Unlike the simple CFE chain above, training with the supervised loss and staggered execution produces stable (albeit jittering) trajectories that successfully converge to the target state (Figure 4c). Surprisingly, this supervised method reaches almost the same accuracy as the differentiable CFE, despite not having access to physics-based gradients. However, employing the differentiable physics loss greatly
+
+Table 1: Quantitative reconstruction evaluation using Burger's equation, avg. for 100 examples.
+
+| Execution scheme | Training loss | Force ∫ |F| dt | Inference time (ms) |
| CFE chain | Supervised | 83.4 ± 2.0 | 0.024 ± 0.013 |
| CFE chain | Diff. Physics | 28.8 ± 0.8 | 0.024 ± 0.013 |
| Staggered | Supervised | 34.3 ± 1.1 | 1.15 ± 0.19 |
| Staggered | Diff. Physics | 15.3 ± 0.7 | 1.15 ± 0.19 |
| Refined | Diff. Physics | 14.2 ± 0.7 | 3.05 ± 0.37 |
| Iterative optim. (60 iter.) | Diff. Physics | 15.3 ± 1.6 | 52.7 ± 2.1 |
| Iterative optim. (300 iter.) | Diff. Physics | 10.2 ± 1.9 | 264.0 ± 3.0 |
+
+
+Figure 5: Example reconstructed trajectory from (a) the natural flow test set and (b) the shape test set. The target state $\boldsymbol{o}^*$ is shown on the right.
+
+improves the reconstruction quality, producing solutions that are hard to distinguish from ideal trajectories (Figure 4d). The prediction refinement scheme further improves the accuracy, but the differences to the staggered execution are relatively small as the predictions of the latter are already very accurate.
+
+Table 1 also lists the results of classic shooting-based optimization applied to this problem. To match the quality of the staggered execution scheme, the shooting method requires around 60 optimization steps. These steps are significantly more expensive to compute, despite the fast convergence. After around 300 iterations, the classic optimization reaches an optimal value of 10.2 and the loss stops decreasing. Starting the iterative optimization with our method as an initial guess pushes the optimum slightly lower to 10.1. Thus, even this relatively simple problem shows the advantages of our learned approach.
+
+Incompressible fluid flow. Next, we apply our algorithm to two-dimensional fluid dynamics problems, which are challenging due to the complexities of the governing Navier-Stokes equations (Batchelor, 1967). For a velocity field $\pmb{v}$ , these can be written as
+
+$$
+\mathcal {P} (\boldsymbol {v}, \nabla \boldsymbol {v}) = - \boldsymbol {v} \cdot \nabla \boldsymbol {v} + \nu \nabla^ {2} \boldsymbol {v} - \nabla p, \tag {7}
+$$
+
+subject to the hard constraints $\nabla \cdot \pmb{v} = 0$ and $\nabla \times p = 0$ , where $p$ denotes pressure and $\nu$ the viscosity. In addition, we consider a passive density $\rho$ that moves with the fluid via $\partial \rho / \partial t = -\pmb{v} \cdot \nabla \rho$ . We set $\pmb{v}$ to be hidden and $\rho$ to be observable, and allow forces to be applied to all of $\pmb{v}$ .
+
+We run our tests on a $128^{2}$ grid, resulting in more than 16,000 effective continuous control parameters. We train the OP and CFE networks for two different tasks: reconstruction of natural fluid flows and controlled shape transitions. Example sequences are shown in Figure 5 and a quantitative evaluation, averaged over 100 examples, is given in Table 2. While all methods manage to approximate the target state well, there are considerable differences in the amount of force applied. The supervised technique exerts significantly more force than the methods based on the differentiable solver, resulting in jittering reconstructions. The prediction refinement scheme produces the smoothest transitions, converging to about half the loss of the staggered, non-refined variant.
+
+We compare our method to classic shooting algorithms for this incompressible flow problem. While a direct shooting method fails to converge, a more advanced multi-scale shooting approach still requires 1500 iterations to obtain a level of accuracy that our model achieves almost instantly. In
+
+Table 2: A comparison of methods in terms of final cost for (a) the natural flow setup and (b) the shape transitions. The initial distribution is sampled randomly and evolved to the target state.
+
+| Execution | Loss | a) Force LF | a) Obs. L*o | b) Force LF | b) Obs. L*o |
| Staggered | Supervised | 243 ± 11 | 1.53 ± 0.23 | n/a | n/a |
| Staggered | Diff. Physics | 22.6 ± 1.1 | 0.64 ± 0.08 | 89 ± 6 | 0.331 ± 0.134 |
| Refined | Diff. Physics | 11.7 ± 0.6 | 0.88 ± 0.11 | 75 ± 4 | 0.126 ± 0.010 |
+
+
+Figure 6: Indirect control sequence. Obstacles are marked white, control regions light blue. The white arrows indicate the velocity field. The domain is enclosed in a solid box with an open top.
+
+
+
+
+
+
+
+
+
+addition, our model successfully learns a solution manifold, while iterative optimization techniques essentially start from scratch every time. This global view leads our model to more intuitive solutions and decreases the likelihood of convergence to undesirable local minima. The solutions of our method can also be used as initial guesses for iterative solvers, as illustrated in Appendix D.4. We find that the iterative optimizer with an initial guess converges to solutions that require only $57.4\%$ of the force achieved by the iterative optimizer with default initialization. This illustrates how the more global view of the learned solution manifold can improve the solutions of regular optimization runs.
+
+Splitting the task into prediction and correction ensures that intermediate predicted states are physically plausible and allows us to generalize to new tasks. For example, we can infer transitions involving multiple shapes, despite training only on individual shapes. This is demonstrated in Appendix D.2.
+
+Incompressible fluid with indirect control. The next experiment increases the complexity of the fluid control problem by adding obstacles to the simulated domain and limiting the area that can be controlled by the network. An example sequence in this setting is shown in Figure 6. As before, only the density $\rho$ is observable. Here, the goal is to move the smoke from its initial position near the center into one of the three "buckets" at the top. Control forces can only be applied in the peripheral regions, which are outside the visible smoke distribution. Only by synchronizing the 5000 continuous control parameters can a directed velocity field be constructed in the central region.
+
+We first infer trajectories using a trained CFE network and predictions that move the smoke into the desired bucket in a straight line. This baseline manages to transfer $89\% \pm 2.6\%$ of the smoke into the target bucket. Next we enable the hierarchical predictions and train the OPs. This version manages to maneuver $99.22\% \pm 0.15\%$ of the smoke into the desired buckets while requiring $19.1\% \pm 1.0\%$ less force.
+
+For comparison, Table 3 also lists success rate and execution time for a direct optimization. Despite only obtaining a low success rate of $82\%$ , the shooting method requires several orders of magnitude longer than evaluating our trained model. Since all optimizations are independent of each other, some find better solutions than others, reflected in the higher standard deviation. The increased number of free parameters and complexity of the fluid dynamics to be controlled make this problem intractable for the shooting method, while our model can leverage the learned representation to infer a solution very quickly. Further details are given in Appendix D.3.
+
+# 7 CONCLUSIONS
+
+We have demonstrated that deep learning models in conjunction with a differentiable physics solver can successfully predict the behavior of complex physical systems and learn to control them. The in
+
+Table 3: Comparison of different methods on the task of moving a distribution of smoke into the target region by applying forces outside the region.
+
+| Method | Optimized quantity | Inside target (%) | Inference time (ms) |
| Straight trajectory | CFE | 89.5 ± 2.6 | 31.46 ± 0.20 |
| Staggered predictions | CFE, OPn | 99.22 ± 0.15 | 67.40 ± 0.20 |
| Iterative optim. | Control velocity | 82.1 ± 7.3 | 266.5 · 103 |
+
+production of a hierarchical predictor-corrector architecture allowed the model to learn to reconstruct long sequences by treating the physical behavior on different time scales separately.
+
+We have shown that using a differentiable solver greatly benefits the quality of solutions since the networks can learn how their decisions will affect the future. In our experiments, hierarchical inference schemes outperform traditional sequential agents because they can easily learn to plan ahead.
+
+To model realistic environments, we have introduced observations to our pipeline which restrict the information available to the learning agent. While the PDE solver still requires full state information to run the simulation, this restriction does not apply when the agent is deployed.
+
+While we do not believe that learning approaches will replace iterative optimization, our method shows that it is possible to learn representations of solution manifolds for optimal control trajectories using data-driven approaches. Fast inference is vital in time-critical applications and can also be used in conjunction with classical solvers to speed up convergence and ultimately produce better solutions.
+
+# 8 ACKNOWLEDGEMENTS
+
+This work was supported in part by the ERC Starting Grant realFlow (ERC-2015-StG-637014).
+
+# REFERENCES
+
+Martín Abadi, Paul Barham, Jianmin Chen, Zhifeng Chen, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Geoffrey Irving, Michael Isard, et al. TensorFlow: A system for large-scale machine learning. In Symposium on Operating Systems Design and Implementation, 2016.
+Brandon Amos and J Zico Kolter. OptNet: Differentiable optimization as a layer in neural networks. In ICML, 2017.
+Yohai Bar-Sinai, Stephan Hoyer, Jason Hickey, and Michael P. Brenner. Learning data-driven discretizations for partial differential equations. Proceedings of the National Academy of Sciences, 116(31), 2019.
+George K. Batchelor. An Introduction to Fluid Dynamics. Cambridge University Press, 1967.
+Peter W Battaglia, Jessica B Hamrick, and Joshua B Tenenbaum. Simulation as an engine of physical scene understanding. Proceedings of the National Academy of Sciences, 110(45), 2013.
+Thomas R. Bewley. Flow control: new challenges for a new renaissance. Progress in Aerospace Sciences, 37, 2001.
+Hans Georg Bock and Karl-Josef Plitt. A multiple shooting algorithm for direct solution of optimal control problems. IFAC Proceedings Volumes, 17(2), 1984.
+James Bradbury, Roy Frostig, Peter Hawkins, Matthew James Johnson, Chris Leary, Dougal Maclaurin, and Skye Wanderman-Milne. JAX: Composable transformations of Python+NumPy programs. GitHub, 2018.
+John Bradshaw, Matt J Kusner, Brooks Paige, Marwin HS Segler, and José Miguel Hernández-Lobato. A generative model for electron paths. In ICLR, 2019.
+
+Tian Qi Chen, Yulia Rubanova, Jesse Bettencourt, and David K Duvenaud. Neural ordinary differential equations. In Advances in Neural Information Processing Systems, 2018.
+Alexandre Joel Chorin. The numerical solution of the Navier-Stokes equations for an incompressible fluid. Bulletin of the American Mathematical Society, 73(6), 1967.
+Richard Courant and David Hilbert. Methods of Mathematical Physics, volume II: Partial Differential Equations. Interscience Publishers, 1962.
+Filipe de Avila Belbute-Peres, Kevin Smith, Kelsey Allen, Josh Tenenbaum, and J Zico Kolter. End-to-end differentiable physics for learning and control. In Advances in Neural Information Processing Systems, 2018.
+Jonas Degrave, Michiel Hermans, Joni Dambre, and Francis wyffels. A differentiable physics engine for deep learning in robotics. Frontiers in Neurorobotics, 13, 2019.
+Patrick E Farrell, David A Ham, Simon W Funke, and Marie E Rognes. Automated derivation of the adjoint of high-level transient finite element programs. SIAM Journal on Scientific Computing, 35(4), 2013.
+Ciprian Foias, George R Sell, and Roger Temam. Inertial manifolds for nonlinear evolutionary equations. Journal of Differential Equations, 73(2), 1988.
+David A Fournier, Hans J Skaug, John Noel Archeta, James Ianelli, Arni Magnusson, Mark N Maunder, Anders Nielsen, and John Sibert. Ad model builder: Using automatic differentiation for statistical inference of highly parameterized complex nonlinear models. Optimization Methods and Software, 27(2), 2012.
+Michael B Giles and Niles A Pierce. An introduction to the adjoint approach to design. *Flow, Turbulence and Combustion*, 65, 2000.
+Justin Gilmer, Samuel S. Schoenholz, Patrick F. Riley, Oriol Vinyals, and George E. Dahl. Neural message passing for quantum chemistry. In ICML, 2017.
+Gene H Golub and Charles F Van Loan. Matrix Computations. JHU press, 2012.
+Andreas Griewank and Andrea Walther. Evaluating Derivatives: Principles and Techniques of Algorithmic Differentiation. SIAM, 2nd edition, 2008.
+Andreas Griewank, David Juedes, and Jean Utke. Algorithm 755: ADOL-C: A package for the automatic differentiation of algorithms written in C/C++. ACM Transactions on Mathematical Software (TOMS), 22(2), 1996.
+Charles R Hargraves and Stephen W Paris. Direct trajectory optimization using nonlinear programming and collocation. Journal of Guidance, Control, and Dynamics, 10(4), 1987.
+Francis Harlow and Eddie Welch. Numerical calculation of time-dependent viscous incompressible flow of fluid with free surface. Physics of Fluids, 8(12), 1965.
+Carsten Hartmann, Juan C Latorre, Wei Zhang, and Grigorios A Pavliotis. Optimal control of multiscale systems using reduced-order models. Journal of Computational Dynamics, 1(2), 2014.
+Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016.
+Jun-Ting Hsieh, Shengjia Zhao, Stephan Eismann, Lucia Mirabella, and Stefano Ermon. Learning neural PDE solvers with convergence guarantees. In ICLR, 2019.
+Yuanming Hu, Jiancheng Liu, Andrew Spielberg, Joshua B Tenenbaum, William T Freeman, Jia-jun Wu, Daniela Rus, and Wojciech Matusik. ChainQueen: A real-time differentiable physical simulator for soft robotics. In ICRA, 2019.
+John Ingraham, Adam Riesselman, Chris Sander, and Debora Marks. Learning protein structure with a differentiable simulator. In ICLR, 2019.
+
+Antony Jameson. Aerodynamic design via control theory. Journal of Scientific Computing, 3(3), 1988.
+Dieter Kraft. On converting optimal control problems into nonlinear programming problems. In Computational Mathematical Programming. 1985.
+Lubor Ladicky, SoHyeon Jeong, Barbara Solenthaler, Marc Pollefeys, and Markus Gross. Data-driven fluid simulations using regression forests. ACM Transactions on Graphics (TOG), 34(6), 2015.
+Horace Lamb. Hydrodynamics. Cambridge University Press, 1932.
+Daniel B Leineweber, Irene Bauer, Hans Georg Bock, and Johannes P Schlöder. An efficient multiple shooting based reduced SQP strategy for large-scale dynamic process optimization. Part 1: Theoretical aspects. Computers & Chemical Engineering, 27(2), 2003.
+Randall J. LeVeque. Numerical Methods for Conservation Laws. Springer, 1992.
+Yunzhu Li, Jiajun Wu, Russ Tedrake, Joshua B Tenenbaum, and Antonio Torralba. Learning particle dynamics for manipulating rigid bodies, deformable objects, and fluids. In ICLR, 2019.
+Junbang Liang, Ming C. Lin, and Vladlen Koltun. Differentiable cloth simulation for inverse problems. In Advances in Neural Information Processing Systems, 2019.
+Julia Ling, Andrew Kurzawski, and Jeremy Templeton. Reynolds averaged turbulence modelling using deep neural networks with embedded invariance. Journal of Fluid Mechanics, 807, 2016.
+Jacques Louis Lions. Optimal Control of Systems Governed by Partial Differential Equations. Springer-Verlag, 1971.
+Zichao Long, Yiping Lu, Xianzhong Ma, and Bin Dong. PDE-net: Learning PDEs from data. In ICML, 2018.
+Dougal Maclaurin, David Duvenaud, and Ryan P. Adams. Autograd: Effortless gradients in Numpy. In ICML Workshops, 2015.
+Antoine McNamara, Adrien Treuille, Zoran Popovic, and Jos Stam. Fluid control using the adjoint method. ACM Transactions on Graphics (TOG), 23(3), 2004.
+Arthur Mensch and Mathieu Blondel. Differentiable dynamic programming for structured prediction and attention. In ICML, 2018.
+Jeremy Morton, Antony Jameson, Mykel J Kochenderfer, and Freddie Witherden. Deep dynamical modeling and control of unsteady fluid flows. In Advances in Neural Information Processing Systems, 2018.
+Damian Mrowca, Chengxu Zhuang, Elias Wang, Nick Haber, Fei-Fei Li, Josh Tenenbaum, and Daniel L. Yamins. Flexible neural representation for physics prediction. In Advances in Neural Information Processing Systems, 2018.
+Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, et al. PyTorch: An imperative style, high-performance deep learning library. In Advances in Neural Information Processing Systems, 2019.
+Olivier Pironneau. On optimum design in fluid mechanics. Journal of Fluid Mechanics, 64(1), 1974.
+Lev Semenovich Pontryagin. Mathematical Theory of Optimal Processes. John Wiley, 1962.
+Jovan Popovic, Steven M. Seitz, Michael A. Erdmann, Zoran Popovic, and Andrew P. Witkin. Interactive manipulation of rigid body simulations. In SIGGRAPH, 2000.
+William H Press, Saul A Teukolsky, William T Vetterling, and Brian P Flannery. Numerical Recipes. Cambridge University Press, 3rd edition, 2007.
+
+Maziar Raissi, Alireza Yazdani, and George Karniadakis. Hidden fluid mechanics: A Navier-Stokes informed deep learning framework for assimilating flow visualization data. arXiv:1808.04327, 2018.
+Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-net: Convolutional networks for biomedical image segmentation. In Medical Image Computing and Computer-Assisted Intervention, 2015.
+Connor Schenck and Dieter Fox. SPNets: Differentiable fluid dynamics for deep neural networks. In Conference on Robot Learning, 2018.
+Gordon D Smith. Numerical Solution of Partial Differential Equations: Finite Difference Methods. Oxford University Press, 1985.
+Jos Stam. Stable Fluids. In SIGGRAPH, 1999.
+Edriss S Titi. On approximate inertial manifolds to the Navier-Stokes equations. Journal of Mathematical Analysis and Applications, 149(2), 1990.
+Seiya Tokui, Ryosuke Okuta, Takuya Akiba, Yusuke Niitani, Toru Ogawa, Shunta Saito, Shuju Suzuki, Kota Uenishi, Brian Vogel, and Hiroyuki Yamazaki Vincent. Chainer: A deep learning framework for accelerating the research cycle. In Conference on Knowledge Discovery and Data Mining (KDD), 2019.
+Jonathan Tompson, Kristofer Schlachter, Pablo Sprechmann, and Ken Perlin. Accelerating Eulerian fluid simulation with convolutional networks. In ICML, 2017.
+Marc Toussaint, Kelsey Allen, Kevin Smith, and Joshua B Tenenbaum. Differentiable physics and stable modes for tool-use and manipulation planning. In Robotics: Science and Systems, 2018.
+Adrien Treuille, Antoine McNamara, Zoran Popovic, and Jos Stam. Keyframe control of smoke simulations. ACM Transactions on Graphics (TOG), 22(3), 2003.
+Adrien Treuille, Andrew Lewis, and Zoran Popovic. Model reduction for real-time fluids. ACM Transactions on Graphics (TOG), 25(3), 2006.
+Benjamin Ummenhofer, Lukas Prantl, Nils Thürey, and Vladlen Koltun. Lagrangian fluid simulation with continuous convolutions. In ICLR, 2020.
+Bart van Merrienboer, Dan Moldovan, and Alexander Wiltschko. Tangent: Automatic differentiation using source-code transformation for dynamically typed array programming. In Advances in Neural Information Processing Systems, 2018.
+Hermann von Helmholtz. Über integrale der hydrodynamischen gleichungen, welcher der wirbelbewegungen entsprechen. Journal für Mathematik Bd. LV. Heft, 1:4, 1858.
+Paul J Werbos. Backwards differentiation in AD and neural nets: Past links and new opportunities. In Automatic Differentiation: Applications, Theory, and Implementations. Springer, 2006.
+You Xie, Erik Franz, Mengyu Chu, and Nils Thuerey. tempoGAN: A temporally coherent, volumetric GAN for super-resolution fluid flow. ACM Transactions on Graphics (TOG), 37(4), 2018.
+Kemin Zhou, John C. Doyle, and Keith Glover. Robust and Optimal Control. Prentice Hall, 1996.
+
+# A IMPLEMENTATION DETAILS OF THE DIFFERENTIABLE PDE SOLVER
+
+Our solver is publicly available at https://github.com/tum-pbs/PhiFlow, licensed as MIT. It is implemented via existing machine learning frameworks to benefit from the built-in automatic differentiation and to enable tight integration with neural networks.
+
+For the experiments shown here we used the popular machine learning framework Tensor-Flow (Abadi et al., 2016). However, our solver is written in a framework-independent way and also supports PyTorch (Paszke et al., 2019). Both frameworks allow for a low-level NumPy-like implementation which is well suited for basic PDE building blocks. The following paragraphs outline how we implemented these building blocks and how they can be put together to solve the PDEs shown in Section 6.
+
+Staggered grids. Many of the experiments presented in Section 6 use PDEs which track velocities. We adopt the marker-and-cell method (Harlow & Welch, 1965), storing densities in a regular grid and velocity in a staggered grid. Unlike regular grids, where all components are sampled at the centers of grid cells, staggered grids sample vector fields in a staggered form. Each vector component is sampled in the center of the cell face perpendicular to that direction. This sampling allows for an exact formulation of the divergence of a staggered vector field, decreasing discretization errors in many cases. On the other hand, it complicates operations that combine vector fields with regular fields such as transport or density-dependent forces.
+
+We use staggered grids for the velocities in all of our experiments. The buoyancy operation, which applies an upward force proportional to the smoke density, interpolates the density to the staggered grid. For the transport, also called advection, of regular or staggered fields, we interpolate the staggered field to grid cell centers or face centers, respectively. These interpolations are implemented in TensorFlow using basic tensor operations, similar to the differential operators. We implemented all differential operators that act on vector fields to support staggered grids as well.
+
+Differential operators. For the experiments outlined in this paper, we have implemented the following differential operators:
+
+Gradient of scalar fields in any number of dimensions, $\nabla x$
+- Divergence of regular and staggered vector fields in any number of dimensions, $\nabla \cdot \pmb{x}$
+- Curl of staggered vector fields in 2D and 3D, $\nabla \times \pmb{x}$
+- Laplace of scalar fields in any number of dimensions, $\nabla^2 x$
+
+All differential operators are local operations, i.e. they only act on a small neighbourhood of grid points. In the context of machine learning, this suggests implementing them as convolution operations with a fixed kernel. Indeed, all differential operators can be expressed this way and we have implemented some low-dimensional versions of them using this method.
+
+This method does, however, scale poorly with the dimensionality of the physical system as the convolutional kernels pick up a large number of zeros, thus wasting computations. Therefore, we express n-dimensional differential operators using basic mathematical tensor operations.
+
+Consider the gradient computation in 1D, which results in a staggered grid. Each resulting value is
+
+$$
+(\nabla x) _ {i} = x _ {i} - x _ {i - 1},
+$$
+
+assuming the result is staggered at the lower faces of each grid cell. This operation can be implemented as a 1D convolution with kernel $(-1,1)$ or as a vector operation which subtracts the array from itself, shifted by one element.
+
+In a low-dimensional setting, the convolution operation will be faster as it is highly optimized and can be executed on GPUs with one call. In higher dimensions, however, the vector-based version is faster and more practical because it avoids unnecessary computations and can be coded in a dimension-independent fashion. Both convolutions and basic mathematical operations are supported by all common machine learning frameworks, eliminating the need to implement custom gradient functions.
+
+Advection. PDEs containing material derivatives can be solved using an advection step
+
+$$
+f \leftarrow \operatorname {A d v e c t} [ f, \boldsymbol {v} ]
+$$
+
+which moves each value of a field $f$ in the direction specified by a vector field $v$ . We implement the advection with semi-Lagrangian step (Stam, 1999) that looks back in time and supports regular and staggered vector fields.
+
+To determine the advected value of a grid cell or face $x_{\mathrm{target}}$ , first $\pmb{v}$ is interpolated to that point. Then the origin location is determined by following the vector backwards in time,
+
+$$
+x _ {\text {o r i g i n}} = x _ {\text {t a r g e t}} - \Delta t \cdot \boldsymbol {v} (x _ {\text {t a r g e t}}).
+$$
+
+The final value is determined by linearly interpolating between the neighbouring grid cells around $x_{\mathrm{origin}}$ . All of these operations are, again, implemented using basic mathematical operations. Hence, gradients can be provided by the framework.
+
+Poisson problems. Incompressible fluids, governed by the Navier-Stokes equations, are subject to the hard constraints $\nabla \cdot \boldsymbol{v} = 0$ and $\nabla \times p = 0$ where $p$ denotes the pressure. A numerical solver can achieve this by finding a $p$ such that these constraints are satisfied. This step is often called Chorin Projection, or Helmholtz decomposition, and is closely related to the fundamental theorem of vector calculus (von Helmholtz, 1858; Chorin, 1967). On a grid, solving for $p$ is equal to solving a Poisson problem, i.e. a system of $N$ linear equations, $A p = \nabla \cdot u$ where $N$ is the total number of grid cells. The $(N \cdot N)$ matrix $A$ is sparse and its entries are located at predictable indices.
+
+We numerically solve this Poisson problem with a conjugate gradient (CG) algorithm (Golub & Van Loan, 2012) that iteratively approximates $p$ . Since hundreds of CG steps typically need to be performed for each Poisson solve, it is unfeasible to unroll this chain of iterations, and store all intermediate results in memory.
+
+To ensure that the automatic differentiation chain is not broken, we instead solve the adjoint problem. For the pressure solve operation, the matrix $A$ is symmetric and positive-definite. This causes the adjoint problem to have the same mathematical form (McNamara et al., 2004) as the original problem. Therefore we implement the gradient for the pressure solve by performing a pressure solve on the gradient. We believe that this is a good example of leveraging the methodology of adjoint method optimizations (Giles & Pierce, 2000; Treuille et al., 2006; Pontryagin, 1962) within deep learning. With this formalism we arrive at a differentiable solver framework that closely integrates numerical methods for forward problems with support for inverse problems such as deep learning via the adjoint method.
+
+Solving Burger's equation and the Navier-Stokes equations. Using the basic building blocks outlined above, solving the PDEs becomes relatively simple. Burger's equation involves an advection and a diffusion term which we evaluate independently.
+
+$$
+\operatorname {S o l v e r} [ u ] = \operatorname {D i f f u s e} [ \operatorname {A d v e c t} [ u, u ] ]
+$$
+
+where we explicitly compute $\mathrm{Diffuse}[u] = u + \nu \nabla^2 u$ with viscosity $\nu$ . The advection is semi-Lagrangian with back-tracing as described above.
+
+Solving the Navier-Stokes equations, typically comprises of the following steps:
+
+- Transporting the density, $\rho \gets \operatorname{Advec}[\rho, \pmb{v}]$
+- Transporting the velocity, $\pmb{v} \gets \operatorname{Advec}[\pmb{v}, \pmb{v}]$
+- Applying diffusion if the viscosity is $\nu > 0$ .
+- Applying buoyancy force, $\mathbf{v} \gets \mathbf{v} - \boldsymbol{\beta} \cdot \rho$ with buoyancy direction $\beta$
+- Enforcing incompressibility by solving for the pressure, $p \gets \operatorname{Solve}[Ap = \nabla \cdot \mathbf{v}]$ , then $\mathbf{v} \gets \mathbf{v} - \nabla p$
+
+These steps are executed in this order to advance the simulation forward in time.
+
+# B COMPLEXITY OF EXECUTION SCHEMES
+
+The staggered execution scheme recursively splits a sequence of length $n$ into smaller sequences, as depicted in Fig. 3b and Fig. 7a for $n = 8$ . With each level of recursion depth, the sequence length
+
+
+
+
+Figure 7: OP and CFE+Solver (Sol) executions for a sequence of length 8 performed by (a) the staggered execution scheme, (b) the prediction refinement scheme. The execution order is from top to bottom.
+
+is cut in half and twice as many predictions need to be performed. The maximum depth depends on the sequence length $t_n - t_0$ and the time steps $\Delta t$ performed by the solver,
+
+$$
+d _ {\max } = \log_ {2} \left(\frac {t _ {n} - t _ {0}}{\Delta t}\right) - 1.
+$$
+
+Therefore, the total number of predictions, equal to the number of OP evaluations, is
+
+$$
+N _ {\mathrm {O P}} = 1 + 2 + 4 + \dots + n / 2 = \sum_ {k = 0} ^ {d _ {\max }} 2 ^ {k} = n - 1.
+$$
+
+The prediction refinement scheme performs more predictions, as can be seen in Fig. 7b. To understand the number of OP evaluations, we need to consider the recursive algorithm Reconstruct $\left[\boldsymbol{u}_0,\boldsymbol{o}_n,\boldsymbol{o}_{2n}\right]$ , listed in Alg 1, that reconstructs a sequence or partial sequence of $n$ frames. For the first invocation, the last parameter $\boldsymbol{o}_{2n}$ is absent, but for subsequences, that is not necessarily the case. Each invocation performs one OP evaluation if $\boldsymbol{o}_{2n}$ is absent, otherwise three. By counting the sequences for which this condition is fulfilled, we can compute the total number of network evaluations to be
+
+$$
+N _ {\mathrm {O P}} = 3 \sum_ {k = 0} ^ {d _ {\max}} 2 ^ {k} - 2 \log_ {2} (n) = 3 n - 2 \log_ {2} (n) - 3.
+$$
+
+# C NETWORK ARCHITECTURES AND TRAINING
+
+All neural networks used in this work are based on a modified U-net architecture (Ronneberger et al., 2015). The U-net represents a typical multi-level convolutional network architecture with skip connections, which we modify by using residual blocks (He et al., 2016) instead of regular convolutions for each level. We slightly modify this basic layout for some experiments.
+
+The network used for predicting observations for the fluid example is detailed in Tab. 4. The input to the network are two feature maps containing the current state and the target state. Zero-padding is applied to the input, so that all strided convolutions do not require padding. Next, five residual blocks are executed in order, each decreasing the resolution (1/2, 1/4, 1/8, 1/16, 1/32) while increasing the number of feature maps (4, 8, 16, 16, 16). Each block performs a convolution with kernel size 2 and stride 2, followed by two residual blocks with kernel size 3 and symmetric padding. Inside each
+
+Table 4: Layers comprising the observation predictor network used in the direct fluid control experiment.
+
+| Layer | Resolution | Feature Maps |
| Input | 128 | 2 |
| Pad | 159 | 2 |
| Strided convolution + 2x Residual block | 79 | 4 |
| Strided convolution + 2x Residual block | 39 | 8 |
| Strided convolution + 2x Residual block | 19 | 16 |
| Strided convolution + 2x Residual block | 9 | 16 |
| Strided convolution + 2x Residual block | 4 | 16 |
| 3x Residual block | 4 | 16 |
| Upsample + Concatenate | 8 | 32 |
| Convolution + 2x Residual block | 8 | 16 |
| Upsample + Concatenate | 16 | 32 |
| Convolution + 2x Residual block | 16 | 16 |
| Upsample + Concatenate | 32 | 24 |
| Convolution + 2x Residual block | 32 | 16 |
| Upsample + Concatenate | 64 | 20 |
| Convolution + 2x Residual block | 64 | 16 |
| Upsample + Concatenate | 128 | 18 |
| Convolution | 128 | 1 |
+
+block, the number of feature maps stays constant. Three more residual blocks are executed on the lowest resolution of the bowtie structure, after which the decoder part of the network commences, translating features into spatial content.
+
+The decoder works as follows: Starting with the lowest resolution, the feature maps are upsampled with linear interpolation. The upsampled maps and the output of the previous block of same resolution are then concatenated. Next, a convolution with 16 filters, a kernel size of 2 and symmetric padding, followed by two more residual blocks, is executed. When the original resolution is reached, only one feature map is produced instead of 16, forming the output of the network.
+
+Depending on the dimensionality of the problem, either 1D or 2D convolutions are used. The network used for the indirect control task is modified in the following ways: (i) It produces two output feature maps, representing the velocity $(v_{x}, v_{y})$ . (ii) Four feature maps of the lowest resolution (4x4) are fed into a dense layer producing four output feature maps. These and the other feature maps are concatenated before moving to the upsampling stage. This modification ensures that the receptive field of the network is the whole domain.
+
+All networks were implemented in TensorFlow (Abadi et al., 2016) and trained using the ADAM optimizer on an Nvidia GTX 1080 Ti. We use batch sizes ranging from 4 to 16. Supervised training of all networks converges within a few minutes, for which we iteratively decrease the learning rate from $10^{-3}$ to $10^{-5}$ . We stop supervised training after a few epochs, comprising between 2000 and 10,000 iterations, as the networks usually converge within a fraction of the first epoch.
+
+For training with the differentiable solver, we start with a decreased learning rate of $10^{-4}$ since the backpropagation through long chains is more challenging than training with a supervised loss. Optimization steps are also considerably more expensive since the whole chain needs to be executed, which includes a forward and backward simulation pass. For the fluid examples, an optimization step takes 1-2 seconds to complete for the 2D fluid problems. We let the networks run about 100.000 iterations, which takes between one and two days for the shown examples.
+
+# D DETAILED DESCRIPTION AND ANALYSIS OF THE EXPERIMENTS
+
+In the following paragraphs, we give further details on the experiments of Section 6.
+
+
+Figure 8: Trajectories for example control tasks using Burger's equation. The initial state is plotted in red, the target state in blue. (a) Natural evolution, (b) Ground truth trajectory generated with constant force, (c) CFE with supervised loss, (d) CFE with differentiable physics loss, (e) Reconstruction with supervised loss, (f) Reconstruction with differentiable physics loss and staggered execution, (g) Reconstruction with differentiable physics loss and prediction refinement.
+
+# D.1BURGER'S EQUATION
+
+For this experiment, we simulate Burger's equation (Eq. 6) on a one-dimensional grid with 32 samples over a course of 32 time steps. The typical behavior of Burger's equation in 1D exhibits shock waves that move in $+x$ or $-x$ direction for $u(x) > 0$ or $u(x) < 0$ , respectively. When opposing waves clash, they both weaken until only the stronger wave survives and keeps moving. Examples are shown in Figs. 4a and 8a.
+
+All 32 samples are observable and controllable, i.e. $o(t) = u(t)$ . Thus, we can enforce that all trajectories reach the target state exactly by choosing the force for the last step to be
+
+$$
+F (t _ {n - 1}) = \frac {o ^ {*} - u (t _ {n - 1})}{\Delta t}.
+$$
+
+To measure the quality of a solution, it is therefore sufficient to consider the applied force $\int_{t_0}^{t_*}|F(t)|dt$ which is detailed for the tested methods in Table 1.
+
+Network training. Both for the CFE chains as well as for the observation prediction models, we use the same network architecture, described in Appendix C. We train the networks on 3600 randomly generated scenes with constant driving forces, $F(t) = \mathrm{const}$ . The examples are initialized with two Gaussian waves of random amplitude, size and position, set to clash in the center. In each time step, a constant Gaussian force with the same randomized parameters is applied to the system to steer it away from its natural evolution. Constant forces have a larger impact on the evolution than temporally varying forces since the effects of temporally varying forces can partly cancel out over time. The ground truth sequence can therefore be regarded as a near-perfect but not necessarily
+
+optimal trajectory. Figs. 4d and 8b display such examples. The same trajectories, without any forces applied, are shown in sub-figures (a) for comparison.
+
+We pretrain all networks (OPs or CFE, depending on the method) with a supervised observation loss,
+
+$$
+L _ {o} ^ {\sup } = \left| \mathrm {O P} [ o (t _ {i}), o (t _ {j}) ] - u ^ {\mathrm {G T}} \left(\frac {t _ {i} + t _ {j}}{2}\right) \right| ^ {2}. \tag {8}
+$$
+
+The resulting trajectory after supervised training for the CFE chain is shown in Figure 4b and Figure 8c. For the observation prediction models, the trajectories are shown in Figure 4c and Figure 8e.
+
+After pretraining, we train all OP networks end-to-end with our objective loss function (see Eq. 4), making use of the differentiable solver. For this experiment, we choose the mean squared difference for the observation loss function:
+
+$$
+L _ {o} ^ {*} = \left| o (u (t _ {*})) - o ^ {*} \right| ^ {2}. \tag {9}
+$$
+
+We test both the staggered execution scheme and the prediction refinement scheme, shown in Figure 8f and Figure 8g.
+
+Results. Table 1 compares the resulting forces inferred by different methods. The results are averaged over a set of 100 examples from the test set which is sampled from the same distribution as the training set. The CFE chains both fail to converge to $o^*$ . While the differentiable physics version manages to produce a $u_{n-1}$ that resembles $o^*$ , the supervised version completely deviates from an optimal trajectory. This shows that learning to infer the control force $F(t_i)$ only from $u(t_i)$ , $o^*$ and $t$ is very difficult as the model needs to learn to anticipate the physical behavior over any length of time.
+
+Compared to the CFE chains, the hierarchical models require much less force and learn to converge towards $o^*$ . Still, the supervised training applies much more force to the system than required, the reasons for which become obvious when inspecting Figure 4b and Fig. 8e. While each state seems close to the ground truth individually, the control oscillates undesirably, requiring counter-actions later in time.
+
+The methods using the differentiable solver significantly outperform their supervised counterparts and exhibit an excellent performance that is very close to the ground truth solutions in terms of required forces. On many examples, they even reach the target state with less force than was applied by the ground truth simulation. This would not be possible with the supervised loss alone, but by having access to the gradient-based feedback from the differentiable solver, they can learn to find more efficient trajectories with respect to the objective loss. This allows the networks to learn applying forces in different locations that make the system approach the target state with less force.
+
+Figure 4e and Fig.8f,g show examples of this. The ground truth applies the same force in each step, thereby continuously increasing the first sample $u(x = 0)$ , and the supervised method tries to imitate this behavior. The governing equation then slowly propagates $u(x = 0)$ in positive $x$ direction since $u(x = 0) > 0$ . The learning methods that use a differentiable solver make use of this fact by applying much more force $F(x = 0) > 0$ at this point than the ground truth, even overshooting the target state. Later, when this value had time to propagate to the right, the model corrects this overshoot by applying a negative force $F(x = 0) < 0$ . Using this trick, these models reach the target state with up to $13\%$ less force than the ground truth on the sequence shown in Figure 4.
+
+Figure 9 analyzes the variance of inferred forces. The supervised methods often fail to properly converge to the target state, resulting in large forces in the last step, visible as a second peak in the supervised CFE chain. The formulation of the loss (Eq. 3) suppresses force spikes. In the solutions inferred by our method, the likelihood of large forces falls off multi-exponentially as a consequence. This means that large forces are exponentially rare, which is the expected behavior given the L2 regularizer from Eq. 3.
+
+We also compare our results to a single-shooting baseline which is able to find near-optimal solutions at the cost of higher computation times. The classic optimization uses the ADAM optimizer with a learning rate of 0.01 and converges after around 300 iterations. To reach the quality of the staggered prediction scheme, it requires only around 60 iterations. This quick convergence can be explained by the relatively simple setup that is dominated by linear effects. Therefore, the gradients are stable, even when propagated through many frames.
+
+
+Figure 9: Histogram comparing the frequency of force strengths of different methods, summed over 100 examples from the Burger's experiment.
+
+The computation times, shown in Tab. 1, were recorded on a single GTX 1080 Ti. We run 100 examples in parallel to reduce the relative overhead caused by GPU instruction queuing. For the network-based methods, we average the inference time over 100 runs. We perform 10 runs for the optimization methods.
+
+# D.2 INCOMPRESSIBLE FLUID FLOW
+
+The incompressible Navier-Stokes equations model dynamics of fluids such as water or air, which can develop highly complex and chaotic behavior. The phenomenon of turbulence is generally seen as one of the few remaining fundamental and unsolved problems of classical physics. The challenging nature of the equations indicates that typically a very significant computational effort and a large number of degrees of freedom are required to numerically compute solutions. Here, we target an incompressible two-dimensional gas with viscosity $\nu$ , described by the Navier-Stokes equations for the velocity field $\pmb{v}$ . We assume a constant fluid density throughout the simulation, setting $\rho_{f} = \mathrm{const.} \equiv 1$ . The gas velocity is controllable and, according to Eq. 1, we set
+
+$$
+\mathcal {P} (\boldsymbol {v}, \nabla \boldsymbol {v}) = - (\boldsymbol {v} \cdot \nabla) \boldsymbol {v} + \nu \nabla^ {2} \boldsymbol {v} - \frac {\nabla p}{\rho_ {f}}
+$$
+
+subject to the hard constraints $\nabla \cdot \pmb{v} = 0$ and $\nabla \times p = 0$ . For our experiments, we target fluids with low viscosities, such as air, and set $\nu = 0$ in the equation above as the transport steps implicitly apply numerical diffusion that is on average higher than the targeted one. For fluids with a larger viscosity, the Poisson solver outlined above for computing $p$ could be used to implicitly solve a vector-valued diffusion equation for $\pmb{v}$ .
+
+However, incorporating a significant amount of viscosity would make the control problem easier to solve for most cases, as viscosity suppresses small scale structures in the motion. Hence, in order to create a challenging environment for training our networks, we have but a minimal amount of diffusion in the physical model.
+
+In addition to the velocity field $\pmb{v}$ , we consider a smoke density distribution $\rho$ which moves passively with the fluid. The evolution of $\rho$ is described by the equation $\partial \rho / \partial t = -\boldsymbol{v} \cdot \nabla \rho$ . We treat the velocity field as hidden from observation, letting only the smoke density be observed, i.e. $o(t) = \rho(t)$ . We stack the two fields as $u = (v, \rho)$ to write the system as one PDE, compatible with Eq. 1.
+
+
+(a) Supervised, staggered execution
+
+
+(b) Diff. Physics, staggered execution
+
+
+(c) Diff. Physics, prediction refinement
+Figure 10: Reconstruction of an example natural flow sequence from the test set. The predictions $o^p$ are plotted above the reconstructions $u$ . The target state $o^*$ is shown in the last column of the predictions.
+
+For the OP and CFE networks, we use the 2D network architecture described in Appendix C. Instead of directly generating the velocity update in the CFE network for this problem setup, we make use of stream functions (Lamb, 1932). Hence, the CFE network outputs a vector potential $\Phi$ of which the curl $\nabla \times \Phi$ is used as a velocity update. This setup numerically simplifies the incompressibility condition of the Navier-Stokes equations but retains the same number of effective control parameters.
+
+Datasets. We generate training and test datasets for two distinct tasks: flow reconstruction and shape transition. Both datasets have a resolution of $128 \times 128$ with the velocity fields being sampled in staggered form (see Appendix A). This results in over 16,000 effective continuous control parameters that make up the control force $F(t_{i})$ for each step $i$ .
+
+The flow reconstruction dataset is comprised of ground-truth sequences where the initial states $(\rho_0, \pmb{v}_0)$ are randomly sampled and then simulated for 64 time steps. The resulting smoke density is then taken to be the target state, $o^* \equiv \rho^* = \rho^{\mathrm{sim}}(t_{64})$ . Since we use fully convolutional networks for both CFE and OPs, the open domain boundary must be handled carefully. If smoke was lost from the simulation, because it crossed the outer boundary, a neural network would see the smoke simply vanish unless it was explicitly given the domain size as input. To avoid these problems, we run the simulation backwards in time and remove all smoke from $\rho_0$ that left the simulation domain.
+
+For the shape transition dataset, we sample initial and target states $\rho_0$ and $\rho_*$ by randomly choosing a shape from a library containing ten basic geometric shapes and placing it at a random location inside the domain. These can then be used for reconstructing sequences of any length $n$ . For the results on shape transition presented in section 6, we choose $n = 16$ because all interesting behavior can be seen within that time frame. Due to the linear interpolation used in the advection step (see Appendix A), both $\rho$ and $\pmb{v}$ smear out over time. This numerical limitation makes it impossible to match target states exactly in this task as the density will become blurry over time. While we could generate ground-truth sequences using a classical optimizer, we refrain from doing so because (i) these trajectories are not guaranteed to be optimal and (ii) we want to see how well the model can learn from scratch, without initialization.
+
+Training. We pretrain the CFE on the natural flow dataset with a supervised loss,
+
+$$
+L _ {\sup } ^ {C F E} (\boldsymbol {u} (t)) = \left| \boldsymbol {v} _ {\boldsymbol {u} (t)} + \boldsymbol {F} (t) - \boldsymbol {v} ^ {*} (t) \right| ^ {2}
+$$
+
+where $\boldsymbol{v}^{*}(t)$ denotes the velocity from ground truth sequences. This supervised training alone constitutes a good loss for the CFE as it only needs to consider single-step intervals $\Delta t$ while the OPs handle longer sequences. Nevertheless, we found that using the differentiable solver with an observation loss,
+
+$$
+L _ {\boldsymbol {o}} ^ {\mathrm {C F E}} = \left| B _ {r} (\boldsymbol {o} ^ {*}) - B _ {r} \left(\operatorname {S o l v e r} [ \boldsymbol {u} + \mathrm {C F E} [ \boldsymbol {u}, \boldsymbol {o} ^ {*} ] ]\right) \right| ^ {2},
+$$
+
+further improves the accuracy of the inferred force without sacrificing the ground truth match. Here $B_{r}(x)$ denotes a blur function with a kernel of the form $\frac{1}{1 + x / r}$ . The blur helps make the gradients smoother and creates non-zero gradients in places where prediction and target do not overlap. During training, we start with a large radius of $r = 16\Delta x$ for $B_{r}$ and successively decrease it to $r = 2\Delta x$ . We choose $\alpha$ such that $L_{F}$ and $L_{o}^{*}$ are of the same magnitude when the force loss spikes (see Fig. 15).
+
+After the CFE is trained, we successively train the OPs starting with the smallest time scale. For the OPs, we train different models for natural flow reconstruction and shape transition, both based on the same CFE model. We pre-train all OPs independently with a supervised observation loss before jointly training them end-to-end with objective loss function (Eq. 4) and the differentiable solver to find the optimal trajectory. We use the OPs trained with the staggered execution scheme as initialization for the prediction refinement scheme. The complexity of solving the Navier-Stokes equations over many time steps in this example requires such a fully supervised initialization step. Without it, this setting is so non-linear that the learning process does not converge to a good solution. Hence, it illustrates the importance of combining supervised and unsupervised (requiring differentiable physics) training for challenging learning objectives.
+
+A comparison of the different losses is shown in Fig. 10. The predictions, shown in the top rows of each subfigure, illustrate the differences between the three methods. The supervised predictions, especially the long-term predictions (central images), are blurry because the network learns to average over all ground truth sequences that match the given initial and target state. The differentiable
+
+
+(a) Predicted trajectory
+
+
+
+
+
+
+
+
+(b) Reconstructed trajectory
+
+
+Figure 11: Reconstruction of multiple shapes using prediction refinement. The CFE is trained on the natural flow dataset and OPs are trained on single-shape transitions. The predictions of all shapes are added and passed to the CFE as one prediction.
+
+
+
+
+
+
+
+physics solver largely resolves this issue. The predictions are much sharper but the long-term predictions still do not account for short-term deviations. This can be seen in the central prediction of Fig. 10b which shows hints of the target state $\boldsymbol{o}^*$ , despite the fact that the actual reconstruction $\boldsymbol{u}$ cannot reach that state at that time. The refined prediction, shown in subfigure (c), is closer to $\boldsymbol{u}$ since it is conditioned on the previous reconstructed state.
+
+In the training data, we let the network transform one shape into another at a random location. The differentiable solver and the long-term intuition provided by our execution scheme make it possible to train networks that can infer accurate sequences of control forces. In most cases, the target shapes are closely matched. As our networks infer sequences over time, we refer readers to the supplemental material (https://ge.in.tum.de/publications/2020-iclr-holl), which contains animations of additional sequences.
+
+Generalization to multiple shapes. Splitting the reconstruction task into prediction and correction has the additional benefit of having full access to the intermediate predictions $\pmb{o}^p$ . These model real states of the system so classical processing or filter operations can be applied to them as well. We demonstrate this by generalizing our method to $m > 1$ shapes that evolve within the same domain. Figure 11 shows an example of two weakly-interacting shape transitions. We implement this by executing the OPs independently for each transition $k \in \{1,2,\dots,m\}$ while inferring the control force $F(t)$ on the joint system. This is achieved by adding the predictions of the smoke density $\rho$ before passing it to the CFE network, $\tilde{\pmb{o}}^p = \sum_{k=1}^{m} \pmb{o}_k^p$ . The resulting force is then applied to all sequences individually so that smoke from one transition does not end up in another target state. Using this scheme, we can define start and end positions for arbitrarily many shapes and let them evolve together.
+
+Evaluation of force strengths The average force strengths are detailed in Tab. 2 while Figure 12 gives a more detailed analysis of the force strengths. As expected from using a L2 regularizer on the force, large values are exponentially rare in the solutions inferred from our test set. None of the hierarchical execution schemes exhibit large outliers. The prediction refinement requires the least amount of force to match the target, slightly ahead of the staggered execution trained with the same loss. The supervised training produces trajectories with reduced continuity that result in larger forces being applied.
+
+# D.3 INCOMPRESSIBLE FLUID WITH INDIRECT CONTROL
+
+As a fourth test environment, we target a case with increased complexity, where the network does not have the means anymore to directly control the full fluid volume. Instead, the network can only apply forces in the peripheral regions, with a total of more than 5000 control parameters per step. The obstacles prevent fluid from passing through them and the domain is enclosed with solid boundaries from the left, right and bottom. This leads to additional hard constraints and interplays between constraints in the physical model, and as such provides an interesting and challenging test case for our method. The domain has three target regions (buckets) separated by walls at the top of the domain, into which a volume of smoke should be transported from any position in the center
+
+
+Figure 12: Histogram comparing the frequency of force strengths applied in the direct fluid control experiment on the natural flow dataset, summed over 100 examples.
+
+
+
+
+
+
+
+
+Figure 13: Two reconstructed trajectories from the test set of the indirect smoke control problem.
+
+
+
+
+
+
+Figure 14: Iterative optimization of the indirect incompressible fluid control problem. The graph shows the fraction of smoke that ends up in the correct bucket vs number of optimization steps, averaged over 10 examples.
+
+part. Both initial position and the target bucket are randomized for our training set of 3600 examples and test set of 100 examples. Each sequence consists of 16 time steps.
+
+In this case the control is indirect since the smoke density lies outside the controlled area at all times. Only the incompressibility condition allows the network to influence the velocity outside the controlled area. This forces the model to consider the global context and synchronize a large number of parameters to create a desired flow field. The requirement of complex synchronized force fields makes generating reliable training data difficult, as manual or random sampling is unlikely to produce a directed velocity field in the center. We therefore skip the pretraining process and directly train the CFE using the differentiable solver, while the OP networks are trained as before with $r = 2\Delta x$ .
+
+To evaluate how well the learning method performs, we measure how much of the smoke density ends up inside the buckets and how much force was applied in total. For reference, we replace the observation predictions with an algorithm that moves the smoke towards the bucket in a straight line. Averaged over 100 examples from the test set, the resulting model manages to put $89\% \pm 2.6\%$ of the smoke into the target bucket. In contrast, the model trained with our full algorithm moves $99.22\% \pm 0.15\%$ of the smoke into the target buckets while requiring $19.1\% \pm 1.0\%$ less force.
+
+We also compare our method to an iterative optimization which directly optimizes the control velocities. We use the ADAM optimizer with a learning rate of 0.1. Despite the highly non-linear setup, the gradients are stable enough to quickly let the smoke flow in the right direction. Fig. 14 shows how the trajectories improve during optimization. After around 60 optimization steps, the smoke distribution starts reaching the target bucket in some examples. Over the next 600 iterations, it converges to a configuration in which $82.1 \pm 7.3$ of the smoke ends up in the correct bucket.
+
+# D.4 COMPARISON TO SHOOTING METHODS
+
+We compare the sequences inferred by our trained models to classical shooting optimizations using our differentiable physics solver to directly optimize $F(t)$ with the objective loss $L$ (Eq. 4) for a single input. We make use of stream functions (Lamb, 1932), as in the second experiment, to ensure the incompressibility condition is fulfilled. For this comparison, the velocities of all steps are initialized with a normal distribution with $\mu = 0$ and $\sigma = 0.01$ so that the initial trajectory does not significantly alter the initial state, $u(t) \approx u(t_0)$ .
+
+We first show how a simple single-shooting algorithm (Zhou et al., 1996) fares with our Navier-Stokes setup. When solving the resulting optimization problem using single-shooting, strong artifacts in the reconstructions can be observed, as shown in Figure 17a. This undesirable behavior stems from the nonlinearity of the Navier-Stokes equations, which causes the gradients $\Delta u \gg 0$ to become noisy and unreliable when they are recurrently backpropagated through many time steps. Unsurprisingly, the single-shooting optimizer converges to a undesirable local minimum.
+
+As single-shooting is well known to have problems with non-trivial problem settings, we employ a multi-scale shooting (MS) method (Hartmann et al., 2014). This solver first computes the trajectory on a coarsely discretized version of the problem before iteratively refining the discretization. For
+
+
+Figure 15: Mean convergence curves of the adjoint method optimization for 100 shape transitions.
+
+
+
+
+Figure 16: Mean convergence curves of the adjoint method optimization for 100 shape transitions, taking the reconstruction from the refinement scheme as initial guess.
+
+
+
+the first resolution, we use 1/16 of the original width and height which both reduces the number of control parameters and reduces nonlinear effects from the physics model. By employing an exponential learning rate decay, this multi-scale optimization converges reliably for all examples. We use the ADAM optimizer to compute the control variable updates from the gradients of the differentiable Navier-Stokes solver.
+
+An averaged set of representative convergence curves for this setup is shown in Figure 15. The objective loss (Eq. 4) is shown in its decomposed state as the sum of the observation loss $L_{o}^{*}$ , shown in Figure 15a, and the force loss $L_{F}$ , shown in Figure 15b. Due to the initialization of all velocities with small values, the force loss starts out small. For the first 1000 iteration steps, $L_{o}^{*}$ dominates which causes the system to move towards the target state $o^{*}$ . This trajectory is not ideal, however, as more force than necessary is applied. Once observation loss and force loss are of the same magnitude, the optimization refines the trajectory to use less force.
+
+We found that the trajectories predicted by our neural network based method correspond to performing about 1500 steps with the MS optimization while requiring less tuning. Reconstructed of the same example are compared in Figure 17. Performing the MS optimization up to this point took 131 seconds on a GTX 1080 Ti graphics card for a single 16-frame sequence while the network inference ran for 0.5 seconds. For longer sequences, this gap grows further because the network inference time scales with $\mathcal{O}(n)$ . This could only be matched if the number of iterations for the MS optimization scaled with $O(1)$ , which is not the case for most problems. These tests indicate that our model has successfully internalized the behavior of a large class of physical behavior, and can exert the right amount of force to reach the intended goal. The large number of iterations required for the single-case shooting optimization highlights the complexity of the individual solutions.
+
+Interestingly, the network also benefits from the much more difficult task to learn a whole manifold of solutions: comparing solutions with similar observation loss for the MS algorithm and our network, the former often finds solutions that are unintuitive and contain noticeable detours, e.g., not taking a straight path for the density matching examples of Fig. 5. In such situations, our network benefits from having to represent the solution manifold, instead of aiming for single task optimizations. As the solutions are changing relatively smoothly, the complex task effectively regularizes the inference of new solutions and gives the network a more global view. Instead, the shooting optimization
+
+
+(a) Classical optimization
+
+
+(b) Classical optimization with multi-resolution
+
+
+(c) Diff. physics, prediction refinement
+Figure 17: Example reconstruction of a shape transition. (a) Direct shooting optimization, 2300 iterations, (b) multi-scale shooting optimization, 1500 iterations, (c) output of our neural network based method with prediction refinement. Our model infers the shown solution in a single pass, and generalizes to a large class of inputs.
+
+tions have to purely rely on local gradients for single-shooting or manually crafted multi-resolution schemes for MS.
+
+Our method can also be employed to support the MS optimization by initializing it with the velocities inferred by the networks. In this case, shown in Figure 16, both $L_{o}^{*}$ and $L_{F}$ decrease right from the beginning, similar to the behavior in Figure 15 from iteration 1500 on. The reconstructed trajectory from the neural-network-based method is so close to the optimum that the multi-resolution approach described above is not necessary.
+
+# D.5 ADDITIONAL RESULTS
+
+In Fig. 18, we provide a visual overview of a sub-set of the sequences that can be found in the supplemental materials. It contains 16 randomly selected reconstructions for each of the natural flow, the shape transitions, and the indirect control examples. In addition, the supplemental material, available at https://ge.in.tum.de/publications/2020-iclr-holl, highlights the differences between unsupervised, staggered, and refined versions of our approach.
+
+
+(a) Natural flow
+
+
+(b) Shape transition
+Figure 18: Five additional sequences from the test sets of the natural flow and shape transition setups. The first nine frames contain frames from our reconstruction. The far right image shows the target.
\ No newline at end of file
diff --git a/learningtocontrolpdeswithdifferentiablephysics/images.zip b/learningtocontrolpdeswithdifferentiablephysics/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..47c439f6b397f9d93adf9963a5f8bf654b995b47
--- /dev/null
+++ b/learningtocontrolpdeswithdifferentiablephysics/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:7c9707905feae7aa655d4c76d1a95b367300ea8dae1b898f95cb42beb01d8f86
+size 1071671
diff --git a/learningtocontrolpdeswithdifferentiablephysics/layout.json b/learningtocontrolpdeswithdifferentiablephysics/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..979864b196afb173fd35eb18ca543bf016e1110e
--- /dev/null
+++ b/learningtocontrolpdeswithdifferentiablephysics/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:63629087c4e25e982a146ecdfd7f28495dedb488243a953674cd1bb4e90553e0
+size 873570
diff --git a/learningtoplaninhighdimensionsvianeuralexplorationexploitationtrees/5ae0aef2-900d-4e35-953b-fd1cef037f55_content_list.json b/learningtoplaninhighdimensionsvianeuralexplorationexploitationtrees/5ae0aef2-900d-4e35-953b-fd1cef037f55_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..02bec19564ae2729b2aa630ae778cc0d3e021bb8
--- /dev/null
+++ b/learningtoplaninhighdimensionsvianeuralexplorationexploitationtrees/5ae0aef2-900d-4e35-953b-fd1cef037f55_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c939a33f09fdfbe419e48fb38ee718da0090306925c6f046a7be46ce6d5594c2
+size 151940
diff --git a/learningtoplaninhighdimensionsvianeuralexplorationexploitationtrees/5ae0aef2-900d-4e35-953b-fd1cef037f55_model.json b/learningtoplaninhighdimensionsvianeuralexplorationexploitationtrees/5ae0aef2-900d-4e35-953b-fd1cef037f55_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..960875a98ae44021311b124662fa2fd7b0a3e5f2
--- /dev/null
+++ b/learningtoplaninhighdimensionsvianeuralexplorationexploitationtrees/5ae0aef2-900d-4e35-953b-fd1cef037f55_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b508870f03e44aba7b3ea627a6f2c01990dfb4e777037efe4736a27565ffb137
+size 181061
diff --git a/learningtoplaninhighdimensionsvianeuralexplorationexploitationtrees/5ae0aef2-900d-4e35-953b-fd1cef037f55_origin.pdf b/learningtoplaninhighdimensionsvianeuralexplorationexploitationtrees/5ae0aef2-900d-4e35-953b-fd1cef037f55_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..8c091f0c140a1f7699255ef86f07400a3d9cbe2f
--- /dev/null
+++ b/learningtoplaninhighdimensionsvianeuralexplorationexploitationtrees/5ae0aef2-900d-4e35-953b-fd1cef037f55_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:6e2e179aa13b4d6f2906f91dece4c3e0aa8198091811e9f69febeb2aeff5e0a1
+size 10792106
diff --git a/learningtoplaninhighdimensionsvianeuralexplorationexploitationtrees/full.md b/learningtoplaninhighdimensionsvianeuralexplorationexploitationtrees/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..28febf9cf1367f2280703f4099611c399fbb2fb8
--- /dev/null
+++ b/learningtoplaninhighdimensionsvianeuralexplorationexploitationtrees/full.md
@@ -0,0 +1,676 @@
+# LEARNING TO PLAN IN HIGH DIMENSIONS VIA NEURAL EXPLORATION-EXPLOITATION TREES
+
+*Binghong Chen1, *Bo Dai2, Qinjie Lin3, Guo Ye3, Han Liu3, Le Song1,4
+
+1Georgia Institute of Technology 2Google Research, Brain Team
+
+$^{3}$ Northwestern University $^{4}$ Ant Financial
+
+# ABSTRACT
+
+We propose a meta path planning algorithm named Neural Exploration-Exploitation Trees (NEXT) for learning from prior experience for solving new path planning problems in high dimensional continuous state and action spaces. Compared to more classical sampling-based methods like RRT, our approach achieves much better sample efficiency in high-dimensions and can benefit from prior experience of planning in similar environments. More specifically, NEXT exploits a novel neural architecture which can learn promising search directions from problem structures. The learned prior is then integrated into a UCB-type algorithm to achieve an online balance between exploration and exploitation when solving a new problem. We conduct thorough experiments to show that NEXT accomplishes new planning problems with more compact search trees and significantly outperforms state-of-the-art methods on several benchmarks.
+
+# 1 INTRODUCTION
+
+Path planning is a fundamental problem with many real-world applications, such as robot manipulation and autonomous driving. A simple planning problem within low-dimensional state space can be solved by first discretizing the continuous state space into a grid, and then searching for a path on top of it using graph search algorithms such as $A^{*}$ (Hart et al., 1968). However, due to the curse of dimensionality, these approaches do not scale well with the number of dimensions of the state space. For high-dimensional planning problems, people often resort to sampling-based approaches to avoid explicit discretization. Sampling-based planning algorithms, such as probabilistic roadmaps (PRM) (Kavraki et al., 1996), rapidly-exploring random trees (RRT) (LaValle, 1998), and their variants (Karaman & Frazzoli, 2011) incrementally build an implicit representation of the state space using probing samples. These generic algorithms typically employ a uniform sampler which does not make use of the structures of the problem. Therefore they may require lots of samples to obtain a feasible solution for complicated problems. To improve the sample efficiency, heuristic biased samplers, such as Gaussian sampler (Boor et al., 1999), bridge test (Hsu et al., 2003) and reachability-guided sampler (Shkolnik et al., 2009) have been proposed. All these sampling heuristics are designed manually to address specific structural properties, which may or may not be valid for a new problem, and may lead to even worse performance compared to the uniform proposal.
+
+Online adaptation in path planning has also been investigated for improving sample efficiency in current planning problem. Specifically, Hsu et al. (2005) exploits online algorithms to dynamically adapts the mixture weights of several manually designed biased samplers. Burns & Brock (2005a;b) fit a model for the planning environment incrementally and use the model for planning. Yee et al. (2016) mimics the Monte-Carlos tree search (MCTS) for problems with continuous state and action spaces. These algorithms treat each planning problem independently, and the collected data from previous experiences and built model will be simply discarded when solving a new problem. However, in practice, similar planning problems may be solved again and again, where the problems are different but sharing common structures. For instance, grabbing a coffee cup on a table at different time are different problems, since the layout of paper and pens, the position and orientation of coffee cups may be different every time; however, all these problems show common structures of handling similar objects which are placed in similar fashions. Intuitively, if the common characteristics across problems can be learned via some shared latent representation, a planner based on such representation can then be transferred to new problems with improved sample efficiency.
+
+Several methods have been proposed recently to learn from past planning experiences to conduct more efficient and generalizable planning for future problems. These works are limited in one way or the other. Zucker et al. (2008); Zhang et al. (2018); Huh & Lee (2018) treat the sampler in the sampling-based planner as a stochastic policy to be learned and apply policy gradient or TD-algorithm to improve the policy. Finney et al. (2007); Bowen & Alterovitz (2014); Ye & Alterovitz (2017); Ichter et al. (2018); Kim et al. (2018); Kuo et al. (2018) apply imitation learning based on the collected demonstrations to bias for better sampler via variants of probabilistic models, e.g., (mixture of) Gaussians, conditional VAE, GAN, HMM and RNN. However, many of these approaches either rely on specially designed local features or assume the problems are indexed by special parameters, which limits the generalization ability. Deep representation learning provides a promising direction to extract the common structure among the planning problems, and thus mitigate such limitation on hand-designed features. However, existing work, e.g., motion planning networks (Qureshi et al., 2019), value iteration networks (VIN) (Tamar et al., 2016), and gated path planning networks (GPPN) (Lee et al., 2018), either apply off-the-shelf MLP architecture ignoring special structures in planning problems or can only deal with discrete state and action spaces in low-dimensional settings.
+
+In this paper, we present Neural EXploration-EXploitation Tree (NEXT), a meta neural path planning algorithm for high-dimensional continuous state space problems. The core contribution is a novel attention-based neural architecture that is capable of learning generalizable problem structures from previous experiences and produce promising search directions with automatic online exploration-exploitation balance adaption. Compared to existing learning-based planners,
+
+- NEXT is more generic. We propose an architecture that can embed high dimensional continuous state spaces into low dimensional discrete spaces, on which a neural planning module is used to extract planning representation. These modules will be learned end-to-end.
+- NEXT balances exploration-exploitation trade-off. We integrate the learned neural prior into an upper confidence bound (UCB) style algorithm to achieve an online balance between exploration and exploitation when solving a new problem.
+
+Empirically, we show that NEXT can exploit past experiences to reduce the number of required samples drastically for solving new planning problems, and significantly outperforms previous state-of-the-arts on several benchmark tasks.
+
+# 1.1 RELATED WORKS
+
+Designing non-uniform sampling strategies for random search to improve the planning efficiency has been considered as we discussed above. Besides the mentioned algorithms, there are other works along this line, including informed RRT* (Gammell et al., 2014) and batch informed Trees (BIT*) (Gammell et al., 2015) as the representative work. Randomized $A^*$ (Diankov & Kuffner, 2007) and sampling-based $A^*$ (Persson & Sharf, 2014) expand the search tree with hand-designed heuristics. These methods incorporate the human prior knowledge via hard-coded rules, which is fixed and unable to adapt to problems, and thus, may not universally applicable. Choudhury et al. (2018); Song et al. (2018) attempt to learn search heuristics. However, both methods are restricted to planning on discrete domains. Meanwhile, the latter one always employs an unnecessary hierarchical structure for path planning, which leads to inferior sample efficiency and extra computation.
+
+The online exploration-exploitation trade-off is also an important issue in planning. For instance, Rickert et al. (2009) constructs a potential field sampler and tuned the sampler variance based on collision rate for the trade-off heuristically. Paxton et al. (2017) separates the action space into high-level discrete options and low-level continuous actions, and only considered the trade-off at the discrete option level, ignoring the exploration-exploitation in the fine action space. These existing works address the trade-off in an ad-hoc way, which may be inferior for the balance.
+
+There have been several non-learning-based planning methods that can also leverage experiences (Kavraki et al., 1996; Phillips et al., 2012) by utilizing search graphs created in previous problems. However, they are designed for largely fixed obstacles and cannot be generalized to unseen tasks from the same planning problems distribution.
+
+# 2 SETTINGS FOR LEARNING TO PLAN
+
+Let $S \subseteq \mathbb{R}^q$ be the state space of the problem, e.g., all the configurations of a robot and its base location in the workspace, $S_{obs} \subsetneq S$ be the obstacles set, $S_{free} := S \setminus S_{obs}$ be the free space, $s_{init} \in S_{free}$ be the initial state and $S_{goal} \subsetneq S_{free}$ be the goal region. Then the space of all collision-free paths can be defined as a continuous function $\Xi := \{\xi(\cdot): [0,1] \to S_{free}\}$ . Let $c(\cdot): \Xi \mapsto \mathbb{R}$
+
+be the cost functional over a path. The optimal path planning problem is to find the optimal path in terms of cost $c(\cdot)$ from start $s_{init}$ to goal $S_{goal}$ in free space $S_{free}$ , i.e.,
+
+$$
+\xi^ {*} = \operatorname {a r g m i n} _ {\xi \in \Xi} c (\xi), \quad \text {s . t .} \xi (0) = s _ {\text {i n i t}}, \xi (1) \in \mathcal {S} _ {\text {g o a l}}. \tag {1}
+$$
+
+Traditionally (Karaman & Frazzoli, 2011), the planner has direct access to $(s_{init}, S_{goal}, c(\cdot))$ and the workspace map (Ichter et al., 2018; Tamar et al., 2016; Lee et al., 2018), $\mathrm{map}(\cdot): \mathbb{R}^2$ or $\mathbb{R}^3 \mapsto \{0,1\}$ , (0: free spaces and 1: obstacles). Since $S_{free}$ often has a very irregular geometry (illustrated in Figure 10 in Appendix A), it is usually represented via a collision detection module which is able to detect the obstacles in a path segment. For the same reason, the feasible paths in $\Xi$ are hard to be described in parametric forms, and thus, the nonparametric $\xi$ , such as a sequence of interconnected path segments $[s_0, s_1], [s_1, s_2], \ldots, [s_{T-1}, s_T] \subset S$ with $\xi(0) = s_0 = s_{init}$ and $\xi(1) = s_T$ , is used with an additive cost $\sum_{i=1}^{T} c([s_{i-1}, s_i])$ .
+
+Assuming given the planning problems $\{U_i\coloneqq (s_{init},S_{goal},S,S_{free},\mathsf{map},c(\cdot))\}_{i = 1}^N$ sampled from some distribution $\mathcal{U}$ , we are interested in learning an algorithm $\mathsf{alg}(\cdot)$ , which can produce the (nearly)-optimal path efficiently from the observed planning problems. Formally, the learning to plan is defined as
+
+$$
+\operatorname {a l g} ^ {*} (\cdot) = \operatorname {a r g m i n} _ {\operatorname {a l g} \in \mathcal {A}} \mathbb {E} _ {U \in \mathcal {U}} [ \ell (\operatorname {a l g} (U)) ], \tag {2}
+$$
+
+where $\mathcal{A}$ denotes the planning algorithm family, and $\ell(\cdot)$ denotes some loss function which evaluates the quality of the generated path and the efficiency of the $\mathsf{alg}(\cdot)$ , e.g., size of the search tree. We elaborate each component in Eq (2) in the following sections. We first introduce the tree-based sampling algorithm template in Section 3, upon which we instantiate the $\mathsf{alg}(\cdot)$ via a novel attention-based neural parametrization in Section 4.2 with exploration-exploitation balance mechanism in Section 4.1. We design the $\ell$ -loss function and the meta learning algorithm in Section 4.3. Composing every component together, we obtain the neural exploration-exploitation trees (NEXT) which achieves outstanding performances in Section 5.
+
+
+Figure 1: Illustration of NEXT. In each epoch, NEXT is executed on a randomly generated planning problem. The search tree grows with $\tilde{V}^*$ and $\tilde{\pi}^*$ guidance. $\{\hat{V}^*,\tilde{\pi}^*\}$ will be updated according to the successful path. Such planning and learning iteration is continued interactively.
+
+# 3 PRELIMINARIES
+
+The sampling-based planners are more practical and become dominant for high-dimensional path planning problems (Elbanhawi & Simic, 2014). We describe a unifying view for many existing tree-based sampling algorithms (TSA), which we will also base our algorithm upon. More specifically, this family of algorithms maintain a search tree $\mathcal{T}$ rooted at the initial point $s_{init}$ and connecting all sampled points $\mathcal{V}$ in the configuration space with edge set $\mathcal{E}$ . The tree will be expanded by incorporating more sampled states until some leaf reaches $S_{goal}$ . Then, a feasible solution for the path planning
+
+# Algorithm 1: Tree-based Sampling Algorithm
+
+1 Problem: $U = (s_{init},\mathcal{S}_{goal},\mathcal{S},\mathcal{S}_{free},\mathsf{map},c(\cdot));$ 2 Initialize $\mathcal{T} = (\mathcal{V},\mathcal{E})$ with $\mathcal{V}\gets \{s_{init}\}$ $\mathcal{E}\gets \emptyset$
+
+# for $t\gets 0$ to $T$ do
+
+$s_{parent}, s_{new} \gets \text{Expand}(\mathcal{T}, U)$ ;
+if ObstacleFree $s_{parent}, s_{new}$ then
+\[
+\begin{array}{c}
+\mathcal{V} \gets \mathcal{V} \cup \{s_{new}\} \text{ and} \\
+\mathcal{E} \gets \mathcal{E} \cup \{[s_{parent}, s_{new}]\}; \\
+\mathcal{T} \gets \text{Postprocess}(\mathcal{T}, U);
+\end{array}
+\]
+Optional
+
+if $s_{new}\in S_{goal}$ then return $\mathcal{T}$
+
+problem will be extracted based on the tree $\mathcal{T}$ . The template of tree-based sampling algorithms is summarized in Algorithm 1 and illustrated in Fig. 1(c). A key component of the algorithm is the Expand operator, which generates the next exploration point $s_{new}$ and its parent $s_{parent} \in \mathcal{V}$ . To ensure the feasibility of the solution, the $s_{new}$ must be reachable from $\mathcal{T}$ , i.e., $[s_{parent}, s_{new}]$ is collision-free, which is checked by a collision detection function. As we will discuss in Appendix B, by instantiating different Expand operators, we will arrive at many existing algorithms, such as RRT (LaValle, 1998) and EST (Hsu et al., 1997; Phillips et al., 2004).
+
+One major limitation of existing TSAs is that they solve each problem independently from scratch and ignore past planning experiences in similar environments. We introduce the neural components into TSA template to form the learnable planning algorithm family $\mathcal{A}$ , which can explicitly take advantages of the past successful experiences to bias the Expand towards more promising regions.
+
+# 4 NEURAL EXPLORATION-EXPLOITATION TREES
+
+Based on the TSA framework, we introduce a learnable neural based Expand operator, which can balance between exploration and exploitation, to instantiate $\mathcal{A}$ in Eq (2). With the self-improving training, we obtain the meta NEXT algorithm illustrated in Figure 1.
+
+# 4.1 GUIDED PROGRESSIVE EXPANSION
+
+We start with our design of the Expand. We assume having an estimated value function $\tilde{V}^{*}(s|U)$ , which stands for the optimal cost from $s$ to target in planning problem $U$ , and a policy $\tilde{\pi}^{*}(s'|s,U)$ which generates the promising action $s'$ from state $s$ . The concrete parametriza
+
+Algorithm 2: NEXT :: Expand $(\mathcal{T} = (\mathcal{V},\mathcal{E}),U)$ $s_{parent}\gets \mathrm{argmax}_{s\in \mathcal{V}}\phi (s);$ $>$ Selection
+ $\{s_1,\dots ,s_k\} \stackrel {id.}{\sim}\tilde{\pi}^* (s'|s_{parent},U);$ $>$ Candidates
+ $s_{new}\gets \mathrm{argmax}_{s'\in \{s_1,\ldots ,s_k\}}\phi (s');$ $>$ Expansion
+return $s_{parent},s_{new};$
+
+tion of $\tilde{V}^*$ and $\tilde{\pi}^*$ will be explained in Section 4.2 and learned in Section 4.3. We will use these functions to construct the learnable Expand with explicit exploration-exploitation balancing.
+
+The Expand operator will expand the current search tree $\mathcal{T}$ by a new neighboring state $s_{new}$ around $\mathcal{T}$ . We design the expansion as a two-step procedure: (i) select a state $s_{parent}$ from existing tree $\mathcal{T}$ ; (ii) expand a state $s_{new}$ in the neighborhood of $s_{parent}$ . More specifically,
+
+Selecting $s_{\text{parent}}$ from $\mathcal{T}$ in step (i). Consider the negative value function $-\tilde{V}^*(s|U)$ as the rewards $r(s)$ , step (i) shares some similarity with the multi-armed bandit problem by viewing existing nodes $s \in \mathcal{V}$ as arms. However, the vanilla UCB algorithm is not directly applicable, since the number of states is increasing as the algorithm proceeds and the value of these adjacent states are naturally correlated. We address this challenge by modeling the correlation explicitly as in contextual bandits. Specifically, we parametrize the UCB of the reward function as $\phi(s)$ , and select a node from $\mathcal{T}$ according to $\phi(s)$
+
+$$
+s _ {\text {p a r e n t}} = \operatorname {a r g m a x} _ {s \in \mathcal {V}} \phi (s) := \bar {r} _ {t} (s) + \lambda \sigma_ {t} (s), \tag {3}
+$$
+
+where $\bar{r}_t$ and $\sigma_t$ denote the average reward and variance estimator after $t$ -calls to Expand. Denote the sequence of $t$ selected tree nodes so far as $S_t = \{s_{parent}^1, \ldots, s_{parent}^t\}$ , then we can use kernel
+
+smoothing estimator for $\bar{r}_t(s) = \frac{\sum_{s' \in S_t} k(s', s)r(s')}{\sum_{s' \in S_t} k(s', s)}$ and $\sigma_t(s) = \sqrt{\frac{\log \sum_{s' \in S_t} w(s')}{w(s)}}$ where $k(s', s)$ is a kernel function and $w(s) = \sum_{s' \in S_t} k(s', s)$ . Other parametrizations of $\bar{r}_t$ and $\sigma_t$ are also possible, such as Gaussian Process parametrization in Appendix C. The average reward exploits more promising states, while the variance promotes exploration towards less frequently visited states; and the exploration versus exploitation is balanced by a tunable weight $\lambda > 0$ .
+
+Expanding a reachable $s_{new}$ in step (ii). Given the selected $s_{parent}$ , we consider expanding a reachable state in the neighborhood $s_{parent}$ as an infinite-armed bandit problem. Although one can first samples $k$ arms uniformly from a neighborhood around $s_{parent}$ and runs a UCB algorithm on the randomly generated finite arms (Wang et al., 2009), such uniform sampler ignores problem structures, and will lead to unnecessary samples. Instead we will employ a policy $\tilde{\pi}^{*}(s'|s,U)^{1}$ for guidance when generating the candidates. The final choice for next move will be selected from these candidates with $\max \phi(s)$ defined in (3). As explained in more details in Section 4.2, $\tilde{\pi}^{*}$ will be
+
+
+Original Planning Space
+Latent Planning Space
+Figure 2: Our neural network model maps a $N$ -link robot from the original planning space (a $(N + 2)$ -d configuration space) to a 3d discrete latent planning space in which we plan a path using value iteration. The result of value iteration is then used as features for defining $\tilde{V}^{*}(s|U)$ and $\tilde{\pi}^{*}(s'|s,U)$ .
+
+trained to mimic previous successful planning experiences across different problems, that is, biasing the sampling towards the states with higher successful probability.
+
+With these detailed step (i) and (ii), we obtain NEXT :: Expand in Algorithm 2 (illustrated in Figure 1(b) and (c)). Plugging it into the TSA in 1, we construct $\mathsf{alg}(\cdot)\in \mathcal{A}$ which will be learned.
+
+The guided progressive expansion bears similarity to MCTS but deals with high dimensional continuous spaces. Moreover, the essential difference lies in the way to select state in $\mathcal{T}$ for expansion: the MCTS only expands the leaf states in $\mathcal{T}$ due to the hierarchical assumption, limiting the exploration ability and incurring extra unnecessary UCB sampling for internal traversal in $\mathcal{T}$ ; while the proposed operation enables expansion from each visited state, particularly suitable for path planning problems.
+
+# 4.2 NEURAL ARCHITECTURE FOR VALUE FUNCTION AND EXPANSION POLICY
+
+In this section, we will introduce our neural architectures for $\tilde{V}^{*}(s|U)$ and $\tilde{\pi}^{*}(s'|s,U)$ used in NEXT :: Expand. The proposed neural architectures can be understood as first embedding the state and problem into a discrete latent representation via an attention-based module in Section 4.2.1, upon which the neuralized value iteration, introduced in Section 4.2.2, is performed to extract features for defining $\tilde{V}^{*}(s|U)$ and $\tilde{\pi}^{*}(s'|s,U)$ , as illustrated in Figure 2.
+
+# 4.2.1 CONFIGURATION SPACE EMBEDDING
+
+Our network for embedding high-dimension configuration space into a latent representation is designed based on an attention mechanism. More specifically, let $s^w$ denote the workspace in state and $s^h$ denote the remaining dimensions of the state, i.e. $s = (s^w, s^h)$ . $s^w$ and $s^h$ will be embedded by different sub-neural networks and combined for the final representation, as illustrated in Figure 3. For simplicity of exposition, we will focus on the 2d workspace, i.e., $s^w \in \mathbb{R}^2$ . However, our method applies to 3d workspace as well.
+
+
+Config Attention: $(1,1,\mathbf{d}_{\mathrm{a}})$
+Full Attention: $(\mathbf{d},\mathbf{d},\mathbf{d}_{\mathbf{a}})$
+Figure 3: Attention-based state embedding module. $s^w = (x, y)$ and $\mathbf{z} = s^h$ . The upper part is spatial attention, with the first two channels being $x$ and $y$ , and the last two channels being constant templates with the row and column coordinates, as shown with a $d$ set to 3. The bottom module learns the representation for $\mathbf{z}$ . The final embedding is obtained by outer-product of these two attention parts.
+
+- Spatial attention. The workspace information $s^w$ will be embedded as $\mu^w(s^w) \in \mathbb{R}^{d \times d}$ , $d$ is a hyperparameter related to map (see remark below). The spatial embedding module (upper part in Figure 3) is composed of $k_w$ convolution layers, i.e.,
+
+$$
+\mu^ {w} \left(s ^ {w}\right) = \operatorname {s o f t m a x 2 d} \left(f _ {k _ {w}} ^ {w} \left(s ^ {w}\right)\right), \quad f _ {i + 1} ^ {w} \left(s ^ {w}\right) = \operatorname {r e l u} \left(\theta_ {i} ^ {w} \oplus f _ {i} ^ {w} \left(s ^ {w}\right)\right), \tag {4}
+$$
+
+where $\theta_i^w$ denotes the convolution kernels, $\oplus$ denotes the convolution operator and $f_{i}^{w}(s^{w})\in \mathbb{R}^{d\times d\times d_{i}}$ with $d_{i}$ channels. The first layer $f_{0}^{w}$ is designed to represent $s^w$ into a $d\times d\times 4$ tensor as $f_0^w (s^w)_{ij} = [s_1^w,s_2^w,i,j],i,j = 1,\ldots ,d,$ without any loss of information.
+
+
+Figure 4: Overall model architecture. Current and goal states are embedded through attention module. Then the embedding of the goal state is concatenated with the map to produce $\nu^{*(0)}$ and $\tilde{R}$ as the input to the planning module. The output of the planning module is aggregated with the embedding of the current state to produce feature $\psi(s)$ for defining $\tilde{V}^*$ and $\tilde{\pi}^*$ .
+
+- Configuration attention. The remaining configuration state information will be embedded as $\mu^h (s^h)$ through $k_{h}$ fully-connected layers (bottom-left part in Figure 3), i.e.
+
+$$
+\mu^ {h} (s ^ {h}) = \operatorname {s o f t m a x} \left(f _ {k _ {h}} ^ {h} \left(s ^ {h}\right)\right), \quad f _ {i + 1} ^ {h} \left(s ^ {h}\right) = \operatorname {r e l u} \left(\theta_ {i} ^ {h} f _ {i} ^ {h} \left(s ^ {h}\right) + b _ {i}\right),
+$$
+
+where $\mu^h (s^h)\in \mathbb{R}^{d_a}$ and $f_0^h (s^h) = s^h$
+
+The final representation $\mu_{\theta}(s)$ will be obtained by multiplying $\mu^w(s^w)$ with $\mu^h(s^h)$ element-wisely, $\mu_{\theta}(s)_{ijl} = \mu^w(s^w)_{ij} \cdot \mu^h(s^h)_l$ , which is a $d \times d \times d_a$ tensor attention map with $\mu_{\theta}(s)_{ijl} \geqslant 0$ , and $\sum_{ijl} \mu_{\theta}(s)_{ijl} = 1$ (bottom-right part in Figure 3). Intuitively, one can think of $d_a$ as the level of the learned discretization of the configuration space $s^h$ , and the entries in $\mu$ softly assign the actual state $s$ to these discretized locations. $\theta := (\{\theta_i^w\}_{i=0}^{k_w-1}, \{\theta_i^h, b_i\}_{i=0}^{k_h-1})$ are the parameters to be learned.
+
+Remark (different map size): To process map using convolution neural networks, we resize it to a $d \times d$ image, with the same size as the spatial attention in Eq (4), where $d$ is a hyperparameter.
+
+# 4.2.2 NEURAL VALUE ITERATION
+
+We then apply neuralized value iteration on top of the configuration space embedding to extract further planning features (Tamar et al., 2016; Lee et al., 2018). Specifically, we first produce the embedding $\mu_{\theta}(s_{goal})$ of the center of the goal region $s_{goal}$ . We execute $T$ steps of neuralized Bellman updates (planning module in Figure 4) in the embedding space,
+
+$$
+\nu^ {* (t)} = \min \left(W _ {1} \oplus \left[ \nu^ {* (t - 1)}, \tilde {R} \right]\right), \quad \text {w i t h} \quad (\nu^ {* (0)}, \tilde {R}) = \sigma \left(W _ {0} \oplus [ \mu_ {\theta} (s _ {g o a l}), \mathbf {m a p} ]\right),
+$$
+
+and obtain $\nu^{*(T)}\in \mathbb{R}^{d\times d\times d_a\times p}$ . Both $W_{0}$ and $W_{1}$ are 3d convolution kernels, min implements the pooling across channels. Accordingly, $\nu^{*(T)}$ now can be understood as a latent representation of the value function $\tilde{V}^{*}(\cdot)$ in learned embedding space for the problem $U$ with $s_{goal}$ in map.
+
+To define the value function for particular state $s$ , i.e., $\tilde{V}^{*}(s|U)$ , from the latent representation $\nu^{*(T)}$ , we first construct another attention model between the embedding of state $s$ using $\mu_{\theta}(s)$ and $\nu^{*(T)}$ , i.e., $\psi(s)_k = \sum_{ijl} \nu_{ijklk}^{*(T)} \cdot \mu_{\theta}(s)_{ijl}$ , for $k = 1, \dots, p$ . Finally we define
+
+$$
+\tilde {V} ^ {*} (s \mid U) = h _ {W _ {2}} (\psi (s)), \quad \text {a n d} \quad \tilde {\pi} ^ {*} (s ^ {\prime} \mid s, U) = \mathcal {N} \left(h _ {W _ {3}} (\psi (s)), \sigma^ {2}\right) \tag {5}
+$$
+
+where $h_{W_2}$ and $h_{W_3}$ are fully connected dense layers with parameters $W_2$ and $W_3$ respectively, and $\mathcal{N}(h_{W_3}(\psi(s)), \sigma^2)$ is a Gaussian distribution with variance $\sigma^2$ . Note that we also parametrize the policy $\tilde{\pi}^*(s'|s,U)$ using the embedding $\nu^{*(T)}$ , since the policy is connected to the value function via $\pi^*(s'|s,U) = \operatorname*{argmin}_{s' \in S} c([s,s']) + V^*(s'|U)$ . It should also be emphasized that in our parametrization, the calculation of $\nu^{*(T)}$ only relies on the $\mu_\theta(s_{goal})$ , which can be reused for evaluating $\tilde{V}^*(s|U)$ and $\tilde{\pi}^*(s'|s,U)$ over different $s$ , saving computational resources. Using this trick the algorithm runs $10 \times -100 \times$ faster empirically.
+
+The overall model architecture in $\mathsf{alg}(\cdot)$ is illustrated in Figure 4. The parameters $W = (W_{0}, W_{1}, W_{2}, W_{3}, \theta)$ will be learned together by our meta self-improving learning. For the details of the parameterization and the size of convolution kernels in our implementation, please refer to Figure 12 in Appendix D.
+
+# 4.3 META SELF-IMPROVING LEARNING
+
+The learning of the planner alg $(\cdot)$ reduces to learning the parameters in $\tilde{V}^{*}(s|U)$ and $\tilde{\pi}^{*}(s'|s,U)$ and is carried out while planning experiences accumulate. We do not have an explicit training and testing phase separation. Particularly, we use a mixture of RRT :: Expand and NEXT :: Expand with probability $\epsilon$ and $1 - \epsilon$ , respectively, inside the TSA framework in Algorithm 1. The RRT* postprocessing step is used in the template. The $\epsilon$ is set to be 1 initially since $\{\tilde{V}^{*},\tilde{\pi}^{*}\}$ are not well-trained, and thus, the algorithm behaves like RRT*. As the training proceeds, we anneal $\epsilon$ gradually as the sampler becomes more efficient.
+
+The dataset $\mathcal{D}_n = \{(\mathcal{T}_j,U_j)\}_{j = 1}^n$ for the $n$ -th training epoch is collected from the previous successful planning experiences across multiple random problems. We fix the size of dataset and update $\mathcal{D}$ in the same way as experience reply buffer (Lin, 1992; Schaul et al., 2015). For an experience $(\mathcal{T},U)\in \mathcal{D}_n$ , we can reconstruct the successful path $\{s^i\}_{i = 1}^m$ from the search tree $\mathcal{T}$ ( $m$ is the number of segments), and the value of each state $s^i$ in the path will be the sum of cost to the goal region, i.e., $y^{i}\coloneqq \sum_{l = i}^{m - 1}c([s^{l},s^{l + 1}])$ . We learn $\{\tilde{V}^*,\tilde{\pi}^*\}$ by optimizing objective
+
+$$
+\min _ {W} \sum_ {\left(\mathcal {T}, U\right) \in \mathcal {D} _ {n}} \ell \left(\tilde {V} ^ {*}, \tilde {\pi} ^ {*}; \mathcal {T}, U\right) := - \sum_ {\mathcal {D} _ {n}} \sum_ {i = 1} ^ {m - 1} \log \tilde {\pi} ^ {*} \left(s ^ {i + 1} \mid s ^ {i}\right) + \sum_ {i = 1} ^ {m} \left(\tilde {V} ^ {*} \left(s ^ {i}\right) - y ^ {i}\right) _ {2} ^ {2} + \lambda \| W \| ^ {2}. \tag {6}
+$$
+
+The loss (6) pushes the $\tilde{V}^{*}$ and $\tilde{\pi}^{*}$ to chase the successful trajectories, providing effective guidance in a1g $(\cdot)$ for searching, and therefore leading to efficient searching procedure with less sample complexity and better solution. On one hand, the value function and policy estimation $\{\tilde{V}^{*},\tilde{\pi}^{*}\}$ is improved based upon the successful outcomes from NEXT itself on previous problems. On the other hand, the updated $\{\tilde{V}^{*},\tilde{\pi}^{*}\}$ will be applied in the next epoch to improve the performance. Therefore, the training is named as Meta Self-Improving Learning (MSIL). Since all the trajectories we collected for learning are feasible, the reachability of the proposed samples is enforced implicitly via imitating these successful paths.
+
+By putting every components together into the learning to plan framework in Eq (2), the over- 10
+
+all procedure is summarized in Algorithm 3 and illustrated in Figure 1.
+
+Initialize dataset $\mathcal{D}_0$
+for epoch $n\gets 1$ to $N$ do Sample a planning problem $U$ .. $\mathcal{T}\leftarrow \mathrm{TSA}(U)$ with $\epsilon \sim \mathcal{U}nif[0,1]$ , and $\epsilon \cdot \mathrm{RRT}::$ Expand+(1-ε)-NEXT :: Expanc Postprocessing with RRT\* :Postprocess; $\mathcal{D}_n\gets \mathcal{D}_{n - 1}\cup \{(\mathcal{T},U)\}$ if successful else $\mathcal{D}_{n - 1}$ . for $j\gets 0$ to $L$ do Sample $(T_{j},U_{j})$ from $\mathcal{D}_n$ Reconstruct sub-optimal path $\{s^i\}_{i = 1}^m$ and the cost of paths based on $\mathcal{T}_j$ Update parameters $W\gets W - \eta \nabla_{W}\ell (\tilde{V}^{*},\tilde{\pi}^{*};\mathcal{T}_{j},U_{j})$ Anneal $\epsilon = \alpha \epsilon ,\alpha \in (0,1)$
+
+# 5 EXPERIMENTS
+
+In this section, we evaluate the proposed NEXT empirically on different planning tasks in a variety of environments. Comparing to the existing planning algorithms, NEXT achieves the state-of-the-art performances, in terms of both success rate and the quality of the found solutions. We further demonstrate the power of the proposed two components by the corresponding ablation study. We also include a case study on a real-world robot arm control problem at the end of the section.
+
+# 5.1 EXPERIMENT SETUP
+
+Benchmark environments. We designed four benchmark tasks to demonstrate the effectiveness of our algorithm for high-dimensional planning. The first three involve planning in a 2d workspace with a 2 DoF (degrees of freedom) point robot, a 3 DoF stick robot and a 5 DoF snake robot, respectively. The last one involves planning a 7 DoF spacecraft in a 3d workspace. For all problems in each benchmark task, the workspace maps were randomly generated from a fixed distribution; the initial and goal states were sampled uniformly randomly in the free space; the cost function $c(\cdot)$ was set as the sum of the Euclidean path length and the control effort penalty of rotating the robot joints.
+
+Baselines. We compared NEXT with RRT* (Karaman & Frazzoli, 2011), BIT* (Gammell et al., 2015), CVAE-plan (Ichter et al., 2018), Reinforce-plan (Zhang et al., 2018), and an improved
+
+
+(a) RRT* (w/o rewiring)
+
+
+(b) NEXT-KS search tree
+
+
+(c) NEXT-GP search tree
+
+
+(d) learned $\tilde{V}^*$ and $\tilde{\pi}^*$
+
+
+(a) NEXT-KS solution path
+
+
+Figure 5: Search trees and the learned $\tilde{V}^*$ and $\tilde{\pi}^*$ produced by NEXT. Obstacles are colored in blue. The start and goal locations are denoted by orange and brown dots. In (a) to (c), samples are represented with yellow circles. In (d), the level of redness denotes the value of the cost-to-go estimate $\tilde{V}^*$ . The cyan arrows point from a given state $s$ to the mean of the learned policy $\tilde{\pi}^*(s'|s,U)$ .
+(b) NEXT-KS search tree
+
+
+(c) RRT* search tree (w/o rewiring)
+Figure 6: Search trees and a solution path produced in an instance of spacecraft planning. The 7 DOF spacecraft has a yellow body and two 2 DOF red arms. NEXT-KS produced a nearly minimum viable search tree while RRT* failed to find a path within limited trials.
+
+version of GPPN (Lee et al., 2018) in terms of both planning time and solution quality. RRT* and BIT* are two widely used effective instances of TSA in Algorithm 1. In our experiments, we equipped RRT* with the goal biasing heuristic to improve its performance. BIT* adopts the informed search strategy (Gammell et al., 2015) to accelerate planning. CVAE-plan and Reinforce-plan are two learning-enhanced TSA planners proposed recently. CVAE-plan learns a conditional VAE as the sampler (Sohn et al., 2015), which will be trained by near-optimal paths produced by RRT*. Reinforce-plan learns to do rejection sampling with policy gradient methods. For the improved GPPN, we combined its architecture for map with a fully-connected MLP for the rest state, such that it can be applied to high-dimensional continuous spaces. Please refer to Appendix E for more details.
+
+Settings. For each task, we randomly generated 3000 different problems from the same distribution without duplicated maps. We trained all learning-based baselines using the first 2000 problems, and reserved the rest for testing. The parameters for RRT* and BIT* are also tuned using the first 2000 problems. For NEXT, we let it improve itself using MSIL over the first 2000 problems. In this period, for every 200 problems, we updated its parameters and annealed $\epsilon$ once.
+
+# 5.2 RESULTS AND ANALYSIS
+
+Comparison results. Examples of all four environments are illustrated in Appendix F.1 and Figure 6, where NEXT finds high-quality solutions as shown. We also illustrated the comparison of the search trees on two 2d and 7d planning tasks between NEXT and RRT* in Figure 5 (a)-(c) and Figure 6 (b) and (c). Obviously, the proposed NEXT algorithm explores with guidance and achieves better quality solutions with fewer samples, while the RRT* expands randomly which may fail to find a solution. The learned $\tilde{V}^*$ and $\tilde{\pi}^*$ in the 2d task are also shown in Figure 5(d). As we can see, they are consistent with our expectation, towards the ultimate target in the map. For more search tree comparisons for all four experiments, please check Figure 18, 19, 20 and 21 in Appendix F.
+
+To systematically evaluate the algorithms, we recorded the cost of time (measured by the number of collision checks used) to find a collision-free path, the success rate within time limits, and the cost of the solution path for each run. The results of the reserved 1000 test problems of each environment are shown in the top row of Figure 7. We set the maximal number of samples as 500 for all algorithms. Both the kernel smoothing (NEXT-KS) and the Gaussian process (NEXT-GP) version of NEXT achieves the state-of-the-art performances, under all three criteria in all test environments. Although the BIT* utilizes the heuristic particularly suitable for 3d maze in 7d task and performs quite well,
+
+
+Figure 7: First row: histograms of results, in terms of success rate, average collision checks, and average cost of the solution paths; Second row: NEXT improvement curves in the 5d experiments. All algorithms are set to use up to 500 samples, except RRT\* -10k, which uses 10,000 samples. The value of collision checks and path costs are normalized w.r.t. the performance of RRT\*.
+
+the NEXT algorithm still outperform every competitor by a large margin, no matter learning-based or prefixed heuristic planner, demonstrating the advantages of the proposed NEXT algorithm.
+
+Self-improving. We plot the performance improvement curves of our algorithms on the 5d planning task in the bottom row of Figure 7. For comparison, we also plot the performance of RRT*. At the beginning phase of self-improving, our algorithms are comparable to RRT*. They then gradually learn from previous experiences and improve themselves as they see more problems and better solutions. In the end, NEXT-KS is able to match the performance of RRT*-10k using only one-twentieth of its samples, while the competitors perform consistently without any improvements.
+
+Due to the space limits, we put improvement curves on other environments in Figure 17 and the quantitative evaluation in Table 1, 2, and 3 in Appendix F. Please refer to the details there.
+
+# 5.3 ABLATION STUDIES
+
+Ablation study I: guided progressive expansion. To demonstrate the power of NEXT :: Expand, we replace it with breadth-first search (BFS) (Kim et al., 2018), another expanding strategy, while keeping other components the same. Specifically, BFS uses a search queue in planning. It repeatedly pops a state $s$ out from the search queue, samples $k$ states from $\pi(\cdot|s)$ , and pushes all generated samples and state $s$ back to the queue, until the goal is reached. For fairness, we use the learned sampling policy $\pi(s'|s,U)$ by NEXT-KS in BFS. As shown in Figure 7, BFS obtained worse paths with a much larger number of collision checks and far lower success rate, which justifies the importance of the balance between exploration versus exploitation achieved by the proposed NEXT :: Expand.
+
+Ablation study II: neural architecture. To further demonstrate the benefits of the proposed neural architecture for learning generalizable representations in high-dimension planning problems, We replaced our attention-based neural architecture with an improved GPPN, as explained in Appendix E, for ablation study. We extended the GPPN for continuous space by adding an extra reactive policy network to its final layers. We emphasize the original GPPN is not applicable to the tasks in our experiments. Intuitively, the improved GPPN first produces a 'rough plan' by processing the robot's discretized workspace positions. Then the reactive policy network predicts a continuous action from both the workspace feature and the full configuration state of the robot. We provide more preference to the improved GPPN by training it to imitate the near-optimal paths produced by RRT* in the training problems. During test time it is also combined with both versions of the guided progressive expansion operators. As we can see, both GPPN-KS and GPPN-GP are clearly much
+
+
+Figure 8: The success rate and average path cost of the different planners under varying time limits. Running NEXT for 1 second achieves the same success rate as running BIT* for 50 seconds.
+
+worse than NEXT-KS and NEXT-GP, demonstrating the advantage of our proposed attention-based neural architecture in high-dimensional planning tasks.
+
+Ablation study III: learning versus heuristic. The NEXT algorithm in Figure 5 shows similar behavior as the Dijkstra heuristic, i.e. sampling on the shortest path connecting the start and the goal in workspace. However, in higher dimensional space, the Dijkstra heuristic will fail. To demonstrate that, we replace the policy and value network with Dijkstra heuristic, using the best direction in workspace to guide sampling. NEXT performs much better than Dijkstra in all but the 2d case, in which the workspace happens to be the state space.
+
+# 5.4 CASE STUDY: ROBOT ARM CONTROL
+
+We conduct a real-world case study on controlling robot arms to move objects on a shelf. On this representative real-time task, we demonstrate the advantages of the NEXT in terms of the wall-clock.
+
+In each planning task, there is a shelf of multiple levels, with each level horizontally divided into multiple bins. The task is to plan a path from a location in one bin to another, i.e., the end effectors of the start and goal configurations are in different bins. The heights of levels, widths of bins, and the start and goal are randomly drawn from some fixed distribution. Different from previous experiments, the base of the robot is fixed. We consider the BIT* instead of RRT* as the imperfect expert in 3000 training problems. We then evaluate the algorithm on a separated 1000 testing problems. We compare NEXT(-KS) with the highly tuned BIT* and RRT* in OMPL, and also CVAE-plan and Reinforce-plan in Figure 8. As seen from the visualization of the found paths in Figure 9, this is a very difficult task. Our NEXT outperforms the baselines by a large margin, requiring only 1 second to reach the same success rate as running 50 seconds of BIT*.
+
+
+Figure 9: The collision-free path produced by NEXT for robot arm planning. The start and goal configurations have end-effectors in different bins of the shelf.
+
+Due to space limits, we put details of the experiment setups, more results and analysis in Appendix F.4.
+
+# 6 CONCLUSION
+
+In this paper, we propose a self-improving planner, Neural EXploration-EXploitation Trees (NEXT), which can generalize and achieve better performance with experiences accumulated. The algorithm achieves a delicate balance between exploration-exploitation via our carefully designed UCB-type expansion operation. To obtain the generalizable ability across different problems, we proposed a new parametrization for the value function and policy, which captures the Bellman recursive structure in the high-dimensional continuous state and action space. We demonstrate the power of the proposed algorithm by outperforming previous state-of-the-art planners with significant margins on planning problems in a variety of different environments.
+
+# ACKNOWLEDGEMENT
+
+We thank the Google Research Brain team members for helpful thoughts and discussions as well as the anonymous reviewers for their insightful comments and suggestions. This work is supported in part by NSF grants CDS&E-1900017 D3SC, CCF-1836936 FMitF, IIS-1841351, CAREER IIS-1350983 to L.S, and by NSF grants BIGDATA 1840866, CAREER 1841569, TRIPODS 1740735, DARPA-PA-18-02-09-QED-RML-FP-003, an Alfred P Sloan Fellowship, a PECASE award to H.L.
+
+# REFERENCES
+
+Auer, P., Cesa-Bianchi, N., and Fischer, P. Finite-time analysis of the multiarmed bandit problem. Machine learning, 47(2-3):235-256, 2002.
+Mohak Bhardwaj, Sanjiban Choudhury, and Sebastian Scherer. Learning heuristic search via imitation. arXiv preprint arXiv:1707.03034, 2017.
+Boor, V., Overmars, M. H., and Van Der Stappen, A. F. The gaussian sampling strategy for probabilistic roadmap planners. In Robotics and automation, 1999. proceedings. 1999 iiem international conference on, volume 2, pp. 1018-1023. IEEE, 1999.
+Burns, B. and Brock, O. Sampling-based motion planning using predictive models. In Robotics and Automation, 2005. ICRA 2005. Proceedings of the 2005 IEEE International Conference on, pp. 3120-3125. IEEE, 2005a.
+Burns, B. and Brock, O. Toward optimal configuration space sampling. In Robotics: Science and Systems, pp. 105-112. CiteSeer, 2005b.
+Bowen, Chris, and Ron Alterovitz. Closed-loop global motion planning for reactive execution of learned tasks. In IEEE/RSJ International Conference on Intelligent Robots and Systems, pp. 1754-1760, 2014.
+Cadena Cesar, Luca Carlone, Henry Carrillo, Yasir Latif, Davide Scaramuzza, José Neira, Ian Reid, and John J. Leonard. Past, present, and future of simultaneous localization and mapping: Toward the robust-perception age. IEEE Transactions on Robotics, 32(6), 2016.
+Sanjiban Choudhury, Mohak Bhardwaj, Sankalp Arora, Ashish Kapoor, Gireeja Ranade, Sebastian Scherer, and Debadeepta Dey. Data-driven planning via imitation learning. The International Journal of Robotics Research, 37(13-14):1632-1672, 2018.
+Chu, W., Li, L., Reyzin, L., and Schapire, R. Contextual bandits with linear payoff functions. In Proceedings of the Fourteenth International Conference on Artificial Intelligence and Statistics, pp. 208-214, 2011.
+Couëtoux, A., Hoock, J.-B., Sokolovska, N., Teytaud, O., and Bonnard, N. Continuous upper confidence trees. In International Conference on Learning and Intelligent Optimization, pp. 433-445. Springer, 2011.
+Rosen Diankov. Automated Construction of Robotic Manipulation Programs. PhD thesis, Carnegie Mellon University, Robotics Institute, August 2010.
+Rosen Diankov and James Kuffner. Randomized statistical path planning. In 2007 IEEE/RSJ International Conference on Intelligent Robots and Systems, pp. 1-6. IEEE, 2007.
+Elbanhawi, M. and Simic, M. Sampling-based robot motion planning: A review. IEEE access, 2: 56-77, 2014.
+Finney, S., Kaelbling, L. P., and Lozano-Perez, T. Predicting partial paths from planning problem parameters. In Robotics Science and Systems, 2007.
+Fulgenzi, Chiara and Tay, Christopher and Spalanzani, Anne and Laugier, Christian Probabilistic navigation in dynamic environment using rapidly-exploring random trees and gaussian processes In IEEE/RSJ International Conference on Intelligent Robots and Systems, pp. 1056-1062, 2008.
+
+Gammell, J. D., Srinivasa, S. S., and Barfoot, T. D. Informed rrt*: Optimal sampling-based path planning focused via direct sampling of an admissible ellipsoidal heuristic. arXiv preprint arXiv:1404.2334, 2014.
+Gammell, J. D., Srinivasa, S. S., and Barfoot, T. D. Batch informed trees (bit*): Sampling-based optimal planning via the heuristically guided search of implicit random geometric graphs. In Robotics and Automation (ICRA), 2015 IEEE International Conference on, pp. 3067-3074. IEEE, 2015.
+Guez, Arthur and Weber, Théophane and Antonoglou, Ioannis and Simonyan, Karen and Vinyals, Oriol and Wierstra, Daan and Munos, Rémi and Silver, David Learning to search with mctsnets arXiv preprint arXiv:1802.04697, 2018.
+Peter E Hart, Nils J Nilsson, and Bertram Raphael. A formal basis for the heuristic determination of minimum cost paths. IEEE transactions on Systems Science and Cybernetics, 4(2):100-107, 1968.
+Hsu, D., Latombe, J.-C., and Motwani, R. Path planning in expansive configuration spaces. In Robotics and Automation, 1997. Proceedings., 1997 IEEE International Conference on, volume 3, pp. 2719-2726. IEEE, 1997.
+Hsu, D., Jiang, T., Reif, J., and Sun, Z. The bridge test for sampling narrow passages with probabilistic roadmap planners. In Robotics and Automation, 2003. Proceedings. ICRA'03. IEEE International Conference on, volume 3, pp. 4420-4426. IEEE, 2003.
+Hsu, D., Sánchez-Ante, G., and Sun, Z. Hybrid prm sampling with a cost-sensitive adaptive strategy. In Robotics and Automation, 2005. ICRA 2005. Proceedings of the 2005 IEEE International Conference on, pp. 3874-3880. IEEE, 2005.
+Huh, Jinwook and Lee, Daniel Efficient Sampling With Q-Learning to Guide Rapidly Exploring Random Trees. IEEE Robotics and Automation Letters, 3:3868-3875, 2018.
+Ichter, B., Harrison, J., and Pavone, M. Learning sampling distributions for robot motion planning. In 2018 IEEE International Conference on Robotics and Automation (ICRA), pp. 7087-7094. IEEE, 2018.
+Karaman, S. and Frazzoli, E. Sampling-based algorithms for optimal motion planning. The international journal of robotics research, 30(7):846-894, 2011.
+Karkus, P., Hsu, D., and Lee, W. S. Qmdp-net: Deep learning for planning under partial observability. In Advances in Neural Information Processing Systems, pp. 4694-4704, 2017.
+Kavraki, L. E., Svestka, P., Latombe, J.-C., and Overmars, M. H. Probabilistic roadmaps for path planning in high-dimensional configuration spaces. IEEE Transactions on Robotics and Automation, 12(4), 1996.
+Kim, B., Kaelbling, L. P., and Lozano-Pérez, T. Guiding search in continuous state-action spaces by learning an action sampler from off-target search experience. 2018.
+Kocsis, L. and Szepesvári, C. Bandit based monte-carlo planning. In European conference on machine learning, pp. 282-293. Springer, 2006.
+Krause, A. and Ong, C. S. Contextual gaussian process bandit optimization. In Advances in Neural Information Processing Systems, pp. 2447-2455, 2011.
+Kuo, Yen-Ling and Barbu, Andrei and Katz, Boris Deep sequential models for sampling-based planning In IEEE/RSJ International Conference on Intelligent Robots and Systems, pp. 6490-6497, 2018.
+Langford, J. and Zhang, T. The epoch-greedy algorithm for multi-armed bandits with side information. In Advances in neural information processing systems, pp. 817-824, 2008.
+LaValle, S. M. Rapidly-exploring random trees: A new tool for path planning. 1998.
+Lee, L., Parisotto, E., Chaplot, D. S., Xing, E., and Salakhutdinov, R. Gated path planning networks. arXiv preprint arXiv:1806.06408, 2018.
+
+Long-Ji Lin. Self-improving reactive agents based on reinforcement learning, planning and teaching. Machine learning, 8(3-4):293-321, 1992.
+Paxton, Chris and Raman, Vasumathi and Hager, Gregory D and Kobilarov, Marin Combining neural networks and tree search for task and motion planning in challenging environments In IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), pp. 6059-6066, 2017.
+Sven Mikael Persson and Inna Sharf. Sampling-based a* algorithm for robot path-planning. The International Journal of Robotics Research, 33(13):1683-1708, 2014.
+Phillips, J. M., Bedrossian, N., and Kavraki, L. E. Guided expansive spaces trees: A search strategy for motion-and cost-constrained state spaces. In IEEE International Conference on Robotics and Automation, pp. 3968-3973, 2004.
+Mike Phillips, Benjamin J Cohen, Sachin Chitta, and Maxim Likhachev. E-graphs: Bootstrapping planning with experience graphs. In Robotics: Science and Systems, volume 5, pp. 110, 2012.
+Qureshi, Ahmed H and Simeonov, Anthony and Bency, Mayur J and Yip, Michael C. Motion planning networks. In IEEE International Conference on Robotics and Automation, 2019.
+Reif, J. H. Complexity of the mover's problem and generalizations. In Foundations of Computer Science, 1979., 20th Annual Symposium on, pp. 421-427. IEEE, 1979.
+Rickert, Markus and Brock, Oliver and Knoll, Alois. Balancing exploration and exploitation in motion planning In IEEE International Conference on Robotics and Automation, pp. 2812-2817. IEEE, 2008.
+Tom Schaul, John Quan, Ioannis Antonoglou, and David Silver. Prioritized experience replay. arXiv preprint arXiv:1511.05952, 2015.
+Shkolnik, A., Walter, M., and Tedrake, R. Reachability-guided sampling for planning under differential constraints. In Robotics and Automation, 2009. ICRA'09. IEEE International Conference on, pp. 2859-2865. IEEE, 2009.
+Silver, David and Hubert, Thomas and Schrittwieser, Julian and Antonoglou, Ioannis and Lai, Matthew and Guez, Arthur and Lanctot, Marc and Sifre, Laurent and Kumaran, Dharshan and Graepel, Thore and others Mastering chess and shogi by self-play with a general reinforcement learning algorithm. arXiv preprint arXiv:1712.01815, 2017.
+Sohn, K., Lee, H., and Yan, X. Learning structured output representation using deep conditional generative models. In Advances in Neural Information Processing Systems, pp. 3483-3491, 2015.
+Jialin Song, Ravi Lanka, Albert Zhao, Yisong Yue, and Masahiro Ono. Learning to search via retrospective imitation. arXiv preprint arXiv:1804.00846, 2018.
+Srinivas, N., Krause, A., Kakade, S. M., and Seeger, M. Gaussian process optimization in the bandit setting: No regret and experimental design. arXiv preprint arXiv:0912.3995, 2009.
+Ioan A. Sucan, Mark Moll, and Lydia E. Kavraki. The Open Motion Planning Library. IEEE Robotics & Automation Magazine, 19(4):72-82, December 2012. doi: 10.1109/MRA.2012.2205651. http://ompl.kavrakilab.org.
+Tamar, A., Wu, Y., Thomas, G., Levine, S., and Abbeel, P. Value iteration networks. In Advances in Neural Information Processing Systems, pp. 2154-2162, 2016.
+Wang, Y., Audibert, J.-Y., and Munos, R. Algorithms for infinitely many-armed bandits. In Advances in Neural Information Processing Systems, pp. 1729-1736, 2009.
+Ye, Gu and Alterovitz, Ron Guided motion planning. In Robotics research, pp. 291-6307. Springer, 2017.
+Yee, T., Lisy, V., and Bowling, M. Monte carlo tree search in continuous action spaces with execution uncertainty. In Proceedings of the Twenty-Fifth International Joint Conference on Artificial Intelligence, pp. 690-696. AAAI Press, 2016.
+
+Zhang, C., Huh, J., and Lee, D. D. Learning implicit sampling distributions for motion planning. arXiv preprint arXiv:1806.01968, 2018.
+Zucker, M., Kuffner, J., and Bagnell, J. A. Adaptive workspace biasing for sampling-based planners. In Robotics and Automation, 2008. ICRA 2008. IEEE International Conference on, pp. 3757-3762. IEEE, 2008.
+
+# Appendix
+
+# A ILLUSTRATION OF THE DIFFICULTY IN PLANNING PROBLEMS
+
+The Figure 10(a) illustrates a concrete planning problem for a stick robot in 2d workspace. With one extra continuous action for rotation, the configuration state is visualized in Figure 10(b), which is highly irregular and unknown to the planner.
+
+
+(a) Workspace
+
+
+(b) Configuration space
+
+Figure 10: Different views of the same planning problem. In (a) we color the obstacles, the starting and the goal position of the robot in deep blue, orange and brown, respectively. The stick robot can move and rotate. The corresponding configuration space is 3d, as visualized in (b), with the extra dimension being the rotation angle w.r.t. the x-axis. The blue region indicates the feasible state space, i.e., the set of collision-free states. The starting and the goal position are denoted with an orange and a brown dot, respectively. Although the workspace looks trivial, the configuration space is irregular, which makes the planning difficult.
+
+# B MORE PRELIMINARIES
+
+Tree-based sampling planner The tree-based sampling planner algorithm is illustrated in Figure 11. The Expand in Algorithm 1 operator returns an existing node in the tree $s_{\text{parent}} \in \mathcal{V}$ and a new state $s_{\text{new}} \in \mathcal{S}$ sampled from the neighborhood of $s_{\text{parent}}$ . Then the line segment $[s_{\text{parent}}, s_{\text{new}}]$ is passed to function ObstacleFree for collision checking. If the line segment $[s_{\text{parent}}, s_{\text{new}}]$ is collision-free (no obstacle in the middle, or called reachable from $\mathcal{T}$ ), then $s_{\text{new}}$ is added to the tree vertex set $\mathcal{V}$ , and the line segment is added to the tree edge set $\mathcal{E}$ . If the newly added node $s_{\text{new}}$ has reached the target $S_{\text{goal}}$ , the algorithm will return. Optionally, some concrete algorithms can define a Postprocess operator to refine the search tree. For an example of the Expand operator, as shown in Figure 1 (c), since there is no obstacle on the dotted edge $[s_{\text{parent}}, s_{\text{new}}]$ , i.e., $s_{\text{new}}$ is reachable, the new state and edge will be added to the search tree (connected by the solid edges).
+
+
+Figure 11: Illustration for one iteration of Algorithm 1. The left and right figures illustrate two different cases where the sample returned by the Expand operator is unreachable and reachable from the search tree.
+
+
+
+Now we will provide two concrete algorithm examples. For instance,
+
+- If we instantiate the Expand operator as Algorithm 4, then we obtain the rapidly-exploring random trees (RRT) algorithm (LaValle, 1998), which first samples a state $s$ from the configuration space
+
+Algorithm 4: RRT :: Expand $(\mathcal{T},U)$
+Data: $\mathcal{T} = (\mathcal{V},\mathcal{E}),U = (s_{init},S_{goal},S,S_{free},\mathrm{map},c(\cdot))$ Sample configuration space $s_{rand}\gets \mathcal{Unif}(\mathcal{S})$ Pull to a tree node $s_{parent}\gets \operatorname {argmin}_{s\in \mathcal{V}}\| s_{rand} - s\|$ $s_{new}\gets \operatorname {argmin}_{s\in \mathcal{B}(s_{parent},\eta)}\| s - s_{rand}\|$ return $s_{parent},s_{new};$
+
+Algorithm 5: EST :: Expand(T,U)
+Data: $\mathcal{T} = (\mathcal{V},\mathcal{E}),U = (s_{init},S_{goal},S,S_{free},\mathrm{map},c(\cdot))$ Sample a tree node $s_{parent}\sim \phi (s),s\in \mathcal{V};$ 2 $s_{new}\gets \mathcal{Unif}(\mathcal{B}(s_{parent}))$ 3 return snearest,snew;
+
+$\mathcal{S}$ and then pulls it toward the neighborhood of current tree $\mathcal{T}$ measured by a ball of radius $\eta$ :
+
+$$
+\mathcal {B} (s, \eta) = \left\{s ^ {\prime} \in \mathcal {S} \mid \| s ^ {\prime} - s \| \leqslant \eta \right\}.
+$$
+
+Moreover, if the Postprocess operator is introduced to modify the maintained search tree as in RRT* (Karaman & Frazzoli, 2011), the algorithm is provable to obtain the optimal path asymptotically.
+
+- If we instantiate the Expand operator as Algorithm 5, then we obtain the expansive-space trees (EST) algorithm (Hsu et al., 1997; Phillips et al., 2004), which samples a state $s$ from the nodes of the existing tree, and then draw a sample from the neighborhood of $s$ .
+
+UCB-based algorithms Specifically, in a $K$ -armed bandit problem, the UCB algorithm will first play each of the arms once, and then keep track of the average reward $\bar{r}_i$ and the visitation count $n_i$ for each arm. After $T$ rounds of trials, the UCB algorithm will maintain a set of information $\{(\bar{r}_i, n_i)\}_{i=1}^K$ with $\sum_{i=1}^{K} n_i = T$ . Then, for the next round, the UCB algorithm will select the next arm based on the one-sided confidence interval estimation provided by the Chernoff-Hoeffding bound,
+
+$$
+a _ {T + 1} ^ {*} = \operatorname {a r g m a x} _ {i \in \{1, \dots , K \}} \bar {r} _ {i} + \lambda \sqrt {\frac {\log T}{n _ {i}}}, \tag {7}
+$$
+
+where $\lambda$ controls the exploration-exploration trade-off. It has been shown that the UCB algorithm achieves $\mathcal{O}(\log T)$ regret. However, the MCTS is not directly applicable to continuous state-action spaces.
+
+There have been many attempts to generalize the UCB and UCT algorithms to continuous state-action spaces (Chu et al., 2011; Krause & Ong, 2011; Couetoux et al., 2011; Yee et al., 2016). For instance, contextual bandit algorithms allow continuous arms but involve a non-trivial high dimensional non-convex optimization to select the next arm. In UCT, the progressive widening technique has been designed to deal with continuous actions (Wang et al., 2009). Even with these extensions, the MCTS restricts the exploration only from leaves states, implicitly adding an unnecessary hierarchical structure for path planning, resulting inferior exploration efficiency and extra computation in path planning tasks.
+
+Although these off-the-shelf algorithms are not directly applicable to our path planning setting, their successes show the importance of exploration-exploitation trade-off and will provide the principles for our algorithm for continuous state-action planning problems.
+
+Planning networks Value iteration networks (Tamar et al., 2016) employ neural networks to embed the value iteration algorithm from planning and then use this embedded algorithm to extract input features and define downstream models such as value functions and policies.
+
+Specifically, VIN mimics the following recursive application of Bellman update operator $\mathcal{G}$ to value function $V^{*}$ ,
+
+$$
+V ^ {*} (s | U) = \left(\mathcal {G} V ^ {*}\right) (s) := \min _ {a} \sum_ {s ^ {\prime}} P \left(s ^ {\prime} \mid s, a\right) \left(c \left([ s, s ^ {\prime} ]\right) + V ^ {*} \left(s ^ {\prime} \mid U\right)\right). \tag {8}
+$$
+
+where $P(s'|s, a)$ is the state transition model. When the state space for $s$ and action space for $a$ are low dimensional, these spaces can be discretized into grids. Then, the local cost function $c([s, s'])$ and the
+
+value function $V^{*}(s^{\prime}|U)$ can be represented as matrices (2d) or tensors (3d) with each entry indexed by grid locations. Furthermore, if the transition model $P(s^{\prime}|s,a)$ is local, that is $P(s^{\prime}|s,a) = 0$ for $s^{\prime} \notin \mathcal{B}(s)$ , it resembles a set of convolution kernels, each indexed by a discrete action $a$ . And the Bellman update operator essentially convolves $P(s^{\prime}|s,a)$ with $c([s,s^{\prime}])$ and $V^{*}(s^{\prime}|U)$ , and then performs a min-pooling operation across the convolution channels.
+
+Inspired by the above computation pattern of the Bellman operator, value iteration networks design the neural architecture as follows,
+
+$$
+\tilde {V} ^ {* 0} = \min \left(W _ {1} \oplus \lceil \operatorname {m a p}, \tilde {R} \rceil\right) \tag {9}
+$$
+
+$$
+\tilde {V} ^ {* t} = \min \left(W _ {1} \oplus \left[ \tilde {V} ^ {* t - 1}, \tilde {R} \right]\right) \tag {10}
+$$
+
+where $\oplus$ is the convolution operation, both map, $\tilde{V}^{*t}$ and $\tilde{R}$ are $d\times d$ matrices, and the parameter $W_{1}$ are $k_{c}$ convolution kernels of size $k\times k$ . The min implements the pooling across $k_{c}$ convolution channels.
+
+The gated path planning networks (GPPN) (Lee et al., 2018) improves the VIN by replacing the VIN cell (9) with the well-established LSTM update, i.e.,
+
+$$
+\tilde {V} ^ {t}, \tilde {c} ^ {t} = \operatorname {L S T M} \left(\sum \left(W _ {1} \oplus \left[ \tilde {V} ^ {t}, \tilde {R} \right]\right), \tilde {c} ^ {t}\right), \tag {11}
+$$
+
+where the summation is taking over all the $k_{c}$ convolution channels.
+
+After constructing the VIN and GPPN, the parameters of the model, i.e., $\{\tilde{R}, W_1\}$ can be learned by imitation learning or reinforcement learning.
+
+The application of planning networks are restricted in low-dimension tasks. However, their success enlightens our neural architecture for generalizable representation for high-dimension planning tasks.
+
+# C PARAMETRIZEDUCB ALGORITHMS
+
+We list two examples of parametrized UCB as the instantiation of (3) used in GPE:
+
+GP-UCB: The GP-UCB Chu et al. (2011) is derived by parameterizing via Gaussian Processes (GP) with kernel $k(s,s')$ , i.e., $\mathbb{E}[r(s)|\mathcal{T},U]\sim \mathcal{GP}(0,k)$ , GP-UCB maintains an UCB of the reward after $t$ -step as
+
+$$
+\phi (\bar {s}) := \bar {r} _ {t} (s) + \lambda \sigma_ {t} (s), \tag {12}
+$$
+
+where
+
+$$
+\bar {r} _ {t} (s) = k _ {t} (s) \left(K _ {t} + \alpha I\right) ^ {- 1} r _ {t},
+$$
+
+$$
+\sigma_ {t} ^ {2} (s) = k (s, s) - k _ {t} (s) ^ {\top} \left(K _ {t} + \alpha I\right) ^ {- 1} k _ {t} (s),
+$$
+
+with $k_{t}(s) = [k(s_{i},s)]_{s_{i}\in \mathcal{S}_{t}}$ , $K_{t} = [k(s,s^{\prime})]_{s,s^{\prime}\in \mathcal{S}_{t}}$ , and $\mathcal{S}_t = \{s_1,s_2,\ldots ,s_t\}$ denotes the sequence of selected nodes in current trees. The variance estimation $\sigma_t^2 (s)$ takes the number of visits into account in an implicit way: the variance will reduce, as the neighborhood of $s$ is visited more frequently (Srinivas et al., 2009).
+
+- KS-UCB: We can also use kernel regression as an alternative parametrization for (7) (Yee et al., 2016), which leads to an UCB of the reward after $t$ -step as
+
+$$
+\phi (s) := \bar {r} _ {t} (s) + \lambda \sigma_ {t} (s), \tag {13}
+$$
+
+where
+
+$$
+\bar {r} _ {t} [ s ] = \frac {\sum_ {s ^ {\prime} \in \mathcal {S} _ {t}} k (s ^ {\prime} , s) r (s ^ {\prime})}{\sum_ {s ^ {\prime} \in \mathcal {S} _ {t}} k (s ^ {\prime} , s)},
+$$
+
+$$
+\sigma_ {t} (s) = \sqrt {\frac {\log \sum_ {s ^ {\prime} \in \mathcal {S} _ {t}} w (s ^ {\prime})}{w (s)}},
+$$
+
+with $w(s) = \sum_{s' \in S_t} k(s', s)$ . Clearly, the variance estimation is to promote exploration towards less frequently visited states.
+
+As we can see, in both two examples of the parametrized UCB, we parametrize the observed rewards, leading to generalizable UCB for increased states by considering the correlations.
+
+# D POLICY AND VALUE NETWORK ARCHITECTURE
+
+We explain the implementation details of the proposed parametrization for policy and value function. Figure 12 and Figure 13 are neural architectures for the attention module, the policy/value network, and the planning module, respectively.
+
+
+Figure 12: Left: attention module, instantiating the Figure 3; Right: policy/value network, instantiating the Figure 4.
+
+In the figures, we use rectangle blocks to denote inputs, intermediate results and outputs, stadium shape blocks to denote operations, and rounded rectangle blocks to denote modules. We use different colors for different operations. In particular, we use blue for convolutional/LSTM layers, green for dense layers, and orange for anything else. For convolutional layers, "Conv $1 \times 1$ , 32, relu" denotes a layer with $1 \times 1$ kernels, 32 channels, followed by a rectified linear unit; for dense layers, "Dense, 64, relu" denotes a layer of size 64, followed by a rectified linear unit.
+
+The attention module (Figure 12-left) embeds a state to a $d \times d \times d_{a}$ tensor. The planning module (Figure 13) is a one-step LSTM update which takes the result of a convolutional layer as input. Both the input and hidden size of the LSTM cell are $d_{e}$ . All $d \times d$ locations share one set of parameters and are processed by the LSTM in one batch.
+
+The main architecture is illustrated in Figure 12-right. It takes maze map, state and goal as input, and outputs the action and the value. Refer to Section 4.2 for details for computing $\psi(s)$ . In our experiments, we set the values of the hyper-parameters to be $(d, d_e, d_a, p) = (15, 64, 8, 8)$ .
+
+
+Figure 13: planning module
+
+# EXPERIMENT DETAILS
+
+# E.1 BENCHMARK ENVIRONMENTS
+
+We used four benchmark environments in our experiment. For the first three, the workspace dimension is 2d. We generated the maze maps with the recursive backtracker algorithm using the following implementation: https://github.com/lilee/gated-path-planning-networks/blob/master/generate>dataset.py. Examples of the workspace are shown in Figure 15. Three environments differ in the choice of robots:
+
+- **Workspace planning (2d).** The robot is abstracted with a point mass moving in the plane. Without higher dimensions, this problem reduces to planning in the workspace.
+- Rigid body navigation (3d). A rigid body robot, abstracted as a thin rectangle, is used here. The extra rotation dimension is added to the planning problem. This robot can rotate and move freely without any constraints in the free space.
+- 3-link snake (5d). The robot is a 5 DoF snake with two joints. Two more angle dimensions are added to the planning task. To prevent links from folding, we restrict the angles to the range of $[- \pi / 4, \pi / 4]$ .
+
+The fourth environment has a 3d workspace. Cuboid obstacles were generated uniformly randomly in space with density $\approx 20\%$ . Example of the workspace is shown in Figure 6 and 16, where the blue cuboids are obstacles. The environment is described below:
+
+- Spacecraft planning (7d). The robot is a spacecraft with a cuboid body and two 2 DoF arms connecting to two opposite sides of the body. There is a joint in the middle of each arm. The outer arm can rotate around this joint. Each arm can also rotate as a whole around its connection point with the body. All rotation angles are restricted in the range of $[0, \pi/2]$ . The spacecraft itself cannot rotate.
+
+# E.2 HYPERPARAMETER FOR MSIL
+
+During self-improving over the first 2000 problems, NEXT updated its parameters and annealed $\epsilon$ once for every 200 problems. The value of the annealing $\epsilon$ was set as the following:
+
+$$
+\epsilon = \left\{ \begin{array}{l l} 1, & \text {i f} i < 1 0 0 0, \\ 0. 5 - 0. 1 \cdot \lfloor (i - 1 0 0 0) / 2 0 0 \rfloor , & \text {i f} 1 0 0 0 \leqslant i < 2 0 0 0, \\ 0. 1, & \text {o t h e r w i s e}, \end{array} \right.
+$$
+
+with $i$ denoting the problem number.
+
+# E.3 BASELINE: THE IMPROVED GPPN
+
+The original GPPN is not directly applicable to our experiments. Inspired by Tamar et al. (2016), we add a fully-connected MLP to its final layers, so that the improved architecture can be applied to high-dimensional continuous domain. As shown in Figure 14, the GPPN first processes the discretized
+
+
+Figure 14: Improved GPPN architecture
+
+workspace locations. Its output and the full robot configurations are processed together by the MLP, which then produces the current value and action estimates. The improved GPPN is trained using supervisions from the near-optimal paths produced by RRT*.
+
+# F EXPERIMENT RESULTS
+
+# F.1 SOLUTION PATH ILLUSTRATION
+
+
+Figure 15: The solution path produced by NEXT in a workspace planning task (2d), rigid body navigation task (3d), 3-link snake task (5d) from left to right. The orange dot and the brown dot are starting and goal locations, respectively.
+
+
+Figure 16: The solution paths produced by NEXT in spacecraft planning task (7d). Spacecraft has a yellow body and two 2 DoF (red) arms. Blue cuboids are obstacles.
+
+# F.2 DETAILS OF QUANTITATIVE EVALUATION
+
+More detailed results are shown in Table 1, 2, 3, including learning-based and non-learning-based ones, on the last 1000 problems in each experiment. We normalized the number of collision checks and the cost of paths based on the solution of RRT*. The success rate result is not normalized. The
+
+best planners in each experiment are in **bold**. NEXT-KS and NEXT-GP outperform the current state-of-the-art planning algorithm with large margins.
+
+Table 1: Success rate results. The higher the better. NEXT-KS performs the best.
+
+ | NEXT-KS | NEXT-GP | GPPN-KS | GPPN-GP | RRT* | BIT* | BFS | CVAE | Reject |
| 2d | 0.988 | 0.981 | 0.718 | 0.632 | 0.735 | 0.710 | 0.185 | 0.535 | 0.720 |
| 3d | 0.943 | 0.841 | 0.689 | 0.554 | 0.490 | 0.514 | 0.121 | 0.114 | 0.498 |
| 5d | 0.883 | 0.768 | 0.633 | 0.515 | 0.455 | 0.497 | 0.030 | 0.476 | 0.444 |
| 7d | 0.931 | 0.906 | 0.634 | 0.369 | 0.361 | 0.814 | 0.288 | 0.272 | 0.370 |
+
+Table 2: Average number of collision checks results. The lower the better. The score is normalized based on the solution of RRT*. NEXT-KS performs the best in 3 benchmarks.
+
+ | NEXT-KS | NEXT-GP | GPPN-KS | GPPN-GP | RRT* | BIT* | BFS | CVAE | Reject |
| 2d | 0.177 | 0.243 | 2.342 | 3.484 | 1.000 | 5.945 | 9.247 | 1.983 | 1.011 |
| 3d | 0.694 | 1.334 | 2.214 | 3.125 | 1.000 | 7.924 | 7.292 | 2.162 | 0.988 |
| 5d | 0.888 | 1.520 | 1.800 | 2.706 | 1.000 | 7.483 | 5.758 | 1.188 | 0.997 |
| 7d | 0.653 | 0.502 | 1.877 | 1.313 | 1.000 | 4.683 | 3.856 | 1.591 | 0.987 |
+
+Table 3: Average cost of paths. The lower the better. The score is normalized based on the solution of RRT*. The NEXT-KS achieves the best solutions.
+
+ | NEXT-KS | NEXT-GP | GPPN-KS | GPPN-GP | RRT* | BIT* | BFS | CVAE | Reject |
| 2d | 0.172 | 0.193 | 1.049 | 1.333 | 1.000 | 1.140 | 2.811 | 1.649 | 1.050 |
| 3d | 0.116 | 0.315 | 0.612 | 0.875 | 1.000 | 0.955 | 1.720 | 1.734 | 0.984 |
| 5d | 0.215 | 0.426 | 0.673 | 0.890 | 1.000 | 0.923 | 1.780 | 0.961 | 1.020 |
| 7d | 0.108 | 0.147 | 0.573 | 0.987 | 1.000 | 0.291 | 1.114 | 1.139 | 0.986 |
+
+We demonstrated the performance improvement curves for 2d workspace planning, 3d rigid body navigation in Figure 17. As we can see, similar to the performances on 5d 3-link snake planning task in Figure 7, in these tasks, the NEXT-KS and NEXT-GP improve the performances along with more and more experiences collected, justified the self-improvement ability by learning $\tilde{V}^*$ and $\tilde{\pi}^*$ .
+
+# F.3 SEARCH TREES COMPARISON
+
+We illustrate the search trees generated by RRT* and the proposed NEXT algorithms with 500 samples in Figure 18, Figure 19, Figure 20 and Figure 21 on several 2d, 3d, 5d and 7d planning tasks, respectively. To help readers better understand how the trees were expanded, we actually visualize the RRT* search trees without edge rewiring, which is equivalent to the RRT search trees, however the vertex set is the same. Comparing to the search trees generated by RRT* side by side, we can clearly see the advantages and the efficiency of the proposed NEXT algorithms. In all the tasks, even in 2d workspace planning task, the RRT* indeed randomly searches without realizing the goals, and thus cannot complete the missions, while the NEXT algorithms search towards the goals with the guidance from $\tilde{V}^*$ and $\tilde{\pi}^*$ , therefore, successfully provides high-quality solutions.
+
+
+
+
+
+
+
+
+Figure 17: The first and second rows display the improvement curves of our algorithms on all 3000 problems of the 2d workspace planning and 3d rigid body navigation problems. We compare our algorithms with RRT*. Three columns correspond to the success rate, the average collision checks, and the average cost of the solution paths for each algorithm.
+
+
+
+
+
+
+
+
+
+
+
+
+
+Figure 18: Column (a) to (c) are the search trees produced by the RRT*, NEXT-KS, and NEXT-GP on the same workspace planning task (2d). The learned $\tilde{V}^*$ and $\tilde{\pi}^*$ from NEXT-KS are plotted in column (d). In the figures, obstacles are colored in deep blue, the starting and goal locations are denoted by orange and brown dots, respectively. In column (a) to (c), samples are represented with hollow yellow circles, and edges are colored in green. In column (d), the level of redness denotes the value of the cost-to-go estimate $\tilde{V}^*$ , and the cyan arrows point from a given state $s$ to the center of the proposal distribution $\tilde{\pi}^*(s'|s,U)$ . We set the maximum number of samples to be 500.
+
+(a) RRT\* (w/o rewiring) (b) NEXT-KS search tree (c) NEXT-GP search tree (d) learned $\tilde{V}^{*}$ and $\tilde{\pi}^*$
+
+
+
+
+
+
+
+
+
+
+RRT* search tree (w/o rewiring)
+
+
+
+
+
+
+Figure 19: Each column corresponds to one example from the rigid body navigation problem (3d). The top and the bottom rows are the search trees produced by the RRT* and NEXT-KS, respectively. In the figures, obstacles are colored in deep blue, and the rigid bodies are represented with matchsticks. The samples, starting states, and goal states are denoted by yellow, orange, and brown matchsticks, respectively. Edges are colored in green. We set the maximum number of samples to be 500.
+
+
+NEXT-KS search trees
+
+
+
+
+
+
+
+
+RRT* search tree (w/o rewiring)
+
+
+
+
+
+
+Figure 20: Each column corresponds to one example from the 3-link snake problem (5d). The top and the bottom rows are the search trees produced by the RRT* and NEXT-KS, respectively. In the figures, obstacles are colored in deep blue, and the rigid bodies are represented with matchsticks. The samples, starting states, and goal states are denoted by yellow, orange, and brown matchsticks, respectively. Edges are colored in green. We set the maximum number of samples to be 500.
+
+
+NEXT-KS search trees
+
+
+
+
+
+
+RRT* search tree (w/o rewiring)
+
+
+
+
+
+
+Figure 21: Each column corresponds to one example from the spacecraft planning problem (7d). The top and the bottom rows are the search trees produced by the RRT* and NEXT-KS, respectively. In the figures, obstacles are colored in blue, and each spacecraft has a yellow body and two 2 DoF red arms. We set the maximum number of samples to be 500.
+
+
+NEXT-KS search trees
+
+
+
+# F.4 CASE STUDY DETAILS
+
+We conduct a real-world case study on controlling robot arms to move objects on a shelf. This is a representative of common scenarios in practice where the robot needs to plan its motion in real-time to reach the inside of some narrow space. For this case study, we focus more on the practical aspect to evaluate how much can we improve on the wall-clock time by learning from similar planning problems.
+
+# F.4.1 TASK DESCRIPTION
+
+We generate planning problems randomly to form the training set and test set. In each planning task, there is a shelf of multiple levels, with each level horizontally divided into multiple bins. The heights of levels and widths of bins are randomly drawn from some fixed distribution. Samples of shelves are shown in Figure 22. Both the start and goal configurations are randomly sampled from a distribution within the reachable region of the robot arm. The planning environment is created with the OpenRave simulator (Diankov, 2010).
+
+The task is to find a path for the 7 DoF robot arm to move from a location in one bin to another, i.e., the end effectors of the start and goal configurations are in different bins, as illustrated in Figure 23. In this case, the base of the robot is fixed and we are planning the movement of arm. We generated 3000 problems for training and 1000 problems for testing.
+
+# F.4.2 BASELINES AND TRAINING
+
+For traditional planners, we include C++ OMPL (Sucan et al., 2012) implementation of BIT* (Gammell et al., 2015) and RRT* (Karaman & Frazzoli, 2011) as baselines. The hyperparameters of RRT* and BIT* are specially tuned for this experiment. We also compare with learning-based planners CVAE-plan (Ichter et al., 2018) and Reinforce-plan (Zhang et al., 2018). The supervisions for CVAE-plan are produced by the well-tuned BIT* on the training set. To train NEXT, we consider the BIT* instead of RRT* as the imperfect expert in training problems.
+
+# F.4.3 RESULTS
+
+We evaluate the algorithms on the separated testing problems, and record the success rate using 10 different time limits. The success rate and average path quality are plot in Figure 8 and recorded in Table 4 and Table 5. The solution paths found by NEXT and BIT* are illustrated in Figure 23. In terms of both success rate and solution path quality, NEXT dominates all the planners under all time limits.
+
+
+Figure 22: Examples of different shelves sampled from the distribution.
+
+
+Figure 23: First row: robot arm solution trajectories produced by NEXT(-KS) in four planning problems; Second row: BIT* solutions on the same planning problems. NEXT only takes 5 seconds to complete each problem while BIT* needs 250 seconds to find a solution for the hardest problems (last two columns).
+
+Table 4: Success rates of different planners under varying time limits, the higher the better.
+
+ | 5s | 10s | 15s | 20s | 25s | 30s | 35s | 40s | 45s | 50s |
| NEXT | 0.579 | 0.657 | 0.703 | 0.709 | 0.745 | 0.743 | 0.746 | 0.752 | 0.772 | 0.763 |
| CVAE | 0.354 | 0.437 | 0.482 | 0.509 | 0.507 | 0.539 | 0.553 | 0.551 | 0.579 | 0.580 |
| Reinforce | 0.160 | 0.170 | 0.200 | 0.150 | 0.180 | 0.190 | 0.175 | 0.180 | 0.225 | 0.175 |
| BIT* | 0.226 | 0.288 | 0.320 | 0.365 | 0.364 | 0.429 | 0.425 | 0.422 | 0.443 | 0.475 |
| RRT* | 0.135 | 0.148 | 0.144 | 0.136 | 0.147 | 0.159 | 0.152 | 0.158 | 0.157 | 0.165 |
+
+Table 5: Average path costs of different planners under varying time limits, the lower the better.
+
+ | 5s | 10s | 15s | 20s | 25s | 30s | 35s | 40s | 45s | 50s |
| NEXT | 25.143 | 21.873 | 20.052 | 19.773 | 18.318 | 18.381 | 18.274 | 18.047 | 17.224 | 17.587 |
| CVAE | 34.414 | 30.815 | 28.909 | 27.717 | 27.784 | 26.408 | 25.776 | 25.883 | 24.665 | 24.659 |
| Reinforce | 42.781 | 42.471 | 41.142 | 43.295 | 42.129 | 41.657 | 42.235 | 42.093 | 40.269 | 42.282 |
| BIT* | 39.543 | 37.086 | 35.744 | 34.002 | 34.007 | 31.414 | 31.587 | 31.651 | 30.841 | 29.601 |
| RRT* | 43.368 | 42.855 | 42.981 | 43.355 | 42.919 | 42.410 | 42.680 | 42.441 | 42.504 | 42.165 |
\ No newline at end of file
diff --git a/learningtoplaninhighdimensionsvianeuralexplorationexploitationtrees/images.zip b/learningtoplaninhighdimensionsvianeuralexplorationexploitationtrees/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..ed540886e73ed2c43b1a9b21d05be3ce77d335e6
--- /dev/null
+++ b/learningtoplaninhighdimensionsvianeuralexplorationexploitationtrees/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:df8abf1d96ab7ed0d448a3263c9eb923129f8bd00618bf3ea2c55d3fe193a612
+size 1448426
diff --git a/learningtoplaninhighdimensionsvianeuralexplorationexploitationtrees/layout.json b/learningtoplaninhighdimensionsvianeuralexplorationexploitationtrees/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..1490a2c15d0a665f9e18aff8b19972200de32c13
--- /dev/null
+++ b/learningtoplaninhighdimensionsvianeuralexplorationexploitationtrees/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0d919fd712d37ce06815ab3ec8649832604c7427a98d344e8015a52628cf6d29
+size 953893
diff --git a/makingsenseofreinforcementlearningandprobabilisticinference/b1b6f1fd-47c3-4b83-97b0-b04772a13ab3_content_list.json b/makingsenseofreinforcementlearningandprobabilisticinference/b1b6f1fd-47c3-4b83-97b0-b04772a13ab3_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..7dc35f8b7a2fba6d4e38204f55e05eacee477aee
--- /dev/null
+++ b/makingsenseofreinforcementlearningandprobabilisticinference/b1b6f1fd-47c3-4b83-97b0-b04772a13ab3_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:630242dd8ecd8df144f8e4631016987d39f58f61a8a91a05337abe033a105a63
+size 108979
diff --git a/makingsenseofreinforcementlearningandprobabilisticinference/b1b6f1fd-47c3-4b83-97b0-b04772a13ab3_model.json b/makingsenseofreinforcementlearningandprobabilisticinference/b1b6f1fd-47c3-4b83-97b0-b04772a13ab3_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..b074b23410d3693a82d252e8a60e7997250b95aa
--- /dev/null
+++ b/makingsenseofreinforcementlearningandprobabilisticinference/b1b6f1fd-47c3-4b83-97b0-b04772a13ab3_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ae98b863bcdbb5380da6ddce6d6bc1017f097a6ba6d47a0925d6621527b5c84c
+size 132000
diff --git a/makingsenseofreinforcementlearningandprobabilisticinference/b1b6f1fd-47c3-4b83-97b0-b04772a13ab3_origin.pdf b/makingsenseofreinforcementlearningandprobabilisticinference/b1b6f1fd-47c3-4b83-97b0-b04772a13ab3_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..465792b3694d16d0749c02cae2ef176479b5cd6c
--- /dev/null
+++ b/makingsenseofreinforcementlearningandprobabilisticinference/b1b6f1fd-47c3-4b83-97b0-b04772a13ab3_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:5ce9c277d76a3ff86abe5dffb1ed1d782fff408cb607fc3374fd6f692b82d4b9
+size 728097
diff --git a/makingsenseofreinforcementlearningandprobabilisticinference/full.md b/makingsenseofreinforcementlearningandprobabilisticinference/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..a9dc71c09184d21d8be7110c91bdf4aa8dfe1173
--- /dev/null
+++ b/makingsenseofreinforcementlearningandprobabilisticinference/full.md
@@ -0,0 +1,498 @@
+# MAKING SENSE OF REINFORCEMENT LEARNING AND PROBABILISTIC INFERENCE
+
+Brendan O'Donoghue*†
+
+Ian Osband *†
+
+Catalin Ionescu†
+
+# ABSTRACT
+
+Reinforcement learning (RL) combines a control problem with statistical estimation: The system dynamics are not known to the agent, but can be learned through experience. A recent line of research casts 'RL as inference' and suggests a particular framework to generalize the RL problem as probabilistic inference. Our paper surfaces a key shortcoming in that approach, and clarifies the sense in which RL can be coherently cast as an inference problem. In particular, an RL agent must consider the effects of its actions upon future rewards and observations: The exploration-exploitation tradeoff. In all but the most simple settings, the resulting inference is computationally intractable so that practical RL algorithms must resort to approximation. We demonstrate that the popular 'RL as inference' approximation can perform poorly in even very basic problems. However, we show that with a small modification the framework does yield algorithms that can provably perform well, and we show that the resulting algorithm is equivalent to the recently proposed K-learning, which we further connect with Thompson sampling.
+
+# 1 INTRODUCTION
+
+Probabilistic inference is a procedure of making sense of uncertain data using Bayes' rule. The optimal control problem is to take actions in a known system in order to maximize the cumulative rewards through time. Probabilistic graphical models (PGMs) offer a coherent and flexible language to specify causal relationships, for which a rich literature of learning and inference techniques have developed (Koller & Friedman, 2009). Although control dynamics might also be encoded as a PGM, the relationship between action planning and probabilistic inference is not immediately clear. For inference, it is typically enough to specify the system and pose the question, and the objectives for learning emerge automatically. In control, the system and objectives are known, but the question of how to approach a solution may remain extremely complex (Bertsekas, 2005).
+
+Perhaps surprisingly, there is a deep sense in which inference and control can represent a dual view of the same problem. This relationship is most clearly stated in the case of linear quadratic systems, where the Ricatti equations relate the optimal control policy in terms of the system dynamics (Welch et al., 1995). In fact, this connection extends to a wide range of systems, where control tasks can be related to a dual inference problem through rewards as exponentiated probabilities in a distinct, but coupled, PGM (Todorov, 2007; 2008). A great benefit of this connection is that it can allow the tools of inference to make progress in control problems, and vice-versa. In both cases the connections provide new insights, inspire new algorithms and enrich our understanding (Toussaint & Storkey, 2006; Ziebart et al., 2008; Kappen et al., 2012).
+
+Reinforcement learning (RL) is the problem of learning to control an unknown system (Sutton & Barto, 2018). Like the control setting, an RL agent should take actions to maximize its cumulative rewards through time. Like the inference problem, the agent is initially uncertain of the system dynamics, but can learn through the transitions it observes. This leads to a fundamental tradeoff: The agent may be able to improve its understanding through exploring poorly-understood states and actions, but it may be able to attain higher immediate reward through exploiting its existing knowledge (Kearns & Singh, 2002). In many ways, RL combines control and inference into a general framework for decision making under uncertainty. Although there has been ongoing research
+
+in this area for many decades, there has been a recent explosion of interest as RL techniques have made high-profile breakthroughs in grand challenges of artificial intelligence research (Mnih et al., 2013; Silver et al., 2016).
+
+A popular line of research has sought to cast 'RL as inference', mirroring the dual relationship for control in known systems. This approach is most clearly stated in the tutorial and review of Levine (2018), and provides a key reference for research in this field. It suggests that a generalization of the RL problem can be cast as probabilistic inference through inference over exponentiated rewards, in a continuation of previous work in optimal control (Todorov, 2009). This perspective promises several benefits: A probabilistic perspective on rewards, the ability to apply powerful inference algorithms to solve RL problems and a natural exploration strategy. In this paper we will outline an important way in which this perspective is incomplete. This shortcoming ultimately results in algorithms that can perform poorly in even very simple decision problems. Importantly, these are not simply technical issues that show up in some edge cases, but fundamental failures of this approach that arise in even the most simple decision problems.
+
+In this paper we revisit an alternative framing of 'RL as inference'. In fact, we show that the original RL problem was already an inference problem all along. Importantly, this inference problem includes inference over the agent's future actions and observations. Of course, this perspective is not new, and has long been known as simply the Bayes-optimal solution, see, e.g., Ghavamzadeh et al. (2015). The problem is that, due to the exponential lookahead, this inference problem is fundamentally intractable for all but the simplest problems (Gittins, 1979). For this reason, RL research focuses on computationally efficient approaches that maintain a level of statistical efficiency (Furmston & Barber, 2010; Osband et al., 2017).
+
+We provide a review of the RL problem in Section 2, together with a simple and coherent framing of RL as probabilistic inference. In Section 3 we present three approximations to the intractable Bayes-optimal policy. We begin with the celebrated Thompson sampling algorithm, then we review the popular 'RL as inference' framing, as presented by Levine (2018), and highlight a clear and simple shortcoming in this approach. Finally, we review K-learning (O'Donoghue, 2018), which we re-interpret as a modification to the RL as inference framework that provides a principled approach to the statistical inference problem, as well as a presenting a relationship with Thompson sampling. In Section 4 we present computational studies that support our claims.
+
+# 2 REINFORCEMENT LEARNING
+
+We consider the problem of an agent taking actions in an unknown environment in order to maximize cumulative rewards through time. For simplicity, this paper will model the environment as a finite horizon, discrete Markov Decision Process (MDP) $M = (\mathcal{S}, \mathcal{A}, \mathcal{R}, \mathcal{P}, H, \rho)$ .2 Here $\mathcal{S} = \{1,.., S\}$ is the state space, $\mathcal{A} = \{1,.., A\}$ is the action space and each episode is of fixed length $H \in \mathbb{N}$ . Each episode $\ell \in \mathbb{N}$ begins with state $s_0 \sim \rho$ then for timesteps $h = 0,.., H - 1$ the agent selects action $a_h$ , observes transition $s_{h + 1}$ with probability $\mathcal{P}(s_{h + 1}, s_h, a_h) \in [0,1]$ and receives reward $r_{h + 1} \sim \mathcal{R}(s_h, a_h)$ , where we denote by $\mu(s_h, a_h) = \mathbb{E}r_{h + 1}$ the mean reward. We define a policy $\pi_t$ to be a mapping from $S$ to probability distributions over $\mathcal{A}$ and write $\Pi$ for the space of all policies. For any timestep $t = (\ell, h)$ , we define $\mathcal{F}_t = (s_0^0, a_0^0, r_1^0, .., s_{h - 1}^\ell, a_{h - 1}^\ell, r_h^\ell)$ to be the sequence of observations made before time $t$ . An RL algorithm maps histories to policies $\pi_t = \mathrm{alg}(\mathcal{S}, \mathcal{A}, \mathcal{F}_t)$ .
+
+Our goal in the design of RL algorithms is to obtain good performance (cumulative rewards) for an unknown $M \in \mathcal{M}$ , where $\mathcal{M}$ is some family of possible environments. Note that this is a different problem from typical 'optimal control', that seeks to optimize performance for one particular known MDP $M$ ; although you might still fruitfully apply an RL algorithm to solve problems of that type. For any environment $M$ and any policy $\pi$ we can define the action-value function,
+
+$$
+Q _ {h} ^ {M, \pi} (s, a) = \mathbb {E} _ {\pi , M} \left[ \sum_ {j = h + 1} ^ {H} r _ {j} \mid s _ {h} = s, a _ {h} = a \right]. \tag {1}
+$$
+
+Where the expectation in (1) is taken with respect to the action selection $a_{j}$ for $j > h$ from the policy $\pi$ and evolution of the fixed MDP $M$ . We define the value function $V_{h}^{M,\pi}(s) = \mathbb{E}_{\alpha \sim \pi}Q_{h}^{M,\pi}(s,\alpha)$ and write $Q_{h}^{M,\star}(s,a) = \max_{\pi \in \Pi}Q_{h}^{M,\pi}(s,a)$ for the optimal Q-values over policies, and the optimal value function is given by $V_{h}^{M,\star}(s) = \max_{a}Q_{h}^{M,\star}(s,a)$ .
+
+In order to compare algorithm performance across different environments, it is natural to normalize in terms of the regret, or shortfall in cumulative rewards relative to the optimal value,
+
+$$
+\operatorname {R e g r e t} (M, \mathrm {a l g}, L) = \mathbb {E} _ {M, \mathrm {a l g}} \left[ \sum_ {\ell = 1} ^ {L} \left(V _ {0} ^ {M, \star} \left(s _ {0} ^ {\ell}\right) - \sum_ {h = 1} ^ {H} r _ {h} ^ {\ell}\right) \right]. \tag {2}
+$$
+
+This quantity depends on the unknown MDP $M$ , which is fixed from the start and kept the same throughout, but the expectations are taken with respect to the dynamics of $M$ and the learning algorithm $\mathrm{alg}$ . For any particular MDP $M$ , the optimal regret of zero can be attained by the non-learning algorithm $\mathrm{alg}_M$ that returns the optimal policy for $M$ .
+
+In order to assess the quality of a reinforcement learning algorithm, which is designed to work across some family of $M \in \mathcal{M}$ , we need some method to condense performance over a set to a single number. There are two main approaches to this:
+
+$$
+\operatorname {B a y e s R e g r e t} (\phi , \operatorname {a l g}, L) = \mathbb {E} _ {M \sim \phi} \operatorname {R e g r e t} (M, \operatorname {a l g}, L), \tag {3}
+$$
+
+$$
+\operatorname {W o r s t C a s e R e g r e t} (\mathcal {M}, \operatorname {a l g}, L) = \max _ {M \in \mathcal {M}} \operatorname {R e g r e t} (M, \operatorname {a l g}, L), \tag {4}
+$$
+
+where $\phi$ is a prior over the family $\mathcal{M}$ . These differing objectives are often framed as Bayesian (average-case) (3) and frequentist (worst-case) (4) RL3. Although these two settings are typically studied in isolation, it should be clear that they are intimately related through the choice of $\mathcal{M}$ and $\phi$ . Our next section will investigate what it would mean to 'solve' the RL problem. Importantly, we show that both frequentist and Bayesian perspectives already amount to a problem in probabilistic inference, without the need for additional re-interpretation.
+
+# 2.1 SOLVING THE RL PROBLEM THROUGH PROBABILISTIC INFERENCE
+
+If you want to 'solve' the RL problem, then formally the objective is clear: find the RL algorithm that minimizes your chosen objective, (3) or (4). To anchor our discussion, we introduce a simple decision problem designed to highlight some key aspects of reinforcement learning. We will revisit this problem setting as we discuss approximations to the optimal policy.
+
+Problem 1 (One unknown action). Fix $N \in \mathbb{N} \geq 3, \epsilon > 0$ and define $\mathcal{M}_{N,\epsilon} = \{M_{N,\epsilon}^{+}, M_{N,\epsilon}^{-}\}$ . Both $M^{+}$ and $M^{-}$ share $\mathcal{S} = \{1\}$ , $H = 1$ and $\mathcal{A} = \{1,.., N\}$ ; they only differ through their rewards:
+
+$$
+\mathcal {R} ^ {+} (1) = 1, \quad \mathcal {R} ^ {+} (2) = + 2, \quad \mathcal {R} ^ {+} (a) = 1 - \epsilon f o r a = 3,.., N,
+$$
+
+$$
+\mathcal {R} ^ {-} (1) = 1, \quad \mathcal {R} ^ {-} (2) = - 2, \quad \mathcal {R} ^ {-} (a) = 1 - \epsilon f o r a = 3,.., N.
+$$
+
+Where $\mathcal{R}(a) = x\in \mathbb{R}$ is a shorthand for deterministic reward of $x$ when choosing action $a$ .
+
+Problem 1 is extremely simple, it involves no generalization and no long-term consequences: It is an independent bandit problem with only one unknown action. For known $M^{+}, M^{-}$ the optimal policy is trivial: Choose $a_{t} = 2$ in $M^{+}$ and $a_{t} = 1$ in $M^{-}$ for all $t$ . An RL agent faced with unknown $M \in \mathcal{M}$ should attempt to optimize the RL objectives (3) or (4). Unusually, and only because Problem 1 is so simple, we can actually compute the optimal solutions to both in terms of $L$ (the total number of episodes) and $\phi = (p^{+}, p^{-})$ where $p^{+} = \mathbb{P}(M = M^{+})$ , the probability of being in $M^{+}$ .
+
+For $L > 3$ an optimal minimax (minimizing the worst-case regret) RL algorithm is to first choose $a_0 = 2$ and observe $r_1$ . If $r_1 = 2$ then you know you are in $M^+$ so pick $a_t = 2$ for all $t = 1, 2, \ldots$ , for $\operatorname{Regret}(L) = 0$ . If $r_1 = -2$ then you know you are in $M^-$ so pick $a_t = 1$ for all $t = 1, 2, \ldots$ , for $\operatorname{Regret}(L) = 3$ . The worst-case regret of this algorithm is 3, which cannot be bested by any algorithm.
+
+Actually, the same RL algorithm is also Bayes-optimal for any $\phi = (p^{+}, p^{-})$ provided $p^{+}L > 3$ . This relationship is not a coincidence. All admissible solutions to the worst-case problem (4) are given by solutions to the average-case (3) for some 'worst-case' prior $\tilde{\phi}$ (Wald, 1950). As such, for ease of exposition, our discussion will focus on the Bayesian (or average-case) setting. However, readers should understand that the same arguments apply to the worst-case objective.
+
+In Problem 1, the key probabilistic inference the agent must consider is the effects of its own actions upon the future rewards, i.e., whether it has chosen action 2. Slightly more generally, where actions are independent and episode length $H = 1$ , the optimal RL algorithm can be computed via Gittins indices, but these problems are very much the exception (Gittins, 1979). In problems with generalization or long-term consequences, computing the Bayes-optimal solution is computationally intractable. One example of an algorithm that converges to Bayes-optimal solution in the limit of infinite computation is given by Bayes-adaptive Monte-Carlo Planning (Guez et al., 2012). The problem is that, even for very simple problems, the lookahead tree of interactions between actions, observations and algorithmic updates grows exponentially in the search depth (Strehl et al., 2006). Worse still, direct computational approximations to the Bayes-optimal solution can fail exponentially badly should they fall short of the required computation (Munos, 2014). As a result, research in reinforcement learning amounts to trying to find computationally tractable approximations to the Bayes-optimal policy that maintain some degree of statistical efficiency.
+
+# 3 APPROXIMATIONS FOR COMPUTATIONAL AND STATISTICAL EFFICIENCY
+
+The exponential explosion of future actions and observations means solving for the Bayes-optimal solution is computationally intractable. To counter this, most computationally efficient approaches to RL simplify the problem at time $t$ to only consider inference over the data $\mathcal{F}_t$ that has been gathered prior to time $t$ . The most common family of these algorithms are 'certainty equivalent' (under an identity utility): They take a point estimate for their best guess of the environment $\hat{M}$ , and try to optimize their control given these estimates $V^{\hat{M},\star}$ . Typically, these algorithms are used in conjunction with some dithering scheme for random action selection (e.g., epsilon-greedy), to mitigate premature and suboptimal convergence (Watkins, 1989). However, since these algorithms do not prioritize their exploration, they may take exponentially long to find the optimal policy (Osband et al., 2014).
+
+In order for an RL algorithm to be statistically efficient, it must consider the value of information. To do this, an agent must first maintain some notion of epistemic uncertainty, so that it can direct its exploration towards states and actions that it does not understand well (O'Donoghue et al., 2018). Here again, probabilistic inference finds a natural home in RL: We should build up posterior estimates for the unknown problem parameters, and use this distribution to drive efficient exploration.4
+
+# 3.1 THOMPSON SAMPLING
+
+One of the oldest heuristics for balancing exploration with exploitation is given by Thompson sampling, or probability matching (Thompson, 1933). Each episode, Thompson sampling (TS) randomly selects a policy according to the probability it is the optimal policy, conditioned upon the data seen prior to that episode. Thompson sampling is a simple and effective method that successfully balances exploration with exploitation (Russo et al., 2018).
+
+Implementing Thompson sampling amounts to an inference problem at each episode. For each $s, a, h$ define the binary random variable $\mathcal{O}_h(s, a)$ where $\mathcal{O}_h(s, a) = 1$ denotes the event that action $a$ is optimal for state $s$ in timestep $h$ . The TS policy for episode $\ell$ is thus given by the inference problem,
+
+$$
+\pi^ {\mathrm {T S}} \sim \mathbb {P} (\mathcal {O} \mid \mathcal {F} _ {\ell}), \tag {5}
+$$
+
+where $\mathbb{P}(\mathcal{O}\mid \mathcal{F}_{\ell})$ is the joint probability over all the binary optimality variables (hereafter we shall suppress the dependence on $\mathcal{F}_{\ell}$ ). To understand how Thompson sampling guides exploration let us consider its performance in Problem 1 when implemented with a uniform prior $\phi = (\frac{1}{2},\frac{1}{2})$ . In the
+
+first timestep the agent samples $M_0 \sim \phi$ . If it samples $M^+$ it will choose action $a_0 = 2$ and learn the true system dynamics, choosing the optimal arm thereafter. If it samples $M^-$ it will choose action $a_0 = 1$ and repeat the identical decision in the next timestep. Note that this procedure achieves BayesRegret 2.5 according to $\phi$ , but also worst-case regret 3, which matches the optimal minimax performance despite its uniform prior.
+
+Recent interest in TS was kindled by strong empirical performance in bandit tasks (Chapelle & Li, 2011). Following work has shown that this algorithm satisfies strong Bayesian regret bounds close to the known lower bounds for MDPs, under certain assumptions (Osband & Van Roy, 2017; 2016). However, although much simpler than the Bayes-optimal solution, the inference problem in (5) can still be prohibitively expensive. Table 1 describes one approach to performing the sampling required in (5) implicitly, by maintaining an explicit model over MDP parameters. This algorithm can be computationally intractable as the MDP becomes large and so attempts to scale Thompson sampling to complex systems have focused on approximate posterior samples via randomized value functions, but it is not yet clear under which settings these approximations should be expected to perform well (Osband et al., 2017). As we look for practical, scalable approaches to posterior inference one promising (and popular) approach is known commonly as 'RL as inference'.
+
+Table 1: Model-based Thompson sampling.
+
+| Before episode ℓ | Sample Mℓ = (S, A, Rℓ, Pℓ, H, ρ) ~ φ | Fℓ |
| Bellman equation | Qℓh(s, a) = μℓ(s, a) + ∑s′ Pℓ(′s, a)Vℓh+1(s′) |
| Vℓh(s) = maxa Qℓh(s, a) |
| Policy | πHS(TS(s, a)) ∈ argmaxQℓh(s, a) |
+
+# 3.2 THE 'RL AS INFERENCE' FRAMEWORK AND ITS LIMITATIONS
+
+The computational challenges of Thompson sampling suggest an approximate algorithm that replaces (5) with a parametric distribution suitable for expedient computation. It is possible to view the algorithms of the 'RL as inference' approach in this light (Rawlik et al., 2013; Todorov, 2009; Toussaint, 2009; Deisenroth et al., 2013; Fellows et al., 2019); see Levine (2018) for a recent survey. These algorithms choose to model the probability of optimality according to,
+
+$$
+\tilde {\mathbb {P}} \left(\mathcal {O} _ {h} (s, a) \mid \tau_ {h} (s, a)\right) \propto \exp \left(\sum_ {\left(s ^ {\prime}, a ^ {\prime}\right) \in \tau_ {h} (s, a)} \beta \mathbb {E} ^ {\ell} \mu \left(s ^ {\prime}, a ^ {\prime}\right)\right). \tag {6}
+$$
+
+for some $\beta > 0$ , where $\tau_h(s, a)$ is a trajectory (a sequence of state-action pairs) starting from $(s, a)$ at timestep $h$ , and where $\mathbb{E}^\ell$ denotes the expectation under the posterior at episode $\ell$ . With this potential in place one can perform Bayesian inference over the unobserved 'optimality' variables, obtaining posteriors over the policy or other variables of interest. This presentation of the RL as inference framework is slightly closer to the one in Deisenroth et al. (2013, §2.4.2.2) than to Levine (2018), but ultimately it produces the same family of algorithms. We provide such a derivation in the appendix for completeness.
+
+Applying inference procedures to (6) leads naturally to RL algorithms with some 'soft' Bellman updates, and added entropy regularization. We describe the general structure of these algorithms in Table 2. These algorithmic connections can help reveal connections to policy gradient, actor-critic, and maximum entropy RL methods (Mnih et al., 2016; O'Donoghue et al., 2017; Haarnoja et al., 2017; 2018; Eysenbach et al., 2018). The problem is that this resultant 'posterior' derived using (6) does not generally bear any close relationship to the agent's epistemic probability that $(s, a, h)$ is optimal.
+
+Table 2: Soft Q-learning.
+
+| Bellman equation | Qh(s,a) = Eℓμ(s,a) + ∑s′ EℓP(s′,s,a)Vh+1(s′) |
| Vh(s) = β-1 log ∑a exp βQh(s,a) |
| Policy | ηSQU(s,a) ∝ exp βQh(s,a) |
+
+To understand how 'RL as inference' guides decision making, let us consider its performance in Problem 1. Practical implementations of 'RL as inference' estimate $\mathbb{E}^{\ell}\mu$ through observations. For $N$ large, and without prior guidance, the agent is then extremely unlikely to select action $a_{t} = 2$ and so resolve its epistemic uncertainty. Even for an informed prior $\phi = \left(\frac{1}{2},\frac{1}{2}\right)$ action selection according to the exploration strategy of Boltzmann dithering is unlikely to sample action 2 for which $\mathbb{E}^{\ell}\mu (2) = 0$ (Levine, 2018; Cesa-Bianchi et al., 2017). This is because the $N - 1$ 'distractor' actions with $\mathbb{E}^{\ell}\mu \geq 1 - \epsilon$ are much more probable under the Boltzmann policy.
+
+This problem is the same problem that afflicts most dithering approaches to exploration. 'RL as inference' as a framework does not incorporate an agents epistemic uncertainty, and so can lead to poor policies for even simple problems. While (6) allows the construction of a dual 'posterior distribution', this distribution does not generally bear any relation to the typical posterior an agent should compute conditioned upon the data it has gathered, e.g., equation (5). Despite this shortcoming RL as inference has inspired many interesting and novel techniques, as well as delivered algorithms with good performance on problems where exploration is not the bottleneck (Eysenbach et al., 2018). However, due to the use of language about 'optimality' and 'posterior inference' etc., it may come as a surprise to some that this framework does not truly tackle the Bayesian RL problem. Indeed, algorithms using 'RL as inference' can perform very poorly on problems where accurate uncertainty quantification is crucial to performance. We hope that this paper sheds some light on the topic.
+
+# 3.3 MAKING sense OF 'RL AS INFERENCE' VIA K-LEARNING
+
+In this section we suggest a subtle alteration to the 'RL as inference' framework that develops a coherent notion of optimality. The K-learning algorithm was originally introduced through a risk-seeking exponential utility (O'Donoghue, 2018). In this paper we re-derive this algorithm as a principled approximate inference procedure with clear connections to Thompson sampling, and we highlight its similarities to the 'RL as inference' framework. We believe that this may offer a road towards combining the respective strengths of Thompson sampling and the 'RL as inference' frameworks. First, consider the following approximate conditional optimality probability at $(s,a,h)$ :
+
+$$
+\tilde {\mathbb {P}} \left(\mathcal {O} _ {h} (s, a) \mid Q _ {h} ^ {M, \star} (s, a)\right) \propto \exp \beta Q _ {h} ^ {M, \star} (s, a), \tag {7}
+$$
+
+for some $\beta > 0$ , and note that this is conditioned on the random variable $Q_h^{M,\star}(s,a)$ . We can marginalize over possible Q-values yielding
+
+$$
+\tilde {\mathbb {P}} \left(\mathcal {O} _ {h} (s, a)\right) = \int \tilde {\mathbb {P}} \left(\mathcal {O} _ {h} (s, a) \mid Q _ {h} ^ {M, \star} (s, a)\right) d \mathbb {P} \left(Q _ {h} ^ {M, \star} (s, a)\right) \propto \exp G _ {h} ^ {Q} (s, a, \beta), \tag {8}
+$$
+
+where $G_h^Q (s,a,\cdot)$ denotes the cumulant generating function of the random variable $Q_{h}^{M,\star}(s,a)$ (Kendall, 1946). Clearly K-learning and the 'RL as inference' framework are similar, since equations (6) and (7) are closely linked, but there is a crucial difference. Notice that the integral performed in (8) is with respect to the posterior over $Q_{h}^{M,\star}(s,a)$ , which includes the epistemic uncertainty explicitly.
+
+Table 3: K-learning.
+
+| Before episode ℓ | Calculate βℓ = β√ℓ |
| Bellman equation | Kh(s,a) = Eℓμ(s,a) + σ2βℓ/2nℓ(s,a) + ∑s′ EℓP(s′,s,a)Vh+1K(s′) |
| VhK(s) = βℓ-1 log ∑a exp βℓKh(s,a) |
| Policy | πKh(s,a) ∝ exp βℓKh(s,a) |
+
+Given the approximation to the posterior probability of optimality in (8) we could sample actions from it as our policy, as done by Thompson sampling (5). However, that requires computation of the cumulant generating function $G_h^Q(s, a, \beta)$ , which is non-trivial. It was shown in (O'Donoghue, 2018) that an upper bound to the cumulant generating function could be computed by solving a particular 'soft' Bellman equation. The resulting K-values, denoted $K_h(s, a)$ at $(s, a, h)$ , are also optimistic for the expected optimal Q-values. Specifically, for any sequence $\{\beta_\ell\}$ the following holds
+
+$$
+K _ {h} (s, a) \geq \beta_ {\ell} ^ {- 1} G _ {h} ^ {Q} (s, a, \beta_ {\ell}) \geq \mathbb {E} ^ {\ell} Q _ {h} ^ {M, \star} (s, a). \tag {9}
+$$
+
+Following a Boltzmann policy over these K-values satisfies a Bayesian regret bound which matches the current best bound for Thompson sampling up to logarithmic factors under the same set of assumptions. We summarize the K-learning algorithm in Table (3), where $\beta > 0$ is a constant and $n^{\ell}(s, a)$ is the visitation count of $(s, a)$ before episode $\ell$ , i.e., the number of times the agent has taken action $a$ at state $s$ , and $\sigma > 0$ is a constant. The uncertainty in the transition function is incorporated into the constant $\sigma$ , which is a technical detail we omit here for clarity, see (O'Donoghue, 2018) for details. In this way the agent is given a reward signal that includes a bonus which is higher for states and actions that the agent has visited less frequently.
+
+Comparing Tables 2 and 3 it is clear that soft Q-learning and K-learning share some similarities: They both solve a 'soft' value function and use Boltzmann policies. However, the differences are important. Firstly, K-learning has an explicit schedule for the inverse temperature parameter $\beta_{\ell}$ , and secondly it adds a bonus based on visitation count to the expected reward. These two relatively small changes make K-learning a principled exploration and inference strategy.
+
+To understand how K-learning drives exploration, consider its performance on Problem 1. Since this is a bandit problem we can compute the cumulant generating functions for each arm and then use the policy given by (8). For any non-trivial prior and choice of $\beta > 0$ the cumulant generating function is optimistic for arm 2 which results in the policy selecting arm 2 more frequently, thereby resolving its epistemic uncertainty. As $\beta \to \infty$ K-learning converges to the policy of pulling arm 2 deterministically. This is in contrast to soft Q-learning where arm 2 is exponentially unlikely to be selected as the exploration parameter $\beta$ grows.
+
+# 3.3.1 CONNECTIONS BETWEEN K-LEARNING AND THOMPSON SAMPLING
+
+Since K-learning can be viewed as approximating the posterior probability of optimality of each action it is natural to ask how close an approximation it is. A natural way to measure this similarity is the Kullback-Leibler (KL) divergence between the distributions,
+
+$$
+D _ {K L} \left(\mathbb {P} \left(\mathcal {O} _ {h} (s)\right) | | \pi_ {h} ^ {\mathrm {K}} (s)\right) = \sum_ {a} \mathbb {P} \left(\mathcal {O} _ {h} (s, a)\right) \log \left(\mathbb {P} \left(\mathcal {O} _ {h} (s, a)\right) / \pi_ {h} ^ {\mathrm {K}} (s, a)\right),
+$$
+
+where we are using the notation $\mathcal{O}_h(s) = \mathcal{O}_h(s,\cdot)$ and $\pi_h^{\mathrm{K}}(s) = \pi_h^{\mathrm{K}}(s,\cdot)$ . This is different to the usual notion of distance that is taken in variational Bayesian methods, which would typically reverse the order of the arguments in the KL divergence (Blundell et al., 2015). However, in RL that 'direction' is not appropriate: a distribution minimizing $D_{KL}(\pi_h(s) || \mathbb{P}(\mathcal{O}_h(s)))$ may put zero probability on regions of support of $\mathbb{P}(\mathcal{O}_h(s))$ . This means an action with non-zero probability of being optimal might never be taken. On the other hand a policy minimizing $D_{KL}(\mathbb{P}(\mathcal{O}_h(s)) || \pi_h(s))$ must assign a non-zero probability to every action that has a non-zero probability of being optimal, or incur an infinite KL divergence penalty. With this characterization in mind, and noting that the
+
+Thompson sampling policy satisfies $\mathbb{E}^{\ell}\pi_h^{\mathrm{TS}}(s) = \mathbb{P}(\mathcal{O}_h(s))$ , our next result links the policies of K-learning to Thompson sampling.
+
+Theorem 1. The $K$ -learning value function $V^{\mathrm{K}}$ and policy $\pi^{\mathrm{K}}$ defined in Table 3 satisfy the following bound at every state $s \in S$ and $h = 0, \ldots, H$ :
+
+$$
+V _ {h} ^ {\mathrm {K}} (s) \geq \mathbb {E} V _ {h} ^ {M, \star} (s) + \beta^ {- 1} D _ {K L} \left(\mathbb {P} \left(\mathcal {O} _ {h} (s)\right) \mid \mid \pi_ {h} ^ {\mathrm {K}} (s)\right). \tag {10}
+$$
+
+We defer the proof to Appendix 5.2. This theorem tells us that the distance between the true probability of optimality and the K-learning policy is bounded for any choice of $\beta < \infty$ . In other words, if there is an action that might be optimal then K-learning will eventually take that action.
+
+# 3.4 WHY IS 'RL AS INFERENCE' SO POPULAR?
+
+The sections above outline some surprising ways that the 'RL as inference' framework can drive suboptimal behaviour in even simple domains. The question remains, why do so many popular and effective algorithms lie within this class? The first, and most important point, is that these algorithms can perform extremely well in domains where efficient exploration is not a bottleneck. Furthermore, they are often easy to implement and amenable to function approximation (Peters et al., 2010; Kober & Peters, 2009; Abdolmaleki et al., 2018). Our discussion of K-learning in Section 3.3 shows that a relatively simple fix to this problem formulation can result in a framing of RL as inference that maintains a coherent notion of optimality. Computational results show that, in tabular domains, K-learning can be competitive with, or even outperform Thompson sampling strategies, but extending these results to large-scale domains with generalization is an open question (O'Donoghue, 2018; Osband et al., 2017).
+
+The other observation is that the 'RL as inference' can provide useful insights to the structure of particular algorithms for RL. It is valid to note that, under certain conditions, following policy gradient is equivalent to a dual inference problem where the 'probabilities' play the role of dummy variables, but are not supposed to represent the probability of optimality in the RL problem. In this light, Levine (2018) presents the inference framework as a way to generalize a wide range of state of the art RL algorithms. However, when taking this view, you should remember that this inference duality is limited to certain RL algorithms, and without some modifications (e.g. Section 3.3) this perspective is in danger of overlooking important aspects of the RL problem.
+
+# 4 COMPUTATIONAL EXPERIMENTS
+
+# 4.1 ONE UNKNOWN ACTION (PROBLEM 1)
+
+Consider the environment of Problem 1 with uniform prior $\phi = (\frac{1}{2},\frac{1}{2})$ . We fix $\epsilon = 1e - 3$ and consider how the Bayesian regret varies with $N > 3$ . Figure 1 compares how the regret scales for Bayes-optimal (1.5), Thompson sampling (2.5), K-learning $(\leq 2.2)$ and soft Q-learning (which grows linearly in $N$ for the optimal $\beta \rightarrow 0$ , but would typically grow exponentially for $\beta > 0$ ). This highlights that, even in a simple problem, there can be great value in considering the value of information.
+
+
+Figure 1: Regret scaling on Problem 1. Soft Q-learning does not scale gracefully with $N$ .
+
+
+Figure 2: DeepSea exploration: A simple example where deep exploration is critical.
+
+# 4.2 'DEEPSEA' EXPLORATION
+
+Our next set of experiments considers the 'DeepSea' MDPs introduced by Osband et al. (2017). At a high level this problem represents a 'needle in a haystack', designed to require efficient exploration, the complexity of which grows with the problem size $N \in \mathbb{N}$ . DeepSea (Figure 2) is a scalable variant of the 'chain MDPs' popular in exploration research (Jaksch et al., 2010).
+
+The agent begins each episode in the top-left state in an $N \times N$ grid. At each timestep the agent can move left or right one column, and falls one row. There is a small negative reward for heading right, and zero reward for left. There is only one rewarding state, at the bottom right cell. The only way the agent can receive positive reward is to choose to go right in each timestep. Algorithms that do not perform deep exploration will take an exponential number of episodes to learn the optimal policy, but those that prioritize informative states and actions can learn much faster.
+
+Figure 3a shows the 'time to learn' for tabular implementations of K-learning (Section 3.3), soft Q-learning (Section 3.2) and Thompson sampling (Section 3.1). We implement each of the algorithms with a $N(0,1)$ prior for rewards and Dirichlet $(1 / N)$ prior for transitions. Since these problems are small and tabular, we can use conjugate prior updates and exact MDP planning via value iteration. As expected, Thompson sampling and K-learning scale gracefully to large domains but soft Q-learning does not.
+
+# 4.3 BEHAVIOUR SUITE FOR REINFORCEMENT LEARNING
+
+So far our experiments have been confined to the tabular setting, but the main focus of 'RL as inference' is for scalable algorithms that work with generalization. In this section we show that the same insights we built in the tabular setting extend to the setting of deep RL. To do this we implement variants of Deep Q-Networks with a single layer, 50-unit MLP (Mnih et al., 2013). To adapt K-learning and Thompson sampling to this deep RL setting we use an ensemble of size 20 with randomized prior functions to approximate the posterior distribution over neural network Q-values (Osband et al., 2018) (full experimental details are included in Appendix 5.4). We then evaluate all of the algorithms on bsuite: A suite of benchmark tasks designed to highlight key issues in RL (Osband et al., 2019).
+
+In particular, bsuite includes an evaluation on the DeepSea problems but with a one-hot pixel representation of the agent position. In Figure 3b we see that the results for these deep RL implementations closely match the observed scaling for the tabular setting. In particular, the algorithms motivated by Thompson sampling and K-learning both scale gracefully to large problem sizes, where soft Q-learning is unable to drive deep exploration. Our bsuite evaluation includes many more experiments that can be fit into this paper, but we provide a link to the complete results at bit.ly/rl-inference-bsuite. In general, the results for Thompson sampling and K-learning are similar, with soft Q-learning performing significantly worse on 'exploration' tasks. We push a summary of these results to Appendix 6.
+
+
+(a) Tabular state representation.
+
+
+(b) One-hot pixel representation into neural net.
+Figure 3: Learning times for DeepSea experiments. Dashed line represents $2^{N}$ .
+
+# 5 CONCLUSION
+
+This paper aims to make sense of reinforcement learning and probabilistic inference. We review the reinforcement learning problem and show that this problem of optimal learning already combined the problems of control and inference. As we highlight this connection, we also clarify some potentially confusing details in the popular 'RL as inference' framework. We show that, since this problem formulation ignores the role of epistemic uncertainty, that algorithms derived from that framework can perform poorly on even simple tasks. Importantly, we also offer a way forward, to reconcile the views of RL and inference in a way that maintains the best pieces of both. In particular, we show that a simple variant to the RL as inference framework (K-learning) can incorporate uncertainty estimates to drive efficient exploration. We support our claims with a series of simple didactic experiments. We leave the crucial questions of how to scale these insights up to large complex domains for future work.
+
+# REFERENCES
+
+Abbas Abdelmaleki, Jost Tobias Springenberg, Yuval Tassa, Remi Munos Nicolas Heess, and Martin Riedmiller. Maximum a posteriori policy optimisation. In International Conference on Learning Representations (ICLR), 2018.
+Søren Asmussen and Peter W Glynn. Stochastic simulation: Algorithms and analysis, volume 57. Springer Science & Business Media, 2007.
+Dimitri P Bertsekas. Dynamic programming and optimal control, volume 1. Athena Scientific, 2005.
+Charles Blundell, Julien Cornebise, Koray Kavukcuoglu, and Daan Wierstra. Weight uncertainty in neural networks. arXiv preprint arXiv:1505.05424, 2015.
+Nicolò Cesa-Bianchi, Claudio Gentile, Gergely Neu, and Gabor Lugosi. Boltzmann exploration done right. In Advances in Neural Information Processing Systems, pp. 6287-6296, 2017.
+Olivier Chapelle and Lihong Li. An empirical evaluation of thompson sampling. In Advances in neural information processing systems, pp. 2249-2257, 2011.
+Marc Peter Deisenroth, Gerhard Neumann, Jan Peters, et al. A survey on policy search for robotics. Foundations and Trends in Robotics, 2(1-2):1-142, 2013.
+Benjamin Eysenbach, Abhishek Gupta, Julian Ibarz, and Sergey Levine. Diversity is all you need: Learning skills without a reward function. arXiv preprint arXiv:1802.06070, 2018.
+Matthew Fellows, Anuj Mahajan, Tim GJ Rudner, and Shimon Whiteson. Virel: A variational inference framework for reinforcement learning. In Advances in Neural Information Processing Systems, pp. 7120-7134, 2019.
+Thomas Furmston and David Barber. Variational methods for reinforcement learning. In Proceedings of the Thirteenth International Conference on Artificial Intelligence and Statistics, pp. 241-248, 2010.
+Mohammad Ghavamzadeh, Shie Mannor, Joelle Pineau, and Aviv Tamar. Bayesian reinforcement learning: A survey. Foundations and Trends in Machine Learning, 8(5-6):359-483, 2015.
+John C Gittins. Bandit processes and dynamic allocation indices. Journal of the Royal Statistical Society. Series B (Methodological), pp. 148-177, 1979.
+Arthur Guez, David Silver, and Peter Dayan. Efficient Bayes-adaptive reinforcement learning using sample-based search. In Advances in Neural Information Processing Systems, pp. 1025-1033, 2012.
+Tuomas Haarnoja, Haoran Tang, Pieter Abbeel, and Sergey Levine. Reinforcement learning with deep energy-based policies. In Proceedings of the 34th International Conference on Machine Learning (ICML), 2017.
+
+Tuomas Haarnoja, Aurick Zhou, Pieter Abbeel, and Sergey Levine. Soft actor-critic: Off-policy maximum entropy deep reinforcement learning with a stochastic actor. arXiv preprint arXiv:1801.01290, 2018.
+Thomas Jaksch, Ronald Ortner, and Peter Auer. Near-optimal regret bounds for reinforcement learning. Journal of Machine Learning Research, 11(Apr):1563-1600, 2010.
+Hilbert J Kappen, Vicenç Gómez, and Manfred Opper. Optimal control as a graphical model inference problem. Machine learning, 87(2):159-182, 2012.
+Michael Kearns and Satinder Singh. Near-optimal reinforcement learning in polynomial time. Machine Learning, 49(2-3):209-232, 2002.
+Maurice George Kendall. The advanced theory of statistics. Charles Griffin and Co., Ltd., London, 1946.
+Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
+Jens Kober and Jan R Peters. Policy search for motor primitives in robotics. In Advances in neural information processing systems, pp. 849-856, 2009.
+Daphne Koller and Nir Friedman. Probabilistic graphical models: principles and techniques. MIT press, 2009.
+Sergey Levine. Reinforcement learning and control as probabilistic inference: Tutorial and review. arXiv preprint arXiv:1805.00909, 2018.
+Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Alex Graves, Ioannis Antonoglou, Daan Wierstra, and Martin Riedmiller. Playing atari with deep reinforcement learning. In NIPS Deep Learning Workshop. 2013.
+Volodymyr Mnih, Adria Puigdomenech Badia, Mehdi Mirza, Alex Graves, Timothy Lillicrap, Tim Harley, David Silver, and Koray Kavukcuoglu. Asynchronous methods for deep reinforcement learning. In Proceedings of the 33rd International Conference on Machine Learning (ICML), pp. 1928-1937, 2016.
+Rémi Munos. From bandits to monte-carlo tree search: The optimistic principle applied to optimization and planning. Foundations and Trends in Machine Learning, 7(1):1-129, 2014.
+Brendan O'Donoghue. Variational Bayesian reinforcement learning with regret bounds. arXiv preprint arXiv:1807.09647, 2018.
+Brendan O'Donoghue, Remi Munos, Koray Kavukcuoglu, and Volodymyr Mnih. Combining policy gradient and Q-learning. In International Conference on Learning Representations (ICLR), 2017.
+Brendan O'Donoghue, Ian Osband, Remi Munos, and Volodymyr Mnih. The uncertainty Bellman equation and exploration. In Proceedings of the 35th International Conference on Machine Learning (ICML), 2018.
+Ian Osband and Benjamin Van Roy. On lower bounds for regret in reinforcement learning. arXiv preprint arXiv:1608.02732, 2016.
+Ian Osband and Benjamin Van Roy. Why is posterior sampling better than optimism for reinforcement learning. In Proceedings of the 34th International Conference on Machine Learning (ICML), 2017.
+Ian Osband, Benjamin Van Roy, and Zheng Wen. Generalization and exploration via randomized value functions. arXiv preprint arXiv:1402.0635, 2014.
+Ian Osband, Charles Blundell, Alexander Pritzel, and Benjamin Van Roy. Deep exploration via bootstrapped DQN. In Advances In Neural Information Processing Systems, pp. 4026-4034, 2016.
+
+Ian Osband, Daniel Russo, Zheng Wen, and Benjamin Van Roy. Deep exploration via randomized value functions. arXiv preprint arXiv:1703.07608, 2017.
+Ian Osband, John Aslanides, and Albin Cassirer. Randomized prior functions for deep reinforcement learning. In Advances in Neural Information Processing Systems, pp. 8617-8629, 2018.
+Ian Osband, Yotam Doron, Matteo Hessel, John Aslanides, Eren Sezener, Andre Saraiva, Katrina McKinney, Tor Lattimore, Csaba Szepezvari, Satinder Singh, Benjamin Van Roy, Richard Sutton, David Silver, and Hado Van Hasselt. Behaviour suite for reinforcement learning. 2019.
+Jan Peters, Katharina Mulling, and Yasemin Altun. Relative entropy policy search. In AAAI. Atlanta, 2010.
+Konrad Rawlik, Marc Toussaint, and Sethu Vijayakumar. On stochastic optimal control and reinforcement learning by approximate inference. In Twenty-Third International Joint Conference on Artificial Intelligence, 2013.
+Daniel Russo and Benjamin Van Roy. Learning to optimize via information-directed sampling. In Advances in Neural Information Processing Systems, pp. 1583-1591, 2014.
+Daniel J Russo, Benjamin Van Roy, Abbas Kazerouni, Ian Osband, Zheng Wen, et al. A tutorial on thompson sampling. Foundations and Trends in Machine Learning, 11(1):1-96, 2018.
+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, 2016.
+Alexander L Strehl, Lihong Li, Eric Wiewiora, John Langford, and Michael L Littman. PAC model-free reinforcement learning. In Proceedings of the 23rd international conference on Machine learning, pp. 881-888. ACM, 2006.
+Richard S Sutton and Andrew G Barto. Reinforcement learning: An introduction. MIT press, 2018.
+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.
+Emanuel Todorov. Linearly-solvable markov decision problems. In Advances in neural information processing systems, pp. 1369-1376, 2007.
+Emanuel Todorov. General duality between optimal control and estimation. In 2008 47th IEEE Conference on Decision and Control, pp. 4286-4292. IEEE, 2008.
+Emanuel Todorov. Efficient computation of optimal actions. Proceedings of the national academy of sciences, 106(28):11478-11483, 2009.
+Marc Toussaint. Robot trajectory optimization using approximate inference. In Proceedings of the 26th annual international conference on machine learning, pp. 1049-1056. ACM, 2009.
+Marc Toussaint and Amos Storkey. Probabilistic inference for solving discrete and continuous state markov decision processes. In Proceedings of the 23rd international conference on Machine learning, pp. 945-952. ACM, 2006.
+Abraham Wald. Statistical decision functions. 1950.
+Christopher John Cornish Hellaby Watkins. Learning from delayed rewards. PhD thesis, University of Cambridge England, 1989.
+Greg Welch, Gary Bishop, et al. An introduction to the Kalman filter. 1995.
+Brian D Ziebart, Andrew Maas, J Andrew Bagnell, and Anind K Dey. Maximum entropy inverse reinforcement learning. 2008.
+
+# APPENDIX
+
+# 5.1 SOFT Q-LEARNING DERIVATION
+
+We present a derivation of soft Q-learning from the RL as inference parametric approximation to the probability of optimality. Although our presentation is slightly different to that of Levine (2018) we show here that the resulting algorithms are essentially identical. Recall from equation (6) that the parametric approximation to optimality we consider is given by
+
+$$
+\begin{array}{l} \tilde {\mathbb {P}} \left(\mathcal {O} _ {h} (s, a) \mid \tau_ {h} (s, a)\right) \propto \exp \left(\sum_ {\left(s ^ {\prime}, a ^ {\prime}\right) \in \tau_ {h} (s, a)} \beta \mathbb {E} ^ {\ell} \mu \left(s ^ {\prime}, a ^ {\prime}\right)\right) \\ = \exp (\beta \mathbb {E} ^ {\ell} \mu (s, a)) \exp \left(\sum_ {(s ^ {\prime \prime}, a ^ {\prime \prime}) \in \tau_ {h + 1} (s ^ {\prime}, a ^ {\prime})} \beta \mathbb {E} ^ {\ell} \mu (s ^ {\prime \prime}, a ^ {\prime \prime})\right) \\ = \exp (\beta \mathbb {E} ^ {\ell} \mu (s, a)) \tilde {\mathbb {P}} (\mathcal {O} _ {h + 1} (s ^ {\prime}, a ^ {\prime}) | \tau_ {h + 1} (s ^ {\prime}, a ^ {\prime})) \\ \end{array}
+$$
+
+where $\tau_h(s,a)$ is a trajectory starting from $(s,a)$ at time $h$ and $\beta >0$ is a hyper-parameter. Now we must marginalize out the possible trajectories $\tau_{h}$ using the (unknown) system dynamics. Since this is a certainty-equivalent algorithm we shall use the expected value of the transition probabilities, under the posterior at episode $\ell$ , which means we can write
+
+$$
+\tilde {\mathbb {P}} (\tau_ {h} (s, a)) = \mathbb {E} ^ {\ell} \mathcal {P} (s ^ {\prime}, s, a) p (a ^ {\prime} | s ^ {\prime}) \tilde {\mathbb {P}} (\tau_ {h + 1} (s ^ {\prime}, a ^ {\prime})),
+$$
+
+and we make the additional assumption that the 'prior' $p(a|s)$ is uniform across all actions $a$ for each $s$ (this assumption is standard in this framework, see Levine (2018)). In this case we obtain
+
+$$
+\begin{array}{l} \tilde {\mathbb {P}} (\mathcal {O} _ {h} (s, a)) = \sum_ {\tau_ {h} (s, a)} \tilde {\mathbb {P}} (\mathcal {O} _ {h} (s, a) | \tau_ {h} (s, a)) \tilde {\mathbb {P}} (\tau_ {h} (s, a)) \\ \propto \exp (\beta \mathbb {E} ^ {\ell} \mu (s, a)) \sum_ {s ^ {\prime}, a ^ {\prime}} \mathbb {E} ^ {\ell} \mathcal {P} (s ^ {\prime}, s, a) \sum_ {\tau_ {h + 1} ^ {\prime} (s ^ {\prime}, a ^ {\prime})} \tilde {\mathbb {P}} (\mathcal {O} _ {h + 1} (s ^ {\prime}, a ^ {\prime}) | \tau_ {h + 1} ^ {\prime} (s ^ {\prime}, a ^ {\prime})) \tilde {\mathbb {P}} (\tau_ {h + 1} ^ {\prime} (s ^ {\prime}, a ^ {\prime})) \\ = \exp (\beta \mathbb {E} ^ {\ell} \mu (s, a)) \sum_ {s ^ {\prime}, a ^ {\prime}} \mathbb {E} ^ {\ell} \mathcal {P} (s ^ {\prime}, s, a) \tilde {\mathbb {P}} (\mathcal {O} _ {h + 1} (s ^ {\prime}, a ^ {\prime})). \\ \end{array}
+$$
+
+Now with this we can rewrite
+
+$$
+\log \tilde {\mathbb {P}} (\mathcal {O} _ {h} (s, a)) = \beta \mathbb {E} ^ {\ell} \mu (s, a) + \log \sum_ {s ^ {\prime}, a ^ {\prime}} \mathbb {E} ^ {\ell} \mathcal {P} (s ^ {\prime}, s, a) \tilde {\mathbb {P}} (\mathcal {O} _ {h + 1} (s ^ {\prime}, a ^ {\prime})) - \log Z (s)
+$$
+
+where $Z(s)$ is the normalization constant for state $s$ , since $\sum_{a} \tilde{\mathbb{P}}(\mathcal{O}_h(s, a)) = 1$ for any $s$ , and using Jensen's we have the following bound
+
+$$
+\log \tilde {\mathbb {P}} (\mathcal {O} _ {h} (s, a)) \geq \beta \mathbb {E} ^ {\ell} \mu (s, a) + \sum_ {s ^ {\prime}} \mathbb {E} ^ {\ell} \mathcal {P} \left(s ^ {\prime}, s, a\right) \log \sum_ {a ^ {\prime}} \tilde {\mathbb {P}} \left(\mathcal {O} _ {h + 1} \left(s ^ {\prime}, a ^ {\prime}\right)\right) - \log Z (s)
+$$
+
+now if we introduce the soft Q-values that satisfy the soft Bellman equation
+
+$$
+\tilde {Q} _ {h} (s, a) = \mathbb {E} ^ {\ell} \mu (s, a) + \sum_ {s ^ {\prime}} \mathbb {E} ^ {\ell} \mathcal {P} (s ^ {\prime}, s, a) \beta^ {- 1} \log \sum_ {a ^ {\prime}} \exp \beta \tilde {Q} _ {h + 1} (s ^ {\prime}, a ^ {\prime})
+$$
+
+then
+
+$$
+\tilde {\mathbb {P}} (\mathcal {O} _ {h} (s, a)) \approx \exp \beta \tilde {Q} _ {h} (s, a) / \sum_ {b} \exp \beta \tilde {Q} _ {h} (s, b)
+$$
+
+and we have the soft Q-learning algorithm (the approximation comes from the fact we used Jensen's inequality to provide a bound).
+
+# 5.2 PROOF OF THEOREM 1
+
+Theorem. The $K$ -learning value function $V^{\mathrm{K}}$ and policy $\pi^{\mathrm{K}}$ defined in Table 3 satisfy the following bound at every state $s \in S$ and $h = 0, \ldots, H$ :
+
+$$
+V _ {h} ^ {\mathrm {K}} (s) \geq \mathbb {E} V _ {h} ^ {M, \star} (s) + \beta^ {- 1} D _ {K L} (\mathbb {P} (\mathcal {O} _ {h} (s)) | | \pi_ {h} ^ {\mathrm {K}} (s)).
+$$
+
+Proof. Fix some particular state $s \in S$ , and let the joint posterior over value and optimality be denoted by
+
+$$
+\mathbb {P} \left(V _ {h} ^ {M, \star} (s), \mathcal {O} _ {h} (s, a)\right) = \mathbb {P} \left(Q _ {h} ^ {M, \star} (s, a) \mid \mathcal {O} _ {h} (s, a)\right) \mathbb {P} \left(\mathcal {O} _ {h} (s, a)\right), \tag {11}
+$$
+
+where we use $f$ to denote the conditional distribution over Q-values conditioned on optimality. Recall that from equation (7) we have approximated the conditional posterior probability of optimality as
+
+$$
+\tilde {\mathbb {P}} \left(\mathcal {O} _ {h} (s, a) \mid Q _ {h} ^ {M, \star} (s, a)\right) \propto \exp \beta Q _ {h} ^ {M, \star} (s, a),
+$$
+
+for some $\beta > 0$ , which when yields
+
+$$
+\tilde {\mathbb {P}} (\mathcal {O} _ {h} (s, a)) \propto \exp G _ {h} ^ {Q} (s, a, \beta).
+$$
+
+From Bayes' rule this implies the following approximation to the conditional distribution
+
+$$
+\begin{array}{l} \tilde {\mathbb {P}} \left(Q _ {h} ^ {M, \star} (s, a) \mid \mathcal {O} _ {h} (s, a)\right) = \frac {\tilde {\mathbb {P}} \left(\mathcal {O} _ {h} (s , a) \mid Q _ {h} ^ {M , \star} (s , a)\right) \mathbb {P} \left(Q _ {h} ^ {M , \star} (s , a)\right)}{\tilde {\mathbb {P}} \left(\mathcal {O} _ {h} (s , a)\right)} \tag {12} \\ = \mathbb {P} (Q _ {h} ^ {M, \star} (s, a)) \exp (\beta Q _ {h} ^ {M, \star} (s, a) - G _ {h} ^ {Q} (s, a, \beta)). \\ \end{array}
+$$
+
+This is known as the exponential tilt of the posterior distribution $\mathbb{P}(Q_h^{M,\star}(s,a))$ and has a myriad of applications in statistics (Asmussen & Glynn, 2007). From this we could derive an approximation to the joint posterior (11), however, the K-learning policy does not follow (8) since computing the cumulant generating function is non-trivial. Instead we compute the K-values, which are the solution to a Bellman equation that provide a guaranteed upper bound on the cumulant generating function, and the K-learning policy is thus
+
+$$
+\pi_ {h} ^ {\mathrm {K}} (s, a) \propto \exp (\beta K _ {h} (s, a)),
+$$
+
+where we have (O'Donoghue, 2018)
+
+$$
+\beta K _ {h} (s, a) \geq G _ {h} ^ {Q} (s, a) (\beta). \tag {13}
+$$
+
+With that in mind we take our approximation to the joint posterior (11) to be
+
+$$
+\tilde {\mathbb {P}} \left(V _ {h} ^ {M, \star} (s), \mathcal {O} _ {h} (s, a)\right) = \tilde {\mathbb {P}} \left(Q _ {h} ^ {M, \star} (s, a) | \mathcal {O} _ {h} (s, a)\right) \pi_ {h} ^ {\mathrm {K}} (s, a).
+$$
+
+Now consider the KL-divergence between the true joint posterior and our approximate one, a quick calculation yields
+
+$$
+\begin{array}{l} D _ {K L} \left(\mathbb {P} \left(V _ {h} ^ {M, \star} (s), \mathcal {O} _ {h} (s, a)\right) | | \tilde {\mathbb {P}} \left(V _ {h} ^ {M, \star} (s), \mathcal {O} _ {h} (s, a)\right)\right) = D _ {K L} \left(\mathbb {P} \left(\mathcal {O} _ {h} (s)\right) | | \pi_ {h} ^ {\mathrm {K}} (s)\right) + \\ \sum_ {a} \mathbb {P} \left(\mathcal {O} _ {h} (s, a)\right) D _ {K L} \left(\mathbb {P} \left(Q _ {h} ^ {M, \star} (s, a) \mid \mathcal {O} _ {h} (s, a)\right) \mid \mid \tilde {\mathbb {P}} \left(Q _ {h} ^ {M, \star} (s, a) \mid \mathcal {O} _ {h} (s, a)\right)\right), \tag {14} \\ \end{array}
+$$
+
+for timestep $h$ and state $s$ . Considering the terms on the right hand side of (14) separately we have
+
+$$
+D _ {K L} \left(\mathbb {P} \left(\mathcal {O} _ {h} (s)\right) | | \pi_ {h} ^ {\mathrm {K}} (s)\right) = - \mathcal {H} \left(\mathbb {P} \left(\mathcal {O} _ {h} (s)\right)\right) - \beta \sum_ {a} \mathbb {P} \left(\mathcal {O} _ {h} (s, a)\right) K _ {h} (s, a) + \log \sum_ {a} \exp \beta K _ {h} (s, a)
+$$
+
+where $\mathcal{H}$ denotes the entropy, and using (12)
+
+$$
+\begin{array}{l} \sum_ {a} \mathbb {P} (\mathcal {O} _ {h} (s, a)) D _ {K L} (\mathbb {P} (Q _ {h} ^ {M, \star} (s, a) | \mathcal {O} _ {h} (s, a)) | | \tilde {\mathbb {P}} (Q _ {h} ^ {M, \star} (s, a) | \mathcal {O} _ {h} (s, a))) \\ = \sum_ {a} \mathbb {P} \left(\mathcal {O} _ {h} (s, a)\right) G _ {h} ^ {Q} (s, a) (\beta) - \beta \sum_ {a} \mathbb {P} \left(\mathcal {O} _ {h} (s, a)\right) \mathbb {E} \left(Q _ {h} ^ {M, \star} (s, a) \mid \mathcal {O} _ {h} (s, a)\right) \\ + \sum_ {a} \mathbb {P} (\mathcal {O} _ {h} (s, a)) D _ {K L} (\mathbb {P} (Q _ {h} ^ {M, \star} (s, a) | \mathcal {O} _ {h} (s, a)) | | \mathbb {P} (Q _ {h} ^ {M, \star} (s, a))). \\ \end{array}
+$$
+
+Now we sum these two terms, using (13) and the following identities
+
+$$
+\sum_ {a} \mathbb {P} (\mathcal {O} _ {h} (s, a)) \mathbb {E} (Q _ {h} ^ {M, \star} (s, a) | \mathcal {O} _ {h} (s, a)) = \mathbb {E} \max _ {a} Q _ {h} ^ {M, \star} (s, a) = \mathbb {E} V _ {h} ^ {M, \star} (s)
+$$
+
+and
+
+$$
+\begin{array}{l} \sum_ {a} \mathbb {P} \left(\mathcal {O} _ {h} (s, a)\right) D _ {K L} \left(\mathbb {P} \left(Q _ {h} ^ {M, \star} (s, a) \mid \mathcal {O} _ {h} (s, a)\right) | | \mathbb {P} \left(Q _ {h} ^ {M, \star} (s, a)\right)\right) \\ = \sum_ {a} \mathbb {P} \left(\mathcal {O} _ {h} (s, a)\right) \int \mathbb {P} \left(Q _ {h} ^ {M, \star} (s, a) \mid \mathcal {O} _ {h} (s, a)\right) \log \left(\mathbb {P} \left(\mathcal {O} _ {h} (s, a) \mid Q _ {h} ^ {M, \star} (s, a)\right)\right) + \mathcal {H} \left(\mathbb {P} \left(\mathcal {O} _ {h} (s)\right)\right) \\ \leq \mathcal {H} (\mathbb {P} (\mathcal {O} _ {h} (s))), \\ \end{array}
+$$
+
+since $\log (\mathbb{P}(\mathcal{O}_h(s,a)|Q_h^{M,\star}(s,a)))\leq 0$ , we obtain
+
+$$
+D _ {K L} \left(\mathbb {P} \left(V _ {h} ^ {M, \star} (s), \mathcal {O} _ {h} (s, a)\right) | | \tilde {\mathbb {P}} \left(V _ {h} ^ {M, \star} (s), \mathcal {O} _ {h} (s, a)\right)\right) \leq \log \sum_ {a} \exp \beta K _ {h} (s, a) - \beta \mathbb {E} V _ {h} ^ {M, \star} (s).
+$$
+
+The theorem follows from this and the fact that the K-learning value function is defined as
+
+$$
+V _ {h} ^ {\mathrm {K}} (s) = \beta^ {- 1} \log \sum_ {a} \exp \beta K _ {h} (s, a)
+$$
+
+as well as the fact that
+
+$$
+D _ {K L} \left(\mathbb {P} \left(\mathcal {O} _ {h} (s)\right) \mid \mid \pi_ {h} ^ {\mathrm {K}} (s)\right) \leq D _ {K L} \left(\mathbb {P} \left(V _ {h} ^ {M, \star} (s), \mathcal {O} _ {h} (s, a)\right) \mid \mid \tilde {\mathbb {P}} \left(V _ {h} ^ {M, \star} (s), \mathcal {O} _ {h} (s, a)\right)\right)
+$$
+
+from equation (14).
+
+
+
+# 5.3 PROBLEM 1 K-LEARNING DETAILS
+
+For a bandit problem the K-learning policy is given by
+
+$$
+\pi_ {i} ^ {\mathrm {K}} \propto \exp G _ {i} ^ {\mu} (\beta),
+$$
+
+which requires the cumulant generating function of the posterior over each arm. For arm 1 and the distractor arms there is no uncertainty, in which case the cumulant generating function is given by
+
+$$
+G _ {i} ^ {\mu} (\beta) = \mu_ {i} \beta , \quad i = 1, 3, \dots N.
+$$
+
+In the case of arm 2 the cumulant generating function is
+
+$$
+G _ {2} ^ {\mu} (\beta) = \log \left((1 / 2) \exp (2 \beta) + (1 / 2) \exp (- 2 \beta)\right).
+$$
+
+In (O'Donoghue, 2018) it was shown that the optimal choice of $\beta$ is given by
+
+$$
+\beta^{\star} = \operatorname *{argmin}_{\beta \geq 0}\left(\beta^{-1}\log \sum_{i = 1}^{N}\exp G_{i}^{\mu}(\beta)\right),
+$$
+
+which requires solving a convex optimization problem in variable $\beta^{-1}$ . In the case of problem 1 the optimal choice of $\beta \approx 10.23$ , which yields $\pi_2^{kl} \approx 0.94$ . Then, once arm 2 has been pulled once and the true reward of arm 2 has been revealed, its cumulant generating function has the same form as the others, and then the optimal choice of $\beta$ is simply
+
+$$
+\beta^{\star} = \operatorname *{argmin}_{\beta \geq 0}\left(\beta^{-1}\log \sum_{i = 1}^{N}\exp \mu_{i}\beta\right) = \infty ,
+$$
+
+at which point K-learning is greedy with respect to the optimal arm.
+
+# 5.4 IMPLEMENTATION DETAILS FOR BSUITE EVALUATION
+
+All three algorithms use the same neural network architecture consisting of an MLP (multilayer perceptron) with a single hidden layer with 50 hidden units. All three algorithms used a replay buffer of the most recent $10^{4}$ transitions to allow re-use of data. For all three the Adam optimizer (Kingma & Ba, 2014) was used with learning rate $10^{-3}$ and batch-size 128, and learning is performed at every time-step. For both K-learning and soft Q-learning the temperature was set at $\beta^{-1} = 0.01$ . For Bootstrap DQN we chose an ensemble of size 20, and used the randomized prior functions (Osband et al., 2018) with scale 3.. For K-learning, in order to estimate the cumulant generating function of the reward, we used an ensemble of neural networks predicting the reward for each state and action and used these to calculate the empirical cumulant generating function over them. Each of these was a single hidden layer MLP with 10 hidden units. Finally, we noted that actually training a small ensemble of K-networks performed better than a single network, we used an ensemble of size 10 for this purpose as well as using randomized priors to encourage diversity between the elements of the ensemble with scale 1.0. The K-learning policy was the Boltzmann policy over all the ensemble K-values at each state.
+
+# 6 Bsuite report: Making sense of RL and Inference
+
+The Behaviour Suite for Reinforcement Learning, or bsuite for short, is a collection of carefully-designed experiments that investigate core capabilities of a reinforcement learning (RL) agent. The aim of the bsuite project is to collect clear, informative and scalable problems that capture key issues in the design of efficient and general learning algorithms and study agent behaviour through their performance on these shared benchmarks. This report provides a snapshot of agent performance on bsuite2019, obtained by running the experiments from github.com/deepmind/bsuite_Osband et al. (2019).
+
+# 6.1 AGENT DEFINITION
+
+All agents were run with the same network architecture (a single layer MLP with 50 hidden units and ReLU activation) adapting DQN (Mnih et al., 2013). Full hyperparameters in Appendix 5.4.
+
+- boot_dqn: bootstrapped DQN with prior networks (Osband et al., 2016; 2018).
+- k_ learn: K-learning via ensemble with prior networks (O'Donoghue, 2018; Osband et al., 2018).
+- **soft_q:** soft Q-learning with temperature $\beta^{-1} = 0.01$ (O'Donoghue et al., 2017).
+
+# 6.2 SUMMARY SCORES
+
+Each bsuite experiment outputs a summary score in [0,1]. We aggregate these scores by according to key experiment type, according to the standard analysis notebook. A detailed analysis of each of these experiments may be found in a notebook hosted on Colaboratory: bit.ly/rl-inference-bsuite.
+
+
+Figure 4: Snapshot of agent behaviour.
+
+
+Figure 5: Score for each bsuite experiment.
+
+# 6.3 RESULTS COMMENTARY
+
+Overall, we see that the algorithms K-learning and Bootstrapped DQN perform extremely similarly across bsuite evaluations. However, there is a clear signal that soft Q-learning performs markedly worse on the tasks requiring efficient exploration. This observation is consistent with the hypothesis that algorithms motivated by 'RL as Inference' fail to account for the value of exploratory actions.
+
+Beyond this major difference in exploration score, we see that Bootstrapped DQN outperforms the other algorithms on problems varying 'Scale'. This too is not surprising, since both soft Q and K-learning rely on a temperature tuning that will be problem-scale dependent. Finally, we note that soft Q also performs worse on some 'basic' tasks, notably 'bandit' and 'mnist'. We believe that the relatively high temperature (tuned for best performance on Deep Sea) leads to poor performance on these tasks with larger action spaces, due to too many random actions.
\ No newline at end of file
diff --git a/makingsenseofreinforcementlearningandprobabilisticinference/images.zip b/makingsenseofreinforcementlearningandprobabilisticinference/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..cb5d565070aa54dde267341f5144d78d4ad333f5
--- /dev/null
+++ b/makingsenseofreinforcementlearningandprobabilisticinference/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:09bac204e11692c04640f908d90f136d9beb84c5e9b02594fd7581ea497bf544
+size 557348
diff --git a/makingsenseofreinforcementlearningandprobabilisticinference/layout.json b/makingsenseofreinforcementlearningandprobabilisticinference/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..381e6024bcdbee52f08ec4e6fc399d2752084095
--- /dev/null
+++ b/makingsenseofreinforcementlearningandprobabilisticinference/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:6ebc4ab5f5a0d275279db68083a2e17e39cb97dd186feb459e06c679571d30f7
+size 590945
diff --git a/maximumlikelihoodconstraintinferenceforinversereinforcementlearning/5035afeb-2b67-4cf6-93d4-fc383f1c107b_content_list.json b/maximumlikelihoodconstraintinferenceforinversereinforcementlearning/5035afeb-2b67-4cf6-93d4-fc383f1c107b_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..ed93d79c09cb8d3000ac02ae5ac9546f7f743f15
--- /dev/null
+++ b/maximumlikelihoodconstraintinferenceforinversereinforcementlearning/5035afeb-2b67-4cf6-93d4-fc383f1c107b_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a2aa5d9d8a786fa990605b284c8321f0d052b4a42972d1a37414efd2950a8d73
+size 80567
diff --git a/maximumlikelihoodconstraintinferenceforinversereinforcementlearning/5035afeb-2b67-4cf6-93d4-fc383f1c107b_model.json b/maximumlikelihoodconstraintinferenceforinversereinforcementlearning/5035afeb-2b67-4cf6-93d4-fc383f1c107b_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..1bdb13c02a4466a106f5030a91f5432f6de65dfd
--- /dev/null
+++ b/maximumlikelihoodconstraintinferenceforinversereinforcementlearning/5035afeb-2b67-4cf6-93d4-fc383f1c107b_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f65960e43b81e8af80d987396c4dbb54bd035575e49c8d294d0f9c48e6ebd0f8
+size 96285
diff --git a/maximumlikelihoodconstraintinferenceforinversereinforcementlearning/5035afeb-2b67-4cf6-93d4-fc383f1c107b_origin.pdf b/maximumlikelihoodconstraintinferenceforinversereinforcementlearning/5035afeb-2b67-4cf6-93d4-fc383f1c107b_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..396bf286e87b24f854991e6ce40f5daa532a8c86
--- /dev/null
+++ b/maximumlikelihoodconstraintinferenceforinversereinforcementlearning/5035afeb-2b67-4cf6-93d4-fc383f1c107b_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:94ffa541e79baea422b0f5e58bec7a2084bcda6c596b1d2071a6a61c154fb5f7
+size 2676530
diff --git a/maximumlikelihoodconstraintinferenceforinversereinforcementlearning/full.md b/maximumlikelihoodconstraintinferenceforinversereinforcementlearning/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..8d96d891a7465b4b3f1e5af7019cc55f5570642d
--- /dev/null
+++ b/maximumlikelihoodconstraintinferenceforinversereinforcementlearning/full.md
@@ -0,0 +1,342 @@
+# MAXIMUM LIKELIHOOD CONSTRAINT INFERENCE FOR INVERSE REINFORCEMENT LEARNING
+
+Dexter R.R. Scobee & S. Shankar Sastry
+
+Department of Electrical Engineering and Computer Sciences
+
+University of California, Berkeley
+
+{dscobee, sastry}@eecs.berkeley.edu
+
+# ABSTRACT
+
+While most approaches to the problem of Inverse Reinforcement Learning (IRL) focus on estimating a reward function that best explains an expert agent's policy or demonstrated behavior on a control task, it is often the case that such behavior is more succinctly represented by a simple reward combined with a set of hard constraints. In this setting, the agent is attempting to maximize cumulative rewards subject to these given constraints on their behavior. We reformulate the problem of IRL on Markov Decision Processes (MDPs) such that, given a nominal model of the environment and a nominal reward function, we seek to estimate state, action, and feature constraints in the environment that motivate an agent's behavior. Our approach is based on the Maximum Entropy IRL framework, which allows us to reason about the likelihood of an expert agent's demonstrations given our knowledge of an MDP. Using our method, we can infer which constraints can be added to the MDP to most increase the likelihood of observing these demonstrations. We present an algorithm which iteratively infers the Maximum Likelihood Constraint to best explain observed behavior, and we evaluate its efficacy using both simulated behavior and recorded data of humans navigating around an obstacle.
+
+# 1 INTRODUCTION
+
+Advances in mechanical design and artificial intelligence continue to expand the horizons of robotic applications. In these new domains, it can be difficult to design a specific robot behavior by hand. Even manually specifying a task for a reinforcement-learning-enabled agent is notoriously difficult (Ho et al., 2015; Amodei et al., 2016). Inverse Reinforcement Learning (IRL) techniques can help alleviate this burden by automatically identifying the objectives driving certain behavior. Since first being introduced as Inverse Optimal Control by Kalman (1964), much of the work on IRL has focused on learning environmental rewards to represent the task of interest (Ng & Russell, 2000; Abbeel & Ng, 2004; Ratliff et al., 2006; Ziebart et al., 2008). While these types of IRL algorithms have proven useful in a variety of situations (Abbeel et al., 2007; Vasquez et al., 2014; Ziebart, 2010; Scobee et al., 2018), their basis in assuming that reward functions fully represent task specifications makes them ill suited to problem domains with hard constraints or non-Markovian objectives.
+
+Recent work has attempted to address these pitfalls by using demonstrations to learn a rich class of possible specifications that can represent a task (Vazquez-Chanlatte et al., 2018). Others have focused specifically on learning constraints, that is, behaviors that are expressly forbidden or infeasible (Pardowitz et al., 2005; Pérez-D'Arpino & Shah, 2017; Subramani et al., 2018; McPherson et al., 2018; Chou et al., 2018). Such constraints arise in safety-critical systems, where requirements such as an autonomous vehicle avoiding collisions with pedestrians are more naturally expressed as hard constraints than as soft reward penalties. It is towards the problem of inferring such constraints that we turn our attention.
+
+In this work, we present a novel method for inferring constraints, drawing primarily from the Maximum Entropy approach to IRL described by Ziebart et al. (2008). We use this framework to reason about the likelihood of observing a set of demonstrations given a nominal task description, as well as about their likelihood if we imposed additional constraints on the task. This knowledge allows us to select a constraint, or set of constraints, which maximizes the demonstrations' likelihood and
+
+best explains the differences between expected and demonstrated behavior. Our method improves on prior work by being able to simultaneously consider constraints on states, actions and features in a Markov Decision Process (MDP) to provide a principled ranking of all options according to their effect on demonstration likelihood.
+
+# 2 RELATED WORK
+
+# 2.1 INVERSE REINFORCEMENT LEARNING
+
+A formulation of the IRL problem was first proposed by Kalman (1964) as the Inverse problem of Optimal Control (IOC). Given a dynamical system and a control law, the author sought to identify which function(s) the control law was designed to optimize. This problem was brought into the domain of MDPs and Reinforcement Learning (RL) by Ng & Russell (2000), who proposed IRL as the task of, given an MDP and a policy (or trajectories sampled according to that policy), find a reward function with respect to which that policy is optimal.
+
+One of the chief difficulties in the problem of IRL is the fact that a policy can be optimal with respect to a potentially infinite set of reward functions. The most trivial example of this is the fact that all policies are optimal with respect to a null reward function that always returns zero. Much of the work in IRL has been devoted to developing approaches that address this ambiguity by imposing additional structure to make the problem well-posed (Abbeel & Ng, 2004; Ratliff et al., 2006). Ziebart et al. (2008) approach the problem by employing the principle of maximum entropy (Jaynes, 1957), which allows the authors to develop an IRL algorithm that produces a single stochastic policy that matches feature counts without adding any additional constraints to the produced behavior. This so called Maximum Entropy IRL (MaxEnt) provides a framework for reasoning about demonstrations from experts who are noisily optimal. The induced probability distribution over trajectories forms the basis for our efforts in identifying the most likely behavior-modifying constraints.
+
+# 2.2 BEYOND REWARD FUNCTIONS
+
+While Markovian rewards do often provide a succinct and expressive way to specify the objectives of a task, they cannot capture all possible task specifications. Vazquez-Chanlatte et al. (2018) highlight the utility of non-Markovian Boolean specifications which can describe complex objectives (e.g. do this before that) and compose in an intuitive way (e.g. avoid obstacles and reach the goal). The authors of that work draw inspiration from the MaxEnt framework to develop their technique for using demonstrations to calculate the posterior probability that an agent is attempting to satisfy a Boolean specification.
+
+A subset of these types of specifications that is of particular interest to us is the specification of constraints, which are states, actions, or features of the environment that must be avoided. Chou et al. (2018) explore how to infer trajectory feature constraints given a nominal model of the environment (lacking the full set of constraints) and a set of demonstrated trajectories. The core of their approach is to sample from the set of trajectories which have better performance than the demonstrated trajectories. They then infer that the set of possible constraints is the subset of the feature space that contains the higher-reward sampled trajectories, but not the demonstrated trajectories. Intuitively, they reason that if the demonstrator could have passed through those features to earn a higher reward, but did not, then there must have been a previously unknown constraint preventing that behavior. However, while their approach does allow for a cost function to rank elements from the set of possible constraints, the authors do not offer a mechanism for determining what cost function will best order these constraints.
+
+Our approach to constraint inference from demonstrations addresses this open question by providing a principled ranking of the likelihood of constraints. We adapt the MaxEnt framework to allow us to reason about how adding a constraint will affect the likelihood of demonstrated behaviors, and we can then select the constraints which maximize this likelihood. We consider feature-space constraints as in Chou et al. (2018), and we explicitly augment the feature space with state- and action-specific features to directly compare the impacts of state-, action-, and feature-based constraints on demonstration likelihood.
+
+# 3 MAXIMUM LIKELIHOOD CONSTRAINT INFERENCE
+
+# 3.1 PROBLEM FORMULATION
+
+Following the formulation presented by Ziebart et al. (2008), we base our work in the setting of a (finite-state) Markov Decision Process (MDP). We define an MDP $\mathcal{M}$ as a tuple $(S, \{A_s\}, \{P_{s,a}\}, D_0, \phi, R)$ where $S$ is a finite set of discrete states; $\{A_s\}$ is a set of the sets of actions available to be taken for each state $s$ , such that $A_s \subseteq A$ , where $A$ is a finite set of discrete actions; $\{P_{s,a}\}$ is a set of state transition probability distributions such that $P_{s,a}(s') = P(s'|s,a)$ is the probability of transitioning to state $s'$ after taking action $a$ from state $s$ ; $D_0: S \to [0,1]$ is an initial state distribution; $\phi: S \times A \to \mathbb{R}_+^k$ is a mapping to a $k$ -dimensional space of non-negative features; and $R: S \times A \to \mathbb{R}$ is a reward function. A trajectory $\xi$ through this MDP is a sequence of states $s_t$ and actions $a_t$ such that $s_0 \sim D_0$ and state $s_{i+1} \sim P_{s_i, a_i}$ . Actions are chosen by an agent navigating the MDP according to a, potentially time-varying, policy $\pi$ such that $\pi(\cdot|s, t)$ is a probability distribution over actions in $A_s$ . We denote a finite-time trajectory of length $T + 1$ by $\xi = \{\mathbf{s}_{0:T}, \mathbf{a}_{0:T}\}$ .
+
+At every time step $t$ , a trajectory will accumulate features equal to $\phi(s_t, a_t)$ . We use the notation $\phi_i(\cdot, \cdot)$ to refer to the $i$ -th element of the feature map, and we use the label $\phi_i$ to denote the $i$ -th feature itself. We also introduce an augmented indicator feature mapping $\widetilde{\phi}^{\mathbb{1}}: S \times A \to \{0, 1\}^{n_{\phi}}$ , where $n_{\phi} = k + |S| + |A|$ . This augmented feature map uses binary variables to indicate the presence of a feature and expands the feature space by adding binary features to track occurrences of each state and action, such that
+
+$$
+\widetilde {\phi} _ {\phi_ {i}} ^ {\mathbb {1}} (s, a) = \left\{ \begin{array}{l l} 1 & \text {i f} \phi_ {i} (s, a) > 0 \\ 0 & \text {o t h e r w i s e} \end{array} , \quad \widetilde {\phi} _ {s _ {i}} ^ {\mathbb {1}} (s, a) = \left\{ \begin{array}{l l} 1 & \text {i f} s = s _ {i} \\ 0 & \text {o t h e r w i s e} \end{array} , \quad \widetilde {\phi} _ {a _ {i}} ^ {\mathbb {1}} (s, a) = \left\{ \begin{array}{l l} 1 & \text {i f} a = a _ {i} \\ 0 & \text {o t h e r w i s e} \end{array} . \right. \right. \right. \tag {1}
+$$
+
+Typically, agents are modeled as trying to maximize, or approximately maximize, the total reward earned for a trajectory $\xi$ , given by $R(\xi) = \sum_{t=0}^{T} \gamma^t R(s_t, a_t)$ , where $\gamma \in (0,1]$ is a discount factor. Therefore, an agent's policy $\pi$ is closely tied to the form of the MDP's reward function.
+
+Conventional IRL focuses on inferring a reward function that explains an agent's policy, revealed through the behavior observed in a set of demonstrated trajectories $\mathcal{D}$ . However, our method for constraint inference poses a different challenge: given an MDP $\mathcal{M}$ , including a reward function, and a set of demonstrations $\mathcal{D}$ , find the most likely set of constraints $C^*$ that could modify $\mathcal{M}$ to explain these demonstrations. We define our notion of constraints in the following section.
+
+# 3.2 CONSTRAINTS FOR MDPS
+
+Constraints are those behaviors that are not disallowed explicitly by the structure of the MDP, but which would be infeasible or prohibited for the underlying system being modeled by the MDP. This sort of discrepancy can occur when a generic or simplified MDP is designed without exact knowledge of specific constraints for the modeled system. For instance, for a generic MDP modeling the behavior of cars, we might want to include states for speeds up to $500\mathrm{km/h}$ and actions for accelerations up to $12\mathrm{m/s^2}$ . However, for a specific car on a specific roadway, the set of states where the vehicle travels above $100\mathrm{km/h}$ may be prohibited because of a speed limit, and the set of actions where the vehicle accelerates above $4\mathrm{m/s^2}$ may be infeasible because of the physical limitations of the vehicle's engine. Therefore, any MDP trajectory of this specific car system would not contain a state-action pair which violates these legal and physical limits. Figure 1 shows an example of constraints driving behavior.
+
+We define a constraint set $C_i \subseteq S \times A$ as a set of state-action pairs that violate some specification of the modeled system. We consider three general classes of constraints: state constraints, action constraints, and feature constraints. A state constraint set $C_{s_i} = \{(s,a) \mid s = s_i\}$ includes all state-action pairs such that the state component is $s_i$ . An action constraint set $C_{a_i} = \{(s,a) \mid a = a_i\}$ includes all state-action pairs such that the action component is $a_i$ . A feature constraint set $C_{\phi_i} = \{(s,a) \mid \phi_i(s,a) > 0\}$ includes all state-action pairs that produce a non-zero value for feature $\phi_i$ .
+
+If we augment the set of features as described in (1), it is straightforward to see that state and action constraints become special cases of feature constraints, with constraint sets given by
+
+$C_i = \{(s, a) \mid \widetilde{\phi}_i^{\mathbb{1}}(s, a) = 1\}$ . It is also evident that we can obtain compound constraints, respecting two or more conditions, by taking the union of constraint sets $C_i$ to obtain $C = \bigcup_{i} C_i$ .
+
+# 3.2.1 ADDING CONSTRAINTS TO AN MDP
+
+We need to be able to reason about how adding a constraint to an MDP will influence the behavior of agents navigating that environment. If we impose a constraint on an MDP, then none of the state-action pairs in that constraint set may appear in a trajectory of the constrained MDP. To enforce this condition, we must restrict the actions available in each state so that it is not possible for an agent to produce one of the constrained state-action pairs. For a given constraint $C$ , we can replace the set of available actions $A_{s}$ in every state $s$ with an alternative set $A_{s}^{C}$ given by
+
+$$
+A _ {s} ^ {C} = A _ {s} \backslash \{a \in A _ {s} \mid (s, a) \in C \}. \tag {2}
+$$
+
+Performing such substitutions for an MDP $\mathcal{M}$ will lead to a modified MDP $\mathcal{M}^C$ such that $\mathcal{M}^C = (S, \{A_s^C\}, \{P_{s,a}\}, \bar{D}_0, \phi, R)$ .
+
+The question then arises as to the how we should treat states with empty action sets $A_{s}^{C} = \emptyset$ . Since an agent arriving in such an empty state would have no valid action to select, any trajectory visiting an empty state must be deemed invalid. Indeed, such empty action sets will be produced for any state $s_i$ such that $C_{s_i} \subseteq C$ .
+
+For MDPs with deterministic transitions, agents know precisely which state they will arrive in following a certain action. Therefore, any agent respecting constraints will not take an action that leads to an empty state, since doing so will lead to constraint violations. If we consider the set of empty states $S_{\mathrm{empty}}$ , then for the purposes of reasoning about an agent's behavior, we can impose an additional constraint set $C_{\mathrm{empty}} = \{(s,a) \mid \exists s_{\mathrm{empty}} \in S_{\mathrm{empty}} : P_{s,a}(s_{\mathrm{empty}}) = 1\}$ . In this work, we will always implicitly add this constraint set, such that $\mathcal{M}^C$ will be equivalent to $\mathcal{M}^{C \cup C_{\mathrm{empty}}}$ , and we recursively add these constraints until reaching a fixed point.
+
+For MDPs with stochastic transitions, the semantics of an empty state are less obvious and could lend themselves to multiple interpretations depending on the nature of the system being modeled. We offer a possible treatment in the appendix.
+
+
+(a) Nominal MDP
+
+
+(b) Constrained MDP
+Figure 1: Illustration of trajectories likely to be produced by noisily optimal agents navigating an MDP. (a) Expected behavior on a generic, nominal MDP. (b) Demonstrated behavior from a specific, constrained MDP. Numbers represent state-based rewards, and the red-shaded tiles represent state constraints.
+
+# 3.2.2 NOMINAL MDPS
+
+The nominal MDPs to which we will add constraints fall into two broad categories, which we denote as generic and baseline. The car MDP described at the beginning of Section 3.2 is an example of a generic nominal model: its state and action spaces are broad enough to encompass a wide range of car models, and we can use this nominal model to infer constraints that specialize the MDP to a specific car and task. For a generic nominal MDP, the reward function may also come from a generic, simplified task, such as "minimize time to the goal" or "minimize energy usage."
+
+A baseline nominal MDP is a snapshot of a system from a point in time where it was well characterized. With a baseline nominal MDP, the constraints that we infer will represent changes to the system with respect to this baseline. In this case, the nominal reward function can be learned using existing IRL techniques with demonstrated behavior from the baseline model. We take this approach in our human obstacle avoidance example in Section 4.2: we use demonstrations of humans walking through the empty space to learn a nominal reward, then we can detect the presence of a new obstacle in the space from subsequent demonstrations.
+
+# 3.3 DEMONSTRATION LIKELIHOOD MAXIMIZATION
+
+Our goal is to find the constraints $C^*$ which are most likely to have been added to a nominal MDP $\mathcal{M}$ , given a set of demonstrations $\mathcal{D}$ from an agent navigating the constrained MDP. Let us define $P_{\mathcal{M}}$ to denote probabilities given that we are considering MDP $\mathcal{M}$ . Our problem then becomes to select the constraints that maximize $P_{\mathcal{M}}(C \mid \mathcal{D})$ . If we assume a uniform prior over possible constraints, then we know from Bayes' Rule that $P_{\mathcal{M}}(C \mid \mathcal{D}) \propto P_{\mathcal{M}}(\mathcal{D} \mid C)$ . Therefore, in order to find the constraints that maximize $P_{\mathcal{M}}(C \mid \mathcal{D})$ , we can solve the equivalent problem of finding which constraints maximize the likelihood of the given demonstrations. In this section, we present our approach to solving maximum likelihood constraint inference via solving demonstration likelihood maximization.
+
+Under the maximum entropy model presented by Ziebart et al. (2008), the probability of a certain finite-length trajectory $\xi$ being executed by an agent traversing a deterministic MDP $\mathcal{M}$ is exponentially proportional to the reward earned by that trajectory.
+
+$$
+P _ {\mathcal {M}} (\xi) = \frac {1}{Z} e ^ {\beta R (\xi)} \mathbb {1} ^ {\mathcal {M}} (\xi), \tag {3}
+$$
+
+where $Z$ is the partition function, $\mathbb{1}^{\mathcal{M}}(\xi)$ indicates if the trajectory is feasible for this MDP, and $\beta \in [0,\infty)$ is a parameter describing how closely an agent adheres to the task of optimizing the reward function (as $\beta \to \infty$ , the agent becomes a perfect optimizer, and as $\beta \to 0$ , the agent's actions become perfectly random). In the sequel, we assume that a given reward function will appropriately capture the role of $\beta$ , so we omit $\beta$ from our notation without loss of generality.
+
+In the case of finite horizon planning, the partition function will be the sum of the exponentially weighted rewards for all feasible trajectories on MDP $\mathcal{M}$ of length no greater than the planning horizon. We denote this set of trajectories by $\Xi_{\mathcal{M}}$ . Because adding constraints $C$ modifies the set of feasible trajectories, we express this dependence as
+
+$$
+Z (C) = \sum_ {\xi \in \Xi_ {\mathcal {M}}} e ^ {R (\xi)} \mathbb {1} ^ {\mathcal {M} ^ {C}} (\xi). \tag {4}
+$$
+
+Assuming independence among demonstrated trajectories, the probability of observing a set $\mathcal{D}$ of $N$ demonstrations is given by the product
+
+$$
+P _ {\mathcal {M} ^ {C}} (\mathcal {D}) = \frac {1}{Z (C) ^ {N}} \prod_ {\xi \in \mathcal {D}} e ^ {R (\xi)} \mathbb {1} ^ {\mathcal {M} ^ {C}} (\xi). \tag {5}
+$$
+
+Our goal is to maximize the demonstration probability given by (5). Because we take the reward function and demonstrations as given, our only available decision variable in this maximization is the constraint set $C$ which alters the indicator $\mathbb{1}^{\mathcal{M}^C}$ and partition function $Z(C)$ .
+
+$$
+C ^ {*} = \underset {C \in \mathcal {C}} {\arg \max } P _ {\mathcal {M} ^ {C}} (\mathcal {D}), \tag {6}
+$$
+
+where $\mathcal{C} \subseteq 2^{S \times A}$ is the hypothesis space of possible constraints.
+
+From the form of (5), it is clear that to solve (6), we must choose a constraint set that does not invalidate any demonstrated trajectory while simultaneously minimizing the value of $Z(C)$ . Consider the set of trajectories that would be made infeasible by augmenting the MDP with constraint $C$ , which we denote as $\Xi_{\mathcal{M}^C}^- = \{\xi \in \Xi_{\mathcal{M}} \mid \mathbb{1}_{\mathcal{M}}^{C}(\xi) = 0\}$ . The value of $Z(C)$ is minimized when we maximize the sum of exponentiated rewards of these infeasible trajectories. Considering the form of the trajectory probability given by (3), we can see that this sum is proportional to the total probability of observing a trajectory from $\Xi_{\mathcal{M}^C}^-$ on the original MDP $\mathcal{M}$
+
+$$
+\sum_ {\xi \in \Xi_ {\mathcal {M} C} ^ {-}} e ^ {R (\xi)} \propto \sum_ {\xi \in \Xi_ {\mathcal {M} C} ^ {-}} P _ {\mathcal {M}} (\xi) = P _ {\mathcal {M}} \left(\Xi_ {\mathcal {M} C} ^ {-}\right). \tag {7}
+$$
+
+This insight leads us to the final form of the optimization
+
+$$
+\begin{array}{l} C ^ {*} = \underset {C \in \mathcal {C}} {\arg \max } P _ {\mathcal {M}} \left(\Xi_ {\mathcal {M} ^ {C}} ^ {-}\right) \tag {8} \\ s. t. \mathcal {D} \cap \Xi_ {\mathcal {M} ^ {C}} ^ {-} = \emptyset \\ \end{array}
+$$
+
+
+(a) Nominal MDP
+
+
+(b) Add constraint $C_1$
+Figure 2: Selecting constraints to maximize demonstration likelihood. Trajectories that are likely to be observed on a given MDP are shown as dashed, angular arrows, and a provided demonstration is shown as a solid, curved arrow. Adding $C_1$ in (b) does little to align the expected trajectories with the demonstration. On the other hand, adding $C_2$ in (c) makes the original expected trajectories infeasible and causes the new expected trajectories to agree with the demonstration, greatly increasing the likelihood of the demonstration on this constrained MDP.
+
+
+(c) Add constraint $C_2$
+
+In order to solve (8), we must reason about the probability distribution of trajectories on the original MDP $\mathcal{M}$ , then find the constraint $C$ such that $\Xi_{\mathcal{M}^C}^-$ contains the most probability mass while not containing any demonstrated trajectories. Figure 2 provides a graphical representation of this reasoning. We highlight here that the fact that the chosen $C$ must not conflict with any demonstration is an important condition: all provided demonstrations must perfectly respect a constraint in order for it to be learned, otherwise a less restrictive set of constraints may be learned instead. Future work will look to relax this requirement in order to learn about constraints that are generally respected by a set of demonstrations, without needing to first isolate just the successful, constraint-respecting demonstrations.
+
+While equation (8) is derived for deterministic MDPs, if we can assume, as proposed by Ziebart et al. (2008), that for a given stochastic MDP, the stochastic outcomes have little effect on an agent's behavior and the partition function, then the solution to (8) will also approximate the optimal constraint selection for that MDP. However, in order to fully address the stochastic case, we would need to reformulate our approach based on maximum causal entropy (Ziebart, 2010). We save this extension for future work.
+
+# 3.3.1 CONSTRAINT HYPOTHESIS SPACE
+
+In order for the solutions to (8) to be meaningful, we must be careful with our choice of the constraint hypothesis space $\mathcal{C}$ . For instance, if we let $\mathcal{C} = 2^{S\times A}$ , then the optimal solution will always be to choose the most restrictive $C$ to constrain all state-action pairs not observed in the demonstration set.
+
+One approach to avoid this trivial solution is to use domain knowledge of the modeled system to restrict $\mathcal{C}$ to a library of plausible or common constraints. McPherson et al. (2018) construct such a library by using reachability theory to calculate a family of likely unsafe sets.
+
+We could also potentially address this problem by adding a regularization term to the optimization that would penalize constraints based on some notion of "size," which would encourage the selection of "smaller" constraints. The size of a constraint set could be defined by the number of minimal constraints that it contains. These minimal constraint sets constrain a single state, action, or feature, and were introduced in Section 3.2 as $C_{s_i}, C_{a_i}$ , and $C_{\phi_i}$ , respectively. While penalizing this definition of size would effectively discourage overfitting, considering every possible combination of minimal constraints causes the hypothesis space to grow exponentially in the number of states, actions, and features of the MDP, which may make directly solving this formulation intractable.
+
+Another approach, which avoids this combinatorial explosion, is to use the minimal constraint sets themselves, not their combinations, as our hypothesis space, and to select from among these constraints in an iterative, greedy manner. By iteratively selecting individual minimal constraint sets, and choosing a proper stopping condition, it is possible to gradually grow the full estimated constraint
+
+set and avoid overfitting to the demonstrations. It is this method that we will utilize in this work. Section 3.4 details our approach for selecting the most likely minimal constraint, and Section 3.5 details our approach for iteratively growing the estimated constraint set.
+
+# 3.4 PROBABILITY MASS FOR MINIMAL CONSTRAINTS
+
+As detailed in Section 3.3, the most likely constraint set is the one whose eliminated trajectories $\Xi_{\mathcal{M}^C}^-$ have the highest probability of being demonstrated on the original, unconstrained MDP. Therefore, to find the most likely of the minimal constraints, we must find the expected proportion of trajectories which will contain any state or action, or accrue any feature. By using our augmented indicator feature map from (1), we can reduce this problem to only examine feature accruals. Ziebart et al. (2008) present their forward-backward algorithm for calculating expected feature counts for an agent following a policy in the maximum entropy setting. This algorithm nearly suffices for our purposes, but it computes the expectation of the total number of times a feature will be accrued (i.e. how often will this feature be observed per trajectory), rather than the expectation of the number of trajectories that will accrue that feature at any point in time. To address this problem, we present a modified form of the "forward" pass as Algorithm 1. Our algorithm tracks state visitations as well as feature accruals at each state, which allows us to produce the same maximum en
+
+Algorithm 1 Feature Accrual History Calculation
+Input: an MDP $\mathcal{M}$ , a policy $\pi(a|s,t)$ , a time horizon $T$
+Output: expected feature accrual history $\widetilde{\Phi}_{[1,T]}$
+/* Initialize state visitation and feature accrual history */
+1: for $s\in S$ do
+2: $D_{s,0}\gets D_0(s)$
+3: $\widetilde{\Phi}_{s,0}\gets 0_{n_{\phi}\times 1}$
+4: end for
+/* Track feature accruals over the time horizon */
+5: for $t\in [0,T - 1]$ do
+6: for $s\in S$ do
+7: for $a\in A_s$ do
+8: /* New feature accruals */
+9: /* “ $\odot$ ” denotes element-wise multiplication */
+10: $\Delta \widetilde{\Phi}_{s,t}(a)\gets \widetilde{\phi}^{\mathbb{1}}(s,a)\odot (D_{s,t}\mathbf{1}_{n_{\phi}\times 1} - \widetilde{\Phi}_{s,t})$
+11: end for
+12: end for
+13: for $s'\in S$ do
+14: $D_{s',t + 1}\gets \sum_{s\in S}\sum_{a\in A_s}D_{s,t}\pi (a|s,t)P(s'|s,a)$
+15: $\widetilde{\Phi}_{s',t + 1}\gets \sum_{s\in S}\sum_{a\in A_s}\left(\widetilde{\Phi}_{s,t} + \Delta \widetilde{\Phi}_{s,t}(a)\right)\pi (a|s,t)P(s'|s,a)$
+16: end for
+17: $\widetilde{\Phi}_{t + 1}\gets \sum_{s\in S}\widetilde{\Phi}_{s,t + 1}$
+18: end for
+19: Return $\widetilde{\Phi}_{[1,T]}$
+
+tropy distribution over trajectories as Ziebart et al. (2008) while not counting additional accruals for trajectories that have already accrued a feature.
+
+The input of Algorithm 1 includes the MDP itself, a time horizon, and a time-varying policy. This policy should capture the expected behavior of the demonstrator on the nominal MDP $\mathcal{M}$ , and it can be computed via the "backward" part of the algorithm from Ziebart et al. (2008). The output of Algorithm 1, $\widetilde{\Phi}_{[1,T]}$ , is an $n_{\phi} \times T$ array such that the $t$ -th column $\widetilde{\Phi}_t$ is a vector whose $i$ -th entry is the expected proportion of trajectories to have accrued the $i$ -th feature by time $t$ . In particular, the $i$ -th element of $\widetilde{\Phi}_T$ is equal to $P_{\mathcal{M}}(\Xi_{\mathcal{M}^c_i}^-)$ , which allows us to now directly select the most likely constraint according to (8).
+
+# 3.5 MAXIMUM-COVERAGE-BASED ITERATIVE CONSTRAINT INFERENCE
+
+When using minimal constraint sets as the constraint hypothesis space, it is possible that the most likely constraint still does not provide a satisfactory explanation for the demonstrated behavior. In this case, it can be beneficial to combine minimal constraints. If the task of solving (8) is framed as finding the combination of constraint sets that "covers" the most probability mass, then the problem becomes a direct analog for the classic maximum coverage problem. While this problem is known to be NP-hard, there exist a simple greedy algorithm with known suboptimality bounds (Hochbaum & Pathria, 1998).
+
+We present Algorithm 2 as our approach for adapting this greedy heuristic to solve the problem of constraint inference. At each iteration, we grow our estimated constraint set by augmenting it with the constraint set in our hypothesis space that covers the most currently uncovered probability mass. By analogy to the maximum coverage problem (Hochbaum & Pathria, 1998), we derive the following bound on the suboptimality of our approach.
+
+Theorem 1. Let $\mathcal{C}_{n_c}$ be the set of all constraints $\mathbf{C}_{n_c}$ such that $\mathbf{C}_{n_c} = \bigcup_{i=1}^{n_c} C_i$ for $C_i \in \mathcal{C}$ , and let $\mathbf{C}_{n_c}^*$ be the solution to (8) using $\mathcal{C}_{n_c}$ as the constraint hypothesis space. It follows, then, that at the end of every iteration $i$ of Algorithm 2,
+
+$$
+P \left(\Xi_ {\mathcal {M} ^ {\hat {C} ^ {*}}}\right) \geq \left(1 - \left(\frac {i - 1}{i}\right) ^ {i}\right) P \left(\Xi_ {\mathcal {M} ^ {\mathbf {C} _ {i} ^ {*}}}\right).
+$$
+
+This bound is directly analogous to the suboptimality bound for the greedy solution to the maximum coverage problem proven by Hochbaum & Pathria (1998). For space, the proof is included in the appendix.
+
+Rather than selecting the number of constraints $n_c$ to be used ahead of time, we check a stopping condition to decide if we should continue to add constraints. Because we are attempting to maximize $P_{\mathcal{M}^c}(\mathcal{D})$ , it might seem natural to use a probability-based stopping condition. However, choosing a stopping criterion based on probability is problematic because
+
+# Algorithm 2 Greedy Iterative Constraint Inference
+
+Input: MDP $\mathcal{M}$ , constraint hypothesis space $\mathcal{C}$ , empirical probability distribution $P_{\mathcal{D}}$ , threshold $d_{D_{\mathrm{KL}}}$
+
+Output: estimated constraint set $\widehat{C}^*$
+
+1: $\widehat{C}^* \gets \emptyset$
+2: for $i \in [1, |\mathcal{C}|]$ do
+3: $C_i \gets$ solution to (8) using $\mathcal{M}^{\widehat{C}^*}, \mathcal{C}$ , and $\mathcal{D}$
+4: $\Delta_{D_{\mathrm{KL}}} = D_{\mathrm{KL}}\big(P_{\mathcal{D}}||P_{\mathcal{M}^{\hat{C}^{*}}}\big) - D_{\mathrm{KL}}\big(P_{\mathcal{D}}||P_{\mathcal{M}^{\hat{C}^{*}\cup C_i}}\big)$
+5: if $\Delta_{D_{\mathrm{KL}}} \leq d_{D_{\mathrm{KL}}}$ then
+6: break
+7: end if
+8: $\widehat{C}^* \gets \widehat{C}^* \cup C_i$
+9: end for
+0: Return $\widehat{C}^*$
+
+the probability of observing a set of demonstrations is dependent on the number of demonstrations in the set, even if each individual demonstration has the same probability. We instead base our stopping condition on KL divergence, which depends only on the distribution of trajectories in $\mathcal{D}$ and not on the number of demonstrations. The quantity $D_{\mathrm{KL}}(P_{\mathcal{D}}||P_{\mathcal{M}^{\hat{c}^{*}}})$ provides a measure of how well the distribution over trajectories induced by our inferred constraints, $P_{\mathcal{M}^{\hat{c}^{*}}}$ , agrees with the empirical probability distribution over trajectories observed in the demonstrations, $P_{\mathcal{D}}$ . Using this KL divergence in the stopping condition actually preserves a link to the probability of the demonstration set, since the KL divergence will decrease monotonically as $P_{\mathcal{M}^{\mathcal{C}}}(\mathcal{D})$ increases. The threshold parameter $d_{D_{\mathrm{KL}}}$ is chosen to avoid overfitting to the demonstrations, combating the tendency to select additional constraints that may only marginally better align our predictions with the demonstrations.
+
+# 4 EXAMPLES
+
+# 4.1 SYNTHETIC GRID WORLD
+
+We consider the grid world MDP presented in Figure 3. The environment consists of a 9-by-9 grid of states, and the actions are to move up, down, left, right, or diagonally by one cell. The objective is to move from the starting state in the bottom-left corner $(s_0)$ to the goal state in the bottom-right corner $(s_G)$ . Every state-action pair produces a distance feature, and the MDP reward is negative distance, which encourages short trajectories. There are additionally two more features, denoted green and blue, which are produced by taking actions from certain states, as shown in Figure 3.
+
+The true MDP, from which agents generate trajectories, is shown in Figure 3a, including its constraints. The nominal, more generic MDP shown in Figure 3b is what we take as $\mathcal{M}$ for applying the iterative maximum likelihood constraint inference in Algorithm 2, with feature accruals estimated using Algorithm 1. While Figures 3c through 3e show the iteratively estimated constraints, which align with the true constraints, it is interesting to note that not all constraints present in the true MDP are identified. For instance, it is so unlikely that an agent would ever select the up-left diagonal action, that the fact that demonstrated trajectories did not contain that action is unsurprising and does not make that action an estimated constraint.
+
+
+(a) True MDP
+
+
+(b) Nominal MDP
+
+
+(c) $\hat{C}^*$ , $n_c = 1$
+
+
+(d) $\widehat{C}^*$ , $n_c = 2$
+
+
+(e) $\widehat{C}^*$ , $n_c = 6$
+
+Figure 4 shows how the performance of our approach varies based on the number of available demonstrations and the selection for the threshold $d_{D_{\mathrm{KL}}}$ . The false positive rate shown in Figure 4a is the proportion of selected constraints which are not constraints of the true system. We can observe two trends in this data that we would expect. First, lower values of $d_{D_{\mathrm{KL}}}$ lead to greater false positive rates since they allow Algorithm 2 to continue iterating and accept constraints that do less to align expectations and demonstrations. Second, having more demonstrations available provides more information and reduces the rate of false positives. Further, Figure 4b shows that more demonstrations also allows the behavior predicted by constraints to better align with the observations. It is interesting to note, however, that with fewer than 10 demonstrations and a very low $d_{D_{\mathrm{KL}}}$ , we may produce very low KL divergence, but at the cost of a high false positive rate. This phenomenon highlights the role of selecting $d_{D_{\mathrm{KL}}}$ to avoid over-fitting. The threshold $d_{D_{\mathrm{KL}}} = 0.1$ achieves a good balance of producing few false positives with sufficient examples while also producing lower KL divergences, and we used this threshold to produce the results in Figures 3 and 5.
+
+# 4.2 HUMAN OBSTACLE AVOIDANCE
+
+In our second example, we analyze trajectories from humans as they navigate around an obstacle on the floor. We map these continuous trajectories into trajectories through a grid world where each cell represents a 1ft-by-1ft area
+
+
+Figure 3: Algorithm performance on a synthetic grid world MDP. Each subfigure represents the MDP by showing (clockwise from left) its states, actions, and features. Each element is shaded according to the proportion of trajectories that are expected to accrue the respective augmented feature, computed via Algorithm 1. Constraints are marked with a red "X," and bright bounding boxes mark the green and blue feature-producing states. The result here are shown for a set of 100 demonstrations sampled according to the expectation for the True MDP (a). We begin with the nominal MDP shown in (b), and produce (c), (d), and (e) by applying Algorithm 2. Note that (c), (d), and (e) show the selections of feature, action, and state constraints, respectively.
+(a) False positives
+
+
+(b) $D_{\mathrm{KL}}$
+Figure 4: Algorithm performance on the synthetic grid world. Each data point represents the mean result of 10 independent trajectory draws, and the margins show $\pm 1$ standard error.
+
+on the ground. The human agents are attempting to reach a fixed goal state $(s_G)$ from a given initial state $(s_0)$ , as shown in Figure 5. We performed MaxEnt IRL on human demonstrations of the task without the obstacle to obtain the nominal distance-based reward function. We restrict ourselves to estimating only state constraints, as we do not supply our algorithm with knowledge of any additional features in the environment and we assume that the humans' motion is unrestrained.
+
+Demonstrations were collected from 16 volunteers, and the results of performing constraint inference are shown in Figure 5. Our method is able to successfully predict the existence of a central obstacle. While we do not estimate every constrained state, the constraints that we do estimate make all of the obstacle states unlikely to be visited. In order to identify those states as additional constraints, we would have to decrease our $d_{D_{\mathrm{KL}}}$ threshold, which could also lead to more spurious constraint selections, such as the three shown in Figure 5.
+
+# 5 CONCLUSION AND FUTURE WORK
+
+We have presented our novel technique for learning constraints from demonstrations. We improve upon previous work in constraint-learning IRL by providing a principled framework for identifying the most likely constraint(s), and we do so in a way that explicitly makes state, action, and feature constraints all directly comparable to one another. We believe that the numerical results presented in Section 4 are promising and highlight the usefulness of our approach.
+
+Despite its benefits, one drawback of our approach is that the formulation is based on (3), which only exactly holds for deterministic MDPs. As mentioned in Section 3.3, we plan to investigate the use of a maximum causal entropy approach
+
+
+Obstacle Avoidance Trajectories
+Figure 5: Human trajectories overlaid on a grid world MDP. The shaded region represents an obstacle in the human's environment, and the red "X"s represent learned constraints.
+
+to address this issue and fully handle stochastic MDPs. Additionally, the methods presented here require all demonstrations to contain no violations of the constraints we will estimate. We believe that softening this requirement, which would allow reasoning about the likelihood of constraints that are occasionally violated in the demonstration set, may be beneficial in cases where trajectory data is collected without explicit labels of success or failure. Finally, the structure of Algorithm 1, which tracks the expected features accruals of trajectories over time, suggests that we may be able to reason about non-Markovian constraints by using this historical information to our advantage.
+
+Overall, we believe that our formulation of maximum likelihood constraint inference for IRL shows promising results and presents attractive avenues for further investigation.
+
+# ACKNOWLEDGMENTS
+
+This work is supported by the National Science Foundation through grant CNS-1545126 (VeHICaL). We would like to thank Jaime Fisac, Andrea Bajcsy, Sylvia Herbert, and David Fridovich-Keil for their insightful discussions and for sharing their collected data.
+
+# REFERENCES
+
+Pieter Abbeel and Andrew Y Ng. Apprenticeship learning via inverse reinforcement learning. In Proceedings of the twenty-first international conference on Machine learning, pp. 1. ACM, 2004.
+Pieter Abbeel, Adam Coates, Morgan Quigley, and Andrew Y Ng. An application of reinforcement learning to aerobic helicopter flight. In Advances in neural information processing systems, pp. 1-8, 2007.
+Dario Amodei, Chris Olah, Jacob Steinhardt, Paul F. Christiano, John Schulman, and Dan Mané. Concrete problems in AI safety. arXiv, arXiv:1606.06565, 2016.
+
+Glen Chou, Dmitry Berenson, and Necmiye Ozay. Learning constraints from demonstrations. In Springer Proceedings in Advanced Robotics (SPAR) series on 2018 Workshop on the Algorithmic Foundations of Robotics (WAFR 2018). Springer, 2018.
+Mark K Ho, Michael L Littman, Fiery Cushman, and Joseph L Austerweil. Teaching with rewards and punishments: Reinforcement or communication? In CogSci, 2015.
+Dorit S Hochbaum and Anu Pathria. Analysis of the greedy approach in problems of maximum k-coverage. Naval Research Logistics (NRL), 45(6):615-627, 1998.
+Edwin T Jaynes. Information theory and statistical mechanics. Physical review, 106(4):620, 1957.
+Rudolf Emil Kalman. When is a linear control system optimal? Journal of Basic Engineering, 86(1): 51-60, 1964.
+David L. McPherson, Dexter R.R. Scobee, Joseph Menke, Allen Y Yang, and S. Shankar Sastry. Modeling supervisor safe sets for improving collaboration in human-robot teams. In 2018 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), pp. 861–868, Oct 2018. doi: 10.1109/IROS.2018.8593865.
+Andrew Y Ng and Stuart J Russell. Algorithms for inverse reinforcement learning. In Proceedings of the Seventeenth International Conference on Machine Learning, pp. 663-670. Morgan Kaufmann Publishers Inc., 2000.
+Michael Pardowitz, Raoul Zollner, and Rüdiger Dillmann. Learning sequential constraints of tasks from user demonstrations. In 5th IEEE-RAS International Conference on Humanoid Robots, 2005., pp. 424-429. IEEE, 2005.
+Claudia Pérez-D'Arpino and Julie A Shah. C-learn: Learning geometric constraints from demonstrations for multi-step manipulation in shared autonomy. In 2017 IEEE International Conference on Robotics and Automation (ICRA), pp. 4058-4065. IEEE, 2017.
+Nathan D Ratliff, J Andrew Bagnell, and Martin A Zinkevich. Maximum margin planning. In Proceedings of the 23rd international conference on Machine learning, pp. 729-736. ACM, 2006.
+Dexter R R Scobee, Vicenc Rubies Royo, Claire J Tomlin, and S Shankar Sastry. Haptic assistance via inverse reinforcement learning. In 2018 IEEE International Conference on Systems, Man, and Cybernetics (SMC), pp. 1510-1517. IEEE, 2018.
+Guru Subramani, Michael Zinn, and Michael Gleicher. Inferring geometric constraints in human demonstrations. In Conference on Robot Learning, pp. 223-236, 2018.
+Dizan Vasquez, Billy Okal, and Kai O Arras. Inverse reinforcement learning algorithms and features for robot navigation in crowds: an experimental comparison. In 2014 IEEE/RSJ International Conference on Intelligent Robots and Systems, pp. 1341-1346. IEEE, 2014.
+Marcell Vazquez-Chanlatte, Susmit Jha, Ashish Tiwari, Mark K Ho, and Sanjit Seshia. Learning task specifications from demonstrations. In Advances in Neural Information Processing Systems, pp. 5367-5377, 2018.
+Brian D Ziebart. Modeling Purposeful Adaptive Behavior with the Principle of Maximum Causal Entropy. PhD thesis, Carnegie Mellon University, 2010.
+Brian D Ziebart, Andrew L Maas, J Andrew Bagnell, and Anind K Dey. Maximum entropy inverse reinforcement learning. In Aaai, volume 8, pp. 1433-1438. Chicago, IL, USA, 2008.
+
+# APPENDIX
+
+# A ADDING CONSTRAINTS TO STOCHASTIC MDPS
+
+For MDPs with stochastic transitions, the semantics of an empty state are less obvious and could lend themselves to multiple interpretations depending on the nature of the system being modeled. In our context, we use constraints to describe how observed behaviors from demonstrations differ from possible behaviors allowed by the nominal MDP structure. We therefore assume that any demonstrations provided are, by the fact that they were selected to be provided, consistent with the system's constraints, including avoiding empty states. This assumption implies that any stochastic state transitions that would have led to an empty state will not be observed in trajectories from the demonstration set. The omission of these transitions means that, for a given $(s,a)$ , if $P_{s,a}(S_{\text{empty}}) = p$ , then a proportion $p$ of these $(s,a)$ pairs which occur as an agent navigates the environment will be excluded from demonstrations. Therefore, as we modify the MDP to reason about demonstrated behavior, we need updated transition probabilities which eliminate the probability mass of transitioning to empty states, an event which will never be observed in a demonstration. Such modified probabilities can be given as
+
+$$
+P _ {s, a} ^ {C} \left(s ^ {\prime}\right) = \left\{ \begin{array}{l l} 0 & \text {i f} s ^ {\prime} \in S _ {\text {e m p t y}} \\ \frac {P _ {s , a} \left(s ^ {\prime}\right)}{1 - P _ {s , a} \left(S _ {\text {e m p t y}}\right)} & \text {o t h e r w i s e} \end{array} . \right. \tag {9}
+$$
+
+We must also capture the change to observed state-action pair frequencies by understanding that any observed policy $\pi^C$ will be related to an agent's actual policy $\pi$ according to
+
+$$
+\pi^ {C} (a | s, t) = \frac {\pi (a | s , t) \left(1 - P _ {s , a} \left(S _ {\text {e m p t y}}\right)\right)}{\sum_ {a ^ {\prime} \in A _ {s} ^ {C}} \pi \left(a ^ {\prime} | s , t\right) \left(1 - P _ {s , a} \left(S _ {\text {e m p t y}}\right)\right)}. \tag {10}
+$$
+
+It is important to note that the modifications presented in (9) and (10) for non-deterministic MDPs are not meant to directly reflect the reality of the underlying system (we wouldn't expect the actual transition dynamics to change, for instance), but to reflect the apparent behavior that we would expect to observe in the subset of trajectories that would be selected as demonstrations. We further note that applying these modifications to deterministic MDPs will result in the same expected behavior as augmenting the constraint set with $C_{\mathrm{empty}}$ .
+
+# B PROOF FOR THEOREM 1
+
+Theorem 1. Let $\mathcal{C}_{n_c}$ be the set of all constraints $\mathbf{C}_{n_c}$ such that $\mathbf{C}_{n_c} = \bigcup_{i=1}^{n_c} C_i$ for $C_i \in \mathcal{C}$ , and let $\mathbf{C}_{n_c}^*$ be the solution to (8) using $\mathcal{C}_{n_c}$ as the constraint hypothesis space. It follows, then, that at the end of every iteration $i$ of Algorithm 2,
+
+$$
+P \left(\Xi_ {\mathcal {M} ^ {\hat {C} ^ {*}} ^ {*}} ^ {-}\right) \geq \left(1 - \left(\frac {i - 1}{i}\right) ^ {i}\right) P \left(\Xi_ {\mathcal {M} ^ {\mathbf {C} _ {i} ^ {*}} ^ {*}} ^ {-}\right).
+$$
+
+Proof. The problem of finding $\mathbf{C}_{n_c}^*$ is analogous to solving the maximum coverage problem, discussed by Hochbaum & Pathria (1998), where the set of elements to be covered is the set of trajectories $\{\xi \mid \exists C \in \mathcal{C} : \xi \in \Xi_{\mathcal{M}^C}^- \text{ and } \mathcal{D} \cap \Xi_{\mathcal{M}^C}^- = \emptyset\}$ and the weight of each element $\xi$ is $P_{\mathcal{M}}(\xi)$ . Because Algorithm 2 constructs $\widehat{C}^*$ iteratively by taking the union of the previous value of $\widehat{C}^*$ and the set $C_i \in \mathcal{C}$ which solves (8), the value of $\widehat{C}^*$ at the end of the $i$ -th iteration is analogous to the greedy solution of the maximum coverage problem with $n_c = i$ . Therefore, we can directly apply the suboptimality bound for the greedy solution proven in Hochbaum & Pathria (1998) to arrive at our given bound on eliminated probability mass.
\ No newline at end of file
diff --git a/maximumlikelihoodconstraintinferenceforinversereinforcementlearning/images.zip b/maximumlikelihoodconstraintinferenceforinversereinforcementlearning/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..16250d277bb8f2a28793a1941d2b8529ee77f9f5
--- /dev/null
+++ b/maximumlikelihoodconstraintinferenceforinversereinforcementlearning/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:644b2aec666078d1c4d2266c16e0c448171306491f3835261c6ea5ab1cbe0dce
+size 306385
diff --git a/maximumlikelihoodconstraintinferenceforinversereinforcementlearning/layout.json b/maximumlikelihoodconstraintinferenceforinversereinforcementlearning/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..cdebbe05a8ee8926fa2719b8ad522502e5d7e4de
--- /dev/null
+++ b/maximumlikelihoodconstraintinferenceforinversereinforcementlearning/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a6edd089b4fe41aa48a9b4882a9b2c4953c9c2d43a75f9ddeac3c13d5b623010
+size 487708
diff --git a/measuringthereliabilityofreinforcementlearningalgorithms/2830d5b8-c913-4a1e-970a-38e2e2482c2a_content_list.json b/measuringthereliabilityofreinforcementlearningalgorithms/2830d5b8-c913-4a1e-970a-38e2e2482c2a_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..df1a88ec5b2bf63fb5a0567b490b00b405461c7d
--- /dev/null
+++ b/measuringthereliabilityofreinforcementlearningalgorithms/2830d5b8-c913-4a1e-970a-38e2e2482c2a_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e3a14ab514543416a7ef101ec9ac76dcda30dbe1f5d48ab69578f3ea05cb61e5
+size 152304
diff --git a/measuringthereliabilityofreinforcementlearningalgorithms/2830d5b8-c913-4a1e-970a-38e2e2482c2a_model.json b/measuringthereliabilityofreinforcementlearningalgorithms/2830d5b8-c913-4a1e-970a-38e2e2482c2a_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..d7a6a2991a6739e60e9b56a3e65aa643a145e82d
--- /dev/null
+++ b/measuringthereliabilityofreinforcementlearningalgorithms/2830d5b8-c913-4a1e-970a-38e2e2482c2a_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:8b2700d1854a142055c544d75706e118143e00d4ac9eaefdb8168f2d42f2dbb3
+size 167084
diff --git a/measuringthereliabilityofreinforcementlearningalgorithms/2830d5b8-c913-4a1e-970a-38e2e2482c2a_origin.pdf b/measuringthereliabilityofreinforcementlearningalgorithms/2830d5b8-c913-4a1e-970a-38e2e2482c2a_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..1f67bf197893b191b34f75de1eb3290629b270ed
--- /dev/null
+++ b/measuringthereliabilityofreinforcementlearningalgorithms/2830d5b8-c913-4a1e-970a-38e2e2482c2a_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b2a6b65b2639da931e3ac8035540b7782891788f7354e5f99d348dbf6e99b738
+size 8130053
diff --git a/measuringthereliabilityofreinforcementlearningalgorithms/full.md b/measuringthereliabilityofreinforcementlearningalgorithms/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..1e0c62c9738ab64417876ef41f789ee04ddebd79
--- /dev/null
+++ b/measuringthereliabilityofreinforcementlearningalgorithms/full.md
@@ -0,0 +1,689 @@
+# MEASURING THE RELIABILITY OF REINFORCEMENT LEARNING ALGORITHMS
+
+Stephanie C.Y. Chan, $^{1*}$ Samuel Fishman, $^{1}$ John Canny, $^{1,2}$ Anoop Korattikara, $^{1}$ & Sergio Guadarrama $^{1}$
+
+1Google Research 2Berkeley EECS
+
+{scychan, sfishman, canny, kbanoop, sguada}@google.com
+
+# ABSTRACT
+
+Lack of reliability is a well-known issue for reinforcement learning (RL) algorithms. This problem has gained increasing attention in recent years, and efforts to improve it have grown substantially. To aid RL researchers and production users with the evaluation and improvement of reliability, we propose a set of metrics that quantitatively measure different aspects of reliability. In this work, we focus on variability and risk, both during training and after learning (on a fixed policy). We designed these metrics to be general-purpose, and we also designed complementary statistical tests to enable rigorous comparisons on these metrics. In this paper, we first describe the desired properties of the metrics and their design, the aspects of reliability that they measure, and their applicability to different scenarios. We then describe the statistical tests and make additional practical recommendations for reporting results. The metrics and accompanying statistical tools have been made available as an open-source library.1 We apply our metrics to a set of common RL algorithms and environments, compare them, and analyze the results.
+
+# 1 INTRODUCTION
+
+Reinforcement learning (RL) algorithms, especially Deep RL algorithms, tend to be highly variable in performance and considerably sensitive to a range of different factors, including implementation details, hyper-parameters, choice of environments, and even random seeds (Henderson et al., 2017). This variability hinders reproducible research, and can be costly or even dangerous for real-world applications. Furthermore, it impedes scientific progress in the field when practitioners cannot reliably evaluate or predict the performance of any particular algorithm, compare different algorithms, or even compare different implementations of the same algorithm.
+
+Recently, Henderson et al. (2017) has performed a detailed analysis of reliability for several policy gradient algorithms, while Duan et al. (2016) has benchmarked average performance of different continuous-control algorithms. In other related work, Colas et al. (2018) have provided a detailed analysis on power analyses for mean performance in RL, and Colas et al. (2019) provide a comprehensive primer on statistical testing for mean and median performance in RL.
+
+In this work, we aim to devise a set of metrics that measure reliability of RL algorithms. Our analysis distinguishes between several typical modes to evaluate RL performance: "evaluation during training", which is computed over the course of training, vs. "evaluation after learning", which is evaluated on a fixed policy after it has been trained. These metrics are also designed to measure different aspects of reliability, e.g. reproducibility (variability across training runs and variability across rollouts of a fixed policy) or stability (variability within training runs). Additionally, the metrics capture multiple aspects of variability - dispersion (the width of a distribution), and risk (the heaviness and extremity of the lower tail of a distribution).
+
+Standardized measures of reliability can benefit the field of RL by allowing RL practitioners to compare algorithms in a rigorous and consistent way. This in turn allows the field to measure
+
+progress, and also informs the selection of algorithms for both research and production environments. By measuring various aspects of reliability, we can also identify particular strengths and weaknesses of algorithms, allowing users to pinpoint specific areas of improvement.
+
+In this paper, in addition to describing these reliability metrics, we also present practical recommendations for statistical tests to compare metric results and how to report the results more generally. As examples, we apply these metrics to a set of algorithms and environments (discrete and continuous, off-policy and on-policy). We have released the code used in this paper as an open-source Python package to ease the adoption of these metrics and their complementary statistics.
+
+ | | Dispersion (D) | Risk (R) |
| DURING TRAINING | Across Time (T) (within training runs) | IQR* within windows, after detrending | Short-term: CVaR† on first-order differences
+Long-term: CVaR† on Drawdown |
| Across Runs (R) | IQR* across training runs, after low-pass filtering. | CVaR† across runs |
| AFTER LEARNING | Across rollouts on a Fixed Policy (F) | IQR* across rollouts for a fixed policy | CVaR† across rollouts for a fixed policy |
+
+Table 1: Summary of our proposed reliability metrics. For evaluation DURING TRAINING, which measures reliability over the course of training an algorithm, the inputs to the metrics are the performance curves of an algorithm, evaluated at regular intervals during a single training run (or on a set of training runs). For evaluation AFTER LEARNING, which measures reliability of an already-trained policy, the inputs to the metrics are the performance scores of a set of rollouts of that fixed policy. *IQR: inter-quartile range. †CVaR: conditional value at risk.
+
+# 2 RELIABILITY METRICS
+
+We target three different axes of variability, and two different measures of variability along each axis. We denote each of these by a letter, and each metric as a combination of an axis + a measure, e.g. "DR" for "Dispersion Across Runs". See Table 1 for a summary. Please see Appendix A for more detailed definitions of the terms used here.
+
+# 2.1 AXES OF VARIABILITY
+
+Our metrics target the following three axes of variability. The first two capture reliability "during training", while the last captures reliability of a fixed policy "after learning".
+
+During training: Across Time (T) In the setting of evaluation during training, one desirable property for an RL algorithm is to be stable "across time" within each training run. In general, smooth monotonic improvement is preferable to noisy fluctuations around a positive trend, or unpredictable swings in performance.
+
+This type of stability is important for several reasons. During learning, especially when deployed for real applications, it can be costly or even dangerous for an algorithm to have unpredictable levels of performance. Even in cases where bouts of poor performance do not directly cause harm, e.g. if training in simulation, high instability implies that algorithms have to be check-pointed and evaluated more frequently in order to catch the peak performance of the algorithm, which can be expensive. Furthermore, while training, it can be a waste of computational resources to train an unstable algorithm that tends to forget previously learned behaviors.
+
+During training: Across Runs (R) During training, RL algorithms should have easily and consistently reproducible performances across multiple training runs. Depending on the components that we allow to vary across training runs, this variability can encapsulate the algorithm's sensitivity to a variety of factors, such as: random seed and initialization of the optimization, random seed and initialization of the environment, implementation details, and hyper-parameter settings. Depending on the goals of the analysis, these factors can be held constant or allowed to vary, in order to disentangle the contribution of each factor to variability in training performance. High variability on any of these dimensions leads to unpredictable performance, and also requires a large search in order to find a model with good performance.
+
+After learning: Across rollouts of a fixed policy (F) When evaluating a fixed policy, a natural concern is the variability in performance across multiple rollouts of that fixed policy. Each rollout may be specified e.g. in terms of a number of actions, environment steps, or episodes. Generally, this metric measures sensitivity to both stochasticity from the environment and stochasticity from the training procedure (the optimization). Practitioners may sometimes wish to keep one or the other constant if it is important to disentangle the two factors (e.g. holding constant the random seed of the environment while allowing the random seed controlling optimization to vary across rollouts).
+
+# 2.2 MEASURES OF VARIABILITY
+
+For each axis of variability, we have two kinds of measures: dispersion and risk.
+
+Dispersion Dispersion is the width of the distribution. To measure dispersion, we use "robust statistics" such as the Inter-quartile range (IQR) (i.e. the difference between the 75th and 25th percentiles) and the Median absolute deviation from the median (MAD), which are more robust statistics and don't require assuming normality of the distributions. We prefer to use IQR over MAD, because it is more appropriate for asymmetric distributions (Rousseeuw & Croux, 1993).
+
+Risk In many cases, we are concerned about the worst-case scenarios. Therefore, we define risk as the heaviness and extent of the lower tail of the distribution. This is complementary to measures of dispersion like IQR, which cuts off the tails of the distribution. To measure risk, we use the Conditional Value at Risk (CVaR), also known as "expected shortfall". CVaR measures the expected loss in the worst-case scenarios, defined by some quantile $\alpha$ . It is computed as the expected value in the left-most tail of a distribution (Acerbi & Tasche, 2002). We use the following definition for the CVaR of a random variable $X$ for a given quantile $\alpha$ :
+
+$$
+\operatorname {C V a R} _ {\alpha} (X) = \mathbb {E} [ X | X \leq \operatorname {V a R} _ {\alpha} (X) ] \tag {1}
+$$
+
+where $\alpha \in (0,1)$ and the $VaR_{\alpha}$ (Value at Risk) is just the $\alpha$ -quantile of the distribution of $X$ . Originally developed in finance, CVaR has also seen recent adoption in Safe RL as an additional component of the objective function by applying it to the cumulative returns within an episode, e.g. Bäuerle & Ott (2011); Chow & Ghavamzadeh (2014); Tamar et al. (2015). In this work, we apply CVaR to the dimensions of reliability described in Section 2.1.
+
+# 2.3 DESIDERATA
+
+In designing our metrics and statistical tests, we required that they fulfill the following criteria:
+
+- A minimal number of configuration parameters – to facilitate standardization as well as to minimize “researcher degrees of freedom” (where flexibility may allow users to tune settings to produce more favorable results, leading to an inflated rate of false positives) (Simmons et al., 2011).
+- Robust statistics, when possible. Robust statistics are less sensitive to outliers and have more reliable performance for a wider range of distributions. Robust statistics are especially
+
+important when applied to training performance, which tends to be highly non-Gaussian, making metrics such as variance and standard deviation inappropriate. For example, training performance is often bi-modal, with a concentration of points near the starting level and another concentration at the level of asymptotic performance.
+
+- Invariance to sampling frequency - results should not be biased by the frequency at which an algorithm was evaluated during training. See Section 2.5 for further discussion.
+- Enable meaningful statistical comparisons on the metrics, while making minimal assumptions about the distribution of the results. We thus designed statistical procedures that are non-parametric (Section 4).
+
+
+OpenAI Gym -- During Training
+
+
+OpenAI Gym -- After Learning
+Figure 1: Reliability metrics and median performance for continuous control RL algorithms (DDPG, TD3, SAC, REINFORCE, and PPO) tested on OpenAI Gym environments. Rank 1 always indicates "best" reliability, e.g. lowest IQR across runs. Error bars are $95\%$ bootstrap confidence intervals (# bootstraps = 1,000). Significant pairwise differences in ranking between pairs of algorithms are indicated by black horizontal lines above the colored bars. ( $\alpha = 0.05$ with Benjamini-Yekutieli correction, permutation test with # permutations = 1,000). Note that the best algorithms by median performance are not always the best algorithms on reliability.
+
+# 2.4 METRIC DEFINITIONS
+
+Dispersion across Time (DT): IQR across Time To measure dispersion across time (DT), we wished to isolate higher-frequency variability, rather than capturing longer-term trends. We did not want our metrics to be influenced by positive trends of improvement during training, which are in fact desirable sources of variation in the training performance. Therefore, we apply detrending before
+
+
+Figure 2: Reliability metrics and median performance for four DQN-variants (C51, DQN: Deep Q-network, IQ: Implicit Quantiles, and RBW: Rainbow) tested on 60 Atari games. Rank 1 always indicates "best" reliability, e.g. lowest IQR across runs. Significant pairwise differences in ranking between pairs of algorithms are indicated by black lines above the colored circles. ( $\alpha = 0.05$ with Benjamini-Yekutieli correction, permutation test with # permutations $= 1,000$ ). Note that the best algorithms by median performance are not always the best algorithms on reliability. Error bars are $95\%$ bootstrap confidence intervals (# bootstraps $= 1,000$ ).
+
+computing dispersion metrics. For detrending, we used differencing (i.e. $y_{t}' = y_{t} - y_{t-1}$ ).3 The final measure consisted of inter-quartile range (IQR) within a sliding window along the detrended training curve.
+
+Short-term Risk across Time (SRT): CVaR on Differences For this measure, we wish to measure the most extreme short-term drop over time. To do this, we apply CVaR to the changes in performance from one evaluation point to the next. I.e., in Eq. 1, $X$ represents the differences from one evaluation time-point to the next. We first compute the time-point to time-point differences on each training run. These differences are normalized by the distance between time-points, to ensure invariance to evaluation frequency (see Section 2.5). Then, we obtain the distribution of these differences, and find the $\alpha$ -quantile. Finally, we compute the expected value of the distribution below the $\alpha$ -quantile. This gives us the worst-case expected drop in performance during training, from one point of evaluation to the next.
+
+Long-term Risk across Time (LRT): CVaR on Drawdown For this measure, we would also like to be able to capture whether an algorithm has the potential to lose a lot of performance relative to its peak, even if on a longer timescale, e.g. over an accumulation of small drops. For this measure, we apply CVaR to the Drawdown. The Drawdown at time $T$ is the drop in performance relative to the highest peak so far, and is another measure borrowed from economics (Chekhlov et al., 2005). I.e. $\text{Drawdown}_T = R_T - \max_{t < = T} R_t$ . Like the SRT metric, the LRT can capture unusually large short-term drops in performance, but can also capture unusually large drops that occur over longer timescales.
+
+Dispersion across Runs (DR): IQR across Runs Unlike the rest of the metrics described here, the dispersion across training runs has previously been used to characterize performance (e.g. Duan et al. (2016); Islam et al. (2017); Bellemare et al. (2017); Fortunato et al. (2017); Nagarajan et al. (2018)). This is usually measured by taking the variance or standard deviation across training runs at a set of evaluation points. We build on the existing practice by recommending first performing low-pass filtering of the training data, to filter out high-frequency variability within runs (this is instead measured using Dispersion across Time, DT). We also replace variance or standard deviation with robust statistics like IQR.
+
+Risk across Runs (RR): CVaR across Runs In order to measure Risk across Runs (RR), we apply CVaR to the final performance of all the training runs. This gives a measure of the expected performance of the worst runs.
+
+Dispersion across Fixed-Policy Rollouts (DF): IQR across Rollouts When evaluating a fixed policy, we are interested in variability in performance when the same policy is rolled out multiple times. To compute this metric, we simply compute the IQR on the performance of the rollouts.
+
+Risk across Fixed-Policy Rollouts (RF): CVaR across Rollouts This metric is similar to DF, except that we apply CVaR on the rollout performances.
+
+# 2.5 INVARIANCE TO FREQUENCY OF EVALUATION
+
+Different experiments and different tasks may produce evaluations at different frequencies during training. Therefore, the reliability metrics should be unbiased by the choice of evaluation frequency. As long as there are no cyclical patterns in performance, the frequency of evaluation will not bias any of the metrics except Long-Term Risk across Time (LRT). For all other metrics, changes in the frequency of evaluation will simply lead to more or less noisy estimates of these metrics. For LRT, comparisons should only be made if the frequency of evaluation is held constant across experiments.
+
+# 3 RECOMMENDATIONS FOR REPORTING METRICS AND PARAMETERS
+
+Whether evaluating an algorithm for practical use or for research, we recommend evaluating all of the reliability metrics described above. Each metric measures a different aspect of reliability, and can help pinpoint specific strengths and weaknesses of the algorithm. Evaluating the metrics is easy with the open-source Python package that we have released.
+
+Reporting parameters. Even given our purposeful efforts to minimize the number of parameters in the reliability metrics, a few remain to be specified by the user that can affect the results, namely: window size (for Dispersion across Time), frequency threshold for low-pass and high-pass filtering (Dispersion across Time, Dispersion across Runs), evaluation frequency (only for Long-term Risk across Time), and length of training runs. Therefore, when reporting these metrics, these parameters need to be clearly specified, and must also be held constant across experiments for meaningful comparisons. The same is true for any other parameters that affect evaluation, e.g., the number of roll-outs per evaluation, the parameters of the environment, whether on-line or off-line evaluation is used, and the random seeds chosen.
+
+Collapsing across evaluation points. Some of the in-training reliability metrics (Dispersion across Runs, Risk across Runs, and Dispersion across Time) need to be evaluated at multiple evaluation
+
+points along the training runs. If it is useful to obtain a small number of values to summarize each metric, we recommend dividing the training run into "time frames" (e.g. beginning, middle, and end), and collapsing across all evaluation points within each time frame.
+
+Normalization by performance. Different algorithms can have vastly different ranges of performance even on the same task, and variability in performance tends to scale with actual performance. Thus, we normalize our metrics in post-processing by a measure of the range of performance for each algorithm. For "during training" reliability, we recommend normalizing by the median range of performance, which we define as the $p_{P_{95}} - p_{t=0}$ , where $p_{P_{95}}$ is the 95th percentile and $p_{t=0}$ is the starting performance. For "after learning" reliability, the range of performance may not be available, in which case we use the median performance directly.
+
+Ranking the algorithms. Because different environments have different ranges and distributions of reward, we must be careful when aggregating across environments or comparing between environments. Thus, if the analysis involves more than one environment, the per-environment median results for the algorithms are first converted to rankings, by ranking all algorithms within each task. To summarize the performance of a single algorithm across multiple tasks, we compute the mean ranking across tasks.
+
+Per-environment analysis. The same algorithm can have different patterns of reliability for different environments. Therefore, we recommend inspecting reliability metrics on a per-environment basis, as well as aggregating across environments as described above.
+
+# 4 CONFIDENCE INTERVALS AND STATISTICAL SIGNIFICANCE TESTS FOR COMPARISON
+
+# 4.1 CONFIDENCE INTERVALS
+
+We assume that the metric values have been converted to mean rankings, as explained in Section 3. To obtain confidence intervals on the mean rankings for each algorithm, we apply bootstrap sampling on the runs, by resampling runs with replacement (Efron & Tibshirani, 1986).
+
+For metrics that are evaluated per-run (e.g. Dispersion across Time), we can resample the metric values directly, and then recompute the mean rankings on each resampling to obtain a distribution over the rankings; this allows us to compute confidence intervals. For metrics that are evaluated across-runs, we need to resample the runs themselves, then evaluate the metrics on each resampling, before recomputing the mean rankings to obtain a distribution on the mean rankings.
+
+# 4.2 SIGNIFICANCE TESTS FOR COMPARING ALGORITHMS
+
+Commonly, we would like to compare algorithms evaluated on a fixed set of environments. To determine whether any two algorithms have statistically significant differences in their metric rankings, we perform an exact permutation test on each pair of algorithms. Such tests allow us to compute a p-value for the null hypothesis (probability that the methods are in fact indistinguishable on the reliability metric).
+
+We designed our permutation tests based on the null hypothesis that runs are exchangeable across the two algorithms being compared. In brief, let $A$ and $B$ be sets of performance measurements for algorithms $a$ and $b$ . Let $Metric(X)$ be a reliability metric, e.g. the inter-quartile range across runs, computed on a set of measurements $X$ . $MetricRanking(X)$ is the mean ranking across tasks on $X$ , compared to the other algorithms being considered. We compute test statistic
+
+$$
+s _ {\text {M e t r i c R a n k i n g}} (A, B) = \text {M e t r i c R a n k i n g} (A) - \text {M e t r i c R a n k i n g} (B).
+$$
+
+Next we compute the distribution for $s_{MetricRanking}$ under the null hypothesis that the methods are equivalent, i.e. that performance measurements should have the same distribution for $a$ and $b$ . We do this by computing random partitions $A', B'$ of $\{A \cup B\}$ , and computing the test statistic $s_{MetricRanking}(A', B')$ on each partition. This yields a distribution for $s_{MetricRanking}$ (for sufficiently many samples), and the p-value can be computed from the percentile value of
+
+$s_{MetricRanking}(A,B)$ in this distribution. As with the confidence intervals, a different procedure is required for per-run vs across-run metrics. Please see Appendix C for diagrams illustrating the permutation test procedures.
+
+When performing pairwise comparisons between algorithms, it is critical to include corrections for multiple comparisons. This is because the probability of incorrect inferences increases with a greater number of simultaneous comparisons. We recommend using the Benjamini-Yekutieli method, which controls the false discovery rate (FDR), i.e., the proportion of rejected null hypotheses that are false.4
+
+# 4.3 REPORTING ON STATISTICAL TESTS
+
+It is important to report the details of any statistical tests performed, e.g. which test was used, the significance threshold, and the type of multiple-comparisons correction used.
+
+# 5 ANALYSIS OF RELIABILITY FOR COMMON ALGORITHMS AND ENVIRONMENTS
+
+In this section, we provide examples of applying the reliability metrics to a number of RL algorithms and environments, following the recommendations described above.
+
+# 5.1 CONTINUOUS CONTROL ALGORITHMS ON OPENAI GYM
+
+We applied the reliability metrics to algorithms tested on seven continuous control environments from the Open-AI Gym (Greg Brockman et al., 2016) run on the MuJoCo physics simulator (Todorov et al., 2012). We tested REINFORCE (Sutton et al., 2000), DDPG (Lillicrap et al., 2015), PPO (Schulman et al., 2017), TD3 (Fujimoto et al., 2018), and SAC (Haarnoja et al., 2018) on the following Gym environments: Ant-v2, HalfCheetah-v2, Humanoid-v2, Reacher-v2, Swimmer-v2, and Walker2d-v2. We used the implementations of DDPG, TD3, and SAC from the TF-Agents library (Guadarrama et al., 2018). Each algorithm was run on each environment for 30 independent training runs.
+
+We used a black-box optimizer (Golovin et al., 2017) to tune selected hyperparameters on a per-task basis, optimizing for final performance. The remaining hyperparameters were defined as stated in the corresponding original papers. See Appendix E for details of the hyperparameter search space and the final set of hyperparameters. During training, we evaluated the policies at a frequency of 1000 training steps. Each algorithm was run for a total of two million environment steps. For the "online" evaluations we used the generated training curves, averaging returns over recent training episodes collected using the exploration policy as it evolves. The raw training curves are shown in Appendix D. For evaluations after learning on a fixed policy, we took the last checkpoint from each training run as the fixed policy for evaluation. Each of these policies was then evaluated for 30 roll-outs, where each roll-out was defined as 1000 environment steps.
+
+# 5.2 DISCRETE CONTROL: DQN VARIANTS ON ATARI
+
+We also applied the reliability metrics to the RL algorithms and training data released as part of the Dopamine package (Castro et al., 2018). The data comprise the training runs of four RL algorithms, each applied to 60 Atari games. The RL algorithms are: DQN (Mnih et al., 2015), Implicit Quantile (IQN) (Dabney et al., 2018), C51 (Bellemare et al., 2017), and a variant of Rainbow implementing the three most important components (Hessel & Modayil, 2018). The algorithms were trained on each game for 5 training runs. Hyper-parameters follow the original papers, but were modified as necessary to follow Rainbow (Hessel & Modayil, 2018), to ensure apples-to-apples comparison. See Appendix E for the hyperparameters.
+
+During training, the algorithms were evaluated in an "online" fashion every 1 million frames, averaging across the training episodes as recommended for evaluations on the ALE (Machado et al., 2018). Each training run consisted of approximately 200 million Atari frames (rounding to the nearest
+
+episode boundary every 1 million frames). For evaluations after learning on a fixed policy ("after learning"), we took the last checkpoint from each training run as the fixed policies for evaluation. We then evaluated each of these policies for 125,000 environment steps.
+
+# 5.3 PARAMETERS FOR RELIABILITY METRICS, CONFIDENCE INTERVALS, AND STATISTICAL TESTS
+
+For the MuJoCo environments, we applied a sliding window of 100000 training steps for Dispersion across Time. For the Atari experiments, we used a sliding window size of 25 on top of the evaluations for the Dispersion across Time. For metrics with multiple evaluation points, we divided each training run into 3 time frames and averaged the metric rankings within each time frame. Because the results were extremely similar for all three time frames, we here report just for the final time frames.
+
+Statistical tests for comparing algorithms were performed according to the recommendations in Section 4. We used pairwise permutation tests using 10,000 permutations per test, with a significance threshold of 0.05 and Benjamini-Yekutieli multiple-comparisons correction.
+
+# 5.4 MEDIAN PERFORMANCE
+
+The median performance of an algorithm is not a reliability metric, but it is interesting to see side-by-side with the reliability metrics. For analyzing median performance for the DQN variants, we used the normalization scheme of (Mnih et al., 2015), where an algorithm's performance is normalized against a lower baseline (e.g. the performance of a random policy) and an upper baseline (e.g. the performance of a human): $P_{\mathrm{normalized}} = \frac{P - B_{\mathrm{lower}}}{B_{\mathrm{upper}} - B_{\mathrm{lower}}}$ . Median performance was not normalized for the continuous control algorithms.
+
+# 5.5 RESULTS
+
+The reliability metric rankings are shown in Fig. 1 for the MuJoCo results. We see that, according to Median Performance during training, SAC and TD3 have the best performance and perform similarly well, while REINFORCE performs the worst. However, SAC outperforms TD3 on all reliability metrics during training. Furthermore, both SAC and TD3 perform relatively poorly on all reliability metrics after learning, despite performing best on median performance.
+
+The reliability metric rankings are shown in Fig. 2 for the Atari results. Here we see a similar result that, even though Rainbow performs significantly better than IQN in Median Performance, IQN performs numerically or significantly better than Rainbow on many of the reliability metrics.
+
+The differing patterns in these metrics demonstrates that reliability is a separate dimension that needs to be inspected separately from mean or median performance – two algorithms may have similar median performance but may nonetheless significantly differ in reliability, as with SAC and TD3 above. Additionally, these results demonstrate that reliability along one axis does not necessarily correlate with reliability on other axes, demonstrating the value of evaluating these different dimensions so that algorithms can be compared and selected based on the requirements of the problem at hand.
+
+To see metric results evaluated on a per-environment basis, please refer to Appendix F. Rank order of algorithms was often relatively consistent across the different environments evaluated. However, different environments did display different patterns across algorithms. For example, even though SAC showed the same or better Dispersion across Runs for most of the MuJoCo environments evaluated, it did show slightly worse Dispersion across Runs for the HalfCheetah environment (Fig 7a). This kind of result emphasizes the importance of inspecting reliability (and other performance metrics) on a per-environment basis, and also of evaluating reliability and performance on the environment of interest, if possible.
+
+# 6 CONCLUSION
+
+We have presented a number of metrics, designed to measure different aspects of reliability of RL algorithms. We motivated the design goals and choices made in constructing these metrics, and also presented practical recommendations for the measurement of reliability for RL. Additionally, we presented examples of applying these metrics to common RL algorithms and environments, and showed that these metrics can reveal strengths and weaknesses of an algorithm that are obscured when we only inspect mean or median performance.
+
+# ACKNOWLEDGMENTS
+
+Many thanks to the following people for helpful discussions during the formulation of these metrics and the writing of the paper: Mohammad Ghavamzadeh, Yinlam Chow, Danijar Hafner, Rohan Anil, Archit Sharma, Vikas Sindhwani, Krzysztof Choromanski, Joelle Pineau, Hal Varian, Shyue-Ming Loh, and Tim Hesterberg. Thanks also to Toby Boyd for his assistance in the open-sourcing process, Oscar Ramirez for code reviews, and Pablo Castro for his help with running experiments using the Dopamine baselines data.
+
+# REFERENCES
+
+Carlo Acerbi and Dirk Tasche. Expected Shortfall: A Natural Coherent Alternative to Value at Risk. Economic Notes, 31(2):379-388, July 2002. ISSN 0391-5026, 1468-0300. doi: 10.1111/1468-0300.00091. URL http://doi.wiley.com/10.1111/1468-0300.00091.
+Marc G. Bellemare, Will Dabney, and Rémi Munos. A Distributional Perspective on Reinforcement Learning. arXiv:1707.06887 [cs, stat], July 2017. URL http://arxiv.org/abs/1707.06887.arXiv:1707.06887.
+Nicole Bäuerle and Jonathan Ott. Markov Decision Processes with Average-Value-at-Risk criteria. Mathematical Methods of Operations Research, 74(3):361-379, December 2011. ISSN 1432-2994, 1432-5217. doi: 10.1007/s00186-011-0367-0. URL http://link.springer.com/10. 1007/s00186-011-0367-0.
+Pablo Samuel Castro, Subhodeep Moitra, Carles Gelada, Saurabh Kumar, and Marc G. Bellemare. *Dopamine: A research framework for deep reinforcement learning.* CoRR, abs/1812.06110, 2018. URL http://arxiv.org/abs/1812.06110.
+Alexei Chekhlov, Stanislav Uryasev, and Michael Zabarankin. Drawdown measure in portfolio optimization. International Journal of Theoretical and Applied Finance, 8(1):46, 2005.
+Yinlam Chow and Mohammad Ghavamzadeh. Algorithms for CVaR Optimization in MDPs. Advances in Neural Information Processing Systems, pp. 9, 2014.
+Cédric Colas, Olivier Sigaud, and Pierre-Yves Oudeyer. How Many Random Seeds? Statistical Power Analysis in Deep Reinforcement Learning Experiments. arXiv:1806.08295 [cs, stat], June 2018. URL http://arxiv.org/abs/1806.08295. arXiv:1806.08295.
+Cédric Colas, Olivier Sigaud, and Pierre-Yves Oudeyer. A Hitchhiker's Guide to Statistical Comparisons of Reinforcement Learning Algorithms. arXiv:1904.06979 [cs, stat], April 2019. URL http://arxiv.org/abs/1904.06979.arXiv:1904.06979.
+Will Dabney, Georg Ostrovski, David Silver, and Rémi Munos. Implicit Quantile Networks for Distributional Reinforcement Learning. Thirty-fifth International Conference on Machine Learning, pp. 10, 2018.
+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, June 2016. URL http://proceedings.mlr.press/v48/duan16.html.
+B. Efron and R. Tibshirani. Bootstrap Methods for Standard Errors, Confidence Intervals, and Other Measures of Statistical Accuracy. Statistical Science, 1(1):54-75, February 1986. ISSN 0883-4237, 2168-8745. doi: 10.1214/ss/1177013815. URL http://projecteuclid.org/euclid.ss/1177013815.
+
+Meire Fortunato, Mohammad Gheshlaghi Azar, Bilal Piot, Jacob Menick, Ian Osband, Alex Graves, Vlad Mnih, Remi Munos, Demis Hassabis, Olivier Pietquin, Charles Blundell, and Shane Legg. Noisy Networks for Exploration. arXiv:1706.10295 [cs, stat], June 2017. URL http://arxiv.org/abs/1706.10295.arXiv:1706.10295.
+Scott Fujimoto, Herke van Hoof, and David Meger. Addressing Function Approximation Error in Actor-Critic Methods. arXiv:1802.09477 [cs, stat], February 2018. URL http://arxiv.org/abs/1802.09477. arXiv:1802.09477.
+Daniel Golovin, Benjamin Solnik, Subhodeep Moitra, Greg Kochanski, John Karro, and D. Sculley. Google Vizier: A Service for Black-Box Optimization. In Proceedings of the 23rd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining - KDD '17, pp. 1487-1495, Halifax, NS, Canada, 2017. ACM Press. ISBN 978-1-4503-4887-4. doi: 10.1145/3097983.3098043. URL http://dl.acm.org/citation.cfm?doid=3097983.3098043.
+Greg Brockman, Vicki Cheung, Ludwig Pettersson, Jonas Schneider, John Schulman, Jie Tang, and Wojciech Zaremba. OpenAI Gym, 2016.
+Sergio Guadarrama, Anoop Korattikara, Pablo Castro Oscar Ramirez, Ethan Holly, Sam Fishman, Ke Wang, Chris Harris Ekaterina Gonina, Vincent Vanhoucke, and Eugene Brevdo. TF-Agents: A library for reinforcement learning in tensorflow. https://github.com/tensorflow/ agents, 2018. URL https://github.com/tensorflow/agents. [Online; accessed 30-November-2018].
+Tuomas Haarnoja, Aurick Zhou, Pieter Abbeel, and Sergey Levine. Soft Actor-Critic: Off-Policy Maximum Entropy Deep Reinforcement Learning with a Stochastic Actor. arXiv:1801.01290 [cs, stat], January 2018. URL http://arxiv.org/abs/1801.01290. arXiv:1801.01290.
+James D. Hamilton. Time Series Analysis. Princeton University Press, 1994.
+Peter Henderson, Riashat Islam, Philip Bachman, Joelle Pineau, Doina Precup, and David Meger. Deep Reinforcement Learning that Matters. arXiv:1709.06560 [cs, stat], September 2017. URL http://arxiv.org/abs/1709.06560.arXiv:1709.06560.
+Matteo Hessel and Joseph Modayil. Rainbow: Combining Improvements in Deep Reinforcement Learning. AAAI, pp. 8, 2018.
+Riashat Islam, Peter Henderson, Maziar Gomrokchi, and Doina Precup. Reproducibility of Benchmarked Deep Reinforcement Learning Tasks for Continuous Control. arXiv:1708.04133 [cs], August 2017. URL http://arxiv.org/abs/1708.04133.arXiv:1708.04133.
+Timothy P. Lillicrap, Jonathan J. Hunt, Alexander Pritzel, Nicolas Heess, Tom Erez, Yuval Tassa, David Silver, and Daan Wierstra. Continuous control with deep reinforcement learning. arXiv:1509.02971 [cs, stat], September 2015. URL http://arxiv.org/abs/1509.02971.arXiv:1509.02971.
+Marlos C. Machado, Marc G. Bellemare, Erik Talvitie, Joel Veness, Matthew Hausknecht, and Michael Bowling. Revisiting the Arcade Learning Environment: Evaluation Protocols and Open Problems for General Agents. Journal of Artificial Intelligence Research, 61:523-562, March 2018. ISSN 1076-9757. doi: 10.1613/jair.5699. URL https://www.jair.org/index.php/jair/article/view/11182.
+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, February 2015. ISSN 1476-4687. doi: 10.1038/nature14236. URL https://www.nature.com/articles/nature14236/.
+Prabhat Nagarajan, Garrett Warnell, and Peter Stone. Deterministic Implementations for Reproducibility in Deep Reinforcement Learning. arXiv:1809.05676 [cs], September 2018. URL http://arxiv.org/abs/1809.05676.arXiv:1809.05676.
+
+Charles R Nelson and Charles I Plosser. Trends and random walks in macroeconomic time series. Journal of Monetary Economics, 10:139-162, 1982.
+Peter J. Rousseeuw and Christophe Croux. Alternatives to the MedianAbsolute Deviation. Journal of the American Statistical Association, 1993.
+Said E. Said and David A. Dickey. Testing for unit roots in autoregressive-moving average models of unknown order. Biometrika, 71(3):599-607, 1984.
+John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal Policy Optimization Algorithms. arXiv:1707.06347 [cs], July 2017. URL http://arxiv.org/abs/1707.06347.arXiv:1707.06347.
+Joseph P. Simmons, Leif D. Nelson, and Uri Simonsohn. False-Positive Psychology: Undisclosed Flexibility in Data Collection and Analysis Allows Presenting Anything as Significant. Psychological Science, 22(11):1359-1366, November 2011. ISSN 0956-7976, 1467-9280. doi: 10.1177/0956797611417632. URL http://journals.sagepub.com/doi/10.1177/ 0956797611417632.
+Richard S Sutton, David A McAllester, Satinder P Singh, and Yishay Mansour. Policy Gradient Methods for Reinforcement Learning with Function Approximation. In NIPS'99 Proceedings of the 12th International Conference on Neural Information Processing Systems, pp. 7, 2000.
+Aviv Tamar, Yonatan Glassner, and Shie Mannor. Optimizing the CVaR via Sampling. Proceedings of the Twenty-Ninth AAAI Conference on Artificial Intelligence, pp. 7, 2015.
+Emanuel Todorov, Tom Erez, and Yuval Tassa. MuJoCo: A physics engine for model-based control. In 2012 IEEE/RSJ International Conference on Intelligent Robots and Systems, pp. 5026-5033, Vilamoura-Algarve, Portugal, October 2012. IEEE. ISBN 978-1-4673-1736-8 978-1-4673-1737-5 978-1-4673-1735-1. doi: 10.1109/IROS.2012.6386109. URL http://ieeexplore.ieee.org/document/6386109/.
+
+# A ASSUMPTIONS AND DEFINITIONS
+
+Reinforcement Learning algorithms vary widely in design, and our metrics are based on certain notions that should span the gamut of RL algorithms.
+
+Policy A policy $\pi_{\Theta}(a_i|s_i)$ is a distribution over actions $a_i$ given a current (input) state $s_i$ . We assume policies are parameterized by a parameter $\Theta$ .
+
+Agent An agent is defined as a distribution over policies (or equivalently a distribution over parameters $\Theta$ ). In many cases, an agent will be a single policy but for population-based RL methods, the agent is a discrete set of policies.
+
+Window A window is a collection of states over which the agent is assumed to have small variation. A window could be a sequence of consecutive time steps for a sequential RL algorithm, or a collection of states at the same training step of a distributed RL algorithm with a parameter server (all agents share $\Theta$ ).
+
+Performance The performance of an agent is the mean or median per-epoch reward from running that agent. If the agent is a single policy, then the performance $p(\pi_{\Theta})$ is the mean or median per-epoch reward for that agent. If the agent is a distribution $D(\Theta)$ of policies, then the performance is the median of $p(\pi_{\Theta})$ with $\Theta \sim D$ .
+
+Training Run A training run is a sequence of updates to the agent $D(\Theta)$ from running a reinforcement learning algorithm. It leads to a trained agent $D_{final}(\Theta)$ . Multiple training runs share no information with each other.
+
+We cannot directly measure performance since it is a statistic across an infinite sample of evaluation runs of an agent. Instead we use windows to compute sample medians to approximate performance.
+
+# B DETRENDING BY DIFFERENCING
+
+Typically, de-trending can be performed in two main ways (Nelson & Plosser, 1982; Hamilton, 1994). Differencing (i.e. $y_{t'} = y_{t} - y_{t-1}$ ) is more appropriate for difference-stationary (DS) processes (e.g. a random walk: $y_{t} = y_{t-1} + b + \epsilon_{t}$ ), where the shocks $\epsilon_{t}$ accumulate over time. For trend-stationary (TS) processes, which are characterized by stationary fluctuations around a deterministic trend, e.g. $y_{t} = a + b * t + \epsilon_{t}$ , it is more appropriate to fit and subtract that trend.
+
+We performed an analysis of real training runs and verified that the data are indeed approximately DS, and that differencing does indeed remove the majority of time-dependent structure. For this analysis we used the training runs on Atari as described in 5.2. Before differencing, the Augmented Dickey-Fuller test (ADF test, also known as a difference-stationarity test; Said E. Said & David A. Dickey (1984)) rejects the null hypothesis of a unit root on only $72\%$ of the runs; after differencing, the ADF test rejects the null hypothesis on $92\%$ of the runs (p-value threshold 0.05). For the ADF test, the rejection of a unit root (of the autoregressive lag polynomial) implies the alternate hypothesis, which is that the time series is trend-stationary.
+
+Therefore, our training curves are better characterized as an accumulation of shocks, i.e. as DS processes, rather than as mean-reverting TS processes. They are not actually purely DS because the shocks $\epsilon_{t}$ are not stationary over time, but because we compute standard deviation within sliding windows, we can capture the non-stationarity and change in variability over time. Thus, we chose to detrend using differencing.
+
+As a further note in favor of detrending by differencing, it is useful to observe that many measures of variability are defined relative to the central tendency of the data, e.g. the median absolute deviation $\mathrm{MAD} = \mathrm{median}(|X_i - \widetilde{X}|)$ where $\widetilde{X}$ is the median of $X$ . On the raw data (without differencing), the MAD would be defined relative to $\widetilde{X}$ as median performance, so that any improvements in performance are included in that computation of variability. On the other hand, if we compute MAD on the 1st-order differences, we are using a $\widetilde{X}$ that represents the median change in performance, which is a more reasonable baseline to compute variability against, when we are in fact concerned with the variability of those changes.
+
+A final benefit of differencing is that it is parameter-free.
+
+# C ILLUSTRATIONS OF PERMUTATION TEST PROCEDURES
+
+We illustrate the procedure for computing permutation tests to compare pairs of algorithms on a specified metric, in Figs. 3 (for per-run metrics) and 4 (for across-run metrics).
+
+# D RAW TRAINING CURVES FOR OPENAI MUJOCO TASKS
+
+In Figure 5, we show the raw training curves for the TF-Agents implementations of continuous-control algorithms, applied to the OpenAI MuJoCo tasks. These are compared against baselines from the literature, where available (DDPG and TD3: Fujimoto et al. (2018), PPO: Schulman et al. (2017), SAC: Haarnoja et al. (2018))
+
+# E HYPERPARAMETER SETTINGS
+
+For the continuous control experiments, hyperparameters were chosen on a per-environment basis according to the black-box optimization algorithm described in Golovin et al. (2017). The hyperparameter search space is shown in Table 2.
+
+For the discrete control experiments, hyperparameter selection is described in (Castro et al., 2018). Hyperparameters are shown in Table 8, duplicated for reference from https://github.com/google/dopamine/tree/master/baselines.
+
+# Comparing algorithms on per-run metrics
+
+
+Raw values e.g. 3 runs per (task, algo)
+Metric values
+
+
+Metric rankings
+
+
+Get difference in mean ranking: algoA - algoB = 6.8 - 4.7
+
+
+Repeat $n$ _permutations times
+
+
+Figure 3: Diagram illustrating the computation of the permutation tests for per-run metrics (Dispersion across Time, Short-term Risk across Time, Long-term Risk across Time). In this example, we are comparing Algorithm A and Algorithm B, and there are only 3 algorithms, 3 tasks, and 3 runs per (task, algo) pair. To compute the difference in average rankings for two algorithms, follow the gray arrows. To compute a null distribution of difference in average rankings (by permuting the runs), follow the blue arrows a number of times (e.g. 1,000 times). Once the null distribution has been computed, the actual value of the difference can be compared with the null distribution to obtain a p-value.
+
+# Comparing algorithms on across-run metrics
+
+Raw values e.g. 3 runs per (task, algo)
+
+| algoA | -1, -7, 3 | 2.5, 7, 3 | 77, 90, 4 |
| algoB | -4, 2, 0 | 1.9, 0.3, 4 | 5, 32, 15 |
| algoC | 3, 2, 4 | 6, 10, 5 | 52, 64, 3 |
| task1 | task2 | task3 |
+
+
+
+Evaluate across-run
+
+metrics for each (task, algo)
+
+| Permute runs across algoA and algoB, within task |
+
+Permuted values
+
+| -7, 0, -1 | 2.5, 7, 3 | 77, 90, 4 |
| -4, 2, 0 | 1.9, 0.3, 4 | 5, 32, 15 |
| 3, 2, 4 | 6, 10, 5 | 52, 64, 3 |
+
+
+
+Evaluate across-run
+
+metrics for each (task, algo)
+
+Metric values
+
+| 0.1 | 2.3 | 3 |
| -0.4 | 2.5 | 0.6 |
| -0.2 | 1.9 | 0.3 |
+
+
+
+Rank within
+
+each task
+
+Metric rankings
+
+
+
+
+
+Get difference in mean ranking:
+
+algoA - algoB = 2 - 1.67
+
+Metric values on permuted runs
+
+| -0.6 | 3.0 | 1.4 |
| 1.2 | 2.1 | 0.8 |
| -0.2 | 1.9 | 0.3 |
+
+
+
+Rank within
+
+each task
+
+Metric rankings on permuted runs
+
+
+
+
+
+Get difference in mean ranking:
+
+algoA - algoB = 5.3 - 6.0
+
+
+Figure 4: Diagram illustrating the computation of the permutation tests for across-run or across-rollout metrics (Dispersion across Runs, Risk Across Runs, Dispersion across Fixed-policy rollouts, Risk across Fixed-Policy rollouts). In this example, we are comparing Algorithm A and Algorithm B, and there are only 3 algorithms, 3 tasks, and 3 runs per (task, algo) pair. To compute the difference in average rankings for two algorithms, follow the gray arrows. To compute a null distribution of difference in average rankings (by permuting the runs), follow the blue arrows a number of times (e.g. 1,000 times). Once the null distribution has been computed, the actual value of the difference can be compared with the null distribution to obtain a p-value.
+
+
+
+
+
+
+
+
+
+
+Figure 5: Raw training curves for OpenAI MuJoCo tasks. The x-axes indicate environment steps, and the y-axes indicate average per-episode return. Dotted lines indicate baseline performance from the literature, where available.
+
+
+
+Table 2: Hyperparameter search space for continuous control algorithms.
+
+| Algorithm | Hyperparameter | Search min | Search max |
| SAC | actor learning rate | 0.000001 | 0.001 |
| α learning rate | 0.000001 | 0.001 |
| critic learning rate | 0.000001 | 0.001 |
| target update τ | 0.00001 | 1.0 |
| TD3 | actor learning rate | 0.000001 | 0.001 |
| critic learning rate | 0.000001 | 0.001 |
| target update τ | 0.00001 | 1.0 |
| PPO | learning rate | 0.000001 | 0.001 |
| DDPG | actor learning rate | 0.000001 | 0.001 |
| critic learning rate | 0.000001 | 0.001 |
| target update τ | 0.00001 | 1.0 |
| REINFORCE | learning rate | 0.000001 | 0.001 |
| # episodes before each train step | 1.0 | 10 |
+
+Table 3: Final hyperparameters for SAC.
+
+ | actor learning rate | α learning rate | critic learning rate | target update τ |
| Ant-v2 | 0.000006 | 0.000009 | 0.0009 | 0.0002 |
| HalfCheetah-v2 | 0.0001 | 0.000005 | 0.0004 | 0.02 |
| Humanoid-v2 | 0.0003 | 0.0008 | 0.0006 | 0.8 |
| Reacher-v2 | 0.00001 | 0.000002 | 0.0005 | 0.00002 |
| Swimmer-v2 | 0.000004 | 0.000009 | 0.0002 | 0.009 |
| Walker2d-v2 | 0.0002 | 0.0009 | 0.0008 | 0.01 |
+
+Table 4: Final hyperparameters for TD3.
+
+ | actor learning rate | critic learning rate | target update τ |
| Ant-v2 | 0.000001 | 0.0002 | 0.0003 |
| HalfCheetah-v2 | 0.0003 | 0.0005 | 0.02 |
| Humanoid-v2 | 0.0001 | 0.0001 | 0.0002 |
| Reacher-v2 | 0.000001 | 0.00003 | 0.00003 |
| Swimmer-v2 | 0.0004 | 0.0002 | 0.01 |
| Walker2d-v2 | 0.00006 | 0.00009 | 0.001 |
+
+Table 5: Final hyperparameters for PPO.
+
+ | learning rate |
| Ant-v2 | 0.0008 |
| HalfCheetah-v2 | 0.0008 |
| Humanoid-v2 | 0.0008 |
| Reacher-v2 | 0.00002 |
| Swimmer-v2 | 0.0004 |
| Walker2d-v2 | 0.0002 |
+
+Table 6: Final hyperparameters for DDPG.
+
+ | actor learning rate | critic learning rate | target update τ |
| Ant-v2 | 0.00003 | 0.0004 | 0.0002 |
| HalfCheetah-v2 | 0.00006 | 0.0005 | 0.02 |
| Humanoid-v2 | 0.00006 | 0.00009 | 0.01 |
| Reacher-v2 | 0.00005 | 0.0005 | 0.005 |
| Swimmer-v2 | 0.0005 | 0.0003 | 0.004 |
| Walker2d-v2 | 0.0003 | 0.0004 | 0.03 |
+
+Table 7: Final hyperparameters for REINFORCE.
+
+ | learning rate | # episodes before each train step |
| Ant-v2 | 0.00002 | 9 |
| HalfCheetah-v2 | 0.0004 | 7 |
| Humanoid-v2 | 0.0005 | 2 |
| Reacher-v2 | 0.000004 | 6 |
| Swimmer-v2 | 0.000005 | 3 |
| Walker2d-v2 | 0.0001 | 6 |
+
+Table 8: Hyperparameters for discrete control algorithms.
+
+| Training ε | Evaluation ε | ε decay schedule | Min. history to start learning | Target network update frequency |
| 0.01 | 0.001 | 1,000,000 frames | 80,000 frames | 32,000 frames |
+
+# F PER-TASK METRIC RESULTS
+
+Metric results are shown on a per-task basis in Figs. 6 to 8 for the OpenAI Gym MuJoCo tasks, and Figs. 9 to 23 for the Atari environments. Note that because we are no longer aggregating across tasks in this analysis, we do not need to convert the metric values to rankings.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+(a) Dispersion across Time. Better reliability is indicated by less positive values. The x-axes indicate the number of environment steps.
+
+
+
+
+
+
+
+
+
+
+
+
+
+(b) Short-term Risk across Time. Better reliability is indicated by more positive values.
+
+
+
+
+
+
+
+
+
+
+Figure 6: Across-time reliability metrics for continuous control RL algorithms tested on OpenAI Gym environments, evaluated on a per-environment basis.
+
+
+
+(c) Long-term Risk across Time. Better reliability is indicated by less positive values.
+
+
+Reacher
+
+
+
+
+
+
+
+
+(a) Dispersion across Runs. Better reliability is indicated by less positive values.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+(b) Risk across Runs. Better reliability is indicated by more positive values.
+
+
+
+
+
+
+
+
+(c) Median performance during training. Better performance is indicated by more positive values.
+
+
+Figure 7: Across-run reliability metrics and median performance for continuous control RL algorithms tested on OpenAI Gym environments, evaluated on a per-environment basis. The x-axes indicate the number of environment steps.
+
+
+
+
+
+
+
+
+
+
+
+
+(a) Dispersion on Fixed-policy rollouts. Better reliability is indicated by less positive values.
+
+
+
+
+
+
+
+
+(b) Risk on Fixed-policy rollouts. Better reliability is indicated by more positive values.
+Figure 8: Reliability metrics and median performance on fixed-policy rollouts for continuous control RL algorithms tested on OpenAI Gym environments, evaluated on a per-environment basis.
+
+
+(c) Median performance on Fixed-policy rollouts. Better performance is indicated by more positive values.
+
+
+
+
+
+
+Figure 9: Dispersion across Time for DQN-variants tested on 60 Atari games, evaluated on a per-environment basis (page 1). Better reliability is indicated by less positive values. The x-axes indicate millions of Atari frames.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Figure 10: Dispersion across Time for DQN-variants tested on 60 Atari games, evaluated on a per-environment basis (page 2). Better reliability is indicated by less positive values. The x-axes indicate millions of Atari frames.
+
+
+
+
+
+
+
+
+Figure 11: Dispersion across Time for DQN-variants tested on 60 Atari games, evaluated on a per-environment basis (page 3). Better reliability is indicated by less positive values. The x-axes indicate millions of Atari frames.
+
+
+Figure 12: Short-term Risk across Time for DQN-variants tested on 60 Atari games, evaluated on a per-environment basis (page 1). Better reliability is indicated by less positive values. The x-axes indicate millions of Atari frames.
+
+
+Figure 13: Short-term Risk across Time for DQN-variants tested on 60 Atari games, evaluated on a per-environment basis (page 2). Better reliability is indicated by less positive values. The x-axes indicate millions of Atari frames.
+
+
+Figure 14: Short-term Risk across Time for DQN-variants tested on 60 Atari games, evaluated on a per-environment basis (page 3). Better reliability is indicated by less positive values. The x-axes indicate millions of Atari frames.
+
+
+Figure 15: Long-term Risk across Time for DQN-variants tested on 60 Atari games, evaluated on a per-environment basis (page 1). Better reliability is indicated by less positive values. The x-axes indicate millions of Atari frames.
+
+
+Figure 16: Long-term Risk across Time for DQN-variants tested on 60 Atari games, evaluated on a per-environment basis (page 2). Better reliability is indicated by less positive values. The x-axes indicate millions of Atari frames.
+
+
+Figure 17: Long-term Risk across Time for DQN-variants tested on 60 Atari games, evaluated on a per-environment basis (page 3). Better reliability is indicated by less positive values. The x-axes indicate millions of Atari frames.
+
+
+Figure 18: Dispersion across Fixed-policy Rollouts for DQN-variants tested on 60 Atari games, evaluated on a per-environment basis (page 1). Better reliability is indicated by less positive values. The x-axes indicate millions of Atari frames.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Figure 19: Dispersion across Fixed-policy Rollouts for DQN-variants tested on 60 Atari games, evaluated on a per-environment basis (page 2). Better reliability is indicated by less positive values. The x-axes indicate millions of Atari frames.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Figure 20: Dispersion across Fixed-policy Rollouts for DQN-variants tested on 60 Atari games, evaluated on a per-environment basis (page 3). Better reliability is indicated by less positive values. The x-axes indicate millions of Atari frames.
+
+
+
+
+
+
+
+
+Figure 21: Risk across Fixed-policy Rollouts for DQN-variants tested on 60 Atari games, evaluated on a per-environment basis (page 1). Better reliability is indicated by more positive values. The x-axes indicate millions of Atari frames.
+
+
+Figure 22: Risk across Fixed-policy Rollouts for DQN-variants tested on 60 Atari games, evaluated on a per-environment basis (page 2). Better reliability is indicated by more positive values. The x-axes indicate millions of Atari frames.
+
+
+
+
+
+
+
+
+
+
+Figure 23: Risk across Fixed-policy Rollouts for DQN-variants tested on 60 Atari games, evaluated on a per-environment basis (page 3). Better reliability is indicated by more positive values. The x-axes indicate millions of Atari frames.
+
+
+
+
+
+
\ No newline at end of file
diff --git a/measuringthereliabilityofreinforcementlearningalgorithms/images.zip b/measuringthereliabilityofreinforcementlearningalgorithms/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..c00db91b3a001f79b10a614713467210c7d473bd
--- /dev/null
+++ b/measuringthereliabilityofreinforcementlearningalgorithms/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ca4209311598efb48a3c792b85eb228b0fe0a2f681f31379140adbe2b6322665
+size 2478705
diff --git a/measuringthereliabilityofreinforcementlearningalgorithms/layout.json b/measuringthereliabilityofreinforcementlearningalgorithms/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..990ca140bc72783b9871f15428ce39f0b9555984
--- /dev/null
+++ b/measuringthereliabilityofreinforcementlearningalgorithms/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d27f9d40c726666f342f7cd2f0607e6f730b5de00ef73c37a38809d414e906e8
+size 779592
diff --git a/metalearningacquisitionfunctionsfortransferlearninginbayesianoptimization/8e2e84ca-e884-41df-a329-745f216d0c08_content_list.json b/metalearningacquisitionfunctionsfortransferlearninginbayesianoptimization/8e2e84ca-e884-41df-a329-745f216d0c08_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..9b39825658458789d7d19b225f9d2e9f9976bb86
--- /dev/null
+++ b/metalearningacquisitionfunctionsfortransferlearninginbayesianoptimization/8e2e84ca-e884-41df-a329-745f216d0c08_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:70a4c1c5650d2d2d5671652fb92c26da437cccb1d14fd1902e82f1ba18440116
+size 127754
diff --git a/metalearningacquisitionfunctionsfortransferlearninginbayesianoptimization/8e2e84ca-e884-41df-a329-745f216d0c08_model.json b/metalearningacquisitionfunctionsfortransferlearninginbayesianoptimization/8e2e84ca-e884-41df-a329-745f216d0c08_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..7f9f2cec669d759cb34be78920ead3e38e1970d7
--- /dev/null
+++ b/metalearningacquisitionfunctionsfortransferlearninginbayesianoptimization/8e2e84ca-e884-41df-a329-745f216d0c08_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:09db458dcfe0699a551c238ab7ec02bbe6c06097ff57b52a8d728aff94025c4d
+size 151597
diff --git a/metalearningacquisitionfunctionsfortransferlearninginbayesianoptimization/8e2e84ca-e884-41df-a329-745f216d0c08_origin.pdf b/metalearningacquisitionfunctionsfortransferlearninginbayesianoptimization/8e2e84ca-e884-41df-a329-745f216d0c08_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..55d87354976b88f7b2eb461ceaef033d45e04b43
--- /dev/null
+++ b/metalearningacquisitionfunctionsfortransferlearninginbayesianoptimization/8e2e84ca-e884-41df-a329-745f216d0c08_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:9634dc53b5ac84cb805844f5ec68853efb2e995e5a9ef266b53f881d7e5d639a
+size 1249947
diff --git a/metalearningacquisitionfunctionsfortransferlearninginbayesianoptimization/full.md b/metalearningacquisitionfunctionsfortransferlearninginbayesianoptimization/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..13418e6ac649f34e1c59944332d2b3fbb969468a
--- /dev/null
+++ b/metalearningacquisitionfunctionsfortransferlearninginbayesianoptimization/full.md
@@ -0,0 +1,443 @@
+# META-LEARNING ACQUISITION FUNCTIONS FOR TRANSFER LEARNING IN BAYESIAN OPTIMIZATION
+
+Michael Volpp $^{1*}$
+
+Lukas P. Fröhlich1,2
+
+Kirsten Fischer1
+
+Andreas Doerr1,3
+
+Stefan Falkner1
+
+Frank Hutter4,1
+
+Christian Daniel
+
+1Bosch Center for Artificial Intelligence, Renningen, Germany
+$^{2}$ ETH Zürich, Zürich, Switzerland
+3Max Planck Institute for Intelligent Systems, Stuttgart/Tübingen, Germany
+4University of Freiburg, Germany
+
+# ABSTRACT
+
+Transferring knowledge across tasks to improve data-efficiency is one of the open key challenges in the field of global black-box optimization. Readily available algorithms are typically designed to be universal optimizers and, therefore, often suboptimal for specific tasks. We propose a novel transfer learning method to obtain customized optimizers within the well-established framework of Bayesian optimization, allowing our algorithm to utilize the proven generalization capabilities of Gaussian processes. Using reinforcement learning to meta-train an acquisition function (AF) on a set of related tasks, the proposed method learns to extract implicit structural information and to exploit it for improved data-efficiency. We present experiments on a simulation-to-real transfer task as well as on several synthetic functions and on two hyperparameter search problems. The results show that our algorithm (1) automatically identifies structural properties of objective functions from available source tasks or simulations, (2) performs favourably in settings with both scarce and abundant source data, and (3) falls back to the performance level of general AFs if no particular structure is present.
+
+# 1 INTRODUCTION
+
+Global optimization of black-box functions is highly relevant for a wide range of real-world tasks. Examples include the tuning of hyperparameters in machine learning, the identification of control parameters, or the optimization of system designs. Such applications oftentimes require the optimization of relatively low-dimensional $(\lesssim 10D)$ functions where each function evaluation is expensive in either time or cost. Furthermore, there is typically no gradient information available.
+
+In this context of data-efficient global black-box optimization, Bayesian optimization (BO) has emerged as a powerful solution (Močkus, 1975; Brochu et al., 2010; Snoek et al., 2012; Shahriari et al., 2016). BO's data efficiency originates from a probabilistic surrogate model which is used to generalize over information from individual data points. This model is typically given by a Gaussian process (GP), whose well-calibrated uncertainty prediction allows for an informed exploration-exploitation trade-off during optimization. The exact manner of performing this trade-off, however, is left to be encoded in an acquisition function (AF). There is a wide range of AFs available in the literature which are designed to yield universal optimization strategies and therefore come with minimal assumptions about the class of target objective functions.
+
+To achieve optimal data-efficiency on new instances of previously seen tasks, however, it is crucial to incorporate the information obtained from these tasks into the optimization. Therefore, transfer
+
+learning is an important and active field of research. Indeed, in many practical applications, optimizations are repeated numerous times in similar settings, underlining the need for specialized optimizers. Examples include hyperparameter optimization which is repeatedly done for the same machine learning model on varying datasets or the optimization of control parameters for a given system with varying physical configurations.
+
+Following recent approaches (Swersky et al., 2013; Feurer et al., 2018; Wistuba et al., 2018), we argue that it is beneficial to perform transfer learning for global black-box optimization in the framework of BO to retain the proven generalization capabilities of its underlying GP surrogate model. To not restrict the expressivity of this model, we propose to implicitly encode the task structure in a specialized AF, i.e., in the optimization strategy. We realize this encoding via a novel method which meta-learns a neural AF, i.e., a neural network representing the AF, on a set of source tasks. The meta-training is performed using reinforcement learning, making the proposed approach applicable to the standard BO setting, where we do not assume access to objective function gradients.
+
+Our contributions are (1) a novel transfer learning method allowing the incorporation of implicit structural knowledge about a class of objective functions into the framework of BO through learned neural AFs to increase data-efficiency on new task instances, (2) an automatic and practical meta-learning procedure for training such neural AFs which is fully compatible with the black-box optimization setting, i.e., not requiring objective function gradients, and (3) the demonstration of the efficiency and practical applicability of our approach on a challenging simulation-to-real control task, on two hyperparameter optimization problems, as well as on a set of synthetic functions.
+
+# 2 RELATED WORK
+
+The general idea of improving the performance or convergence speed of a learning system on a given set of tasks through experience on similar tasks is known as learning to learn, meta-learning or transfer learning and has attracted a large amount of interest in the past while remaining an active field of research (Schmidhuber, 1987; Hochreiter et al., 2001; Thrun and Pratt, 1998; Lake et al., 2016).
+
+In the context of meta-learning optimization, a large body of literature revolves around learning local optimization strategies. One line of work focuses on learning improved optimizers for the training of neural networks, e.g., by directly learning update rules (Bengio et al., 1991; Runarsson and Jonsson, 2000) or by learning controllers for selecting appropriate step sizes for gradient descent (Daniel et al., 2016). Another direction of research considers the more general setting of replacing the gradient descent update step by neural networks which are trained using either reinforcement learning (Li and Malik, 2016; 2017) or in a supervised fashion (Andrychowicz et al., 2016; Metz et al., 2019). Finn et al. (2017), Nichol et al. (2018), and Flennerhag et al. (2019) propose approaches for initializing machine learning models through meta-learning to be able to solve new learning tasks with few gradient steps.
+
+We are currently aware of only one work tackling the problem of meta-learning global black-box optimization (Chen et al., 2017). In contrast to our proposed method, the authors assume access to gradient information and choose a supervised learning approach, representing the optimizer as a recurrent neural network operating on the raw input vectors. Based on statistics of the optimization history accumulated in its memory state, this network directly outputs the next query point. In contrast, we consider transfer learning applications where gradients are typically not available.
+
+A number of articles address the problem of increasing BO's data-efficiency via transfer learning, i.e., by incorporating information obtained from similar optimizations on source tasks into the current target task. A range of methods accumulate all available source and target data in a single GP and make the data comparable via a ranking algorithm (Bardenet et al., 2013), standardization or multi-kernel GPs (Yogatama and Mann, 2014), multi-task GPs (Swersky et al., 2013), the GP noise model (Theckel Joy et al., 2016), or by regressing on prediction biases (Shilton et al., 2017). These approaches naturally suffer from the cubic scaling behaviour of GPs, which can be tackled for instance by replacing the GP model, e.g., with Bayesian neural networks with task-specific embedding vectors (Springenberg et al., 2016) or with adaptive Bayesian linear regression with basis functions shared across tasks via a neural network (Perrone et al., 2018). Recently, Garnelo et al. (2018) proposed Neural Processes as another interesting alternative for GPs with improved scaling behavior. Other
+
+approaches retain the GP surrogate model and combine individual GPs for source and target tasks in an ensemble model with the weights adjusted according to the GP uncertainties (Schilling et al., 2016), dataset similarities (Wistuba et al., 2016), or estimates of the GP generalization performance on the target task (Feurer et al., 2018). Similarly, Golovin et al. (2017) form a stack of GPs by iteratively regressing onto the residuals w.r.t. the most recent source task. In contrast to our proposed method, many of these approaches rely on hand-engineered dataset features to measure the relevance of source data for the target task. Such features have also been used to pick promising initial configurations for BO (Feurer et al., 2015a;b).
+
+The method being closest in spirit and capability to our approach is proposed by Wistuba et al. (2018). It is similar to the aforementioned ensemble techniques with the important difference that the source and target GPs are not combined via a surrogate model but via a new AF, the so-called transfer acquisition function (TAF). This AF is defined to be a weighted superposition of the predicted improvements according to the source GPs and the expected improvement according to the target GP. Viewed in this context, our method also combines knowledge from source and target tasks in a new AF which we represent as a neural network. Our weighting of source and target data is implicitly determined in a meta-learning phase and is automatically regulated during the optimization on the target task to adapt online to the specific objective function at hand. Furthermore, our method does not store and evaluate many source GPs because the knowledge from the source datasets is encoded directly in the network weights of the learned AF. This allows our method to incorporate large amounts of source data while the applicability of TAF is restricted to a comparably small number of source tasks.
+
+# 3 PRELIMINARIES
+
+We are aiming to find a global optimum $\pmb{x}^{*} \in \arg \max_{\pmb{x} \in \mathcal{D}} f(\pmb{x})$ of some unknown objective function $f: \mathcal{D} \to \mathbb{R}$ on the domain $\mathcal{D} \subset \mathbb{R}^D$ . The only means of acquiring information about $f$ is via (possibly noisy) evaluations at points in $\mathcal{D}$ . Therefore, at each optimization step $t \in \{1, 2, \ldots\}$ , the optimizer has to decide for the iterate $\pmb{x}_t \in \mathcal{D}$ solely based on the optimization history $\mathcal{H}_t \equiv \{\pmb{x}_i, y_i\}_{i=1}^{t-1}$ with $y_i = f(\pmb{x}_i) + \epsilon$ . Here, $\epsilon \sim \mathcal{N}(0, \sigma_n^2)$ denotes independent and identically distributed Gaussian noise. In particular, the optimizer does not have access to gradients of $f$ . To assess the performance of global optimization algorithms, it is natural to use the simple regret $R_t \equiv f(\pmb{x}^*) - f(\pmb{x}_t^+)$ where $\pmb{x}_t^+$ is the input location corresponding to the best evaluation found by an algorithm up to and including step $t$ . The proposed method relies on the framework of BO and is trained using reinforcement learning. Therefore, we now shortly introduce these frameworks.
+
+Bayesian Optimization In Bayesian optimization (BO) (Shahriari et al., 2016), one specifies a prior belief about the objective function $f$ and at each step $t$ builds a probabilistic surrogate model conditioned on the current optimization history $\mathcal{H}_t$ . Typically, a Gaussian process (GP) (Rasmussen and Williams, 2005) is employed as the surrogate model in which case the resulting posterior belief about $f(\pmb{x})$ follows a Gaussian distribution with mean $\mu_t(\pmb{x}) \equiv \mathbb{E}\left\{f(\pmb{x}) \mid \mathcal{H}_t\right\}$ and variance $\sigma_t^2(\pmb{x}) \equiv \mathbb{V}\left\{f(\pmb{x}) \mid \mathcal{H}_t\right\}$ , for which closed-form expressions are available. To determine the next iterate $\pmb{x}_t$ based on the belief about $f$ given $\mathcal{H}_t$ , a sampling strategy is defined in terms of an acquisition function (AF) $\alpha_t(\cdot \mid \mathcal{H}_t): \mathcal{D} \to \mathbb{R}$ . The AF outputs a score value at each point in $\mathcal{D}$ such that the next iterate is defined to be given by $\pmb{x}_t \in \arg \max_{\pmb{x} \in \mathcal{D}} \alpha_t(\pmb{x} \mid \mathcal{H}_t)$ . The strength of the resulting optimizer is largely based upon carefully designing the AF to trade-off exploration of unknown versus exploitation of promising areas in $\mathcal{D}$ .
+
+There is a wide range of general-purpose AFs available in the literature. Popular choices are probability of improvement (PI) (Kushner, 1964), $GP$ -upper confidence bound (GP-UCB) (Srinivas et al., 2010), and expected improvement (EI) (Močkus, 1975). In our experiments, we will use EI as a not pre-informed baseline AF, so we state its definition here,
+
+$$
+\operatorname {E I} _ {t} (\boldsymbol {x}) \equiv \mathbb {E} _ {f (\boldsymbol {x})} \left\{\max \left[ f (\boldsymbol {x}) - f \left(\boldsymbol {x} _ {t - 1} ^ {+}\right), 0 \right] \mid \mathcal {H} _ {t} \right\}, \tag {1}
+$$
+
+and note that it can be written in closed form if $f(\pmb{x})$ follows a Gaussian distribution.
+
+To perform transfer learning in the context of BO, Wistuba et al. (2018) introduced the transfer acquisition framework (TAF) which defines a new AF as a weighted superposition of EI on the target
+
+task and the predicted improvements on the source tasks, i.e.,
+
+$$
+\operatorname {T A F} _ {t} (\boldsymbol {x}) \equiv \frac {w _ {M + 1} \operatorname {E I} _ {t} ^ {M + 1} (\boldsymbol {x}) + \sum_ {j = 1} ^ {M} w _ {j} I _ {t} ^ {j} (\boldsymbol {x})}{\sum_ {j = 1} ^ {M + 1} w _ {j}}, \tag {2}
+$$
+
+with the predicted improvement
+
+$$
+I _ {t} ^ {j} (\boldsymbol {x}) \equiv \max \left(\mu^ {j} (\boldsymbol {x}) - y _ {t - 1} ^ {j, \max }, 0\right). \tag {3}
+$$
+
+TAF stores separate GP surrogate models for the source and target tasks, with $j \in \{1, \dots, M\}$ indexing the source tasks and $j = M + 1$ indexing the target task. Therefore, $\mathrm{EI}_t^{M + 1}$ denotes EI according to the target GP surrogate model and $\mu^j$ denotes the mean function of the $j$ -th source GP model. $y_t^{j,\max}$ denotes the maximum of the mean predictions of the $j$ -th source GP model on the set of iterates $\{\pmb{x}_i\}_{i=1}^t$ . The weights $w_j \in \mathbb{R}$ are determined either based on the predicted variances of the source and target GP surrogate models (TAF-ME) or, alternatively, by a pairwise comparison of the predicted performance ranks of the iterates (TAF-R).
+
+Reinforcement Learning Reinforcement learning (RL) allows an agent to learn goal-oriented behavior via trial-and-error interactions with its environment (Sutton and Barto, 1998). This interaction process is formalized as a Markov decision process: at step $t$ the agent senses the environment's state $s_t \in S$ and uses a policy $\pi : S \to \mathcal{P}(\mathcal{A})$ to determine the next action $a_t \in \mathcal{A}$ . Typically, the agent explores the environment by means of a probabilistic policy, i.e., $\mathcal{P}(\mathcal{A})$ denotes the probability measures over $\mathcal{A}$ . The environment's response to $a_t$ is the next state $s_{t+1}$ , which is drawn from a probability distribution with density $p(s_{t+1} | s_t, a_t)$ . The agent's goal is formulated in terms of a scalar reward $r_t = r(s_t, a_t, s_{t+1})$ , which the agent receives together with $s_{t+1}$ . The agent aims to maximize the expected cumulative discounted future reward $\eta(\pi)$ when acting according to $\pi$ and starting from some state $s_0 \in S$ , i.e., $\eta(\pi) \equiv \mathbb{E}_{\pi} \left[ \sum_{t=1}^{T} \gamma^{t-1} r_t | s_0 \right]$ . Here, $T$ denotes the episode length and $\gamma \in (0,1]$ is a discount factor.
+
+# 4 METABO ALGORITHM
+
+We devise a global black-box optimization method that is able to automatically identify and exploit structural properties of a given class of objective functions for improved data-efficiency. We stay within the framework of BO, enabling us to exploit the powerful generalization capabilities of a GP surrogate model. The actual optimization strategy which is informed by this GP is classically encoded in a hand-designed AF. Instead, we meta-train on a set of source tasks to replace this AF by a neural network but retain all other elements of the proven BO-loop (middle panel of Fig. 1). To distinguish the learned AF from a classical AF $\alpha_{t}$ , we call such a network a neural acquisition function and denote it by $\alpha_{t,\theta}$ , indicating that it is parametrized by a vector $\theta$ . We dub the resulting algorithm MetaBO.
+
+Let $\mathcal{F}$ be the class of objective functions for which we aim to learn a neural acquisition function $\alpha_{t,\theta}$ . For instance, $\mathcal{F}$ may be the set of objective functions resulting from different physical configurations of a laboratory experiment or from evaluating the loss function of a machine learning model on different data sets. Often, such objective functions share structure which we aim to exploit for data-efficient optimization on further instances from the same function class. In many relevant cases, it is straightforward to obtain approximations to $\mathcal{F}$ , i.e., a set of functions $\mathcal{F}'$ which capture relevant properties of $\mathcal{F}$ but are much cheaper to evaluate (e.g., by using numerical simulations or results from previous hyperparameter optimization tasks (Wistuba et al., 2018)). During an offline meta-training phase, MetaBO makes use of such cheap approximations to identify the implicit structure of $\mathcal{F}$ and to adapt $\theta$ to obtain a data-efficient optimization strategy customized to $\mathcal{F}$ .
+
+Typically, the minimal set of inputs to AFs in BO is given by the pointwise GP posterior prediction $\mu_t(\pmb{x})$ and $\sigma_t(\pmb{x})$ . To perform transfer learning, the AF has to be able to identify relevant structure shared by the objective functions in $\mathcal{F}$ . In our setting, this is achieved via extending this basic set of inputs by additional features which enable the neural AF to evaluate sample locations. Therefore, in addition to the mean $\mu_t(\pmb{x})$ and variance $\sigma_t(\pmb{x})$ at potential sample locations, the neural AF also receives the input location $\pmb{x}$ itself. Furthermore, we add to the set of input features the current
+
+
+Figure 1: Different levels of the MetaBO framework. Left panel: structure of the training loop for meta-learning neural AFs using RL (PPO). Middle panel: the classical BO loop with a neural AF $\alpha_{t,\theta}$ . At test time, there is no difference to classical BO, i.e., $\pmb{x}_t$ is given by the arg max of the AF output. During training, the AF corresponds to the RL policy evaluated on an adaptive set $\pmb{\xi}_t \subset \mathcal{D}$ . The outputs are interpreted as logits of a categorical distribution from which the actions $a_t = \pmb{x}_t \in \pmb{\xi}_t$ are sampled. This sampling procedure is detailed in the right panel. We indicate by the dotted curve and tiny two-headed arrows that $\alpha_{t,\theta}$ is a function defined on the whole domain $\mathcal{D}$ which can be evaluated at arbitrary points $\pmb{\xi}_{t,n}$ to form the categorical distribution representing the policy $\pi_{\theta}$ .
+
+Table 1: The MetaBO setting in the RL framework.
+
+| RL | MetaBO |
| Policy πθ | Neural AF αt,θ |
| Episode | Optimization run on f ∈ F' |
| Episode length T | Optimization budget T |
| State st | [μt(ξt,n), σt(ξt,n), ξt,n, t, T]Nn=1 |
| Action at | Sampling point xt ∈ ξt |
| Reward rt | Negative simple regret -Rt |
| Transition p(st+1|st, at) | Noisy evaluation of f, GP update |
+
+optimization step $t$ and the optimization budget $T$ , as these features can be valuable for adjusting the exploration-exploitation trade-off (Srinivas et al., 2010). Therefore, we define
+
+$$
+\alpha_ {t, \theta} (\boldsymbol {x}) \equiv \alpha_ {t, \theta} \left[ \mu_ {t} (\boldsymbol {x}), \sigma_ {t} (\boldsymbol {x}), \boldsymbol {x}, t, T \right]. \tag {4}
+$$
+
+This architecture allows learning a scalable neural AF, as we still base our architecture only on the pointwise GP posterior prediction. Furthermore, neural AFs of this form can be used as a plug-in feature in any state-of-the-art BO framework. In particular, if differentiable activation functions are chosen, a neural AF constitutes a differentiable mapping $\mathcal{D} \to \mathbb{R}$ and standard gradient-based optimization strategies can be used to find its maximum in the BO loop during evaluation. We further emphasize that after the training phase the resulting neural AF is fully defined, i.e., there is no need to calibrate any AF-related hyperparameters.
+
+Training Procedure In the general BO setting, gradients of $\mathcal{F}$ are assumed to be unavailable. This is oftentimes also true for the functions in $\mathcal{F}'$ , for instance, when $\mathcal{F}'$ comprises numerical simulations or results from previous optimization runs. Therefore, we resort to RL as the meta-algorithm, as it does not require gradients of the objective functions. Specifically, we use the Proximal Policy Optimization (PPO) algorithm as proposed in Schulman et al. (2017). Tab. 1 translates the MetaBO-setting into RL parlance.
+
+We aim to shape the mapping $\alpha_{t,\theta}(\pmb{x})$ during meta-training in such a way that its maximum location corresponds to a promising sampling location $\pmb{x}$ for optimization. The meta-algorithm PPO explores its state space using a parametrized stochastic policy $\pi_{\theta}$ from which the actions $a_{t} = \pmb{x}_{t}$ are sampled depending on the current state $s_t$ , i.e., $a_{t} \sim \pi_{\theta}(\cdot | s_{t})$ . As the meta-algorithm requires access to
+
+the global information contained in the GP posterior prediction, the state $s_t$ at optimization step $t$ formally corresponds to the functions $\mu_t$ and $\sigma_t$ (together with the aforementioned additional input features to the neural AF). To connect the neural AF $\alpha_{t,\theta}$ with the policy $\pi_{\theta}$ and to arrive at a practical implementation, we evaluate $\mu_t$ and $\sigma_t$ on a discrete set of points $\pmb{\xi}_t \equiv \{\pmb{\xi}_{t,n}\}_{n=1}^N \subset \mathcal{D}$ and feed these evaluations through the neural AF $\alpha_{t,\theta}$ one at a time, yielding one scalar output value $\alpha_{t,\theta}(\pmb{\xi}_{t,n}) = \alpha_{t,\theta}[\mu_t(\pmb{\xi}_{t,n}), \sigma_t(\pmb{\xi}_{t,n}), \pmb{\xi}_{t,n}, t, T]$ for each point $\pmb{\xi}_{t,n}$ . These outputs are interpreted as the logits of a categorical distribution, i.e., we arrive at the policy architecture
+
+$$
+\pi_ {\theta} (\cdot \mid s _ {t}) \equiv \operatorname {C a t} \left[ \alpha_ {t, \theta} \left(\boldsymbol {\xi} _ {t, 1}\right), \dots , \alpha_ {t, \theta} \left(\boldsymbol {\xi} _ {t, N}\right) \right], \tag {5}
+$$
+
+cf. Fig. 1, right panel. Therefore, the proposed policy evaluates the same neural acquisition function $\alpha_{t,\theta}$ at arbitrarily many input locations $\pmb{\xi}_{t,n}$ and preferably samples actions $\pmb{x}_t\in \pmb{\xi}_t$ with high $\alpha_{t,\theta}(\pmb{x}_t)$ . This incentivizes the meta-algorithm to adjust $\theta$ such that promising locations $\pmb{\xi}_{t,n}$ are attributed high values of $\alpha_{t,\theta}(\pmb{\xi}_{t,n})$ .
+
+Calculating a sufficiently fine static set $\xi$ of evaluation points is challenging for higher dimensional settings. Instead, we build on the approach proposed by Snoek et al. (2012) and continuously adapt $\xi = \xi_{t}$ to the current state of $\alpha_{t,\theta}$ . At each step $t$ , $\alpha_{t,\theta}$ is first evaluated on a static and relatively coarse Sobol grid (Sobol, 1967) $\xi_{\mathrm{global}}$ spanning the whole domain $\mathcal{D}$ . Subsequently, local maximizations of $\alpha_{t,\theta}$ are started from the $k$ points corresponding to the best evaluations. We denote the resulting set of local maxima by $\xi_{\mathrm{local},t}$ . Finally, we define $\xi_{t} \equiv \xi_{\mathrm{local},t} \cup \xi_{\mathrm{global}}$ . The adaptive local part of this set enables the RL agent to exploit what it has learned so far by picking points which look promising according to the current neural AF while the static global part maintains exploration. We refer the reader to App. B.1 for details.
+
+The final characteristics of the neural AF are controlled through the choice of reward function. For the presented experiments we emphasized fast convergence to the optimum by using the negative simple regret as the reward signal, i.e., we set $r_t \equiv -R_t$ . This choice does not penalize explorative evaluations which do not yield an immediate improvement and additionally serves as a normalization of the functions $f \in \mathcal{F}'$ . We emphasize that the knowledge of the true maximum is only required during training and that cases in which it is not known at training time do not limit the applicability of our method, as a cheap approximation (e.g., by evaluating the function on a coarse grid) can also be utilized.
+
+The left panel of Fig. 1 depicts the resulting training loop graphically. The outer loop corresponds to the RL meta-training iterations, each performing a policy update step $\pi_{\theta_i} \to \pi_{\theta_{i+1}}$ . To approximate the gradients of the PPO loss function, we record a batch of episodes in the inner loop, i.e., a set of $(s_t, a_t, r_t)$ -tuples, by rolling out the current policy $\pi_{\theta_i}$ . At the beginning of each episode, we draw some function $f$ from the training set $\mathcal{F}'$ and fix an optimization budget $T$ . In each iteration of the inner loop we determine the adaptive set $\xi_t$ and feed the state $s_t$ through the policy which yields the action $a_t = x_t$ . We then evaluate $f$ at $\boldsymbol{x}_t$ and use the result to compute the reward $r_t$ and to update the optimization history: $\mathcal{H}_t \to \mathcal{H}_{t+1} = \mathcal{H}_t \cup \{\boldsymbol{x}_t, y_t\}$ . Finally, the GP is conditioned on the updated optimization history $\mathcal{H}_{t+1}$ to obtain the next state $s_{t+1}$ .
+
+# 5 EXPERIMENTS
+
+We trained MetaBO on a wide range of function classes and compared the performance of the resulting neural AFs with the general-purpose AF expected improvement $(\mathrm{EI})^2$ as well as the transfer acquisition function framework (TAF) which proved to be the current state-of-the-art solution for transfer learning in BO in an extensive experimental study (Wistuba et al., 2018). We tested both the ranking-based version (TAF-R) and the mixture-of-experts version (TAF-ME). We refer the reader to App. A for a more detailed experimental investigation of MetaBO's performance.
+
+If not stated differently, we report performance in terms of the median simple regret $R_{t}$ over 100 optimization runs on unseen test functions as a function of the optimization step $t$ together with $30\% / 70\%$ percentiles (shaded areas). We emphasize that all experiments use the same MetaBO
+
+
+Figure 2: Performance on three global optimization benchmark functions with random translations sampled uniformly from $[-0.1, 0.1]^D$ and scalings from [0.9, 1.1]. To test TAF's performance, we randomly picked $M = 50$ source tasks from this function class and evaluated both the ranking-based version (TAF-R-50) and the mixture-of-experts version (TAF-ME-50). We trained MetaBO on the same set of source tasks (MetaBO-50). In contrast to TAF, MetaBO can also be trained without manually restricting the set of available source tasks. The corresponding results are labelled "MetaBO". MetaBO outperformed EI by clear margin, especially in early stages of the optimization. After few steps used to identify the specific instance of the objective function, MetaBO also outperformed both flavors of TAF over wide ranges of the optimization budget. Results for TAF-20 can be found in App. A.4, Fig. 12.
+
+hyperparameters, making our method easily applicable in practice. Furthermore, MetaBO does not increase evaluation time considerably compared to standard AFs, cf. App. A.2, Tab. 3. In addition, even the most expensive of our experiments (the simulation-to-real task, due to the simulation in the BO loop) required not more than $10\mathrm{h}$ of training time on a moderately complex architecture (10 CPU workers, 1 GPU), which is fully justified for our intended offline transfer learning use-case. To foster reproducibility, we provide a detailed exposition of the experimental settings in App. B and make the source code of MetaBO available online.3
+
+Global Optimization Benchmark Functions We evaluated our method on a set of synthetic function classes based on the standard global optimization benchmark functions Branin $(D = 2)$ , Goldstein-Price $(D = 2)$ , and Hartmann-3 $(D = 3)$ (Picheny et al., 2013). To construct the training set $\mathcal{F}'$ , we applied translations in $[-0.1, 0.1]^D$ as well as scalings in [0.9, 1.1].
+
+As TAF stores and evaluates one source GP for each source task, its applicability is restricted to a relatively small amount of source data. For the evaluations of TAF and MetaBO, we therefore picked a random set of $M = 50$ source tasks from the continuously parametrized family $\mathcal{F}'$ of available objective functions and spread these tasks uniformly over the whole range of translations and scalings (MetaBO-50, TAF-R-50, TAF-ME-50). We used $N_{\mathrm{TAF}} = 100$ data points for each source GP of TAF. We also tested both flavors of TAF for $M = 20$ source tasks (with $N_{\mathrm{TAF}} = 50$ ) and observed that TAF's performance does not necessarily increase with more source data, rendering the choice of suitable source tasks cumbersome. Fig. 2 shows the performance on unseen functions drawn randomly from $\mathcal{F}'$ . To avoid clutter, we move the results for TAF-20 to App. A.4, cf. Fig. 12. MetaBO-50 outperformed EI by large margin, in particular at early stages of the optimization, by making use of the structural knowledge about $\mathcal{F}'$ acquired during the meta-learning phase. Furthermore, MetaBO-50 outperformed both flavors of TAF-50 over wide ranges of the optimization budget. This is due to its ability to learn sampling strategies which go beyond a combination of a prior over $\mathcal{D}$ and a standard AF (as is the case for TAF). Indeed, note that MetaBO spends some initial non-greedy evaluations to identify specific properties of the target objective function, resulting in much more efficient optimization strategies. We investigate this behaviour further on simple toy experiments and using easily interpretable baseline AFs in App. A.1.
+
+We further emphasize that MetaBO does not require the user to manually pick a suitable set of source tasks but that it can naturally learn from the whole set $\mathcal{F}'$ of available source tasks by randomly picking a new task from $\mathcal{F}'$ at the beginning of each BO iteration and aggregating this information in the neural AF weights. We also trained this full version of MetaBO (labelled "MetaBO") on the
+
+
+(a) Evaluation in simulation.
+
+
+(b) Evaluation on hardware in (c).
+Figure 3: Performance on a simulation-to-real task (cf. text). MetaBO and TAF used source data from a cheap numerical simulation. (a) Performance on an extended training set in simulation. (b) Transfer to the hardware depicted in (c), averaged over ten BO runs. MetaBO learned robust neural AFs with very strong optimization performance and online adaption to the target objectives, which reliably yielded stabilizing controllers after less than ten BO iterations while TAF-ME-100, TAF-R-100, and EI explore too heavily. Comparing the results for MetaBO and MetaBO-50 in simulation, we observe that MetaBO benefits from its ability to learn from the whole set of available source data, while TAF's applicability is restricted to a comparably small number of source tasks. We move the results for TAF-50 to App. A.4, Fig. 13.
+
+
+(c) Exp. setup.3
+
+global optimization benchmark functions, obtaining performance comparable with MetaBO-50. We demonstrate below that for more complex experiments, such as the simulation-to-real task, MetaBO's ability to learn from the full set of available source tasks is crucial for efficient transfer learning. We also investigate the dependence of MetaBO's performance on the number of source tasks in more detail in App. A.2.
+
+As a final test on synthetic functions, we evaluated the neural AFs on objective functions outside of the training distribution. This can give interesting insights into the nature of the problems under consideration. We move the results of this experiment to App. A.3.
+
+Simulation-to-Real Task Sample efficiency is of special interest for the optimization of real world systems. In cases where an approximate model of the system can be simulated, the proposed approach can be used to improve the data-efficiency on the real system. To demonstrate this, we evaluated MetaBO on a $4D$ simulation-to-real experiment. The task was to stabilize a Furuta pendulum (Furuta et al., 1992) for $5\mathrm{s}$ around the upper equilibrium position using a linear state-feedback controller. We applied BO to tune the four feedback gains of this controller (Fröhlich et al., 2020). To assess the performance of a given controller, we employed a logarithmic quadratic cost function (Bansal et al., 2017). If the controller was not able to stabilize the system or if the voltage applied to the motor exceeded some safety limit, we added a penalty term proportional to the remaining time the pendulum would have had to be stabilized for successfully completing the task. We emphasize that the cost function is rather sensitive to the control gains, resulting in a challenging black-box optimization problem.
+
+To meta-learn the neural AF, we employed a fast numerical simulation based on the nonlinear dynamics equations of the Furuta pendulum which only contained the most basic physical effects. In particular, effects like friction and stiction were not modeled. The training distribution was generated by sampling the physical parameters of this simulation (two lengths, two masses), uniformly on a range of $75\% - 125\%$ around the measured parameters of the hardware (Quanser QUBE - Servo 2, $^4$ Fig. 3(c)). We also used this simulation to generate $M = 100$ source tasks for TAF ( $N_{\mathrm{TAF}} = 200$ ).
+
+Fig. 3(a) shows the performance on objective functions from simulation. Again, MetaBO learned a sophisticated sampling strategy which first identifies the target objective function and adapts its optimization strategy accordingly, resulting in very strong optimization performance. In contrast, TAF's superposition of a prior over $\mathcal{D}$ obtained from the source tasks with EI on the target task leads to excessive explorative behaviour. We move further experimental results for TAF-50 to App. A.4, Fig. 13.
+
+
+Figure 4: Performance on two $2D$ hyperparameter optimization tasks (SVM and AdaBoost). We trained MetaBO on precomputed data for 35 randomly chosen datasets and used the same datasets as source tasks for TAF. The remaining 15 datasets were used for this evaluation. MetaBO learned very data-efficient sampling strategies on both experiments, outperforming the benchmark methods by clear margin. Note that the optimization domain is discrete and therefore tasks can be solved exactly, corresponding to zero regret.
+
+By comparing the performance of MetaBO and MetaBO-50 in simulation, we find that our architecture's ability to incorporate large amounts of source data is indeed beneficial on this complex optimization problem. The results in App. A.2 underline that this task indeed requires large amounts of source data to be solved efficiently. This is substantiated by the results on the hardware, on which we evaluated the full version of MetaBO and the baseline AFs obtained by training on data from simulation without any changes. Fig. 3(b) shows that MetaBO learned a neural AF which generalizes well from the simulated objectives to the hardware task and was thereby able to rapidly adjust to its specific properties. This resulted in very data-efficient optimization on the target system, consistently yielding stabilizing controllers after less than ten BO iterations. In comparison, the benchmark AFs required many samples to identify promising regions of the search space and therefore did not reliably find stabilizing controllers within the budget of 25 optimization steps.
+
+As it provides interesting insights into the nature of the studied problem, we investigate MetaBO's generalization performance to functions outside of the training distribution in App. A.3. We emphasize, however, that the intended use case of our method is on unseen functions drawn from the training distribution. Indeed, by measuring the physical parameters of the hardware system and adjusting the ranges from which the parameters are drawn to generate $\mathcal{F}'$ according to the measurement uncertainty, the training distribution can be modelled in such a way that the true system parameters lie inside of it with high confidence.
+
+Hyperparameter Optimization We tested MetaBO on two $2D$ -hyperparameter optimization (HPO) problems for RBF-based SVMs and AdaBoost. As proposed in Wistuba et al. (2018), we used precomputed results of training these models on 50 datasets with 144 parameter configurations (RBF kernel parameter, penalty parameter $C$ ) for the SVMs and 108 configurations (number of product terms, number of iterations) for AdaBoost. We randomly split these datasets into 35 source datasets used for training MetaBO as well as for TAF and evaluated the resulting optimization strategies on the remaining 15 datasets. To determine when to stop the meta-training of MetaBO, we performed 7-fold cross validation on the training datasets. We emphasize that MetaBO did not use more source data than TAF in this experiment, underlining again its broad applicability in situations with both scarce and abundant source data. The results (Fig. 4) show that MetaBO learned very data-efficient neural AFs which surpassed EI und TAF on both experiments.
+
+General Function Classes Finally, we evaluated the performance of MetaBO on function classes without any particular structure except a bounded correlation lengthscale. As there is only little structure present in this function class which could be exploited in the transfer learning setting, it is desirable to obtain neural AFs which fall back at least on the performance level of general-purpose AFs such as EI. We performed two different experiments of this type. For the first experiment, we sampled the objective functions from a GP prior with squared-exponential (RBF) kernel with lengthscales drawn uniformly from $\ell \in [0.05, 0.5]$ . For the second experiment, we used a GP prior
+
+
+(a) $D = 3$ RBF kernel
+
+
+(b) $D = 4$ RBF kernel
+
+
+(c) $D = 5$ RBF kernel
+
+
+(d) $D = 3$ ,Matern-5/2 kernel
+
+
+(e) $D = 4$ ,Matern-5/2 kernel
+
+
+(f) $D = 5$ ,Matern-5/2 kernel
+Figure 5: Performance of MetaBO trained on $D = 3$ -dimensional objective functions sampled from a GP prior with RBF kernel (upper row) and Matern-5/2 kernel (lower row) with lengthscales drawn randomly from $\ell \in [0.05, 0.5]$ . Panels (a, d) show the performance on these training distributions. As we excluded the $x$ -feature from the neural AF inputs during training, the resulting AFs can be applied to functions of different dimensionalities. We evaluated each AF on $D = 4$ and $D = 5$ without retraining MetaBO. We report simple regret w.r.t. the best observed function value, determined separately for each function in the test set.
+
+with Matern-5/2 kernel with the same range of lengthscales. For the latter experiment we also used the Matern-5/2 kernel (in contrast to the RBF kernel used in all other experiments) as the kernel of the GP surrogate model to avoid model mismatch. For both types of function classes we trained MetaBO on $D = 3$ dimensional tasks and excluded the $x$ -feature to study a dimensionality-agnostic version of MetaBO. Indeed, we evaluated the resulting neural AFs without retraining for dimensionalities $D \in \{3,4,5\}$ . The results (Fig. 5) show that MetaBO is capable of learning neural AFs which perform better than or at least on on-par with EI on these general function classes.
+
+# 6 CONCLUSION AND FUTURE WORK
+
+We introduced MetaBO, a novel method for transfer learning in the framework of BO. Via a flexible meta-learning approach, we inject prior knowledge directly into the optimization strategy of BO using neural AFs. The experiments show that our method consistently outperforms existing methods, for instance in simulation-to-real settings or on hyperparameter search tasks. Our approach is broadly applicable to a wide range of practical problems, covering both the cases of scarce and abundant source data. The resulting neural AFs can represent search strategies which go far beyond the abilities of current approaches which often rely on weighted superpositions of priors over the optimization domain obtained from the source data with standard AFs. In future work, we aim to tackle the multi-task multi-fidelity setting (Valkov et al., 2018), where we expect MetaBO's sample efficiency to be of high impact.
+
+# ACKNOWLEDGEMENTS
+
+We want to thank Julia Vinogradska, Edgar Klenske, Aaron Klein, Matthias Feurer, Gerhard Neumann, as well as the anonymous reviewers for valuable remarks and discussions which greatly helped to improve this paper.
+
+# REFERENCES
+
+Marcin Andrychowicz, Misha Denil, Sergio Gomez Colmenarejo, Matthew W. Hoffman, David Pfau, Tom Schaul, and Nando de Freitas. Learning to Learn by Gradient Descent by Gradient Descent. In Advances in Neural Information Processing Systems, 2016.
+Somil Bansal, Roberto Calandra, Ted Xiao, Sergey Levine, and Claire J. Tomlin. Goal-driven Dynamics Learning via Bayesian Optimization. In IEEE Annual Conference on Decision and Control, 2017.
+Rémi Bardenet, Mátyás Brendel, Balázs Kégl, and Michèle Sebag. Collaborative Hyperparameter Tuning. In International Conference on Machine Learning, 2013.
+Yoshua Bengio, Samy Bengio, and Jocelyn Cloutier. Learning a Synaptic Learning Rule. In International Joint Conference on Neural Networks, 1991.
+Eric Brochu, Vlad M. Cora, and Nando de Freitas. A Tutorial on Bayesian Optimization of Expensive Cost Functions, with Application to Active User Modeling and Hierarchical Reinforcement Learning. arXiv:1012.2599, 2010.
+Yutian Chen, Matthew W. Hoffman, Sergio Gomez Colmenarejo, Misha Denil, Timothy P. Lillicrap, Matt Botvinick, and Nando de Freitas. Learning to Learn without Gradient Descent by Gradient Descent. In International Conference on Machine Learning, 2017.
+Christian Daniel, Jonathan Taylor, and Sebastian Nowozin. Learning Step Size Controllers for Robust Neural Network Training. In AAAI Conference on Artificial Intelligence, 2016.
+Matthias Feurer, Aaron Klein, Katharina Eggensperger, Jost Tobias Springenberg, Manuel Blum, and Frank Hutter. Efficient and Robust Automated Machine Learning. In Advances in Neural Information Processing Systems, 2015a.
+Matthias Feurer, Jost Tobias Springenberg, and Frank Hutter. Initializing Bayesian Hyperparameter Optimization via Meta-Learning. AAAI Conference on Artificial Intelligence, 2015b.
+Matthias Feurer, Benjamin Letham, and Eytan Bakshy. Scalable Meta-Learning for Bayesian Optimization. arXiv:1802.02219, 2018.
+Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-Agnostic Meta-Learning for Fast Adaptation of Deep Networks. In International Conference on Machine Learning, 2017.
+Sebastian Flennerhag, Pablo Garcia Moreno, Neil Lawrence, and Andreas Damianou. Transferring Knowledge across Learning Processes. In International Conference on Learning Representations, 2019.
+Lukas P. Fröhlich, Edgar D. Klenske, Christian G. Daniel, and Melanie N. Zeilinger. Bayesian Optimization for Policy Search in High-Dimensional Systems via Automatic Domain Selection. arXiv:2001.07394, 2020.
+Katsuhisa Furuta, M. Yamakita, and S. Kobayashi. Swing-up Control of Inverted Pendulum Using Pseudo-State Feedback. Journal of Systems and Control Engineering, 206(4), 1992.
+Marta Garnelo, Jonathan Schwarz, Dan Rosenbaum, Fabio Viola, Danilo J. Rezende, S. M. Ali Eslami, and Yee Whye Teh. Neural Processes. arXiv:1807.01622, 2018.
+Daniel Golovin, Benjamin Solnik, Subhodeep Moitra, Greg Kochanski, John Karro, and D. Sculley. Google Vizier: A Service for Black-Box Optimization. In International Conference on Knowledge Discovery and Data Mining, 2017.
+GPy. GPy: A Gaussian Process Framework in Python, 2012.
+Sepp Hochreiter, Steven A. Younger, and Peter R. Conwell. Learning to Learn Using Gradient Descent. In Artificial Neural Networks - ICANN, 2001.
+Harold J. Kushner. A New Method of Locating the Maximum Point of an Arbitrary Multipeak Curve in the Presence of Noise. Journal of Basic Engineering, 86(1), 1964.
+
+Brenden M. Lake, Tomer D. Ullman, Joshua B. Tenenbaum, and Samuel J. Gershman. Building Machines That Learn and Think Like People. arXiv:1604.00289, 2016.
+Ke Li and Jitendra Malik. Learning to Optimize. arXiv:1606.01885, 2016.
+Ke Li and Jitendra Malik. Learning to Optimize Neural Nets. arXiv:1703.00441, 2017.
+Luke Metz, Niru Maheswaranathan, Brian Cheung, and Jascha Sohl-Dickstein. Learning Unsupervised Learning Rules. In International Conference on Learning Representations, 2019.
+Jonas Močkus. On Bayesian Methods for Seeking the Extremum. In *Optimization Techniques IFIP Technical Conference*, 1975.
+Alex Nichol, Joshua Achiam, and John Schulman. On First-Order Meta-Learning Algorithms. arXiv:1803.02999, 2018.
+Valerio Perrone, Rodolphe Jenatton, Matthias W Seeger, and Cedric Archambeau. Scalable Hyperparameter Transfer Learning. In Advances in Neural Information Processing Systems, 2018.
+Victor Picheny, Tobias Wagner, and David Ginsbourger. A Benchmark of Kriging-based Infill Criteria for Noisy Optimization. Structural and Multidisciplinary Optimization, 48(3), 2013.
+Carl Edward Rasmussen and Christopher K. I. Williams. Gaussian Processes for Machine Learning. The MIT Press, 2005.
+Thomas Philip Runarsson and Magnus Thor Jonsson. In *IEEE Symposium on Combinations of Evolutionary Computation and Neural Networks*, 2000.
+Nicolas Schilling, Martin Wistuba, and Lars Schmidt-Thieme. Scalable Hyperparameter Optimization with Products of Gaussian Process Experts. European Conference on Machine Learning and Knowledge Discovery in Databases, 2016.
+Jürgen Schmidhuber. Evolutionary Principles in Self-Referential Learning. On Learning how to Learn: The Meta-Meta-Meta...-Hook. Diploma Thesis, Technische Universitat München, Germany, 1987.
+John Schulman, Philipp Moritz, Sergey Levine, Michael I. Jordan, and Pieter Abbeel. High-Dimensional Continuous Control Using Generalized Advantage Estimation. arXiv:1506.02438, 2015.
+John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal Policy Optimization Algorithms. arXiv:1707.06347, 2017.
+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), 2016.
+Alistair Shilton, Sunil Gupta, Santu Rana, and Svetha Venkatesh. Regret Bounds for Transfer Learning in Bayesian Optimisation. In International Conference on Artificial Intelligence and Statistics, volume 54, 2017.
+Jasper Snoek, Hugo Larochelle, and Ryan P. Adams. Practical Bayesian Optimization of Machine Learning Algorithms. In Advances in Neural Information Processing Systems, 2012.
+Ilya Meerovich Sobol. On the Distribution of Points in a Cube and the Approximate Evaluation of Integrals. Zhurnal Vychislitelnoi Matematiki i Matematicheskoi Fiziki, 7(4), 1967.
+Jost Tobias Springenberg, Aaron Klein, Stefan Falkner, and Frank Hutter. Bayesian Optimization with Robust Bayesian Neural Networks. In Advances in Neural Information Processing Systems, 2016.
+Niranjan Srinivas, Andreas Krause, Sham Kakade, and Matthias W. Seeger. Gaussian Process Optimization in the Bandit Setting: No Regret and Experimental Design. In International Conference on Machine Learning, 2010.
+
+Richard S. Sutton and Andrew G. Barto. Reinforcement Learning - an Introduction. Adaptive Computation and Machine Learning. MIT Press, 1998.
+Kevin Swersky, Jasper Snoek, and Ryan P. Adams. Multi-Task Bayesian Optimization. In Advances in Neural Information Processing Systems, 2013.
+Tinu Theckel Joy, Santu Rana, Sunil Gupta, and Svetha Venkatesh. Flexible Transfer Learning Framework for Bayesian Optimisation. In Advances in Knowledge Discovery and Data Mining, 2016.
+Sebastian Thrun and Lorien Pratt. Learning to Learn. Kluwer Academic Publishers, Norwell, MA, USA, 1998.
+Lazar Valkov, Rodolphe Jenatton, Fela Winkelmolen, and Cedric Archambeau. A Simple Transfer-learning Extension of Hyperband. NeurIPS Workshop on Meta-Learning, 2018.
+Martin Wistuba, Nicolas Schilling, and Lars Schmidt-Thieme. Two-Stage Transfer Surrogate Model for Automatic Hyperparameter Optimization. In European Conference on Machine Learning and Knowledge Discovery in Databases, 2016.
+Martin Wistuba, Nicolas Schilling, and Lars Schmidt-Thieme. Scalable Gaussian Process-based Transfer Surrogates for Hyperparameter Optimization. Journal of Machine Learning Research, 107(1), 2018.
+Dani Yogatama and Gideon Mann. Efficient Transfer Learning Method for Automatic Hyperparameter Tuning. In International Conference on Artificial Intelligence and Statistics, 2014.
+
+# A ADDITIONAL EXPERIMENTAL RESULTS
+
+# A.1 INTERPRETATION OF NEURAL AF SEARCH STRATEGIES
+
+We provide additional experimental results to demonstrate that MetaBO's neural AFs learn representations that go beyond some kind of standard AF combined with a prior over $\mathcal{D}$ .
+
+Emergence of Non-Greedy Search Strategies To obtain intuition about the kind of search strategies MetaBO is able to learn, we devised two classes of one-dimensional toy objective functions.
+
+The first class of objective functions (Rhino-1, cf. Fig. 6) is generated by applying random translations sampled uniformly from $t \in [-0.2, 0.2]$ to a function which is given by the superposition of two Gaussian bumps with different heights and widths and fixed distance,
+
+$$
+f _ {\mathrm {R} 1} (x, t) \equiv 0. 5 \cdot \mathcal {N} (x \mid \mu = 0. 3 - t, \sigma = 0. 1) + 3. 0 \cdot \mathcal {N} (x \mid \mu = 0. 7 - t, \sigma = 0. 0 1), \tag {6}
+$$
+
+where we define $\mathcal{N}(x|\mu ,\sigma)\equiv \exp (-1 / 2\cdot (x - \mu)^2 /\sigma^2)$ . The second class of objective functions (Rhino-2, cf. Fig. 7) is given by uniformly sampling the parameter $h\in [0.6,0.9]$ of the function
+
+$$
+f _ {\mathrm {R} 2} (x, h) \equiv h \cdot \mathcal {N} (x | \mu = 0. 2, \sigma = 0. 1) + 2. 0 \cdot \mathcal {N} (x | \mu = h, \sigma = 0. 0 1) - 1. 0. \tag {7}
+$$
+
+For both of these function classes it is intuitively clear that the optimal search strategy involves a first non-greedy evaluation to identify the specific instance of the target function. Indeed, for all instances of these function classes, the smaller and wider bumps overlap and encode information about the position of the sharp global optimum. Therefore, an optimal strategy spends the first evaluation at a fixed position $x_0$ where all smaller and wider bumps have non-negligible heights $y_0$ . Then, for both function classes, the global optimum $x^*$ can be determined exactly from $y_0$ (if we assume noiseless evaluations), such that $x^*$ can be found in the second step. Figs. 6, 7 show that MetaBO indeed learns such non-greedy optimization strategies, which go far beyond a simple combination of a prior over $\mathcal{D}$ with some kind of standard AF. As mentioned in the main part of this paper, we suppose that MetaBO employs similar strategies on more complex function classes. For instance, we observe in the experiments on the global optimization benchmark functions (Fig. 2) that MetaBO consistently starts with higher regret than the pre-informed TAF which suggests that it learned to spend a few non-greedy evaluations at the beginning of an optimization run to identify the specific instance of the target function.
+
+Additional Baseline Methods To provide further evidence that MetaBO's neural AFs learn representations that go beyond a simple prior over $\mathcal{D}$ combined with some kind of standard AF, we show results for two additional baseline AFs which rely on such a naive combination.
+
+We define the AF GMM-UCB as the following convex combination of a Gaussian Mixture Model (GMM) and the standard AF UCB:
+
+$$
+\operatorname {G M M} - \operatorname {U C B} (\boldsymbol {x}) \equiv w \cdot \operatorname {G M M} (\boldsymbol {x}) + (1 - w) \cdot \operatorname {U C B} (\boldsymbol {x}). \tag {8}
+$$
+
+The GMM is defined to have $n_{\mathrm{comp}}$ components and is fitted to the best designs from each of the $M$ source tasks. Further, UCB is defined as
+
+$$
+\operatorname {U C B} (\boldsymbol {x}) \equiv \mu (\boldsymbol {x}) + \beta \sigma (\boldsymbol {x}), \tag {9}
+$$
+
+and we choose $\beta = 2$ as is common in BO.
+
+Furthermore, we define EPS-GREEDY as the AF which in each optimization samples without replacement from the set of best designs of each of the source tasks step with probability $\epsilon$ and uses standard EI with probability $1 - \epsilon$ .
+
+Note that these baseline methods are similar in spirit to the TAF-approach evaluated in the main part of this paper. Indeed, TAF, GMM-UCB, and EPS-GREEDY all rely on some kind of prior over $\mathcal{D}$ determined using the source data which is combined through a weighted superposition with some standard AF. However, TAF uses more principled methods (TAF-ME, TAF-R) to adaptively determine the weights of this superposition.
+
+To obtain optimal performance of GMM-UCB and EPS-GREEDY, we chose the parameters for these methods by grid search on the test set7 w.r.t. the median simple regret summed from $t = 0$ to
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Figure 6: Visualization of three BO episodes with neural AFs on the $1D$ Rhino-1 task. Each column of this figure corresponds to one episode with three optimization steps. The uppermost row corresponds to the prior state before the objective function was queried. The fourth row depicts the state after three evaluations. Each subfigure shows the GP mean (dashed blue line), GP standard deviation (blue shaded area), and the ground truth function (black) in the upper panel as well as the neural AF in the lower panel. Dashed red lines indicate the maxima of the ground truth function and of the neural AF. Red and green crosses indicate the recorded data (the red cross corresponds to the most recent data point). Each instance of this task is generated by randomly translating an objective function with two peaks of different heights and widths. The distance between the local and global optimum is the same for each instance. MetaBO learns a sophisticated sampling strategy, spending a non-greedy evaluation at the beginning of each episode at a position where the smaller but wider peaks overlap for every instance of the function class to gain information about the location of the global optimum. Using this strategy, MetaBO is able to find the global optimum very efficiently.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Figure 7: Visualization of three episodes from the $1D$ Rhino-2 task. Each column of this figure corresponds to one episode with two optimization steps. The uppermost row corresponds to the prior state before the objective function was queried. The third row depicts the state after two evaluations. Each subfigure shows the GP mean (dashed blue line), GP standard deviation (blue shaded area), and the ground truth function (black) in the upper panel as well as the neural AF in the lower panel. Dashed red lines indicate the maxima of the ground truth function and of the neural AF. Red and green crosses indicate the recorded data (the red cross corresponds to the most recent data point). Each instance of this task is generated by sampling the height $h$ of a wide bump at a fixed location $x = 0.2$ and placing a sharp peak at $x = h$ . MetaBO learns a sophisticated sampling strategy, spending a non-greedy evaluation at $x \approx 0.2$ at the beginning of each episode to gain information about the location of the global optimum. Using this strategy, MetaBO is able to find the global optimum very efficiently.
+
+
+
+
+
+
+MetaBO (ours) - MetaBO-50 (ours) - EI - GMM-UCB - EPS-GREEDY
+(a) Branin $(D = 2)$
+Figure 8: Performance on three global optimization benchmark functions with random translations sampled uniformly from $[-0.1,0.1]^D$ and scalings from [0.9,1.1]. We present results for two additional baseline methods (GMM-UCB, EPS-GREEDY) which rely on a weighted superposition of a prior over $\mathcal{D}$ obtained from $M = 50$ source tasks and a standard AF and can thus be easily interpreted. As MetaBO produces more sophisticated search strategies, these approaches are not able to surpass MetaBO's performance.
+
+
+(b) Goldstein-Price $(D = 2)$
+
+
+(c) Hartmann-3 $(D = 3)$
+
+Table 2: Optimal parameters of GMM-UCB and EPS-GREEDY (determined on the test set).
+
+ | w | ncompss | ε |
| Branin | 0.22 | 3 | linear schedule |
| Goldstein-Price | 0.22 | 1 | 0.55 |
| Hartmann-3 | 0.11 | 2 | linear schedule |
+
+$t = T = 30$ . To tune $w$ for GMM-UCB we tested 10 linearly spaced points in $[0.0, 1.0]$ as well as a schedule which reduces $w$ from 1.0 to 0.0 over the course of one episode. Furthermore, we tested numbers of GMM-components $n_{\mathrm{comp}} \in \{1, 2, 3, 4, 5\}$ . Similarly, for EPS-GREEDY we tested $\epsilon$ on 10 linearly spaced points in $[0.0, 1.0]$ and also evaluated a schedule which reduces $\epsilon$ from 1.0 to 0.0 over an episode.
+
+In Fig. 8 we display the performance of GMM-UCB and EPS-GREEDY on the global optimization benchmark functions Branin, Goldstein-Price, and Hartmann-3 with the optimal parameter configurations (cf. Tab. 2) and with $M = 50$ source tasks. MetaBO outperforms both GMM-UCB and EPS-GREEDY which provides additional evidence that neural AFs learn representations which go beyond a simple combination of standard AFs with a prior over $\mathcal{D}$ .
+
+# A.2 DEPENDENCE ON THE NUMBER OF SOURCE TASKS
+
+We argued in the main part of this paper that one main advantage of MetaBO over existing transfer learning methods for BO is its ability to process a very large amount of source data because it does not store all available data in GP models (in contrast to TAF) but rather accumulates the data in the neural AF weights. For tasks where source data is abundant (e.g., when it comes from simulations, cf. Fig. 3), this frees the user from having to select a small subset of representative source tasks by hand, which can be intricate or even impossible for complex tasks. In addition, we showed in our experiments that MetaBO's applicability is not restricted to such cases, but that it also performs favourably with the same amount of source data as presented to the baseline methods on tasks which do not require a very large amount of source data to be solved efficiently (cf. Figs. 2, 4).
+
+In Fig. 9 we provide further evidence for this aspect by plotting the performance of MetaBO for different numbers $M$ of source tasks on the Branin function and on functions from the simulation of the Furuta pendulum stabilization task. The results indicate that on the Branin function a small number of source tasks is already sufficient to obtain strong optimization performance. In contrast, the more complex stabilization task requires a much larger amount of source data to be solved reliably.
+
+We emphasize that MetaBO's evaluation runtime does not depend on the number $M$ of source tasks because a neural AF evaluation only requires one forward pass through a neural AF of fixed size. Therefore, it scales well to the regime of abundant source data. In contrast, TAF-ME's runtime scales
+
+
+(a) Branin function
+
+
+(b) Furuta pendulum in simulation
+Figure 9: Dependence of MetaBO's performance on the number of source tasks provided during training on the Branin function (cf. Fig. 2(a)) and on the stabilization task for the Furuta pendulum in simulation (cf. Fig. 3(a)). We show the number of steps MetaBO requires to reach a given performance in terms of median regret over 100 test functions in dependence of the number $M$ of source tasks. As in the main part of this paper, we chose a constant budget of $T = 30$ on the Branin function and of $T = 50$ on the stabilization task. The dashed red line indicates the number of source tasks seen by the full version of MetaBO (a new function is sampled from the training distribution at the beginning of each optimization episode) at the point of convergence of meta-training. For the Branin function we chose the regret threshold $R = 10^{-3}$ , which corresponds to the median final performance of TAF after $t = 30$ steps as presented in the main part of this paper (Fig. 2(a)). For the Furuta stabilization task, we chose the regret threshold $R = 1.0$ , which corresponds approximately to the regret that has to be reached in simulation to allow stabilization on the real system. The results show that on the Branin function already a small number of source tasks is enough to obtain a powerful optimization strategy. In contrast, neural AFs trained on the more complex simulation-to-real task benefit from MetaBO's ability to process a very large amount of source tasks.
+
+Table 3: Comparison of evaluation runtimes per BO episode with budget $T = {30}$ in s for various AFs, averaged over 10 BO runs. We show MetaBO's runtime for $M = {50}$ source tasks as well as for the full version (where a new function is sampled from the training distribution in each BO run). For TAF, we indicate $M$ and the number $N$ of data points per source task by TAF-ME- $M - N$ and TAF-R- $M - N$ . Note that the absolute figures of the reported runtimes obviously depend on the hardware architecture used for the evaluation.
+
+ | Branin | Goldstein-Price | Hartmann-3 |
| EI | 0.13 | 0.13 | 0.16 |
| MetaBO-50 | 0.60 | 0.55 | 0.82 |
| MetaBO-full | 0.62 | 0.59 | 0.81 |
| TAF-ME-50-100 | 13 | 14 | 24 |
| TAF-ME-50-200 | 29 | 28 | 35 |
| TAF-ME-100-100 | 17 | 19 | 30 |
| TAF-ME-100-200 | 47 | 49 | 65 |
| TAF-R-50-100 | 50 | 50 | 56 |
| TAF-R-50-200 | 61 | 60 | 69 |
| TAF-R-100-100 | 100 | 100 | 110 |
| TAF-R-100-200 | 120 | 120 | 140 |
+
+linearly in the number $M$ of source tasks and quadratically in the number $N$ of data points per source task, while TAF-R shows an even stronger dependence on $M$ due to the computation of the pairwise ranks. We underline this scaling behavior by presenting measured evaluation runtimes in Tab. 3.
+
+
+(a) Branin $(D = 2)$
+
+
+(b) Goldstein-Price $(D = 2)$
+Figure 10: Generalization of neural AFs to functions outside of the training distribution (translations $t \in [-0.1, 0.1]$ , scalings $s \in [0.9, 1.1]$ , red square) on Branin, Goldstein-Price, and Hartmann-3. We evaluated the neural AFs on 100 test distributions with disjoint ranges of translations and scalings, each corresponding to one tile of the heatmap. The $x$ - and $y$ -labels of each tile denote the lower bounds of the translations $t$ and scalings $s$ of the respective test distribution from which the parameters were sampled uniformly (for each dimension we sampled the translation and its sign independently). The color encodes the number of optimization steps required to reach a given regret threshold. White tiles indicate that this threshold could not be reached within $T = 30$ optimization steps. The regret threshold was fixed for each function separately: we set it to the $1\%$ -percentile of the set of regrets corresponding to function evaluations on a Sobol grid of one million points in the domain of the original objective functions.
+
+
+(c) Hartmann-3 $(D = 3)$
+
+# A.3 GENERALIZATION BEHAVIOR
+
+As described in the main part of this paper, MetaBO's primary use case is transfer learning, i.e., to speed up optimization on target functions similar to the source objective functions. Put differently, we are mainly interested in MetaBO's performance on unseen functions drawn from the training distribution. Nevertheless, studying MetaBO's generalization performance to functions outside of the training distribution can give interesting insights into the nature of the tasks we considered in the main part. Therefore, we present a study of MetaBO's generalization performance on the global optimization benchmark functions (Fig. 10) as well as on the simulation-to-real experiment (Fig. 11).
+
+The results on the simulation-to-real task show that the neural AF generalizes better to heavy and long than to lightweight and short pendula. We suppose that this result is related to the fact that lightweight and short pendula show much faster dynamics due to their small moments of inertia than heavier and longer ones and are thus much harder to stabilize. Put more precisely, the change of the optimization landscape is much more pronounced when moving to lighter and smaller pendula than in the other direction. Similar conclusions can be drawn for the translated and scaled global optimization benchmark functions.
+
+# A.4 FULL SET OF RESULTS FROM MAIN PART
+
+Global Optimization Benchmark Functions We provide the full set of results for the experiment on the global optimization benchmark functions. In Fig. 12 we also include results for TAF with $\mathrm{M} = 20$ , showing that TAF's performance does not necessarily increase with more source data.
+
+Simulation-to-Real Experiment We provide the full set of results for the experiment on the global optimization benchmark functions, including the results for TAF-50, cf. Fig. 13.
+
+# B EXPERIMENTAL DETAILS
+
+To foster reproducibility, we provide a detailed explanation of the settings used in our experiments and make source code available online. $^{8}$
+
+
+Figure 11: Generalization of neural AFs to functions outside of the training distribution (75% to 125% of measured physical parameters, red square) on the simulation-to-real task. We evaluated neural AFs on test distributions with disjoint ranges of physical parameters (masses and lengths of the pendulum and arm). We sampled each physical parameter $p_i$ uniformly on $[f \cdot p_{i,\text{measured}}, (f + 0.2) \cdot p_{i,\text{measured}}]$ . Therefore, $f = 0.9$ corresponds to the interval containing the measured parameters. We plot $f$ on the $x$ -axis and the number of steps required to reach a regret threshold of $R = 1.0$ on the $y$ -axis. Following our experience, this corresponds approximately to the regret that has to be reached in simulation to allow stabilization on the real system. We emphasize that the intended use case of MetaBO is on systems inside of the training distribution marked in red, as this distribution is chosen such that the true parameters are located inside of it with high confidence when taking into account the measurement uncertainty. Note that for small $f$ the system becomes very hard to stabilize (lightweight and short pendula) such that the optimization landscape differs significantly from the training distribution, which is why the regret threshold cannot be reached within 30 steps for $f \leq 0.5$ .
+
+
+Figure 12: Performance on three global optimization benchmark functions with random translations sampled uniformly from $[-0.1, 0.1]^D$ and scalings from [0.9, 1.1]. To test TAF's performance, we randomly picked $M$ source tasks from this function class and evaluated both the ranking-based version (TAF-R-M) and the mixture-of-experts version (TAF-ME-M). We show results for $M \in \{20, 50\}$ . Note that TAF's performance does not necessarily increase with more source data. We trained MetaBO on the same set of source tasks as TAF-50 (MetaBO-50). In contrast to TAF, MetaBO can also be trained without manually restricting the set of available source tasks. The corresponding results are labelled "MetaBO". MetaBO outperformed EI by clear margin, especially in early stages of the optimization. After few steps used to identify the specific instance of the objective function, MetaBO also outperforms both flavors of TAF over wide ranges of the optimization budget.
+
+
+Figure 13: Performance on a simulation-to-real task (cf. text). MetaBO and TAF used source data from a cheap numerical simulation. (a) Performance on an extended training set in simulation. (b) Transfer to the hardware depicted in (c), averaged over ten BO runs. MetaBO learned robust neural AFs with very strong early-time performance and online adaption to the target objectives, which reliably yielded stabilizing controllers after less than ten BO iterations while TAF-ME-50, TAF-ME-100, TAF-R-50, TAF-R-100, and EI explore too heavily. Comparing the results for MetaBO and MetaBO-50 in simulation, we observe that MetaBO benefits from its ability to learn from the whole set of available source data, while TAF's applicability is restricted to a comparably small number of source tasks.
+
+# B.1 GENERAL IMPLEMENTATION DETAILS
+
+In what follows, we explain all hyperparameters used in our experiments and summarize them in Tab. 4. We emphasize that we used the same MetaBO hyperparameters for all our experiments, making our method easily applicable in practice.
+
+Gaussian Process Surrogate Models We used the implementation GPy (GPy, 2012) with squared-exponential kernels (Matern-5/2 kernels for the corresponding experiments on general function classes) with automatic relevance determination and a Gaussian noise model and tuned the corresponding hyperparameters (noise variance, kernel lengthscales, kernel signal variance) offline by fitting a GP to the objective functions in the training and test sets using type-2 maximum likelihood. We also used the resulting hyperparameters for the source GPs of TAF. We emphasize that our method is fully compatible with other (online) hyperparameter optimization techniques, which we did not use in our experiments to arrive at a consistent and fair comparison with as few confounding factors as possible.
+
+Baseline AFs As is standard, we used the parameter-free version of EI. For TAF, we follow Wistuba et al. (2018) and evaluate both the ranking-based (TAF-R) as well as the product-of-experts (TAF-ME) versions. We detail the specific choices for the number of source tasks $M$ and the number of datapoints $N_{\mathrm{TAF}}$ contained in each source GP in the main part of this paper.
+
+For EI we used the midpoint of the optimization domain $\mathcal{D}$ as initial design. For TAF we did not use an initial design as it utilizes the information contained in the source tasks to warmstart BO. Note that MetaBO also works without any initial design.
+
+**Maximization of the AFs** Our method is fully compatible with any state-of-the-art method for maximizing AFs. In particular our neural AFs can be optimized using gradient-based techniques. We chose to switch off any confounding factors related to AF maximization and used a hierarchical gridding approach for all evaluations as well as during training of MetaBO. For the experiments with continuous domains $\mathcal{D}$ , i.e. all experiments except the HPO task, we first put a multistart Sobol grid with $N_{\mathrm{MS}}$ points over the whole optimization domain and evaluated the AF on this grid. Afterwards, we implemented local searches from the $k$ maximal evaluations via centering $k$ local Sobol grids with $N_{\mathrm{LS}}$ points, each spanning approximately one "unit cell" of the multistart grid, around the $k$ maximal evaluations. The AF maximum is taken to be the maximal evaluation of the AF on these $k$ Sobol grids. For the HPO task, the AF maximum can be determined exactly because the domain is discrete.
+
+Reinforcement Learning Method We use the trust-region policy gradient method Proximal Policy Optimization (PPO) (Schulman et al., 2017) as the algorithm to train the neural AF.
+
+Table 4: Parameters of the MetaBO framework used in our experiments.
+
+| Description | Value in experiments |
| BO/AF parameters |
| Cardinality NMS of multistart grid | |
| Branin, Goldstein-Price | 1000 |
| Hartmann-3 | 2000 |
| Simulation-to-real | 10000 |
| GPs (D=1,2,3,4,5) | 500, 1000, 2000, 3000, 4000 |
| Cardinality NLS of local search grid | NMS |
| Number k of multistarts | 5 |
| MetaBO parameters |
| Cardinality of ξglobal | NMS |
| Cardinality of ξlocal,t | k |
| Neural AF architecture | 200 - 200 - 200 - 200, relu activations |
| PPO parameters (Schulman et al., 2017) |
| Batch size | 1200 |
| Number of epochs | 4 |
| Number of minibatches | 20 |
| Adam learning rate | 1 · 10-4 |
| CPI-loss clipping parameter | 0.15 |
| Value network architecture | 200 - 200 - 200 - 200, relu activations |
| Value coefficient in loss function | 1.0 |
| Entropy coefficient in loss function | 0.01 |
| Discount factor γ | 0.98 |
| GAE-λ (Schulman et al., 2015) | 0.98 |
+
+Reward Function If the true maximum of the objective functions is not known at training time, we compute $R_{t}$ with respect to an approximate maximum and define the reward to be given by $r_t \equiv -R_t$ . This is the case for the experiment on general function classes (GP samples) where we used grid search to approximate the maximum as well as for the simulation-to-real task on the Furuta pendulum where we used the performance of a linear quadratic regulator (LQR) controller as an approximate maximum. For the experiments on the global optimization benchmark functions as well as on the HPO tasks, we do know the exact value of the global optimum. In these cases, we use a logarithmic transformation of the simple regret, i.e., $r_t \equiv -\log_{10} R_t$ as the reward signal. Note that we also consistently plot the logarithmic simple regret in our evaluations for these cases.
+
+Neural AF Architecture We used multi-layer perceptrons with relu-activation functions and four hidden layers with 200 units each to represent the neural AFs.
+
+Value Function Network To reduce the variance of the gradient estimates for PPO, a value function $V_{\pi}(s_t)$ , i.e., an estimator for the expected cumulative reward from state $s_t$ , can be employed (Schulman et al., 2015). In this context, the optimization step $t$ and the budget $T$ are particularly informative features, as for a given sampling strategy on a given function class they allow quite reliable predictions of future regrets. Thus, we propose to use a separate neural network to learn a value function of the form $V_{\pi}(s_t) = V_{\pi}(t,T)$ . We used an MLP with relu-activations and four hidden layers with 200 units each for the value network.
+
+Computation Time For training MetaBO, we employed ten parallel CPU-workers to record the data batches and one GPU to perform the policy updates. Depending on the complexity of the objective function evaluations, training a neural AF for a given function class took between approximately $30\mathrm{min}$ and $10\mathrm{h}$ on this moderately complex architecture.
\ No newline at end of file
diff --git a/metalearningacquisitionfunctionsfortransferlearninginbayesianoptimization/images.zip b/metalearningacquisitionfunctionsfortransferlearninginbayesianoptimization/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..ae9c404c5839c113ad5a638b8204ec46ebbeef67
--- /dev/null
+++ b/metalearningacquisitionfunctionsfortransferlearninginbayesianoptimization/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:020c572509624fc52ca9dc2f1e20d6ecedfe2ba40ccf728e44a00bb8954327d3
+size 879177
diff --git a/metalearningacquisitionfunctionsfortransferlearninginbayesianoptimization/layout.json b/metalearningacquisitionfunctionsfortransferlearninginbayesianoptimization/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..b1802d7a0523b05124ebd5432236229ef6145acd
--- /dev/null
+++ b/metalearningacquisitionfunctionsfortransferlearninginbayesianoptimization/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a0fd8fe2fb578ae054e956b81b6b36b2f6d7b70dae249ebfd01fcb4cdd57d99b
+size 751894
diff --git a/metalearningwithoutmemorization/0abc3f45-93bc-4970-9a66-50af5721a91b_content_list.json b/metalearningwithoutmemorization/0abc3f45-93bc-4970-9a66-50af5721a91b_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..f3d92c3c6ee384b2a1728bf369d7f7ca7afe9d4f
--- /dev/null
+++ b/metalearningwithoutmemorization/0abc3f45-93bc-4970-9a66-50af5721a91b_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ce18a5c799b3fe8812bb54cec9957b1c76ba313db09ad9ab2fdaf1e6fcf9145e
+size 133942
diff --git a/metalearningwithoutmemorization/0abc3f45-93bc-4970-9a66-50af5721a91b_model.json b/metalearningwithoutmemorization/0abc3f45-93bc-4970-9a66-50af5721a91b_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..57ea3f5930d5a7fff857c0b3b5cd31beadf66c67
--- /dev/null
+++ b/metalearningwithoutmemorization/0abc3f45-93bc-4970-9a66-50af5721a91b_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:fcd4495208e5103a541d2448485255675e1beea09cf8f136de1ed9a7b1fb5fe1
+size 157192
diff --git a/metalearningwithoutmemorization/0abc3f45-93bc-4970-9a66-50af5721a91b_origin.pdf b/metalearningwithoutmemorization/0abc3f45-93bc-4970-9a66-50af5721a91b_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..d33840d048a9cf6a780b7c85585b12b69261c3c5
--- /dev/null
+++ b/metalearningwithoutmemorization/0abc3f45-93bc-4970-9a66-50af5721a91b_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e25db30b23b8cfc71dad2a2e42481b395e522b14d99e5e4015edabd21567607b
+size 2095202
diff --git a/metalearningwithoutmemorization/full.md b/metalearningwithoutmemorization/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..fb81247639348d33ea9a73322bb186c9095eeb5e
--- /dev/null
+++ b/metalearningwithoutmemorization/full.md
@@ -0,0 +1,522 @@
+# META-LEARNING WITHOUT MEMORIZATION
+
+Mingzhang Yin $^{12}$ , George Tucker $^{2}$ , Mingyuan Zhou $^{1}$ , Sergey Levine $^{23}$ , Chelsea Finn $^{24}$
+
+mzyin@utexas.edu, gjt@google.com, mingyuan.zhou@mccombs.utexas.edu
+svlevine@eecs.berkeley.edu, cbfinn@cs.stanford.edu
+
+1UT Austin, 2Google Research, Brain team, 3UC Berkeley, 4Stanford
+
+# ABSTRACT
+
+The ability to learn new concepts with small amounts of data is a critical aspect of intelligence that has proven challenging for deep learning methods. Meta-learning has emerged as a promising technique for leveraging data from previous tasks to enable efficient learning of new tasks. However, most meta-learning algorithms implicitly require that the meta-training tasks be mutually-exclusive, such that no single model can solve all of the tasks at once. For example, when creating tasks for few-shot image classification, prior work uses a per-task random assignment of image classes to N-way classification labels. If this is not done, the meta-learner can ignore the task training data and learn a single model that performs all of the meta-training tasks zero-shot, but does not adapt effectively to new image classes. This requirement means that the user must take great care in designing the tasks, for example by shuffling labels or removing task identifying information from the inputs. In some domains, this makes meta-learning entirely inapplicable. In this paper, we address this challenge by designing a meta-regularization objective using information theory that places precedence on data-driven adaptation. This causes the meta-learner to decide what must be learned from the task training data and what should be inferred from the task testing input. By doing so, our algorithm can successfully use data from non-mutually-exclusive tasks to efficiently adapt to novel tasks. We demonstrate its applicability to both contextual and gradient-based meta-learning algorithms, and apply it in practical settings where applying standard meta-learning has been difficult. Our approach substantially outperforms standard meta-learning algorithms in these settings.
+
+# 1 INTRODUCTION
+
+The ability to learn new concepts and skills with small amounts of data is a critical aspect of intelligence that many machine learning systems lack. Meta-learning (Schmidhuber, 1987) has emerged as a promising approach for enabling systems to quickly learn new tasks by building upon experience from previous related tasks (Thrun & Pratt, 2012; Koch et al., 2015; Santoro et al., 2016; Ravi & Larochelle, 2016; Finn et al., 2017). Meta-learning accomplishes this by explicitly optimizing for few-shot generalization across a set of meta-training tasks. The meta-learner is trained such that, after being presented with a small task training set, it can accurately make predictions on test datapoints for that meta-training task.
+
+While these methods have shown promising results, current methods require careful design of the meta-training tasks to prevent a subtle form of task overfitting, distinct from standard overfitting in supervised learning. If the task can be accurately inferred from the test input alone, then the task training data can be ignored while still achieving low meta-training loss. In effect, the model will collapse to one that makes zero-shot decisions. This presents an opportunity for overfitting where the meta-learner generalizes on meta-training tasks, but fails to adapt when presented with training data from novel tasks. We call this form of overfitting the memorization problem in meta-learning because the meta-learner memorizes a function that solves all of the meta-training tasks, rather than learning to adapt.
+
+Existing meta-learning algorithms implicitly resolve this problem by carefully designing the metatraining tasks such that no single model can solve all tasks zero-shot; we call tasks constructed in this
+
+way mutually-exclusive. For example, for $N$ -way classification, each task consists of examples from $N$ randomly sampled classes. The $N$ classes are labeled from 1 to $N$ , and critically, for each task, we randomize the assignment of classes to labels $\{1,2,\dots,N\}$ (visualized in Appendix Figure 3). This ensures that the task-specific class-to-label assignment cannot be inferred from a test input alone. However, the mutually-exclusive tasks requirement places a substantial burden on the user to cleverly design the meta-training setup (e.g., by shuffling labels or omitting goal information). While shuffling labels provide a reasonable mechanism to force tasks to be mutually-exclusive with standard few-shot image classification datasets such as MiniImageNet (Ravi & Larochelle, 2016), this solution cannot be applied to all domains where we would like to utilize meta-learning. For example, consider meta-learning a pose predictor that can adapt to different objects: even if $N$ different objects are used for meta-training, a powerful model can simply learn to ignore the training set for each task, and directly learn to predict the pose of each of the $N$ objects. However, such a model would not be able to adapt to new objects at meta-test time.
+
+The primary contributions of this work are: 1) to identify and formalize the memorization problem in meta-learning, and 2) to propose a meta-regularizer (MR) using information theory as a general approach for mitigating this problem without placing restrictions on the task distribution. We formally differentiate the meta-learning memorization problem from overfitting problem in conventional supervised learning, and empirically show that naive applications of standard regularization techniques do not solve the memorization problem in meta-learning. The key insight of our meta-regularization approach is that the model acquired when memorizing tasks is more complex than the model that results from task-specific adaptation because the memorization model is a single model that simultaneously performs well on all tasks. It needs to contain all information in its weights needed to do well on test points without looking at training points. Therefore we would expect the information content of the weights of a memorization model to be larger, and hence the model should be more complex. As a result, we propose an objective that regularizes the information complexity of the meta-learned function class (motivated by Alemi et al. (2016); Achille & Soatto (2018)). Furthermore, we show that meta-regularization in MAML can be rigorously motivated by a PAC-Bayes bound on generalization. In a series of experiments on non-mutually-exclusive task distributions entailing both few-shot regression and classification, we find that memorization poses a significant challenge for both gradient-based (Finn et al., 2017) and contextual (Garnelo et al., 2018a) meta-learning methods, resulting in near random performance on test tasks in some cases. Our meta-regularization approach enables both of these methods to achieve efficient adaptation and generalization, leading to substantial performance gains across the board on non-mutually-exclusive tasks.
+
+# 2 PRELIMINARIES
+
+We focus on the standard supervised meta-learning problem (see, e.g., Finn et al. (2017)). Briefly, we assume tasks $\mathcal{T}_i$ are sampled from a task distribution $p(\mathcal{T})$ . During meta-training, for each task, we observe a set of training data $\mathcal{D}_i = (\boldsymbol{x}_i, \boldsymbol{y}_i)$ and a set of test data $\mathcal{D}_i^* = (\boldsymbol{x}_i^*, \boldsymbol{y}_i^*)$ with $\boldsymbol{x}_i = (x_{i1}, \ldots, x_{iK}), \boldsymbol{y}_i = (y_{i1}, \ldots, y_{iK})$ sampled from $p(x, y | \mathcal{T}_i)$ , and similarly for $\mathcal{D}_i^*$ . We denote the entire meta-training set as $\mathcal{M} = \{\mathcal{D}_i, \mathcal{D}_i^*\}_{i=1}^N$ . The goal of meta-training is to learn a model for a new task $\mathcal{T}$ by leveraging what is learned during meta-training and a small amount of training data for the new task $\mathcal{D}$ . We use $\theta$ to denote the meta-parameters learned during meta-training and use $\phi$ to denote the task-specific parameters that are computed based on the task training data.
+
+Following Grant et al. (2018); Gordon et al. (2018), given a meta-training set $\mathcal{M}$ , we consider meta-learning algorithms that maximize conditional likelihood $q(\hat{y}^{*} = y^{*}|x^{*},\theta ,\mathcal{D})$ , which is composed of three distributions: $q(\theta |\mathcal{M})$ that summarizes meta-training data into a distribution on metaparameters, $q(\phi |\mathcal{D},\theta)$ that summarizes the per-task training set into a distribution on task-specific parameters, and $q(\hat{y}^{*}|x^{*},\phi ,\theta)$ that is the predictive distribution. These distributions are learned to minimize
+
+$$
+- \frac {1}{N} \sum_ {i} \mathbb {E} _ {q (\theta | \mathcal {M}) q (\phi | \mathcal {D} _ {i}, \theta)} \left[ \frac {1}{K} \sum_ {\left(x ^ {*}, y ^ {*}\right) \in \mathcal {D} _ {i} ^ {*}} \log q \left(\hat {y} ^ {*} = y ^ {*} \mid x ^ {*}, \phi , \theta\right) \right]. \tag {1}
+$$
+
+For example, in MAML (Finn et al., 2017), $\theta$ and $\phi$ are the weights of a predictor network, $q(\theta | \mathcal{M})$ is a delta function learned over the meta-training data, $q(\phi | \mathcal{D}, \theta)$ is a delta function centered at a point defined by gradient optimization, and $\phi$ parameterizes the predictor network $q(\hat{y}^* | x^*, \phi)$ (Grant et al., 2018). In particular, to determine the task-specific parameters $\phi$ , the task training data $\mathcal{D}$ and $\theta$ are used in the predictor model $\phi = \theta + \frac{\alpha}{K} \sum_{(x,y) \in \mathcal{D}} \nabla_{\theta} \log q(y|x, \phi = \theta)$ .
+
+Another family of meta-learning algorithms are contextual methods (Santoro et al., 2016), such as conditional neural processes (CNP) (Garnelo et al., 2018b;a). CNP instead defines $q(\phi | \mathcal{D}, \theta)$ as a mapping from $\mathcal{D}$ to a summary statistic $\phi$ (parameterized by $\theta$ ). In particular, $\phi = a_{\theta} \circ h_{\theta}(\mathcal{D})$ is the output of an aggregator $a_{\theta}(\cdot)$ applied to features $h_{\theta}(\mathcal{D})$ extracted from the task training data. Then $\theta$ parameterizes a predictor network that takes $\phi$ and $x^{*}$ as input and produces a predictive distribution $q(\hat{y}^{*} | x^{*}, \phi, \theta)$ .
+
+In the following sections, we describe a common pitfall for a variety of meta-learning algorithms, including MAML and CNP, and a general meta-regularization approach to prevent this pitfall.
+
+# 3 THE MEMORIZATION PROBLEM IN META-LEARNING
+
+The ideal meta-learning algorithm will learn in such a way that generalizes to novel tasks. However, we find that unless tasks are carefully designed, current meta-learning algorithms can overfit to the tasks and end up ignoring the task training data (i.e., either $q(\phi | \mathcal{D}, \theta)$ does not depend on $\mathcal{D}$ or $q(\hat{y}^* | x^*, \phi, \theta)$ does not depend on $\phi$ , as shown in Figure 1), which can lead to poor generalization. This memorization phenomenon is best understood through examples.
+
+Consider a 3D object pose prediction problem (illustrated in Figure 1), where each object has a fixed canonical pose. The $(x,y)$ pairs for the task are 2D grey-scale images of the rotated object $(x)$ and the rotation angle relative to the fixed canonical pose for that object $(y)$ . In the most extreme case, for an unseen object, the task is impossible without using $\mathcal{D}$ because the canonical pose for the unseen object is unknown. The number of objects in the meta-training dataset is small, so it is straightforward for a single network to memorize the canonical pose for each training object and to infer the object from the input image (i.e., task overfitting), thus achieving a low training error without using $\mathcal{D}$ . However, by construction, this solution will necessarily have poor generalization to test tasks with unseen objects.
+
+As another example, imagine an automated medical prescription system that suggests medication prescriptions to doctors based on patient symptoms and the patient's previous record of prescription responses (i.e., medical history) for adaptation. In the meta-learning framework, each patient represents a separate task. Here, the symptoms and prescriptions have a close relationship, so we cannot assign random prescriptions to symptoms, in contrast to the classification tasks where we can randomly shuffle the labels to create mutually-exclusiveness. For this non-mutually-exclusive task distribution, a standard meta-learning system can memorize the patients' identity information in the training, leading it to ignore the medical history and only utilize the symptoms combined with the memorized information. As a result, it may issue highly accurate prescriptions on the meta-training set, but fail to adapt to new patients effectively. While such a system would achieve a baseline level of accuracy for new patients, it would be no better than a standard supervised learning method applied to the pooled data.
+
+We formally define (complete) memorization as:
+
+Definition 1 (Complete Meta-Learning Memorization). Complete memorization in meta-learning is when the learned model ignores the task training data such that $I(\hat{y}^{*};\mathcal{D}|x^{*},\theta) = 0$ (i.e., $q(\hat{y}^{*}|x^{*},\theta ,\mathcal{D}) = q(\hat{y}^{*}|x^{*},\theta) = \mathbb{E}_{\mathcal{D}'|x^*}[q(\hat{y}^* |x^*,\theta ,\mathcal{D}')]$ ).
+
+Memorization describes an issue with overfitting the meta-training tasks, but it does not preclude the network from generalizing to unseen $(x,y)$ pairs on the tasks similar to the training tasks. Memorization becomes an undesired problem for generalization to new tasks when $I(y^{*};\mathcal{D}|x^{*})\gg I(\hat{y}^{*};\mathcal{D}|x^{*},\theta)$ (i.e., the task training data is necessary to achieve good performance, even with exact inference under the data generating distribution, to make accurate predictions).
+
+A model with the memorization problem may generalize to new datapoints in training tasks but cannot generalize to novel tasks, which distinguishes it from typical overfitting in supervised learning. In practice, we find that MAML and CNP frequently converge to this memorization solution (Table 2). For MAML, memorization can occur when a particular setting of $\theta$ that does not adapt to the task training data can achieve comparable meta-training error to a solution that adapts $\theta$ . For example, if a setting of $\theta$ can solve all of the meta-training tasks (i.e., for all $(x,y)$ in $\mathcal{D}$ and $\mathcal{D}^*$ the predictive error is close to zero), the optimization may converge to a stationary point of the MAML objective where minimal adaptation occurs based on the task training set (i.e., $\phi \approx \theta$ ). For a novel task where it is necessary to use the task training data, MAML can in principle still leverage the task training data because the adaptation step is based on gradient descent. However, in practice, the
+
+poor initialization of $\theta$ can affect the model's ability to generalize from a small amount of data. For CNP, memorization can occur when the predictive distribution network $q(\hat{y}^{*}|x^{*},\phi ,\theta)$ can achieve low training error without using the task training summary statistics $\phi$ . On a novel task, the network is not trained to use $\phi$ , so it is unable to use the information extracted from the task training set to effectively generalize.
+
+In some problem domains, the memorization problem can be avoided by carefully constructing the tasks. For example, for $N$ -way classification, each task consists of examples from $N$ randomly sampled classes. If the classes are assigned to a random permutation of $N$ for each task, this ensures that the task-specific class-to-label assignment cannot be inferred from the test inputs alone. As a result, a model that ignores the task training data cannot achieve low training error, preventing convergence to the memorization problem. We refer to tasks constructed in this way as mutually-exclusive. However, the mutually-exclusive tasks requirement places a substantial burden on the user to cleverly design the meta-training setup (e.g., by shuffling labels or omitting goal information) and cannot be applied to all domains where we would like to utilize meta-learning.
+
+
+Figure 1: Left: An example of non-mutually-exclusive pose prediction tasks, which may lead to the memorization problem. The training tasks are non-mutually-exclusive because the test data label (right) can be inferred accurately without using task training data (left) in the training tasks, by memorizing the canonical orientation of the meta-training objects. For a new object and canonical orientation (bottom), the task cannot be solved without using task training data (bottom left) to infer the canonical orientation. Right: Graphical model for meta-learning. Observed variables are shaded. Without either one of the dashed arrows, $\hat{Y}^*$ is conditionally independent of $\mathcal{D}$ given $\theta$ and $X^{*}$ , which we refer to as complete memorization (Definition 1).
+
+
+
+# 4 META REGULARIZATION USING INFORMATION THEORY
+
+At a high level, the sources of information in the predictive distribution $q(\hat{y}^{*}|x^{*},\theta ,\mathcal{D})$ come from the input, the meta-parameters, and the data. The memorization problem occurs when the model encodes task information in the predictive network that is readily available from the task training set (i.e., it memorizes the task information for each meta-training task). We could resolve this problem by encouraging the model to minimize the training error and to rely on the task training dataset as much as possible for the prediction of $y^{*}$ (i.e., to maximize $I(\hat{y}^{*};\mathcal{D}|x^{*},\theta)$ ). Explicitly maximizing $I(\hat{y}^{*};\mathcal{D}|x^{*},\theta)$ requires an intractable marginalization over task training sets to compute $q(\hat{y}^{*}|x^{*},\theta)$ . Instead, we can implicitly encourage it by restricting the information flow from other sources ( $x^{*}$ and $\theta$ ) to $\hat{y}^*$ . To achieve both low error and low mutual information between $\hat{y}^*$ and $(x^{*},\theta)$ , the model must use task training data $\mathcal{D}$ to make predictions, hence increasing the mutual information $I(\hat{y}^{*};\mathcal{D}|x^{*},\theta)$ , leading to reduced memorization. In this section, we describe two tractable ways to achieve this.
+
+# 4.1 META REGULARIZATION ON ACTIVATIONS
+
+Given $\theta$ , the statistical dependency between $x^{*}$ and $\hat{y}^{*}$ is controlled by the direct path from $x^{*}$ to $\hat{y}^{*}$ and the indirect path through $\mathcal{D}$ (see Figure 1), where the latter is desirable because it leverages the task training data. We can control the information flow between $x^{*}$ and $\hat{y}^{*}$ by introducing an intermediate stochastic bottleneck variable $z^{*}$ such that $q(\hat{y}^{*}|x^{*},\phi ,\theta) = \int q(\hat{y}^{*}|z^{*},\phi ,\theta)q(z^{*}|x^{*},\theta)dz^{*}$ (Alemi et al., 2016) as shown in Figure 4. Now, we would like
+
+to maximize $I(\hat{y}^{*};\mathcal{D}|z^{*},\theta)$ to prevent memorization. We can bound this mutual information by
+
+$$
+\begin{array}{l} I (\hat {y} ^ {*}; \mathcal {D} | z ^ {*}, \theta) \\ \geq I \left(x ^ {*}; \hat {y} ^ {*} | \theta , z ^ {*}\right) = I \left(x ^ {*}; \hat {y} ^ {*} | \theta\right) - I \left(x ^ {*}; z ^ {*} | \theta\right) + I \left(x ^ {*}; z ^ {*} | \hat {y} ^ {*}, \theta\right) \\ \geq I \left(x ^ {*}; \hat {y} ^ {*} | \theta\right) - I \left(x ^ {*}; z ^ {*} | \theta\right) \\ = I \left(x ^ {*}; \hat {y} ^ {*} | \theta\right) - \mathbb {E} _ {p \left(x ^ {*}\right) q \left(z ^ {*} \mid x ^ {*}, \theta\right)} \left[ \log \frac {q \left(z ^ {*} \mid x ^ {*} , \theta\right)}{q \left(z ^ {*} \mid \theta\right)} \right] \\ \geq I \left(x ^ {*}; \hat {y} ^ {*} | \theta\right) - \mathbb {E} \left[ \log \frac {q \left(z ^ {*} \mid x ^ {*} , \theta\right)}{r \left(z ^ {*}\right)} \right] = I \left(x ^ {*}; \hat {y} ^ {*} | \theta\right) - \mathbb {E} \left[ D _ {\mathrm {K L}} \left(q \left(z ^ {*} \mid x ^ {*}, \theta\right) \mid r \left(z ^ {*}\right)\right) \right] \tag {2} \\ \end{array}
+$$
+
+where $r(z^{*})$ is a variational approximation to the marginal, the first inequality follows from the statistical dependencies in our model (see Figure 4 and Appendix A.2 for the proof). By simultaneously minimizing $\mathbb{E}\left[D_{\mathrm{KL}}(q(z^{*}|x^{*},\theta)||r(z^{*}))\right]$ and maximizing the mutual information $I(x^{*};\hat{y}^{*}|\theta)$ , we can implicitly encourage the model to use the task training data $\mathcal{D}$ .
+
+For non-mutually-exclusive problems, the true label $y^{*}$ is dependent on $x^{*}$ . If the model has the memorization problem and $I(x^{*};\hat{y}^{*}|\theta) = 0$ , then $q(\hat{y}^{*}|x^{*},\theta ,\mathcal{D}) = q(\hat{y}^{*}|x^{*},\theta) = q(\hat{y}^{*}|\theta)$ , which means the model predictions do not depend on $x^{*}$ or $\mathcal{D}$ . Hence, in practical problems, the predictions generated from the model will have low accuracy.
+
+This suggests minimizing the training loss in Eq. (1) can increase $I(\hat{y}^{*};\mathcal{D}|x^{*},\theta)$ or $I(x^{*};\hat{y}^{*}|\theta)$ . Replacing the maximization of $I(x^{*};\hat{y}^{*}|\theta)$ in Eq. (2) with minimizing the training loss results in the following regularized training objective
+
+$$
+\frac {1}{N} \sum_ {i} \mathbb {E} _ {q (\theta | \mathcal {M}) q (\phi | \mathcal {D} _ {i}, \theta)} \left[ - \frac {1}{K} \sum_ {\left(x ^ {*}, y ^ {*}\right) \in \mathcal {D} _ {i} ^ {*}} \log q \left(\hat {y} ^ {*} = y ^ {*} \mid x ^ {*}, \phi , \theta\right) + \beta D _ {\mathrm {K L}} \left(q \left(z ^ {*} \mid x ^ {*}, \theta\right) \mid r \left(z ^ {*}\right)\right) \right] \tag {3}
+$$
+
+where $\log q(\hat{y}^* | x^*, \phi, \theta)$ is estimated by $\log q(\hat{y}^* | z^*, \phi, \theta)$ with $z^* \sim q(z^* | x^*, \theta)$ , $\beta$ modulates the regularizer and $r(z^*)$ can be set as $\mathcal{N}(z^*; 0, I)$ . We refer to this regularizer as meta-regularization (MR) on the activations.
+
+As we demonstrate in Section 6, we find that this regularizer performs well, but in some cases can fail to prevent the memorization problem. Our hypothesis is that in these cases, the network can sidestep the information constraint by storing the prediction of $y^{*}$ in a part of $z^{*}$ , which incurs a small penalty in Eq. (3) and small lower bound in Eq. (2).
+
+# 4.2 META REGULARIZATION ON WEIGHTS
+
+Alternatively, we can penalize the task information stored in the meta-parameters $\theta$ . Here, we provide an informal argument and provide the complete argument in Appendix A.3. Analogous to the supervised setting (Achille & Soatto, 2018), given meta-training dataset $\mathcal{M}$ , we consider $\theta$ as random variable where the randomness can be introduced by training stochasticity. We model the stochasticity over $\theta$ with a Gaussian distribution $\mathcal{N}(\theta; \theta_{\mu}, \theta_{\sigma})$ with learned mean and variance parameters per dimension (Blundell et al., 2015; Achille & Soatto, 2018). By penalizing $I(y_{1:N}^{*}, \mathcal{D}_{1:N}; \theta | x_{1:N}^{*})$ , we can limit the information about the training tasks stored in the meta-parameters $\theta$ and thus require the network to use the task training data to make accurate predictions. We can tractably upper bound it by
+
+$$
+I \left(y _ {1: N} ^ {*}, \mathcal {D} _ {1: N}; \theta \mid x _ {1: N} ^ {*}\right) = \mathbb {E} \left[ \log \frac {q (\theta \mid \mathcal {M})}{q (\theta \mid x _ {1 : N} ^ {*})} \right] \leq \mathbb {E} \left[ D _ {\mathrm {K L}} (q (\theta \mid \mathcal {M}) \| r (\theta)) \right], \tag {4}
+$$
+
+where $r(\theta)$ is a variational approximation to the marginal, which we set to $\mathcal{N}(\theta; 0, I)$ . In practice, we apply meta-regularization to the meta-parameters $\theta$ that are not used to adapt to the task training data and denote the other parameters as $\tilde{\theta}$ . In this way, we control the complexity of the network that can predict the test labels without using task training data, but we do not limit the complexity of the network that processes the task training data. Our final meta-regularized objective can be written as
+
+$$
+\frac {1}{N} \sum_ {i} \mathbb {E} _ {q (\theta ; \theta_ {\mu}, \theta_ {\sigma}) q (\phi | \mathcal {D} _ {i}, \tilde {\theta})} \left[ - \frac {1}{K} \sum_ {(x ^ {*}, y ^ {*}) \in \mathcal {D} _ {i} ^ {*}} \log q \left(\hat {y} ^ {*} = y ^ {*} \mid x ^ {*}, \phi , \theta , \tilde {\theta}\right) + \beta D _ {\mathrm {K L}} (q (\theta ; \theta_ {\mu}, \theta_ {\sigma}) | | r (\theta)) \right] \tag {5}
+$$
+
+For MAML, we apply meta-regularization to the parameters uninvolved in the task adaptation. For CNP, we apply meta-regularization to the encoder parameters. The detailed algorithms are shown in Algorithm 1 and 2 in the appendix.
+
+# 4.3 DOES META REGULARIZATION LEAD TO BETTER GENERALIZATION?
+
+Now that we have derived meta regularization approaches for mitigating the memorization problem, we theoretically analyze whether meta regularization leads to better generalization via a PAC-Bayes bound. In particular, we study meta regularization (MR) on the weights (W) of MAML, i.e. MR-MAML (W), as a case study.
+
+Meta regularization on the weights of MAML uses a Gaussian distribution $\mathcal{N}(\theta; \theta_{\mu}, \theta_{\sigma})$ to model the stochasticity in the weights. Given a task and task training data, the expected error is given by
+
+$$
+e r \left(\theta_ {\mu}, \theta_ {\sigma}, \mathcal {D}, \mathcal {T}\right) = \mathbb {E} _ {\theta \sim \mathcal {N} \left(\theta ; \theta_ {\mu}, \theta_ {\sigma}\right), \phi \sim q \left(\phi \mid \theta , \mathcal {D}\right), \left(x ^ {*}, y ^ {*}\right) \sim p (x, y \mid \mathcal {T})} \left[ \mathcal {L} \left(x ^ {*}, y ^ {*}, \phi\right) \right], \tag {6}
+$$
+
+where the prediction loss $\mathcal{L}(x^{*},y^{*},\phi_{i})$ is bounded1. Then, we would like to minimize the error on novel tasks
+
+$$
+e r \left(\theta_ {\mu}, \theta_ {\sigma}\right) = \mathbb {E} _ {\mathcal {T} \sim p (\mathcal {T}), \mathcal {D} \sim p (x, y | \mathcal {T})} \left[ e r \left(\theta_ {\mu}, \theta_ {\sigma}, \mathcal {D}, \mathcal {T}\right) \right] \tag {7}
+$$
+
+We only have a finite sample of training tasks, so computing $er(Q)$ is intractable, but we can form an empirical estimate:
+
+$$
+\begin{array}{l} \hat {e r} \left(\theta_ {\mu}, \theta_ {\sigma}, \mathcal {D} _ {1}, \mathcal {D} _ {1} ^ {*},..., \mathcal {D} _ {n}, \mathcal {D} _ {n} ^ {*}\right) \\ = \frac {1}{n} \sum_ {i = 1} ^ {n} \underbrace {\mathbb {E} _ {\theta \sim \mathcal {N} \left(\theta ; \theta_ {\mu} , \theta_ {\sigma}\right) , \phi_ {i} \sim q \left(\phi \mid \theta , \mathcal {D} _ {i}\right)} \left[ - \frac {1}{K} \sum_ {\left(x ^ {*}, y ^ {*}\right) \in \mathcal {D} _ {i} ^ {*}} \log q \left(\hat {y} ^ {*} = y ^ {*} \mid x ^ {*}, \phi_ {i}\right) \right]} _ {\hat {e r} \left(\theta_ {\mu}, \theta_ {\sigma}, \mathcal {D} _ {i}, \mathcal {D} _ {i} ^ {*}\right)} \tag {8} \\ \end{array}
+$$
+
+where for exposition we have assumed $|\mathcal{D}_i^*| = K$ are the same for all tasks. We would like to relate $\operatorname{er}(\theta_{\mu}, \theta_{\sigma})$ and $\hat{\operatorname{er}}(\theta_{\mu}, \theta_{\sigma}, \mathcal{D}_1, \mathcal{D}_1^*, \dots, \mathcal{D}_n, \mathcal{D}_n^*)$ , but the challenge is that $\theta_{\mu}$ and $\theta_{\sigma}$ are derived from the meta-training tasks $\mathcal{D}_1, \mathcal{D}_1^*, \dots, \mathcal{D}_n, \mathcal{D}_n^*$ . There are two sources of generalization error: (i) error due to the finite number of observed tasks and (ii) error due to the finite number of examples observed per task. Closely following the arguments in (Amit & Meir, 2018), we apply a standard PAC-Bayes bound to each of these and combine the results with a union bound, resulting in the following Theorem.
+
+Theorem 1. Let $P(\theta)$ be an arbitrary prior distribution over $\theta$ that does not depend on the metatraining data. Then for any $\delta \in (0,1]$ , with probability at least $1 - \delta$ , the following inequality holds uniformly for all choices of $\theta_{\mu}$ and $\theta_{\sigma}$ ,
+
+$$
+\begin{array}{l} e r \left(\theta_ {\mu}, \theta_ {\sigma}\right) \leq \frac {1}{n} \sum_ {i = 1} ^ {n} \hat {e} r \left(\theta_ {\mu}, \theta_ {\sigma}, \mathcal {D} _ {i}, \mathcal {D} _ {i} ^ {*}\right) + \\ \left(\sqrt {\frac {1}{2 (K - 1)}} + \sqrt {\frac {1}{2 (n - 1)}}\right) \sqrt {D _ {K L} \left(\mathcal {N} \left(\theta ; \theta_ {\mu} , \theta_ {\sigma}\right) \| P\right) + \log \frac {n (K + 1)}{\delta}}, \tag {9} \\ \end{array}
+$$
+
+where $n$ is the number of meta-training tasks and $K$ is the number of per-task validation datapoints.
+
+We defer the proof to the Appendix A.4. The key difference from the result in (Amit & Meir, 2018) is that we leverage the fact that the task training data is split into training and validation.
+
+In practice, we set $P(\theta) = r(\theta) = \mathcal{N}(\theta; 0, I)$ . If we can achieve a low value for the bound, then with high probability, our test error will also be low. As shown in the Appendix A.4, by a first order Taylor expansion of the second term of the RHS in Eq.(9) and setting the coefficient of the KL term as $\beta = \frac{\sqrt{1/2(K - 1)} + \sqrt{1/2(n - 1)}}{2\sqrt{\log n(K + 1)/\delta}}$ , we recover the MR-MAML(W) objective (Eq.(5)). $\beta$ trades-off between the tightness of the generalization bound and the probability that it holds true. The result of this bound suggests that the proposed meta-regularization on weights does indeed improve generalization on the meta-test set.
+
+# 5 RELATED WORK
+
+Previous works have developed approaches for mitigating various forms of overfitting in meta-learning. These approaches aim to improve generalization in several ways: by reducing the number of parameters that are adapted in MAML (Zintgraf et al., 2019), by compressing the task embedding (Lee et al., 2019), through data augmentation from a GAN (Zhang et al., 2018), by using an auxiliary objective on task gradients (Guiroy et al., 2019), and via an entropy regularization objective (Jamal & Qi, 2019). These methods all focus on the setting with mutually-exclusive task distributions. We instead recognize and formalize the memorization problem, a particular form of overfitting that manifests itself with non-mutually-exclusive tasks, and offer a general and principled solution. Unlike prior methods, our approach is applicable to both contextual and gradient-based meta-learning methods. We additionally validate that prior regularization approaches, namely TAML (Jamal & Qi, 2019), are not effective for addressing this problem setting.
+
+Our derivation uses a Bayesian interpretation of meta-learning (Tenenbaum, 1999; Fei-Fei et al., 2003; Edwards & Storkey, 2016; Grant et al., 2018; Gordon et al., 2018; Finn et al., 2018; Kim et al., 2018; Harrison et al., 2018). Some Bayesian meta-learning approaches place a distributional loss on the inferred task variables to constrain them to a prior distribution (Garnelo et al., 2018b; Gordon et al., 2018; Rakelly et al., 2019), which amounts to an information bottleneck on the latent task variables. Similarly Zintgraf et al. (2019); Lee et al. (2019); Guiroy et al. (2019) aim to produce simpler or more compressed task adaptation processes. Our approach does the opposite, penalizing information from the inputs and parameters, to encourage the task-specific variables to contain greater information driven by the per-task data.
+
+We use PAC-Bayes theory to study the generalization error of meta-learning and meta-regularization. Pentina & Lampert (2014) extends the single task PAC-Bayes bound (McAllester, 1999) to the multi-task setting, which quantifies the gap between empirical error on training tasks and the expected error on new tasks. More recent research shows that, with tightened generalization bounds as the training objective, the algorithms can reduce the test error for mutually-exclusive tasks (Galanti et al., 2016; Amit & Meir, 2018). Our analysis is different from these prior works in that we only include pre-update meta parameters in the generalization bound rather than both pre-update and post-update parameters. In the derivation, we also explicitly consider the splitting of data into the task training set and task validation set, which is aligned with the practical setting.
+
+The memorization problem differs from overfitting in conventional supervised learning in several aspects. First, memorization occurs at the task level rather than datapoint level and the model memorizes functions rather than labels. In particular, within a training task, the model can generalize to new datapoints, but it fails to generalize to new tasks. Second, the source of information for achieving generalization is different. For meta-learning the information is from both the meta-training data and new task training data but in standard supervised setting the information is only from training data. Finally, the aim of regularization is different. In the conventional supervised setting, regularization methods such as weight decay (Krogh & Hertz, 1992), dropout (Srivastava et al., 2014), the information bottleneck (Tishby et al., 2000; Tishby & Zaslavsky, 2015), and Bayes-by-Backprop (Blundell et al., 2015) are used to balance the network complexity and the information in the data. The aim of meta-regularization is different. It governs the model complexity to avoid one complex model solving all tasks, while allowing the model's dependency on the task data to be complex. We further empirically validate this difference, finding that standard regularization techniques do not solve the memorization problem.
+
+# 6 EXPERIMENTS
+
+In the experimental evaluation, we aim to answer the following questions: (1) How prevalent is the memorization problem across different algorithms and domains? (2) How does the memorization problem affect the performance of algorithms on non-mutually-exclusive task distributions? (3) Is our meta-regularization approach effective for mitigating the problem and is it compatible with multiple types of meta-learning algorithms? (4) Is the problem of memorization empirically distinct from that of the standard overfitting problem?
+
+To answer these questions, we propose several meta-learning problems involving non-mutually-exclusive task distributions, including two problems that are adapted from prior benchmarks with mutually-exclusive task distributions. We consider model-agnostic meta-learning (MAML) and conditional neural processes (CNP) as representative meta-learning algorithms. We study both variants
+
+of our method in combination with MAML and CNP. When comparing with meta-learning algorithms with and without meta-regularization, we use the same neural network architecture, while other hyperparameters are tuned via cross-validation per-problem.
+
+# 6.1 SINUSOID REGRESSION
+
+First, we consider a toy sinusoid regression problem that is non-mutually-exclusive. The data for each task is created in the following way: the amplitude $A$ of the sinusoid is uniformly sampled from a set of 20 equally-spaced points $\{0.1, 0.3, \dots, 4\}$ ; $u$ is sampled uniformly from $[-5, 5]$ and $y$ is sampled from $\mathcal{N}(A\sin(u), 0.1^2)$ . We provide both $u$ and the amplitude $A$ (as a one-hot vector) as input, i.e. $x = (u, A)$ . At the test time, we expand the range of the tasks by randomly sampling the data-generating amplitude $A$ uniformly from $[0.1, 4]$ and use a random one-hot vector for the input to the network. The meta-training tasks are a proper subset of the meta-test tasks.
+
+Without the additional amplitude input, both MAML and CNP can easily solve the task and generalize to the meta-test tasks. However, once we add the additional amplitude input which indicates the task identity, we find that both MAML and CNP converge to the complete memorization solution and fail to generalize well to test data (Table 1 and Appendix Figures 7 and 8). Both meta-regularized MAML and CNP (MR-MAML) and (MR-CNP) instead converge to a solution that adapts to the data, and as a result, greatly outperform the unregularized methods.
+
+Table 1: Test MSE for the non-mutually-exclusive sinusoid regression problem. We compare MAML and CNP against meta-regularized MAML (MR-MAML) and meta-regularized CNP (MR-CNP) where regularization is either on the activations (A) or the weights (W). We report the mean over 5 trials and the standard deviation in parentheses.
+
+| Methods | MAML | MR-MAML (A)
+(ours) | MR-MAML (W)
+(ours) | CNP | MR-CNP (A)
+(ours) | MR-CNP (W)
+(ours) |
| 5 shot | 0.46 (0.04) | 0.17 (0.03) | 0.16 (0.04) | 0.91 (0.10) | 0.10 (0.01) | 0.11 (0.02) |
| 10 shot | 0.13 (0.01) | 0.07 (0.02) | 0.06 (0.01) | 0.92 (0.05) | 0.09 (0.01) | 0.09 (0.01) |
+
+# 6.2 POSE PREDICTION
+
+To illustrate the memorization problem on a more realistic task, we create a multi-task regression dataset based on the Pascal 3D data (Xiang et al., 2014) (See Appendix A.5.1 for a complete description). We randomly select 50 objects for meta-training and the other 15 objects for meta-testing. For each object, we use MuJoCo (Todorov et al., 2012) to render images with random orientations of the instance on a table, visualized in Figure 1. For the meta-learning algorithm, the observation $(x)$ is the $128 \times 128$ gray-scale image and the label $(y)$ is the orientation relative to a fixed canonical pose. Because the number of objects in the meta-training dataset is small, it is straightforward for a single network to memorize the canonical pose for each training object and to infer the orientation from the input image, thus achieving a low meta-training error without using $\mathcal{D}$ . However, this solution performs poorly at the test time because it has not seen the novel objects and their canonical poses.
+
+Optimization modes and hyperparameter sensitivity. We choose the learning rate from $\{0.0001, 0.0005, 0.001\}$ for each method, $\beta$ from $\{10^{-6}, 10^{-5}, \dots, 1\}$ for meta-regularization and report the results with the best hyperparameters (as measured on the meta-validation set) for each method. In this domain, we find that the convergence point of the meta-learning algorithm is determined by both the optimization landscape of the objective and the training dynamics, which vary due to stochastic gradients and the random initialization. In particular, we observe that there are two modes of the objective, one that corresponds to complete memorization and one that corresponds to successful adaptation to the task data. As illustrated in the Appendix, we find that models that converge to a memorization solution have lower training error than solutions which use the task training data, indicating a clear need for meta-regularization. When the meta-regularization is on the activations, the solution that the algorithms converge to depends on the learning rate, while MR on the weights consistently converges to the adaptation solution (See Appendix Figure 9 for the sensitivity analysis). This suggests that MR on the activations is not always successful at preventing memorization. Our hypothesis is that there exists a solution in which the bottlenecked activations encode only the prediction $y^{*}$ , and discard other information. Such a solution can achieve both low training MSE and low regularization loss without using task training data, particularly if the predicted label contains a small number of bits (i.e., because the activations will have low information complexity).
+
+However, note that this solution does not achieve low regularization error when applying MR to the weights because the function needed to produce the predicted label does not have low information complexity. As a result, meta-regularization on the weights does not suffer from this pathology and is robust to different learning rates. Therefore, we will use regularization on weights as the proposed methodology in the following experiments and algorithms in Appendix A.1.
+
+Quantitative results. We compare MAML and CNP with their meta-regularized versions (Table 2). We additionally include fine-tuning as baseline, which trains a single network on all the instances jointly, and then fine-tunes on the task training data. Meta-learning with meta-regularization (on weights) outperforms all competing methods by a large margin. We show test error as a function of the meta-regularization coefficient $\beta$ in Appendix Figure 2. The curve reflects the trade-off when changing the amount of information contained in the weights. This indicates that $\beta$ gives a knob that allows us to tune the degree to which the model uses the data to adapt versus relying on the prior.
+
+
+Figure 2: The performance of MAML and CNP with meta-regularization on the weights, as a function of the regularization strength $\beta$ . We observe $\beta$ provides us a knob with which we can control the degree to which the algorithm adapts versus memorizes. When $\beta$ is small, we observe memorization, leading to large test error; when $\beta$ is too large, the network does not store enough information in the weights to perform the task. Crucially, in the middle of these two extremes, meta-regularization is effective in inducing adaptation, leading to good generalization. The plot shows the mean and standard deviation across 5 meta-training runs.
+
+
+
+Table 2: Meta-test MSE for the pose prediction problem. We compare MR-MAML (ours) with conventional MAML and fine-tuning (FT). We report the average over 5 trials and standard deviation in parentheses.
+
+| Method | MAML | MR-MAML (W) (ours) | CNP | MR-CNP (W) (ours) | FT | FT + Weight Decay |
| MSE | 5.39 (1.31) | 2.26 (0.09) | 8.48 (0.12) | 2.89 (0.18) | 7.33 (0.35) | 6.16 (0.12) |
+
+Comparison to standard regularization. We compare our meta-regularization with standard regularization techniques, weight decay (Krogh & Hertz, 1992) and Bayes-by-Backprop (Blundell et al., 2015), in Table 3. We observe that simply applying standard regularization to all the weights, as in conventional supervised learning, does not solve the memorization problem, which validates that the memorization problem differs from the standard overfitting problem.
+
+Table 3: Meta-testing MSE for the pose prediction problem. We compare MR-CNP (ours) with conventional CNP, CNP with weight decay, and CNP with Bayes-by-Backprop (BbB) regularization on all the weights. We report the average over 5 trials and standard deviation in parentheses.
+
+| Methods | CNP | CNP + Weight Decay | CNP + BbB | MR-CNP (W) (ours) |
| MSE | 8.48 (0.12) | 6.86 (0.27) | 7.73 (0.82) | 2.89 (0.18) |
+
+# 6.3 OMNIGLOT AND MINIIMAGENET CLASSIFICATION
+
+Next, we study memorization in the few-shot classification problem by adapting the few-shot Omniglot (Lake et al., 2011) and MiniImagenet (Ravi & Larochelle, 2016; Vinyals et al., 2016) bench-
+
+marks to the non-mutually-exclusive setting. In the non-mutually-exclusive N-way K-shot classification problem, each class is (randomly) assigned a fixed classification label from 1 to N. For each task, we randomly select a corresponding class for each classification label and $K$ task training data points and $K$ task test data points from that class $^2$ . This ensures that each class takes only one classification label across tasks and different tasks are non-mutually-exclusive (See Appendix A.5.2 for details).
+
+We evaluate MAML, TAML (Jamal & Qi, 2019), MR-MAML (ours), fine-tuning, and a nearest neighbor baseline on non-mutually-exclusive classification tasks (Table 4). We find that MR-MAML significantly outperforms previous methods on all of these tasks. To better understand the problem, for the MAML variants, we calculate the pre-update accuracy (before adaptation on the task training data) on the meta-training data in Appendix Table 5. The high pre-update meta-training accuracy and low meta-test accuracy are evidence of the memorization problem for MAML and TAML, indicating that it is learning a model that ignores the task data. In contrast, MR-MAML successfully controls the pre-update accuracy to be near chance and encourages the learner to use the task training data to achieve low meta-training error, resulting in good performance at meta-test time.
+
+Finally, we verify that meta-regularization does not degrade performance on the standard mutually-exclusive task. We evaluate performance as a function of regularization strength on the standard 20-way 1-shot Omniglot task (Appendix Figure 10), and we find that small values of $\beta$ lead to slight improvements over MAML. This indicates that meta-regularization substantially improves performance in the non-mutually-exclusive setting without degrading performance in other settings.
+
+Table 4: Meta-test accuracy on non-mutually-exclusive (NME) classification. The fine-tuning and nearest-neighbor baseline results for MiniImagenet are from (Ravi & Larochelle, 2016).
+
+| NME Omniglot | 20-way 1-shot | 20-way 5-shot |
| MAML | 7.8 (0.2)% | 50.7 (22.9)% |
| TAML (Jamal & Qi, 2019) | 9.6 (2.3)% | 67.9 (2.3)% |
| MR-MAML (W) (ours) | 83.3 (0.8)% | 94.1 (0.1)% |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
+
+# 7 CONCLUSION AND DISCUSSION
+
+Meta-learning has achieved remarkable success in few-shot learning problems. However, we identify a pitfall of current algorithms: the need to create task distributions that are mutually exclusive. This requirement restricts the domains that meta-learning can be applied to. We formalize the failure mode, i.e. the memorization problem, that results from training on non-mutually-exclusive tasks and distinguish it as a function-level overfitting problem compared to the standard label-level overfitting in supervised learning.
+
+We illustrate the memorization problem with different meta-learning algorithms on a number of domains. To address the problem, we propose an algorithm-agnostic meta-regularization (MR) approach that leverages an information-theoretic perspective of the problem. The key idea is that by placing a soft restriction on the information flow from meta-parameters in prediction of test set labels, we can encourage the meta-learner to use task training data during meta-training. We achieve this by successfully controlling the complexity of model prior to the task adaptation.
+
+The memorization issue is quite broad and is likely to occur in a wide range of real-world applications, for example, personalized speech recognition systems, learning robots that can adapt to different environments (Nagabandi et al., 2018), and learning goal-conditioned manipulation skills using trial-and-error data. Further, this challenge may also be prevalent in other conditional prediction problems, beyond meta-learning, an interesting direction for future study. By both recognizing the challenge of memorization and developing a general and lightweight approach for solving it, we believe that this work represents an important step towards making meta-learning algorithms applicable to and effective on any problem domain.
+
+# ACKNOWLEDGEMENT
+
+The authors would like to thank Alexander A. Alemi, Kevin Murphy, Luke Metz, Abhishek Kumar and the anonymous reviewers for helpful discussions and feedback. M. Yin and M. Zhou acknowledge the support of the U.S. National Science Foundation under Grant IIS-1812699.
+
+# REFERENCES
+
+Alessandro Achille and Stefano Soatto. Emergence of invariance and disentanglement in deep representations. The Journal of Machine Learning Research, 19(1):1947-1980, 2018.
+Alexander A Alemi, Ian Fischer, Joshua V Dillon, and Kevin Murphy. Deep variational information bottleneck. arXiv preprint arXiv:1612.00410, 2016.
+Ron Amit and Ron Meir. Meta-learning by adjusting priors based on extended pac-bayes theory. In International Conference on Machine Learning, pp. 205-214, 2018.
+Charles Blundell, Julien Cornebise, Koray Kavukcuoglu, and Daan Wierstra. Weight uncertainty in neural networks. arXiv preprint arXiv:1505.05424, 2015.
+Thomas M Cover and Joy A Thomas. Elements of information theory. John Wiley & Sons, 2012.
+Harrison Edwards and Amos Storkey. Towards a neural statistician. arXiv preprint arXiv:1606.02185, 2016.
+Li Fei-Fei et al. A bayesian approach to unsupervised one-shot learning of object categories. In Proceedings Ninth IEEE International Conference on Computer Vision, pp. 1134-1141. IEEE, 2003.
+Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 1126-1135. JMLR.org, 2017.
+Chelsea Finn, Kelvin Xu, and Sergey Levine. Probabilistic model-agnostic meta-learning. In Advances in Neural Information Processing Systems, pp. 9516-9527, 2018.
+Tomer Galanti, Lior Wolf, and Tamir Hazan. A theoretical framework for deep transfer learning. Information and Inference: A Journal of the IMA, 5(2):159-209, 2016.
+Marta Garnelo, Dan Rosenbaum, Chris J Maddison, Tiago Ramalho, David Saxton, Murray Shanahan, Yee Whye Teh, Danilo J Rezende, and SM Eslami. Conditional neural processes. arXiv preprint arXiv:1807.01613, 2018a.
+Marta Garnelo, Jonathan Schwarz, Dan Rosenbaum, Fabio Viola, Danilo J Rezende, SM Eslami, and Yee Whye Teh. Neural processes. arXiv preprint, 2018b.
+Jonathan Gordon, John Bronskill, Matthias Bauer, Sebastian Nowozin, and Richard E Turner. Meta-learning probabilistic inference for prediction. arXiv preprint arXiv:1805.09921, 2018.
+Erin Grant, Chelsea Finn, Sergey Levine, Trevor Darrell, and Thomas Griffiths. Recasting gradient-based meta-learning as hierarchical bayes. arXiv preprint arXiv:1801.08930, 2018.
+Simon Guiroy, Vikas Verma, and Christopher Pal. Towards understanding generalization in gradient-based meta-learning. arXiv preprint arXiv:1907.07287, 2019.
+James Harrison, Apoorva Sharma, and Marco Pavone. Meta-learning priors for efficient online bayesian regression. arXiv preprint arXiv:1807.08912, 2018.
+Muhammad Abdullah Jamal and Guo-Jun Qi. Task agnostic meta-learning for few-shot learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 11719-11727, 2019.
+Taesup Kim, Jaesik Yoon, Ousmane Dia, Sungwoong Kim, Yoshua Bengio, and Sungjin Ahn. Bayesian model-agnostic meta-learning. arXiv preprint arXiv:1806.03836, 2018.
+
+Gregory Koch, Richard Zemel, and Ruslan Salakhutdinov. Siamese neural networks for one-shot image recognition. In ICML deep learning workshop, volume 2, 2015.
+Anders Krogh and John A Hertz. A simple weight decay can improve generalization. In Advances in neural information processing systems, pp. 950-957, 1992.
+Brenden Lake, Ruslan Salakhutdinov, Jason Gross, and Joshua Tenenbaum. One shot learning of simple visual concepts. In Proceedings of the annual meeting of the cognitive science society, volume 33, 2011.
+Yoonho Lee, Wonjae Kim, and Seungjin Choi. Discrete infomax codes for meta-learning. arXiv preprint arXiv:1905.11656, 2019.
+David A McAllester. Pac-bayesian model averaging. In $COLT$ , volume 99, pp. 164-170. CiteSeer, 1999.
+Anusha Nagabandi, Ignasi Clavera, Simin Liu, Ronald S Fearing, Pieter Abbeel, Sergey Levine, and Chelsea Finn. Learning to adapt in dynamic, real-world environments through meta-reinforcement learning. arXiv preprint arXiv:1803.11347, 2018.
+Anastasia Pentina and Christoph Lampert. A pac-bayesian bound for lifelong learning. In International Conference on Machine Learning, pp. 991-999, 2014.
+Kate Rakelly, Aurick Zhou, Deirdre Quillen, Chelsea Finn, and Sergey Levine. Efficient off-policy meta-reinforcement learning via probabilistic context variables. arXiv preprint arXiv:1903.08254, 2019.
+Sachin Ravi and Hugo Larochelle. Optimization as a model for few-shot learning. In ICLR 2016, 2016.
+Adam Santoro, Sergey Bartunov, Matthew Botvinick, Daan Wierstra, and Timothy Lillicrap. Meta-learning with memory-augmented neural networks. In International conference on machine learning, pp. 1842-1850, 2016.
+Jurgen Schmidhuber. Evolutionary principles in self-referential learning. On learning how to learn: The meta-meta... hook.) Diploma thesis, Institut f. Informatik, Tech. Univ. Munich, 1:2, 1987.
+Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: a simple way to prevent neural networks from overfitting. The journal of machine learning research, 15(1):1929-1958, 2014.
+Joshua Brett Tenenbaum. A Bayesian framework for concept learning. PhD thesis, Massachusetts Institute of Technology, 1999.
+Sebastian Thrun and Lorien Pratt. Learning to learn. Springer Science & Business Media, 2012.
+Naftali Tishby and Noga Zaslavsky. Deep learning and the information bottleneck principle. In 2015 IEEE Information Theory Workshop (ITW), pp. 1-5. IEEE, 2015.
+Naftali Tishby, Fernando C Pereira, and William Bialek. The information bottleneck method. arXiv preprint physics/0004057, 2000.
+Emanuel Todorov, Tom Erez, and Yuval Tassa. Mujoco: A physics engine for model-based control. In 2012 IEEE/RSJ International Conference on Intelligent Robots and Systems, pp. 5026-5033. IEEE, 2012.
+Oriol Vinyals, Charles Blundell, Timothy Lillicrap, Daan Wierstra, et al. Matching networks for one shot learning. In Advances in neural information processing systems, pp. 3630-3638, 2016.
+Yu Xiang, Roozbeh Mottaghi, and Silvio Savarese. Beyond Pascal: A benchmark for 3d object detection in the wild. In IEEE Winter Conference on Applications of Computer Vision (WACV), 2014.
+
+Ruixiang Zhang, Tong Che, Zoubin Ghahramani, Yoshua Bengio, and Yangqiu Song. Metagan: An adversarial approach to few-shot learning. In Advances in Neural Information Processing Systems, pp. 2365-2374, 2018.
+
+Luisa M Zintgraf, Kyriacos Shiarlis, Vitaly Kurin, Katja Hofmann, and Shimon Whiteson. Fast context adaptation via meta-learning. In Thirty-sixth International Conference on Machine Learning (ICML 2019), 2019.
+
+# A APPENDIX
+
+# A.1 ALGORITHM
+
+We present the detailed algorithm for meta-regularization on weights with conditional neural processes (CNP) in Algorithm 1 and with model-agnostic meta-learning (MAML) in Algorithm 2. For CNP, we add the regularization on the weights $\theta$ of encoder and leave other weights $\tilde{\theta}$ unrestricted. For MAML, we similarly regularize the weights $\theta$ from input to an intermediate hidden layer and leave the weights $\tilde{\theta}$ for adaptation unregularized. In this way, we restrict the complexity of the pre-adaptation model not the post-adaptation model.
+
+Algorithm 1: Meta-Regularized CNP
+output: Network parameter $\tau, \theta$ .
+```txt
+input : Task distribution $p\left( \mathcal{T}\right)$ ; Encoder weights distribution $q\left( {\theta ;\tau }\right) = \mathcal{N}\left( {\theta ;\tau }\right)$ with Gaussian parameters $\tau = \left( {{\theta }_{\mu },{\theta }_{\sigma }}\right)$ ; Prior distribution $r\left( \theta \right)$ and Lagrangian multiplier $\beta$ ; $\widetilde{\theta }$ that parameterizes feature extractor ${h}_{\widetilde{\theta }}\left( \cdot \right)$ and decoder ${T}_{\widetilde{\theta }}\left( \cdot \right)$ . Stepsize $\alpha$ .
+```
+
+Initialize $\tau, \tilde{\theta}$ randomly; while not converged do
+Algorithm 2: Meta-Regularized MAML
+```latex
+Sample a mini-batch of $\{\mathcal{T}_i\}$ from $p(\mathcal{T})$
+Sample $\theta \sim q(\theta ;\tau)$ with reparameterization;
+for all $\mathcal{T}_i\in \{\mathcal{T}_i\}$ do Sample $\mathcal{D}_i = (\pmb {x}_i,\pmb {y}_i),\mathcal{D}_i^* = (\pmb {x}_i^*,\pmb {y}_i^*)$ from $\mathcal{T}_i$ . Encode observation $\pmb {z}_i = g_\theta (\pmb {x}_i),\pmb {z}_i^* = g_\theta (\pmb {x}_i^*)$ . Compute task context $\phi_{i} = a(h_{\tilde{\theta}}(\pmb {z}_{i},\pmb {y}_{i}))$ with aggregator $a(\cdot)$ Update $\tilde{\theta}\gets \tilde{\theta} +\alpha \nabla_{\tilde{\theta}}\sum_{\mathcal{T}_i}\log q(\pmb {y}_i^* |T_{\tilde{\theta}}(\pmb {z}_i^*,\phi_i))$ Update $\tau \leftarrow \tau +\alpha \nabla_{\tau}[\sum_{\mathcal{T}_i}\log q(\pmb {y}_i^* |T_{\tilde{\theta}}(\pmb {z}_i^*,\phi_i)) - \beta D_{\mathrm{KL}}(q(\theta ;\tau)||r(\theta))]$
+```
+
+input : Task distribution $p\left( \mathcal{T}\right)$ ; Weights distribution $q\left( {\theta ;\tau }\right) = \mathcal{N}\left( {\theta ;\tau }\right)$ with Gaussian parameters $\tau = \left( {{\theta }_{\mu },{\theta }_{\sigma }}\right)$ ; Prior distribution $r\left( \theta \right)$ and Lagrangian multiplier $\beta$ ; Stepsize $\alpha ,{\alpha }^{\prime }$ .
+output: Network parameter $\tau, \tilde{\theta}$ .
+Initialize $\tau, \tilde{\theta}$ randomly;
+```txt
+while not converged do Sample a mini-batch of $\{\mathcal{T}_i\}$ from $p(\mathcal{T})$ Sample $\theta \sim q(\theta ;\tau)$ with reparameterization; for all $\mathcal{T}_i\in \{\mathcal{T}_i\}$ do Sample $\mathcal{D}_i = (\pmb {x}_i,\pmb {y}_i),\mathcal{D}_i^* = (\pmb {x}_i^*,\pmb {y}_i^*)$ from $\mathcal{T}_i$ ; Encode observation $\pmb {z}_i = g_\theta (\pmb {x}_i),\pmb {z}_i^* = g_\theta (\pmb {x}_i^*)$ ; Compute task specific parameter $\phi_{i} = \tilde{\theta} +\alpha^{\prime}\nabla_{\tilde{\theta}}\log q(\pmb {y}_i|\pmb {z}_i,\tilde{\theta})$ Update $\tilde{\theta}\gets \tilde{\theta} +\alpha \nabla_{\tilde{\theta}}\sum_{\tau_i}\log q(\pmb {y}_i^*\mid \pmb {z}_i^*,\phi_i);$ Update $\tau \leftarrow \tau +\alpha \nabla_{\tau}[\sum_{\tau_i}\log q(\pmb {y}_i^*\mid \pmb {z}_i^*,\phi_i) - \beta D_{\mathrm{KL}}(q(\theta ;\tau)||r(\theta))]$
+```
+
+Algorithm 3: Meta-Regularized Methods in Meta-testing
+
+input: Meta-testing task $\mathcal{T}$ with training data $\mathcal{D} = (x,y)$ and testing input $x^{*}$ , optimized parameters $\tau, \tilde{\theta}$ .
+
+output: Prediction $\hat{y}^*$
+
+for $k$ from 1 to $K$ do
+
+Sample $\theta_{k}\sim q(\theta ;\tau)$
+
+Encode observation $\pmb{z}_k = g_{\theta_k}(\pmb{x})$ , $\pmb{z}_k^* = g_{\theta_k}(\pmb{x}^*)$ ;
+
+Compute task specific parameter $\phi_{k} = a(h_{\tilde{\theta}}(\pmb{z}_{k},\pmb{y}))$ for MR-CNP and
+
+$\phi_{k} = \tilde{\theta} +\alpha^{\prime}\nabla_{\tilde{\theta}}\log q(\boldsymbol {y}|\boldsymbol{z}_{k},\tilde{\theta})$ for MR-MAML;
+
+Predict $\hat{y}_k^*\sim q(\hat{y}^* |z_k^*,\phi_k,\tilde{\theta})$
+
+Return prediction $\hat{y}^{*} = \frac{1}{K}\sum_{k = 1}^{K}\hat{y}_{k}^{*}$
+
+# A.2 META REGULARIZATION ON ACTIVATIONS
+
+We show that $I(x^{*};\hat{y}^{*}|z^{*},\theta)\leq I(\hat{y}^{*};\mathcal{D}|z^{*},\theta)$ . By Figure 4, we have that $I(\hat{y}^{*};x^{*}|\theta ,\mathcal{D},z^{*}) = 0$ . By the chain rule of mutual information we have
+
+$$
+\begin{array}{l} I (\hat {y} ^ {*}; \mathcal {D} | z ^ {*}, \theta) = I (\hat {y} ^ {*}; \mathcal {D} | z ^ {*}, \theta) + I (\hat {y} ^ {*}; x ^ {*} | \mathcal {D}, \theta , z ^ {*}) \\ = I \left(\dot {y} ^ {*}; x ^ {*}, \mathcal {D} | \theta , z ^ {*}\right) \\ = I \left(x ^ {*}; \hat {y} ^ {*} \mid \theta , z ^ {*}\right) + I \left(\hat {y} ^ {*}; \mathcal {D} \mid x ^ {*}, \theta , z ^ {*}\right) \\ \geq I \left(x ^ {*}; \hat {y} ^ {*} \mid \theta , z ^ {*}\right) \tag {10} \\ \end{array}
+$$
+
+# A.3 META REGULARIZATION ON WEIGHTS
+
+Similar to (Achille & Soatto, 2018), we use $\xi$ to denote the unknown parameters of the true data generating distribution. This defines a joint distribution $p(\xi, \mathcal{M}, \theta) = p(\xi)p(\mathcal{M}|\xi)q(\theta|\mathcal{M})$ . Furthermore, we have a predictive distribution $q(\hat{y}^* | x^*, \mathcal{D}, \theta) = \mathbb{E}_{\phi|\theta, \mathcal{D}}[q(\hat{y}^* | x^*, \phi, \theta)]$ .
+
+The meta-training loss in Eq. 1 is an upper bound for the cross entropy $H_{p,q}(y_{1:N}^* |x_{1:N}^*,\mathcal{D}_{1:N},\theta)$ . Using an information decomposition of cross entropy (Achille & Soatto, 2018), we have
+
+$$
+\begin{array}{l} H _ {p, q} \left(y _ {1: N} ^ {*} \mid x _ {1: N} ^ {*}, \mathcal {D} _ {1: N}, \theta\right) = H \left(y _ {1: N} ^ {*} \mid x _ {1: N} ^ {*}, \mathcal {D} _ {1: N}, \xi\right) + I (\xi ; y _ {1: N} ^ {*} \mid x _ {1: N} ^ {*}, \mathcal {D} _ {1: N}, \theta) \\ + \mathbb {E} \left[ D _ {\mathrm {K L}} \left(p \left(y _ {1: N} ^ {*} \mid x _ {1: N} ^ {*}, \mathcal {D} _ {1: N}, \theta\right) | | q \left(y _ {1: N} ^ {*} \mid x _ {1: N} ^ {*}, \mathcal {D} _ {1: N}, \theta\right)\right) \right] + I \left(\mathcal {D} _ {1: N}; \theta \mid x _ {1: N} ^ {*}, \xi\right) \\ - I \left(y _ {1: N} ^ {*}, \mathcal {D} _ {1: N}; \theta \mid x _ {1: N} ^ {*}, \xi\right). \tag {11} \\ \end{array}
+$$
+
+Here the only negative term is the $I(y_{1:N}^*, \mathcal{D}_{1:N}; \theta | x_{1:N}^*, \xi)$ , which quantifies the information that the meta-parameters contain about the meta-training data beyond what can be inferred from the data generating parameters (i.e., memorization). Without proper regularization, the cross entropy loss can be minimized by maximizing this term. We can control its value by upper bounding it
+
+$$
+\begin{array}{l} I \left(y _ {1: N} ^ {*}, \mathcal {D} _ {1: N}; \theta | x _ {1: N} ^ {*}, \xi\right) = \mathbb {E} \left[ \log \frac {q (\theta | \mathcal {M} , \xi)}{q (\theta | x _ {1 : N} ^ {*} , \xi)} \right] \\ = \mathbb {E} \left[ \log \frac {q (\theta | \mathcal {M})}{q (\theta | x _ {1 : N} ^ {*} , \xi)} \right] \\ = \mathbb {E} \left[ D _ {\mathrm {K L}} \left(q (\theta | \mathcal {M}) | | q \left(\theta \mid x _ {1: N} ^ {*}, \xi\right)\right) \right] \\ \leq \mathbb {E} \left[ D _ {\mathrm {K L}} (q (\theta | \mathcal {M}) | | r (\theta)) \right], \\ \end{array}
+$$
+
+where the second equality follows because $\theta$ and $\xi$ are conditionally independent given $\mathcal{M}$ . This gives the regularization in Section 4.2.
+
+# A.4 PROOF OF THE PAC-BAYES GENERALIZATION BOUND
+
+First, we prove a more general result and then specialize it. The goal of the meta-learner is to extract information about the meta-training tasks and the test task training data to serve as a prior for test examples from the novel task. This information will be in terms of a distribution $Q$ over possible models. When learning a new task, the meta-learner uses the training task data $\mathcal{D}$ and a model
+
+parameterized by $\theta$ (sampled from $Q(\theta)$ ) and outputs a distribution $q(\phi|\mathcal{D},\theta)$ over models. Our goal is to learn $Q$ such that it performs well on novel tasks.
+
+To formalize this, define
+
+$$
+e r (Q, \mathcal {D}, \mathcal {T}) = \mathbb {E} _ {\theta \sim Q (\theta), \phi \sim q (\phi | \theta , \mathcal {D}), \left(x ^ {*}, y ^ {*}\right) \sim p (x, y | \mathcal {T})} \left[ \mathcal {L} \left(\phi \left(x ^ {*}\right), y ^ {*}\right) \right] \tag {12}
+$$
+
+where $\mathcal{L}(\phi(x^*), y^*)$ is a bounded loss in $[0,1]$ . Then, we would like to minimize the error on novel tasks
+
+$$
+e r (Q) = \min _ {Q} \mathbb {E} _ {\mathcal {T} \sim p (\mathcal {T}), \mathcal {D} \sim p (x, y | \mathcal {T})} [ e r (Q, \mathcal {D}, \mathcal {T}) ] \tag {13}
+$$
+
+Because we only have a finite training set, computing $er(Q)$ is intractable, but we can form an empirical estimate:
+
+$$
+\hat {e r} \left(Q, \mathcal {D} _ {1}, \mathcal {D} _ {1} ^ {*}, \dots , \mathcal {D} _ {n}, \mathcal {D} _ {n} ^ {*}\right) = \frac {1}{n} \sum_ {i = 1} ^ {n} \underbrace {\mathbb {E} _ {\theta \sim Q (\theta) , \phi_ {i} \sim q (\phi | \theta , \mathcal {D} _ {i})} \left[ \frac {1}{K} \sum_ {\left(x ^ {*}, y ^ {*}\right) \in \mathcal {D} _ {i} ^ {*}} \mathcal {L} \left(\phi \left(x ^ {*}\right), y ^ {*}\right)\right)} _ {\hat {e r} (Q, \mathcal {D} _ {i}, \mathcal {D} _ {i} ^ {*})} \tag {14}
+$$
+
+where for exposition we assume $K = |\mathcal{D}_i^*|$ is the same for all $i$ . We would like to relate $er(Q)$ and $\hat{er}(Q, \mathcal{D}_1, \mathcal{D}_1^*, \dots, \mathcal{D}_n, \mathcal{D}_n^*)$ , but the challenge is that $Q$ may depend on $\mathcal{D}_1, \mathcal{D}_1^*, \dots, \mathcal{D}_n, \mathcal{D}_n^*$ due to the learning algorithm. There are two sources of generalization error: (i) error due to the finite number of observed tasks and (ii) error due to the finite number of examples observed per task. Closely following the arguments in (Amit & Meir, 2018), we apply a standard PAC-Bayes bound to each of these and combine the results with a union bound.
+
+Theorem. Let $Q(\theta)$ be a distribution over parameters $\theta$ and let $P(\theta)$ be a prior distribution. Then for any $\delta \in (0,1]$ , with probability at least $1 - \delta$ , the following inequality holds uniformly for all distributions $Q$ ,
+
+$$
+e r (Q) \leq \frac {1}{n} \sum_ {i = 1} ^ {n} \hat {e r} \left(Q, \mathcal {D} _ {i}, \mathcal {D} _ {i} ^ {*}\right) + \left(\sqrt {\frac {1}{2 (K - 1)}} + \sqrt {\frac {1}{2 (n - 1)}}\right) \sqrt {D _ {K L} (Q \| P) + \log \frac {n (K + 1)}{\delta}} \tag {15}
+$$
+
+Proof. To start, we state a classical PAC-Bayes bound and use it to derive generalization bounds on task and datapoint level generalization, respectively.
+
+Theorem 2. Let $\mathcal{X}$ be a sample space (i.e. a space of possible datapoints). Let $P(X)$ be a distribution over $\mathcal{X}$ (i.e. a data distribution). Let $\Theta$ be a hypothesis space. Given a "loss function" $l(\theta, X): \Theta \times \mathcal{X} \to [0,1]$ and a collection of $M$ i.i.d. random variables sampled from $P(X)$ , $X_1, \ldots, X_M$ , let $\pi$ be a prior distribution over hypotheses in $\Theta$ that does not depend on the samples but may depend on the data distribution $P(X)$ . Then, for any $\delta \in (0,1]$ , the following bound holds uniformly for all posterior distributions $\rho$ over $\Theta$
+
+$$
+\begin{array}{l} P \Big (\mathbb {E} _ {X _ {i} \sim P (X), \theta \sim \rho (\cdot)} [ l (\theta , X _ {i}) ] \leq \frac {1}{M} \sum_ {m = 1} ^ {M} \mathbb {E} _ {\theta \sim \rho (\cdot)} [ l (\theta , X _ {m} ] + \sqrt {\frac {1}{2 (M - 1)} \left(D _ {K L} (\rho \| \pi) + \log \frac {M}{\delta}\right)}, \forall \rho \Big) \\ \geq 1 - \delta . \tag {16} \\ \end{array}
+$$
+
+Meta-level generalization First, we bound the task-level generalization, that is we relate $er(Q)$ to $\frac{1}{n}\sum_{i=1}^{n}er(Q,\mathcal{D}_i,\mathcal{T}_i)$ . Letting the samples be $X_i = (\mathcal{D}_i,\mathcal{T}_i)$ , and $l(\theta,X_n) = \mathbb{E}_{\phi_i\sim q(\phi|\mathcal{D}_i,\theta),(x^*,y^*)\sim\mathcal{T}_i}[\mathcal{L}(\phi(x^*),y^*)]$ , then Theorem 1 says that for any $\delta_0\sim (0,1]$
+
+$$
+P \left(e r (Q) \leq \frac {1}{n} \sum_ {i = 1} ^ {n} e r (Q, \mathcal {D} _ {i}, \mathcal {T} _ {i}) + \sqrt {\frac {1}{2 (n - 1)} \left(D _ {K L} (Q \| P) + \log \frac {n}{\delta_ {0}}\right)}, \forall Q\right) \geq 1 - \delta_ {0}, \tag {17}
+$$
+
+where $P$ is a prior over $\theta$ .
+
+Within task generalization Next, we relate $er(Q,\mathcal{D}_i,\mathcal{T}_i)$ to $\hat{er}(Q,\mathcal{D}_i,\mathcal{D}_i^*)$ via the PAC-Bayes bound. For a fixed task $i$ , task training data $\mathcal{D}_i$ , a prior $\pi(\phi|\mathcal{T}_i)$ that only depends on the training
+
+data, and any $\delta_{i}\in (0,1]$ , we have that
+
+$$
+\begin{array}{l} P \left(\mathbb {E} _ {\left(x ^ {*}, y ^ {*}\right) \sim p \left(x, y \mid \mathcal {T} _ {i}\right) \rho \left(\phi_ {i}\right)} \left[ \mathcal {L} \left(\phi_ {i} \left(x ^ {*}\right), y ^ {*}\right) \right] \leq \mathbb {E} _ {\rho \left(\phi_ {i}\right)} \left[ \frac {1}{K} \sum_ {\left(x ^ {*}, y ^ {*}\right) \in \mathcal {D} _ {i} ^ {*}} \mathcal {L} \left(\phi_ {i} \left(x ^ {*}\right), y ^ {*}\right) \right] \right. \\ + \sqrt {\frac {1}{2 (K - 1)} \left(D _ {K L} (\rho | | \pi) + \log \frac {K}{\delta_ {i}}\right)}, \forall \rho) \geq 1 - \delta_ {i}. \\ \end{array}
+$$
+
+Now, we choose $\pi (\phi |\mathcal{T}_i)$ to be $\int P(\theta)q(\phi |\theta ,\mathcal{D}_i)d\theta$ and restrict $\rho (\phi)$ to be of the form $\int Q(\theta)q(\phi |\theta ,\mathcal{D}_i)d\theta$ for any $Q$ . While, $\pi$ and $\rho$ may be complicated distributions (especially, if they are defined implicitly), we know that with this choice of $\pi$ and $\rho$ , $D_{KL}(\rho ||\pi)\leq D_{KL}(Q||P)$ (Cover & Thomas, 2012), hence, we have
+
+$$
+P \left(e r (Q, \mathcal {D} _ {i}, \mathcal {T} _ {i}) \leq \hat {e r} (Q, \mathcal {D} _ {i}, \mathcal {D} _ {i} ^ {*}) + \sqrt {\frac {1}{2 (K - 1)} \left(D _ {K L} (Q \| P) + \log \frac {K}{\delta_ {i}}\right)}, \forall Q\right) \geq 1 - \delta_ {i} \tag {18}
+$$
+
+Overall bound on meta-learner generalization Combining Eq. (17) and (18) using the union bound, we have
+
+$$
+\begin{array}{l} P \Big (e r (Q) \leq \frac {1}{n} \sum_ {i = 1} ^ {n} \hat {e r} (Q, \mathcal {D} _ {i}, \mathcal {D} _ {i} ^ {*}) + \sqrt {\frac {1}{2 (K - 1)} D _ {K L} (Q \| P) + \log \frac {K}{\delta_ {i}}} \\ + \sqrt {\frac {1}{2 (n - 1)} D _ {K L} (Q \| P) + \log \frac {n}{\delta_ {0}}}, \forall Q \bigg) \geq 1 - \left(\sum_ {i} \delta_ {i} + \delta_ {0}\right) \tag {19} \\ \end{array}
+$$
+
+Choosing $\delta_0 = \frac{\delta}{K + 1}$ and $\delta_{i} = \frac{K\delta}{n(K + 1)}$ , then we have:
+
+$$
+\begin{array}{l} P \left(e r (Q) \leq \frac {1}{n} \sum_ {i = 1} ^ {n} \hat {e r} (Q, \mathcal {D} _ {i}, \mathcal {D} _ {i} ^ {*}) + \left(\sqrt {\frac {1}{2 (K - 1)}} + \sqrt {\frac {1}{2 (n - 1)}}\right) \sqrt {D _ {K L} (Q \| P) + \log \frac {n (K + 1)}{\delta}}, \forall Q\right) \\ \geq 1 - \delta . \tag {20} \\ \end{array}
+$$
+
+
+
+Because $n$ is generally large, by Taylor expansion of the complexity term we have
+
+$$
+\begin{array}{l} \left(\sqrt {\frac {1}{2 (K - 1)}} + \sqrt {\frac {1}{2 (n - 1)}}\right) \sqrt {\left(D _ {K L} Q | | P) + \log \frac {n (K + 1)}{\delta}\right)} \\ = \frac {1}{2 \sqrt {\log n (K + 1) / \delta}} \left(\sqrt {\frac {1}{2 (K - 1)}} + \sqrt {\frac {1}{2 (n - 1)}}\right) \left(D _ {K L} Q | | P) + 2 \log \left(\frac {n (K + 1)}{\delta}\right)\right) + o (1) \\ \end{array}
+$$
+
+Re-defining the coefficient of KL term as $\beta$ and omitting the constant and higher order term, we recover the meta-regularization bound in Eq.(5) when $Q(\theta) = \mathcal{N}(\theta ;\theta_{\mu},\theta_{\sigma})$
+
+# A.5 EXPERIMENTAL DETAILS
+
+# A.5.1 POSE PREDICTION
+
+We create a multi-task regression dataset based on the Pascal 3D data (Xiang et al., 2014). The dataset consists of 10 classes of 3D object such as "aeroplane", "sofa", "TV monitor", etc. Each class has multiple different objects and there are 65 objects in total. We randomly select 50 objects for meta-training and the other 15 objects for meta-testing. For each object, we use MuJoCo (Todorov et al., 2012) to render 100 images with random orientations of the instance on a table, visualized in Figure 1. For the meta-learning algorithm, the observation $(x)$ is the $128 \times 128$ gray-scale image and the label $(y)$ is the orientation re-scaled to be within $[0, 10]$ . For each task, we randomly sample
+
+$30(x,y)$ pairs for an object and evenly split them between task training and task test data. We use a meta batch-size of 10 tasks per iteration.
+
+For MR-CNP, we use a convolutional encoder with a fully connected bottom layer to map the input image to a 20-dimensional latent representation $z$ and $z^{*}$ for task training input $x$ and test input $x^{*}$ respectively. The $(z,y)$ are concatenated and mapped by the feature extractor and aggregator which are fully connected networks to the 200 dimensional task summary statistics $\phi$ . The decoder is a fully connected network that maps $(\phi ,z^{*})$ to the prediction $\hat{y}^*$ .
+
+For MR-MAML, we use a convolutional encoder to map the input image to a $14 \times 14$ dimensional latent representation $z$ and $z^{*}$ . The pairs $(z,y)$ are used in the task adaptation step to get a task specific parameter $\phi$ via gradient descent. Then $z^{*}$ is mapped to the prediction $\hat{y}^{*}$ with a convolutional predictor parameterized by $\phi$ . The network is trained using 5 gradient steps with learning rate 0.01 in the inner loop for adaptation and evaluated using 20 gradient steps at the test-time.
+
+# A.5.2 NON-MUTUALLY-EXCLUSIVE CLASSIFICATION
+
+The Omniglot dataset consists of 20 instances of 1623 characters from 50 different alphabets. We randomly choose 1200 characters for meta-training and use the remaining for testing. The meta-training characters are partitioned into 60 disjoint sets for 20-way classification. The MiniImagenet dataset contains 100 classes of images including 64 training classes, 12 validation classes, and 24 test classes. We randomly partition the 64 meta-training classes into 13 disjoint sets for 5-way classification with one label having one less class of images than the others.
+
+For MR-MAML we use a convolutional encoder similar to the pose prediction problem. The dimension of $z$ and $z^{*}$ is $14 \times 14$ for Omniglot and $20 \times 20$ for MiniImagenet. We use a convolutional decoder for both datasets. Following (Finn et al., 2017), we use a meta batch-size of 16 for 20-way Omniglot classification and meta batch-size of 4 for 5-way MiniImagenet classification. The meta-learning rate is chosen from $\{0.001, 0.005\}$ and the $\beta$ for meta-regularized methods are chosen from $\{10^{-7}, 10^{-6}, \dots, 10^{-3}\}$ . The optimal hyperparameters are chosen for each method separately via cross-validation.
+
+# A.6 ADDITIONAL ILLUSTRATION AND GRAPHICAL MODEL
+
+We show a standard few-shot classification setup in meta-learning to illustrate a mutually-exclusive task distribution and a graphical model for the regularization on the activations.
+
+
+Figure 3: An example of mutually-exclusive task distributions. In each task of mutually-exclusive few-shot classification, different classes are randomly assigned to the $N$ -way classification labels. The same class, such as the dog and butterfly in this illustration, can be assigned different labels across tasks which makes it impossible for one model to solve all tasks simultaneously.
+
+
+Figure 4: Graphical model of the regularization on activations. Observed variables are shaded and $Z$ is bottleneck variable. The complete memorization corresponds to the graph without the dashed arrows.
+
+# A.7 ADDITIONAL RESULTS
+
+As shown in Figures 5, 7 and 8, when meta-learning algorithms converge to the memorization solution, the test tasks must be similar to the train tasks in order to achieve low test error. For CNP, although the task training set contains sufficient information to infer the correct amplitude, this information is ignored and the regression curve at test-time is determined by the one-hot vector. As a result, CNP can only generalize to points from the curves it has seen in the training (Figure 7 first row). On the other hand, MAML does use the task training data (Figure 5, 8 and Table 1), however, its performance is much worse than in the mutually-exclusive task. MR-MAML and MR-CNP avoid converging to a memorization solution and achieve excellent test performance on sinusoid task.
+
+
+Figure 5: Test MSE on the mutually-non-exclusive sinusoid problem as function of the number of gradient steps used in the inner loop of MAML and MR-MAML. For each trial, we calculate the mean MSE over 100 randomly generated meta-testing tasks. We report the mean and standard deviation over 5 random trials.
+
+
+
+
+(a) CNP
+
+
+(b) MR-CNP (W)
+
+
+(c) MAML
+Figure 6: Visualization of the optimized weight matrix $W$ that is connected to the inputs in the sinusoid regression example. The input $x = (u, A)$ where $u \sim \mathrm{Unif}(-5, 5)$ , $A$ is 20 dimensional one-hot vector and the intermediate layer is 100 dimensional, hence $x \in \mathbb{R}^{21}$ and $W \in \mathbb{R}^{21 \times 100}$ . For both CNP and MAML, the meta-regularization restricts the part of weights that is connected to $A$ close to 0. Therefore it avoids storing the amplitude information in weights and forces the amplitude to be inferred from the task training data $\mathcal{D}$ , hence preventing the memorization problem.
+
+
+(d) MR-MAML (W)
+
+
+(a) CNP
+
+
+(b) MR-CNP (A)
+
+
+(c) MR-CNP (W)
+Figure 7: Meta-test results on the non-mutually-exclusive sinusoid regression problem with CNP. For each row, the amplitudes of the true curves (orange) are randomly sampled uniformly from $[0.1,4]$ . For illustrative purposes, we fix the one-hot vector component of the input. (a): The vanilla CNP cannot adapt to new task training data at test-time and the shape of prediction curve (blue) is determined by the one-hot amplitude not the task training data. (b) (c): Adding meta-regularization on both activation and weights enables the CNP to use the task training data at meta-training and causes the model to generalize well at test-time.
+
+
+(a) MAML
+
+
+(b) MR-MAML (A)
+
+
+(c) MR-MAML (W)
+Figure 8: Meta-test results on the non-mutually-exclusive sinusoid regression problem with MAML. For each row, the true amplitudes of the true curves (orange) are randomly sampled uniformly from [0.1, 4]. For illustrative purposes, we fix the one-hot vector component of the input. (a): Due to memorization, MAML adapts slowly and has large generalization error at test-time. (b) (c): Adding meta-regularization on both activation and weights recovers efficient adaptation.
+
+
+MR-CNP (A)
+Figure 9: Sensitivity of activation regularization and weight regularization with respect to the learning rate on the pose prediction problem. For activation regularization, lower training loss corresponds to higher test MSE which indicates that the memorization solution is not solved. For weights regularization, lower training loss corresponds to lower test MSE which indicates proper training can converge to the adaptation solution.
+
+
+MR-CNP (A)
+
+
+MR-CNP (W)
+
+
+MR-CNP (W)
+
+In Table 5, we report the pre-update accuracy for the non-mutually-exclusive classification experiment in Section 6.3. The pre-update accuracy is obtained by the initial parameters $\theta$ rather than the task adapted parameters $\phi$ . At the meta-training time, for both MAML and MR-MAML the post-update accuracy obtained by using $\phi$ gets close to 1. High pre-update accuracy reflects the memorization problem. For example, in 20-way 1-shot Omniglot example, the pre-update accuracy for MAML is $99.2\%$ at the training time, which means only $0.8\%$ improvement in accuracy is due to adaptation, so the task training data is ignored to a large extent. The pre-update training accuracy for MR-MAML is $5\%$ , which means $95\%$ improvement in accuracy during training is due to the adaptation. This explains why in Table 4, the test accuracy of MR-MAML is much higher than that of MAML at the test-time, since the task training data is used to achieve fast adaptation.
+
+Table 5: Meta-training pre-update accuracy on non-mutually-exclusive classification. MR-MAML controls the meta-training pre-update accuracy close to random guess and achieves low training error after adaptation.
+
+| NME Omniglot | 20-way 1-shot | 20-way 5-shot | NME MiniImagenet | 5-way 1-shot | 5-way 5-shot |
| MAML | 99.2 (0.2)% | 45.1 (38.9)% | MAML | 99.4 (0.1)% | 21.0(1.2)% |
| TAML | 68.9(43.1)% | 6.7 (1.8)% | TAML | 99.4 (0.1)% | 20.8(0.4)% |
| MR-MAML (ours) | 5.0 (0)% | 5.0 (0)% | MR-MAML (ours) | 20.0(0)% | 20.2(0.1)% |
+
+
+Figure 10: The test accuracy of MAML with meta-regularization on the weights as a function of the regularization strength $\beta$ on the mutually-exclusive 20-way 1-shot Omniglot problem. The plot shows the mean and standard deviation across 5 meta-training runs. When $\beta$ is small, MR-MAML slightly outperforms MAML, indicating that meta-regularization does not degrade performance on mutually-exclusive tasks. The accuracy numbers are not directly comparable to previous work (e.g., (Finn et al., 2017)) because we do not use data augmentation.
\ No newline at end of file
diff --git a/metalearningwithoutmemorization/images.zip b/metalearningwithoutmemorization/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..d78323f355c9765cf88b22804a02a1cb47293ab5
--- /dev/null
+++ b/metalearningwithoutmemorization/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a917df33d8a22b02df5b21a54c38de5a77208f40e53877f5826ee55d24bc46e1
+size 841190
diff --git a/metalearningwithoutmemorization/layout.json b/metalearningwithoutmemorization/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..9146d9896552a3d722e53cecba520181bcb768d3
--- /dev/null
+++ b/metalearningwithoutmemorization/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:19d88b96cf876645d3ad9a06687943f7b0f990fd3958e93e3877ddf42969a2d1
+size 810587
diff --git a/modelbasedreinforcementlearningforatari/14c34569-cd85-44c8-ad6b-a1e919fa2dcd_content_list.json b/modelbasedreinforcementlearningforatari/14c34569-cd85-44c8-ad6b-a1e919fa2dcd_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..b5cc8d6a2410dd464602ee5c606a25b8977bf381
--- /dev/null
+++ b/modelbasedreinforcementlearningforatari/14c34569-cd85-44c8-ad6b-a1e919fa2dcd_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:85b41c831fa15cd264940570f3df4f9e89ee5a44b8f5b7af227094626e934f10
+size 149500
diff --git a/modelbasedreinforcementlearningforatari/14c34569-cd85-44c8-ad6b-a1e919fa2dcd_model.json b/modelbasedreinforcementlearningforatari/14c34569-cd85-44c8-ad6b-a1e919fa2dcd_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..4e056a251356af1abb62261d8a8f3fa820b6467d
--- /dev/null
+++ b/modelbasedreinforcementlearningforatari/14c34569-cd85-44c8-ad6b-a1e919fa2dcd_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:211b3be89cbaed87f1e4433c75c329197ace1d79d86de3570775b80b4f6324b1
+size 175971
diff --git a/modelbasedreinforcementlearningforatari/14c34569-cd85-44c8-ad6b-a1e919fa2dcd_origin.pdf b/modelbasedreinforcementlearningforatari/14c34569-cd85-44c8-ad6b-a1e919fa2dcd_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..4a36fd17f665a558e852f21051aeb16c014a509f
--- /dev/null
+++ b/modelbasedreinforcementlearningforatari/14c34569-cd85-44c8-ad6b-a1e919fa2dcd_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e41aea3f393fe962a41283eef3f143a076a4ef2a24b5e62a780185f025163483
+size 3448850
diff --git a/modelbasedreinforcementlearningforatari/full.md b/modelbasedreinforcementlearningforatari/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..14ccfbdec3ec5694913a7d124b7461202945cf60
--- /dev/null
+++ b/modelbasedreinforcementlearningforatari/full.md
@@ -0,0 +1,413 @@
+# MODEL BASED REINFORCEMENT LEARNING FOR ATARI
+
+Łukasz Kaiser $^{1,\ast}$ , Mohammad Babaeizadeh $^{1,\ast}$ , Piotr Miłos $^{2,3,\ast}$ , Błajej Osiński $^{2,4,\ast}$ , Roy H. Campbell $^{5}$ , Konrad Czechowski $^{4}$ , Dumitru Erhan $^{1}$ , Chelsea Finn $^{1,6}$ , Piotr Kozakowski $^{4}$ , Sergey Levine $^{1}$ , Afroz Mohiuddin $^{1}$ , Ryan Sepassi $^{1}$ , George Tucker $^{1}$ , Henryk Michalewski $^{4}$
+
+$^{1}$ Google Brain, $^{2}$ deepsense.ai, $^{3}$ Institute of Mathematics of the Polish Academy of Sciences, $^{4}$ Faculty of Mathematics, Informatics and Mechanics, University of Warsaw, $^{5}$ University of Illinois at Urbana-Champaign, $^{6}$ Stanford University
+
+# ABSTRACT
+
+Model-free reinforcement learning (RL) can be used to learn effective policies for complex tasks, such as Atari games, even from image observations. However, this typically requires very large amounts of interaction – substantially more, in fact, than a human would need to learn the same games. How can people learn so quickly? Part of the answer may be that people can learn how the game works and predict which actions will lead to desirable outcomes. In this paper, we explore how video prediction models can similarly enable agents to solve Atari games with fewer interactions than model-free methods. We describe Simulated Policy Learning (SimPLe), a complete model-based deep RL algorithm based on video prediction models and present a comparison of several model architectures, including a novel architecture that yields the best results in our setting. Our experiments evaluate SimPLe on a range of Atari games in low data regime of 100k interactions between the agent and the environment, which corresponds to two hours of real-time play. In most games SimPLe outperforms state-of-the-art model-free algorithms, in some games by over an order of magnitude.
+
+# 1 INTRODUCTION
+
+Human players can learn to play Atari games in minutes (Tsividis et al., 2017). However, some of the best model-free reinforcement learning algorithms require tens or hundreds of millions of time steps – the equivalent of several weeks of training in real time. How is it that humans can learn these games so much faster? Perhaps part of the puzzle is that humans possess an intuitive understanding of the physical processes that are represented in the game: we know that planes can fly, balls can roll, and bullets can destroy aliens. We can therefore predict the outcomes of our actions. In this paper, we explore how learned video models can enable learning in the Atari Learning Environment (ALE) benchmark Bellemare et al. (2015); Machado et al. (2018) with a budget restricted to 100K time steps – roughly to two hours of a play time.
+
+Although prior works have proposed training predictive models for next-frame, future-frame, as well as combined future-frame and reward predictions in Atari games (Oh et al. (2015); Chiappa et al. (2017); Leibfried et al. (2016)), no prior work has successfully demonstrated model-based control via predictive models that achieve competitive results with model-free RL. Indeed, in a recent survey (Section 7.2 in Machado et al. (2018)) this was formulated as the following challenge: "So far, there has been no clear demonstration of successful planning with a learned model in the ALE".
+
+Using models of environments, or informally giving the agent ability to predict its future, has a fundamental appeal for reinforcement learning. The spectrum of possible applications is vast, including learning policies from the model (Watter et al., 2015; Finn et al., 2016; Finn & Levine, 2017; Ebert et al., 2017; Hafner et al., 2019; Piergiovanni et al., 2018; Rybkin et al., 2018; Sutton & Barto,
+
+
+Figure 1: Main loop of SimPLe. 1) the agent starts interacting with the real environment following the latest policy (initialized to random). 2) the collected observations will be used to train (update) the current world model. 3) the agent updates the policy by acting inside the world model. The new policy will be evaluated to measure the performance of the agent as well as collecting more data (back to 1). Note that world model training is self-supervised for the observed states and supervised for the reward.
+
+
+
+2017, Chapter 8), capturing important details of the scene (Ha & Schmidhuber, 2018), encouraging exploration (Oh et al., 2015), creating intrinsic motivation (Schmidhuber, 2010) or counterfactual reasoning (Buesing et al., 2019). One of the exciting benefits of model-based learning is the promise to substantially improve sample efficiency of deep reinforcement learning (see Chapter 8 in Sutton & Barto (2017)).
+
+Our work advances the state-of-the-art in model-based reinforcement learning by introducing a system that, to our knowledge, is the first to successfully handle a variety of challenging games in the ALE benchmark. To that end, we experiment with several stochastic video prediction techniques, including a novel model based on discrete latent variables. We present an approach, called Simulated Policy Learning (SimPLe), that utilizes these video prediction techniques and trains a policy to play the game within the learned model. With several iterations of dataset aggregation, where the policy is deployed to collect more data in the original game, we learn a policy that, for many games, successfully plays the game in the real environment (see videos on the project webpage https://goo.gl/itykP8).
+
+In our empirical evaluation, we find that SimPLe is significantly more sample-efficient than a highly tuned version of the state-of-the-art Rainbow algorithm (Hessel et al., 2018) on almost all games. In particular, in low data regime of $100\mathrm{k}$ samples, on more than half of the games, our method achieves a score which Rainbow requires at least twice as many samples. In the best case of Freeway, our method is more than $10\mathrm{x}$ more sample-efficient, see Figure 3. Since the publication of the first preprint of this work, it has been shown in van Hasselt et al. (2019); Kielak (2020) that Rainbow can be tuned to have better results in low data regime. The results are on a par with SimPLe – both of the model-free methods are better in 13 games, while SimPLe is better in the other 13 out of the total 26 games tested (note that in Section 4.2 van Hasselt et al. (2019) compares with the results of our first preprint, later improved).
+
+# 2 RELATED WORK
+
+Atari games gained prominence as a benchmark for reinforcement learning with the introduction of the Arcade Learning Environment (ALE) Bellemare et al. (2015). The combination of reinforcement learning and deep models then enabled RL algorithms to learn to play Atari games directly from images of the game screen, using variants of the DQN algorithm (Mnih et al., 2013; 2015; Hessel et al., 2018) and actor-critic algorithms (Mnih et al., 2016; Schulman et al., 2017; Babaeizadeh et al., 2017b; Wu et al., 2017; Espeholt et al., 2018). The most successful methods in this domain remain model-free algorithms (Hessel et al., 2018; Espeholt et al., 2018). Although the sample complexity of these methods has substantially improved recently, it remains far higher than the amount of experience required for human players to learn each game (Tsividis et al., 2017). In this work, we aim to learn Atari games with a budget of just 100K agent steps (400K frames), corresponding to about two hours of play time. Prior methods are generally not evaluated in this regime, and we therefore optimized Rainbow (Hessel et al., 2018) for optimal performance on 1M steps, see Appendix E for details.
+
+Oh et al. (2015) and Chiappa et al. (2017) show that learning predictive models of Atari 2600 environments is possible using appropriately chosen deep learning architectures. Impressively, in some cases the predictions maintain low $L_{2}$ error over timespans of hundreds of steps. As learned simulators of Atari environments are core ingredients of our approach, in many aspects our work is motivated by Oh et al. (2015) and Chiappa et al. (2017), however we focus on using video prediction in the context of learning how to play the game well and positively verify that learned simulators can be used to train a policy useful in original environments. An important step in this direction was made by Leibfried et al. (2016), which extends the work of Oh et al. (2015) by including reward prediction, but does not use the model to learn policies that play the games. Most of these approaches, including ours, encode knowledge of the game in implicit way. Unlike this, there are works in which modeling is more explicit, for example Ersen & Sariel (2014) uses testbed of the Incredible Machines to learn objects behaviors and their interactions. Similarly Guzdial et al. (2017) learns an engine predicting interactions of predefined set of sprites in the domain of Super Mario Bros.
+
+Perhaps surprisingly, there is virtually no work on model-based RL in video games from images. Notable exceptions are the works of Oh et al. (2017), Sodhani et al. (2019), Ha & Schmidhuber (2018), Holland et al. (2018), Leibfried et al. (2018) and Azizzadenesheli et al. (2018). Oh et al. (2017) use a model of rewards to augment model-free learning with good results on a number of Atari games. However, this method does not actually aim to model or predict future frames, and achieves clear but relatively modest gains in efficiency. Sodhani et al. (2019) proposes learning a model consistent with RNN policy which helps to train policies that are more powerful than their model-free baseline. Ha & Schmidhuber (2018) present a way to compose a variational autoencoder with a recurrent neural network into an architecture that is successfully evaluated in the VizDoom environment and on a 2D racing game. The training procedure is similar to Algorithm 1, but only one iteration of the loop is needed as the environments are simple enough to be fully explored with random exploration. Similarly, Alaniz (2018) utilizes a transition model with Monte Carlo tree search to solve a block-placing task in Minecraft. Holland et al. (2018) use a variant of Dyna (Sutton, 1991) to learn a model of the environment and generate experience for policy training in the context of Atari games. Using six Atari games as a benchmark Holland et al. (2018) measure the impact of planning shapes on performance of the Dyna-DQN algorithm and include ablations comparing scores obtained with perfect and imperfect models. Our method achieves around $330\%$ of the Dyna-DQN score on Asterix, $120\%$ on Q-Bert, $150\%$ on Seaquest and $80\%$ on Ms. Pac-Man. Azizzadenesheli et al. (2018) propose an algorithm called Generative Adversarial Tree Search (GATS) and for five Atari games train a GAN-based world model along with a Q-function. Azizzadenesheli et al. (2018) primarily discuss various failure modes of the GATS algorithm. Our method achieves around 64 times the score of GATS on Pong and 10 times on Breakout. $^{1}$
+
+Outside of games, model-based reinforcement learning has been investigated at length for applications such as robotics (Deisenroth et al., 2013). Though most of such works do not use image observations, several recent works have incorporated images into real-world (Finn et al., 2016; Finn & Levine, 2017; Babaeizadeh et al., 2017a; Ebert et al., 2017; Piergiovanni et al., 2018; Paxton et al., 2019; Rybkin et al., 2018; Ebert et al., 2018) and simulated (Watter et al., 2015; Hafner et al., 2019) robotic control. Our video models of Atari environments described in Section 4 are motivated by models developed in the context of robotics. Another source of inspiration are discrete autoencoders proposed by van den Oord et al. (2017) and Kaiser & Bengio (2018).
+
+The structure of the model-based RL algorithm that we employ consists of alternating between learning a model, and then using this model to optimize a policy with model-free reinforcement learning. Variants of this basic algorithm have been proposed in a number of prior works, starting from Dyna Q Sutton (1991) to more recent methods that incorporate deep networks Heess et al. (2015); Feinberg et al. (2018); Kalweit & Boedecker (2017); Kurutach et al. (2018).
+
+
+Figure 2: Architecture of the proposed stochastic model with discrete latent. The input to the model is four stacked frames (as well as the action selected by the agent) while the output is the next predicted frame and expected reward. Input pixels and action are embedded using fully connected layers, and there is per-pixel softmax (256 colors) in the output. This model has two main components. First, the bottom part of the network which consists of a skip-connected convolutional encoder and decoder. To condition the output on the actions of the agent, the output of each layer in the decoder is multiplied with the (learned) embedded action. Second part of the model is a convolutional inference network which approximates the posterior given the next frame, similarly to Babaeizadeh et al. (2017a). At training time, the sampled latent values from the approximated posterior will be discretized into bits. To keep the model differentiable, the backpropagation bypasses the discretization following Kaiser & Bengio (2018). A third LSTM based network is trained to approximate each bit given the previous ones. At inference time, the latent bits are predicted auto-regressively using this network. The deterministic model has the same architecture as this figure but without the inference network.
+
+# 3 SIMULATED POLICY LEARNING (SIMPLE)
+
+Reinforcement learning is formalized in Markov decision processes (MDP). An MDP is defined as a tuple $(S, \mathcal{A}, P, r, \gamma)$ , where $S$ is a state space, $\mathcal{A}$ is a set of actions available to an agent, $P$ is the unknown transition kernel, $r$ is the reward function and $\gamma \in (0,1)$ is the discount factor. In this work we refer to MDPs as environments and assume that environments do not provide direct access to the state (i.e., the RAM of Atari 2600 emulator). Instead we use visual observations, typically $210 \times 160$ RGB images. A single image does not determine the state. In order to reduce environment's partial observability, we stack four consecutive frames and use it as the observation. A reinforcement learning agent interacts with the MDP by issuing actions according to a policy. Formally, policy $\pi$ is a mapping from states to probability distributions over $\mathcal{A}$ . The quality of a policy is measured by the value function $\mathbb{E}_{\pi} \left( \sum_{t=0}^{+\infty} \gamma^t r_{t+1} | s_0 = s \right)$ , which for a starting state $s$ estimates the total discounted reward gathered by the agent.
+
+In Atari 2600 games our goal is to find a policy which maximizes the value function from the beginning of the game. Crucially, apart from an Atari 2600 emulator environment env we will use a neural network simulated environment env' which we call a world model and describe in detail in Section 4. The environment env' shares the action space and reward space with env and produces visual observations in the same format, as it will be trained to mimic env. Our principal aim is to train a policy $\pi$ using a simulated environment env' so that $\pi$ achieves good performance in the original environment env. In this training process we aim to use as few interactions with env as possible. The initial data to train env'
+
+comes from random rollouts of env. As this is unlikely to capture all aspects of env, we use the iterative method presented in Algorithm 1.
+
+# Algorithm 1: Pseudocode for SimPLe
+
+Initialize policy $\pi$
+
+Initialize model parameters $\theta$ of $env'$
+
+Initialize empty set D
+
+while not done do
+
+collect observations from real env.
+
+$\mathbf{D}\gets \mathbf{D}\cup \mathrm{COLLECT}(env,\pi)$
+
+$\triangleright$ update model using collected data.
+
+$\pmb{\theta} \gets$ TRAIN_SUPERVISED $(env', \mathbf{D})$
+
+$\triangleright$ update policy using world model.
+
+$\pi \gets$ TRAIN_RL $(\pi, env')$
+
+end while
+
+# 4 WORLD MODELS
+
+In search for an effective world model we experimented with various architectures, both new and modified versions of existing ones. This search resulted in a novel stochastic video prediction model (visualized in Figure 2) which achieved superior results compared to other previously proposed models. In this section, we describe the details of this architecture and the rationale behind our design decisions. In Section 6 we compare the performance of these models.
+
+Deterministic Model. Our basic architecture, presented as part of Figure 2, resembles the convolutional feedforward network from Oh et al. (2015). The input $X$ consists of four consecutive game frames and an action $a$ . Stacked convolution layers process the visual input. The actions are one-hot-encoded and embedded in a vector which is multiplied channel-wise with the output of the convolutional layers. The network outputs the next frame of the game and the value of the reward.
+
+In our experiments, we varied details of the architecture above. In most cases, we use a stack of four convolutional layers with 64 filters followed by three dense layers (the first two have 1024 neurons). The dense layers are concatenated with 64 dimensional vector with a learnable action embedding. Next, three deconvolutional layers of 64 filters follow. An additional deconvolutional layer outputs an image of the original $105 \times 80$ size. The number of filters is either 3 or $3 \times 256$ . In the first case, the output is a real-valued approximation of pixel's RGB value. In the second case, filters are followed by softmax producing a probability distribution on the color space. The reward is predicted by a softmax attached to the last fully connected layer. We used dropout equal to 0.2 and layer normalization.
+
+Loss functions. The visual output of our networks is either one float per pixel/channel or the categorical 256-dimensional softmax. In both cases, we used the clipped loss max(Loss, $C$ ) for a constant $C$ . We found that clipping was crucial for improving the models (measured with the correct reward predictions per sequence metric and successful training using Algorithm 1). We conjecture that clipping substantially decreases the magnitude of gradients stemming from fine-tuning of big areas of background consequently letting the optimization process concentrate on small but important areas (e.g. the ball in Pong). In our experiments, we set $C = 10$ for $L_{2}$ loss on pixel values and to $C = 0.03$ for softmax loss. Note that this means that when the level of confidence about the correct pixel value exceeds $97\%$ (as $-\ln(0.97) \approx 0.03$ ) we get no gradients from that pixel any longer.
+
+Scheduled sampling. The model $env'$ consumes its own predictions from previous steps and due to compounding errors, the model may drift out of the area of its applicability. Following Bengio et al. (2015); Venkatraman et al. (2016), we mitigate this problem by randomly replacing in training some frames of the input $X$ by the prediction from the previous step while linearly increasing the mixing probability to $100\%$ around the middle of the first iteration of the training loop.
+
+Stochastic Models. A stochastic model can be used to deal with limited horizon of past observed frames as well as sprites occlusion and flickering which results to higher quality predictions. Inspired by Babaeizadeh et al. (2017a), we tried a variational autoencoder (Kingma & Welling, 2014) to model the stochasticity of the environment. In this model, an additional network receives the input frames as well as the future target frame as input and approximates the distribution of the posterior. At each timestep, a latent value $z_{t}$ is sampled from this distribution and passed as input to the original predictive model. At test time, the latent values are sampled from an assumed prior $\mathcal{N}(\mathbf{0},\mathbf{I})$ . To match the assumed prior and the approximate, we use the Kullback-Leibler divergence term as an additional loss term (Babaeizadeh et al., 2017a).
+
+We noticed two major issues with the above model. First, the weight of the KL divergence loss term is game dependent, which is not practical if one wants to deal with a broad portfolio of Atari games. Second, this weight is usually a very small number in the range of $[10^{-3}, 10^{-5}]$ which means that the approximated posterior can diverge significantly from the assumed prior. This can result in previously unseen latent values at inference time that lead to poor predictions. We address these issues by utilizing a discrete latent variable similar to Kaiser & Bengio (2018).
+
+As visualized in Figure 2, the proposed stochastic model with discrete latent variables discretizes the latent values into bits (zeros and ones) while training an auxiliary LSTM-based Hochreiter & Schmidhuber (1997) recurrent network to predict these bits autoregressively. At inference time, the latent bits will be generated by this auxiliary network in contrast to sampling from a prior. To make the predictive model more robust to unseen latent bits, we add uniform noise to approximated latent
+
+values before discretization and apply dropout (Srivastava et al., 2014) on bits after discretization. More details about the architecture is in Appendix C.
+
+# 5 POLICY TRAINING
+
+We will now describe the details of SimPLe, outlined in Algorithm 1. In step 6 we use the proximal policy optimization (PPO) algorithm (Schulman et al., 2017) with $\gamma = 0.95$ . The algorithm generates rollouts in the simulated environment $env'$ and uses them to improve policy $\pi$ . The fundamental difficulty lays in imperfections of the model compounding over time. To mitigate this problem we use short rollouts of $env'$ . Typically every $N = 50$ steps we uniformly sample the starting state from the ground-truth buffer $D$ and restart $env'$ (for experiments with the value of $\gamma$ and $N$ see Section 6.4). Using short rollouts may have a degrading effect as the PPO algorithm does not have a way to infer effects longer than the rollout length. To ease this problem, in the last step of a rollout we add to the reward the evaluation of the value function. Training with multiple iterations re-starting from trajectories gathered in the real environment is new to our knowledge. It was inspired by the classical Dyna-Q algorithm and, notably, in the Atari domain no comparable results have been achieved.
+
+The main loop in Algorithm 1 is iterated 15 times (cf. Section 6.4). The world model is trained for $45\mathrm{K}$ steps in the first iteration and for $15\mathrm{K}$ steps in each of the following ones. Shorter training in later iterations does not degrade the performance because the world model after first iteration captures already part of the game dynamics and only needs to be extended to novel situations.
+
+In each of the iterations, the agent is trained inside the latest world model using PPO. In every PPO epoch we used 16 parallel agents collecting 25, 50 or 100 steps from the simulated environment $env'$ (see Section 6.4 for ablations). The number of PPO epochs is $z \cdot 1000$ , where $z$ equals to 1 in all passes except last one (where $z = 3$ ) and two passes number 8 and 12 (where $z = 2$ ). This gives $800\mathrm{K} \cdot z$ interactions with the simulated environment in each of the loop passes. In the process of training the agent performs 15.2M interactions with the simulated environment $env'$ .
+
+# 6 EXPERIMENTS
+
+We evaluate SimPLe on a suite of Atari games from Atari Learning Environment (ALE) benchmark. In our experiments, the training loop is repeated for 15 iterations, with 6400 interactions with the environment collected in each iteration. We apply a standard pre-processing for Atari games: a frame skip equal to 4, that is every action is repeated 4 times. The frames are down-scaled by a factor of 2.
+
+Because some data is collected before the first iteration of the loop, altogether $6400 \cdot 16 = 102$ , 400 interactions with the Atari environment are used during training. This is equivalent to 409, 600 frames from the Atari game (114 minutes at 60 FPS). At every iteration, the latest policy trained under the learned model is used to collect data in the real environment env. The data is also directly used to train the policy with PPO. Due to vast difference between number of training data from simulated environment and real environment (15M vs 100K) the impact of the latter on policy is negligible.
+
+We evaluate our method on 26 games selected on the basis of being solvable with existing state-of-the-art model-free deep RL algorithms², which in our comparisons are Rainbow Hessel et al. (2018) and PPO Schulman et al. (2017). For Rainbow, we used the implementation from the Dopamine package and spent considerable time tuning it for sample efficiency (see Appendix E).
+
+For visualization of all experiments see https://goo.gl/itykP8 and for a summary see Figure 3. It can be seen that our method is more sample-efficient than a highly tuned Rainbow baseline on almost all games, requires less than half of the samples on more than half of the games and, on Freeway, is more than $10\mathrm{x}$ more sample-efficient. Our method outperforms PPO by an even larger margin. We also compare our method with fixed score baselines (for different baselines) rather than counting how many steps are required to match our score, see Figure 4 for the results. For the
+
+
+Figure 3: Comparison with Rainbow and PPO. Each bar illustrates the number of interactions with environment required by Rainbow (left) or PPO (right) to achieve the same score as our method (SimPLe). The red line indicates the $100K$ interactions threshold which is used by the our method.
+
+
+
+qualitative analysis of performance on different games see Appendix B. The source code is available as part of the Tensor2Tensor library and it includes instructions on how to run the experiments3.
+
+# 6.1 SAMPLE EFFICIENCY
+
+The primary evaluation in our experiments studies the sample efficiency of SimPLe, in comparison with state-of-the-art model-free deep RL methods in the literature. To that end, we compare with Rainbow (Hessel et al., 2018; Castro et al., 2018), which represents the state-of-the-art Q-learning method for Atari games, and PPO (Schulman et al., 2017), a model-free policy gradient algorithm (see Appendix E for details of tuning of Rainbow and PPO). The results of the comparison are presented in Figure 3. For each game, we plot the number of time steps needed for either Rainbow or PPO to reach the same score that our method reaches after 100K interaction steps. The red line indicates 100K steps: any bar larger than this indicates a game where the model-free method required more steps. SimPLe outperforms the model-free algorithms in terms of learning speed on nearly all of the games, and in the case of a few games, does so by over an order of magnitude. For some games, it reaches the same performance that our PPO implementation reaches at 10M steps. This indicates that model-based reinforcement learning provides an effective approach to learning Atari games, at a fraction of the sample complexity.
+
+The results in these figures are generated by averaging 5 runs for each game. The model-based agent is better than a random policy for all the games except Bank Heist. Interestingly, we observed that the best of the 5 runs was often significantly better. For 6 of the games, it exceeds the average human score (as reported in Table 3 of Pohlen et al. (2018)). This suggests that further stabilizing SimPLe should improve its performance, indicating an important direction for future work. In some cases during training we observed high variance of the results during each step of the loop. There are a number of possible reasons, such as mutual interactions of the policy training and the supervised training or domain mismatch between the model and the real environment. We present detailed numerical results, including best scores and standard deviations, in Appendix D.
+
+
+Figure 4: Fractions of Rainbow and PPO scores at different numbers of interactions calculated with the formula (SimPLe_score@100K - random_score)/(baseline_score - random_score); if denominator is smaller than 0, both nominator and denominator are increased by 1. From left to right, the baselines are: Rainbow at 100K, Rainbow at 200K, PPO at 100K, PPO at 200K. SimPLe outperforms Rainbow and PPO even when those are given twice as many interactions.
+
+
+
+
+
+
+
+
+(a) Model based (SimPLe)
+
+
+(b) Model based $^+$ model free (SimPLe $^+$ PPO)
+Figure 5: Behaviour with respect to the number of used samples. We report number of frames required by PPO to reach the score of our models. Results are averaged over all games.
+
+# 6.2 NUMBER OF FRAMES
+
+We focused our work on learning games with 100K interaction steps with the environment. In this section we present additional results for settings with 20K, 50K, 200K, 500K and 1M interactions; see Figure 5 (a). Our results are poor with 20K interactions. For 50K they are already almost as good as with 100K interactions. From there the results improve until 500K samples – it is also the point at which they are on par with model-free PPO. Detailed per game results can be found in Appendix F.
+
+This demonstrates that SimPLe excels in a low data regime, but its advantage disappears with a bigger amount of data. Such a behavior, with fast growth at the beginning of training, but lower asymptotic performance is commonly observed when comparing model-based and model-free methods (Wang et al. (2019)). As observed in Section 6.4 assigning bigger computational budget helps in 100K setting. We suspect that gains would be even bigger for the settings with more samples.
+
+Finally, we verified if a model obtained with SimPLe using $100\mathrm{K}$ is a useful initialization for model-free PPO training. Based on the results depicted in Figure 5 (b) we can positively answer this conjecture. Lower asymptotic performance is probably due to worse exploration. A policy pre-trained with SimPLe was meant to obtain the best performance on $100\mathrm{K}$ , at which point its entropy is very low thus hindering further PPO training.
+
+# 6.3 ENVIRONMENT STOCHASTICITY
+
+A crucial decision in the design of world models is the inclusion of stochasticity. Although Atari is known to be a deterministic environment, it is stochastic given only a limited horizon of past observed frames (in our case 4 frames). The level of stochasticity is game dependent; however, it can be observed in many Atari games. An example of such behavior can be observed in the game Kung Fu Master - after eliminating the current set of opponents, the game screen always looks the same (it contains only player's character and the background). The game dispatches diverse sets of new opponents, which cannot be inferred from the visual observation alone (without access to the game's internal state) and thus cannot be predicted by a deterministic model. Similar issues have been reported in Babaeizadeh et al. (2017a), where the output of their baseline deterministic model was a blurred superposition of possible random object movements. As can be seen in Figure 11 in the Appendix, the stochastic model learns a reasonable behavior - samples potential opponents and renders them sharply.
+
+Given the stochasticity of the proposed model, Simple can be used with truly stochastic environments. To demonstrate this, we ran an experiment where the full pipeline (both the world model and the policy) was trained in the presence of sticky actions, as recommended in (Machado et al., 2018, Section 5). Our world model learned to account for the stickiness of actions and in most cases the end results were very similar to the ones for the deterministic case even without any tuning, see Figure 6.
+
+# 6.4 ABLATIONS
+
+To evaluate the design of our method, we independently varied a number of the design decisions. Here we present an overview; see Appendix A for detailed results.
+
+Model architecture and hyperparameters. We evaluated a few choices for the world model and our proposed stochastic discrete model performs best by a significant margin. The second most important parameter was the length of world model's training. We verified that a longer training would be beneficial, however we had to restrict it in all other ablation studies due to a high cost of training on all games. As for the length of rollouts from simulated env', we use $N = 50$ by default. We experimentally shown that $N = 25$ performs roughly on par, while $N = 100$ is
+
+
+Figure 6: Impact of the environment stochasticity. The graphs are in the same format as Figure 3: each bar illustrates the number of interactions with environment required by Rainbow to achieve the same score as SimPLE (with stochastic discrete world model) using 100k steps in an environment with and without sticky actions.
+
+slightly worse, likely due to compounding model errors. The discount factor was set to $\gamma = 0.99$ unless specified otherwise. We see that $\gamma = 0.95$ is slightly better than other values, and we hypothesize that it is due to better tolerance to model imperfections. But overall, all three values of $\gamma$ perform comparably.
+
+Model-based iterations. The iterative process of training the model, training the policy, and collecting data is crucial for non-trivial tasks where random data collection is insufficient. In a game-by-game analysis, we quantified the number of games where the best results were obtained in later iterations of training. In some games, good policies could be learned very early. While this might have been due to the high variability of training, it does suggest the possibility of much faster training (i.e. in fewer steps than 100k) with more directed exploration policies. In Figure 9 in the Appendix we present the cumulative distribution plot for the (first) point during learning when the maximum score for the run was achieved in the main training loop of Algorithm 1.
+
+Random starts. Using short rollouts is crucial to mitigate the compounding errors in the model. To ensure exploration, SimPLe starts rollouts from randomly selected states taken from the real data buffer D. Figure 9 compares the baseline with an experiment without random starts and rollouts of length 1000 on Seaquest which shows much worse results without random starts.
+
+# 7 CONCLUSIONS AND FUTURE WORK
+
+We presented SimPLe, a model-based reinforcement learning approach that operates directly on raw pixel observations and learns effective policies to play games in the Atari Learning Environment. Our experiments demonstrate that SimPLe learns to play many of the games with just 100K interactions with the environment, corresponding to 2 hours of play time. In many cases, the number of samples required for prior methods to learn to reach the same reward value is several times larger.
+
+Our predictive model has stochastic latent variables so it can be applied in highly stochastic environments. Studying such environments is an exciting direction for future work, as is the study of other ways in which the predictive neural network model could be used. Our approach uses the model as a learned simulator and directly applies model-free policy learning to acquire the policy. However, we could use the model for planning. Also, since our model is differentiable, the additional information contained in its gradients could be incorporated into the reinforcement learning process. Finally, the representation learned by the predictive model is likely to be more meaningful by itself than the raw pixel observations from the environment. Incorporating this representation into the policy could further accelerate and improve the reinforcement learning process.
+
+While SimPLe is able to learn more quickly than model-free methods, it does have limitations. First, the final scores are on the whole lower than the best state-of-the-art model-free methods. This can be improved with better dynamics models and, while generally common with model-based RL algorithms, suggests an important direction for future work. Another, less obvious limitation is that the performance of our method generally varied substantially between different runs on the same game. The complex interactions between the model, policy, and data collection were likely responsible for this. In future work, models that capture uncertainty via Bayesian parameter posteriors or ensembles (Kurutach et al., 2018; Chua et al., 2018) may improve robustness. Finally, the computational and time requirement of training inside world model are substantial (see Appendix C), which makes developing lighter models an important research direction.
+
+In this paper our focus was to demonstrate the capability and generality of SimPLe only across a suite of Atari games, however, we believe similar methods can be applied to other environments and tasks which is one of our main directions for future work. As a long-term challenge, we believe that model-based reinforcement learning based on stochastic predictive models represents a promising and highly efficient alternative to model-free RL. Applications of such approaches to both high-fidelity simulated environments and real-world data represent an exciting direction for future work that can enable highly efficient learning of behaviors from raw sensory inputs in domains such as robotics and autonomous driving.
+
+# ACKNOWLEDGMENTS
+
+We thank Marc Bellemare and Pablo Castro for their help with Rainbow and Dopamine. The work of Konrad Czechowski, Piotr Kozakowski and Piotr Miłos was supported by the Polish National Science Center grants UMO-2017/26/E/ST6/00622. The work of Henryk Michalewski was supported by the Polish National Science Center grant UMO-2018/29/B/ST6/02959. This research was supported by the PL-Grid Infrastructure. In particular, Konrad Czechowski, Piotr Kozakowski, Henryk Michalewski, Piotr Miłos and Błajej Osiński extensively used the Prometheus supercomputer, located in the Academic Computer Center Cyfronet in the AGH University of Science and Technology in Kraków, Poland. Some of the experiments were managed using https://neptune.ai. We would like to thank the Neptune team for providing us access to the team version and technical support.
+
+# REFERENCES
+
+Stephan Alaniz. Deep reinforcement learning with model learning and monte carlo tree search in mycraf. arXiv preprint arXiv:1803.08456, 2018.
+Kamyar Azizzadenesheli, Brandon Yang, Weitang Liu, Emma Brunskill, Zachary C. Lipton, and Animashree Anandkumar. Sample-efficient deep RL with generative adversarial tree search. CoRR, abs/1806.05780, 2018.
+
+Mohammad Babaeizadeh, Chelsea Finn, Dumitru Erhan, Roy H. Campbell, and Sergey Levine. Stochastic variational video prediction. *ICLR*, 2017a.
+Mohammad Babaeizadeh, Iuri Frosio, Stephen Tyree, Jason Clemons, and Jan Kautz. Reinforcement learning through asynchronous advantage actor-critic on a GPU. In 5th International Conference on Learning Representations, ICLR 2017, Toulon, France, April 24-26, 2017, Conference Track Proceedings. OpenReview.net, 2017b. URL https://openreview.net/forum?id=r1VGvBcxl.
+Marc G. Bellemare, Yavar Naddaf, Joel Veness, and Michael Bowling. The arcade learning environment: An evaluation platform for general agents (extended abstract). In Proceedings of the Twenty-Fourth International Joint Conference on Artificial Intelligence, IJCAI, pp. 4148-4152, 2015.
+Samy Bengio, Oriol Vinyals, Navdeep Jaitly, and Noam Shazeer. Scheduled sampling for sequence prediction with recurrent neural networks. In Advances in Neural Information Processing Systems 28: Annual Conference on Neural Information Processing Systems 2015, December 7-12, 2015, Montreal, Quebec, Canada, pp. 1171-1179, 2015.
+Lars Buesing, Theophane Weber, Yori Zwols, Nicolas Heess, Sébastien Racanière, Arthur Guez, and Jean-Baptiste Lespiau. Woulda, coulda, shoulda: Counterfactually-guided policy search. In 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019. OpenReview.net, 2019. URL https://openreview.net/forum?id=BJG0voC9YQ.
+Pablo Samuel Castro, Subhodeep Moitra, Carles Gelada, Saurabh Kumar, and Marc G. Bellemare. *Dopamine: A research framework for deep reinforcement learning.* CoRR, abs/1812.06110, 2018.
+Silvia Chiappa, Sébastien Racanière, Daan Wierstra, and Shakir Mohamed. Recurrent environment simulators. In 5th International Conference on Learning Representations, ICLR 2017, Toulon, France, April 24-26, 2017, Conference Track Proceedings. OpenReview.net, 2017. URL https://openreview.net/forum?id=Bls6xvqlx.
+Kurtland Chua, Roberto Calandra, Rowan McAllister, and Sergey Levine. Deep reinforcement learning in a handful of trials using probabilistic dynamics models. In Advances in Neural Information Processing Systems, pp. 4759-4770, 2018.
+Marc Peter Deisenroth, Gerhard Neumann, and Jan Peters. A survey on policy search for robotics. Foundations and Trends in Robotics, 2(1-2), 2013.
+Frederik Ebert, Chelsea Finn, Alex X. Lee, and Sergey Levine. Self-supervised visual planning with temporal skip connections. In 1st Annual Conference on Robot Learning, CoRL 2017, Mountain View, California, USA, November 13-15, 2017, Proceedings, volume 78 of Proceedings of Machine Learning Research, pp. 344-356. PMLR, 2017.
+Frederik Ebert, Chelsea Finn, Sudeep Dasari, Annie Xie, Alex Lee, and Sergey Levine. Visual foresight: Model-based deep reinforcement learning for vision-based robotic control. arXiv preprint arXiv:1812.00568, 2018.
+Mustafa Ersen and Sanem Sariel. Learning behaviors of and interactions among objects through spatio-temporal reasoning. IEEE Transactions on Computational Intelligence and AI in Games, 7 (1):75-87, 2014.
+Lasse Espeholt, Hubert Soyer, Rémi Munos, Karen Simonyan, Volodymyr Mnih, Tom Ward, Yotam Doron, Vlad Firoiu, Tim Harley, Iain Dunning, Shane Legg, and Koray Kavukcuoglu. IMPALA: scalable distributed deep-rl with importance weighted actor-learner architectures. In Proceedings of the 35th International Conference on Machine Learning, ICML, pp. 1406–1415, 2018.
+Vladimir Feinberg, Alvin Wan, Ion Stoica, Michael I. Jordan, Joseph E. Gonzalez, and Sergey Levine. Model-based value estimation for efficient model-free reinforcement learning. CoRR, abs/1803.00101, 2018.
+Chelsea Finn and Sergey Levine. Deep visual foresight for planning robot motion. In 2017 IEEE International Conference on Robotics and Automation, ICRA 2017, Singapore, Singapore, May 29 - June 3, 2017, pp. 2786-2793. IEEE, 2017. doi: 10.1109/ICRA.2017.7989324.
+Chelsea Finn, Xin Yu Tan, Yan Duan, Trevor Darrell, Sergey Levine, and Pieter Abbeel. Deep spatial autoencoders for visuomotor learning. In IEEE International Conference on Robotics and Automation, ICRA, pp. 512-519, 2016.
+Matthew Guzdial, Boyang Li, and Mark O. Riedl. Game engine learning from video. In Proceedings of the Twenty-Sixth International Joint Conference on Artificial Intelligence, IJCAI 2017, Melbourne, Australia, August 19-25, 2017, pp. 3707-3713, 2017. doi: 10.24963/ijcai.2017/518.
+
+David Ha and Jürgen Schmidhuber. Recurrent world models facilitate policy evolution. In Samy Bengio, Hanna M. Wallach, Hugo Larochelle, Kristen Grauman, Nicolò Cesa-Bianchi, and Roman Garnett (eds.), Advances in Neural Information Processing Systems 31: Annual Conference on Neural Information Processing Systems 2018, NeurIPS 2018, 3-8 December 2018, Montréal, Canada, pp. 2455-2467, 2018.
+Danijar Hafner, Timothy P. Lillicrap, Ian Fischer, Ruben Villegas, David Ha, Honglak Lee, and James Davidson. Learning latent dynamics for planning from pixels. In Kamalika Chaudhuri and Ruslan Salakhutdinov (eds.), 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, pp. 2555-2565. PMLR, 2019.
+Nicolas Heess, Gregory Wayne, David Silver, Timothy P. Lillicrap, Tom Erez, and Yuval Tassa. Learning continuous control policies by stochastic value gradients. In Corinna Cortes, Neil D. Lawrence, Daniel D. Lee, Masashi Sugiyama, and Roman Garnett (eds.), Advances in Neural Information Processing Systems 28: Annual Conference on Neural Information Processing Systems 2015, December 7-12, 2015, Montreal, Quebec, Canada, pp. 2944-2952, 2015.
+Matteo Hessel, Joseph Modayil, Hado van Hasselt, Tom Schaul, Georg Ostrovski, Will Dabney, Dan Horgan, Bilal Piot, Mohammad Gheshlaghi Azar, and David Silver. Rainbow: Combining improvements in deep reinforcement learning. In Sheila A. McIlraith and Kilian Q. Weinberger (eds.), Proceedings of the Thirty-Second AAAI Conference on Artificial Intelligence, (AAAI-18), the 30th innovative Applications of Artificial Intelligence (IAAI-18), and the 8th AAAI Symposium on Educational Advances in Artificial Intelligence (EAAI-18), New Orleans, Louisiana, USA, February 2-7, 2018, pp. 3215-3222. AAAI Press, 2018.
+Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural computation, 9(8): 1735-1780, 1997.
+G. Zacharias Holland, Erik Talvitie, and Michael Bowling. The effect of planning shape on dyna-style planning in high-dimensional state spaces. CoRR, abs/1806.01825, 2018.
+Lukasz Kaiser and Samy Bengio. Discrete autoencoders for sequence models. CoRR, abs/1801.09797, 2018.
+Gabriel Kalweit and Joschka Boedecker. Uncertainty-driven imagination for continuous deep reinforcement learning. In Sergey Levine, Vincent Vanhoucke, and Ken Goldberg (eds.), Proceedings of the 1st Annual Conference on Robot Learning, volume 78 of Proceedings of Machine Learning Research, pp. 195-206. PMLR, 13-15 Nov 2017.
+Kacper Piotr Kielak. Do recent advancements in model-based deep reinforcement learning really improve data efficiency?, 2020. URL https://openreview.net/forum?id=Bke9u1HFwB.
+Diederik P. Kingma and Max Welling. Auto-encoding variational bayes. In Yoshua Bengio and Yann LeCun (eds.), 2nd International Conference on Learning Representations, ICLR 2014, Banff, AB, Canada, April 14-16, 2014, Conference Track Proceedings, 2014.
+Thanard Kurutach, Ignasi Clavera, Yan Duan, Aviv Tamar, and Pieter Abbeel. Model-ensemble trust-region policy optimization. In 6th International Conference on Learning Representations, ICLR 2018, Vancouver, BC, Canada, April 30 - May 3, 2018, Conference Track Proceedings. OpenReview.net, 2018. URL https://openreview.net/forum?id=SJJinbWRZ.
+Felix Leibfried, Nate Kushman, and Katja Hofmann. A deep learning approach for joint video frame and reward prediction in Atari games. CoRR, abs/1611.07078, 2016.
+Felix Leibfried, Rasul Tutunov, Peter Vrancx, and Haitham Bou-Ammar. Model-based regularization for deep reinforcement learning with transcoder networks. arXiv preprint arXiv:1809.01906, 2018.
+Marlos C. Machado, Marc G. Bellemare, Erik Talvitie, Joel Veness, Matthew J. Hausknecht, and Michael Bowling. Revisiting the arcade learning environment: Evaluation protocols and open problems for general agents. *J. Artif. Intell. Res.*, 61:523-562, 2018. doi: 10.1613/jair.5699.
+Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Alex Graves, Ioannis Antonoglou, Daan Wierstra, and Martin A. Riedmiller. Playing atari with deep reinforcement learning. CoRR, abs/1312.5602, 2013.
+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.
+
+Volodymyr Mnih, Adrià Puigdomènech Badia, Mehdi Mirza, Alex Graves, Timothy P. Lillicrap, Tim Harley, David Silver, and Koray Kavukcuoglu. Asynchronous methods for deep reinforcement learning. In Proceedings of the 33nd International Conference on Machine Learning, ICML, pp. 1928-1937, 2016.
+Junhyuk Oh, Xiaoxiao Guo, Honglak Lee, Richard L. Lewis, and Satinder P. Singh. Action-conditional video prediction using deep networks in atari games. In NIPS, pp. 2863-2871, 2015.
+Junhyuk Oh, Satinder Singh, and Honglak Lee. Value prediction network. In I. Guyon, U. V. Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett (eds.), Advances in Neural Information Processing Systems 30, pp. 6118-6128. Curran Associates, Inc., 2017.
+Chris Paxton, Yotam Barnoy, Kapil D. Katyal, Raman Arora, and Gregory D. Hager. Visual robot task planning. In International Conference on Robotics and Automation, ICRA 2019, Montreal, QC, Canada, May 20-24, 2019, pp. 8832-8838. IEEE, 2019. doi: 10.1109/ICRA.2019.8793736.
+A. J. Piergiovanni, Alan Wu, and Michael S. Ryoo. Learning real-world robot policies by dreaming. CoRR, abs/1805.07813, 2018.
+Tobias Pohlen, Bilal Piot, Todd Hester, Mohammad Gheshlaghi Azar, Dan Horgan, David Budden, Gabriel Barth-Maron, Hado van Hasselt, John Quan, Mel Vecerik, Matteo Hessel, Rémi Munos, and Olivier Pietquin. Observe and look further: Achieving consistent performance on atari. CoRR, abs/1805.11593, 2018.
+Oleh Rybkin, Karl Pertsch, Andrew Jaegle, Konstantinos G. Derpanis, and Kostas Daniilidis. Unsupervised learning of sensorimotor affordances by stochastic future prediction. CoRR, abs/1806.09655, 2018.
+Jürgen Schmidhuber. Formal theory of creativity, fun, and intrinsic motivation (1990-2010). IEEE Trans. Autonomous Mental Development, 2(3):230-247, 2010.
+John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. CoRR, abs/1707.06347, 2017.
+Shagun Sodhani, Anirudh Goyal, Tristan Deleu, Yoshua Bengio, Sergey Levine, and Jian Tang. Learning powerful policies by using consistent dynamics model. arXiv preprint arXiv:1906.04355, 2019.
+Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: a simple way to prevent neural networks from overfitting. The Journal of Machine Learning Research, 15(1):1929-1958, 2014.
+Richard S. Sutton. Dyna, an integrated architecture for learning, planning, and reacting. SIGART Bull., 2(4):160-163, July 1991.
+Richard S. Sutton and Andrew G. Barto. Reinforcement learning - an introduction, 2nd edition (work in progress). Adaptive computation and machine learning. MIT Press, 2017.
+Pedro Tsividis, Thomas Pouncy, Jaqueline L. Xu, Joshua B. Tenenbaum, and Samuel J. Gershman. Human learning in atari. In 2017 AAAI Spring Symposia, Stanford University, Palo Alto, California, USA, March 27-29, 2017, 2017.
+Aäron van den Oord, Oriol Vinyals, and Koray Kavukcuoglu. Neural discrete representation learning. In Isabelle Guyon, Ulrike von Luxburg, Samy Bengio, Hanna M. Wallach, Rob Fergus, S. V. N. Vishwanathan, and Roman Garnett (eds.), Advances in Neural Information Processing Systems 30: Annual Conference on Neural Information Processing Systems 2017, 4-9 December 2017, Long Beach, CA, USA, pp. 6306-6315, 2017.
+Hado van Hasselt, Matteo Hessel, and John Aslanides. When to use parametric models in reinforcement learning? In Hanna M. Wallach, Hugo Larochelle, Alina Beygelzimer, Florence d'Alché-Buc, Emily B. Fox, and Roman Garnett (eds.), Advances in Neural Information Processing Systems 32: Annual Conference on Neural Information Processing Systems 2019, NeurIPS 2019, 8-14 December 2019, Vancouver, BC, Canada, pp. 14322-14333, 2019.
+Arun Venkatraman, Roberto Capobianco, Lerrel Pinto, Martial Hebert, Daniele Nardi, and J. Andrew Bagnell. Improved learning of dynamics models for control. In International Symposium on Experimental Robotics, ISER 2016, Tokyo, Japan, October 3-6, 2016., pp. 703-713, 2016.
+Tingwu Wang, Xuchan Bao, Ignasi Clavera, Jerrick Hoang, Yeming Wen, Eric Langlois, Shunshi Zhang, Guodong Zhang, Pieter Abbeel, and Jimmy Ba. Benchmarking model-based reinforcement learning. CoRR, abs/1907.02057, 2019.
+Manuel Watter, Jost Tobias Springenberg, Joschka Boedecker, and Martin A. Riedmiller. Embed to control: A locally linear latent dynamics model for control from raw images. In Advances in Neural Information Processing Systems, pp. 2746-2754, 2015.
+
+Yuhuai Wu, Elman Mansimov, Roger B. Grosse, Shun Liao, and Jimmy Ba. Scalable trust-region method for deep reinforcement learning using kronecker-factored approximation. In Isabelle Guyon, Ulrike von Luxburg, Samy Bengio, Hanna M. Wallach, Rob Fergus, S. V. N. Vishwanathan, and Roman Garnett (eds.), Advances in Neural Information Processing Systems 30: Annual Conference on Neural Information Processing Systems 2017, 4-9 December 2017, Long Beach, CA, USA, pp. 5279-5288, 2017.
+
+Table 1: Summary of SimPLE ablations. For each game, a configuration was assigned a score being the mean over 5 experiments. The best and median scores were calculated per game. The table reports the number of games a given configuration achieved the best score or at least the median score, respectively.
+
+| model | best | at least median |
| deterministic | 0 | 7 |
| det. recurrent | 3 | 13 |
| SD | 8 | 16 |
| SD γ = 0.9 | 1 | 14 |
| default | 10 | 21 |
| SD 100 steps | 0 | 14 |
| SD 25 steps | 4 | 19 |
+
+All our code is available as part of the Tensor2Tensor library and it includes instructions on how to run our experiments: https://github.com/tensorflow/tensor2tensor/tree/master/tensor2tensor/rl.
+
+# A ABLATIONS
+
+To evaluate the design of our method, we independently varied a number of the design decisions: the choice of the model, the $\gamma$ parameter and the length of PPO rollouts. The results for 7 experimental configurations are summarized in the Table 1.
+
+Models. To assess the model choice, we evaluated the following models: deterministic, deterministic recurrent, and stochastic discrete (see Section 4). Based on Table 1 it can be seen that our proposed stochastic discrete model performs best. Figures 7a and 7b show the role of stochasticity and recurrence.
+
+Steps. See Figure 7d. As described in Section 5 every $N$ steps we reinitialize the simulated environment with ground-truth data. By default we use $N = 50$ , in some experiments we set $N = 25$ or $N = 100$ . It is clear from the table above and Figure 7d that 100 is a bit worse than either 25 or 50, likely due to compounding model errors, but this effect is much smaller than the effect of model architecture.
+
+Gamma. See Figure 8b. We used the discount factor $\gamma = 0.99$ unless specified otherwise. We see that $\gamma = 0.95$ is slightly better than other values, and we hypothesize that it is due to better tolerance to model imperfections. But overall, all three values of $\gamma$ seem to perform comparably at the same number of steps.
+
+Model-based iterations. The iterative process of training the model, training the policy, and collecting data is crucial for non-trivial tasks where simple random data collection is insufficient. In the game-by-game analysis, we quantified the number of games where the best results were obtained in later iterations of training. In some games, good policies could be learned very early. While this might have been due simply to the high variability of training, it does suggest the possibility that much faster training – in many fewer than 100k steps – could be obtained in future work with more directed exploration policies. We leave this question to future work.
+
+In Figure 9 we present the cumulative distribution plot for the (first) point during learning when the maximum score for the run was achieved in the main training loop of Algorithm 1.
+
+On Figure 7c we show results for experiments in which the number samples was fixed to be $100\mathrm{K}$ but the number of training loop varied. We conclude that 15 is beneficial for training.
+
+Long model training Our best results were obtained with much 5 times longer training of the world models, see Figure 8a for comparison with shorter training. Due to our resources constraints other ablations were made with the short model training setting.
+
+Random starts. Using short rollouts is crucial to mitigate the compounding errors under the model. To ensure exploration SimPLe starts rollouts from randomly selected states taken from the real data buffer D. In Figure 9 we present a comparison with an experiment without random starts and rollouts of length 1000 on Seaquest. These data strongly indicate that ablating random starts substantially deteriorate results.
+
+# B QUALITATIVE ANALYSIS
+
+This section provides a qualitative analysis and case studies of individual games. We emphasize that we did not adjust the method nor hyperparameters individually for each game, but we provide specific qualitative analysis to better understand the predictions from the model.4
+
+Solved games. The primary goal of our paper was to use model-based methods to achieve good performance within a modest budget of 100k interactions. For two games, Pong and Freeway, our method, SimPLe, was able to achieve the maximum score.
+
+Exploration. Freeway is a particularly interesting game. Though simple, it presents a substantial exploration challenge. The chicken, controlled by the agents, is quite slow to ascend when exploring randomly as it constantly gets bumped down by the cars (see the left video https://goo.gl/YHbKZ6). This makes it very unlikely to fully cross the road and obtain a non-zero reward. Nevertheless, SimPLe is able to capture such rare events, internalize them into the predictive model and then successfully learn a successful policy.
+
+However, this good performance did not happen on every run. We conjecture the following scenario in failing cases. If at early stages the entropy of the policy decayed too rapidly the collected experience stayed limited leading to a poor world model, which was not powerful enough to support exploration (e.g. the chicken disappears when moving to high). In one of our experiments, we observed that the final policy was that the chicken moved up only to the second lane and stayed waiting to be hit by the car and so on so forth.
+
+Pixel-perfect games. In some cases (for Pong, Freeway, Breakout) our models were able to predict the future perfectly, down to every pixel. This property holds for rather short time intervals, we observed episodes lasting up to 50 time-steps. Extending it to long sequences would be a very exciting research direction. See videos https://goo.gl/uyfNnW.
+
+Benign errors. Despite the aforementioned positive examples, accurate models are difficult to acquire for some games, especially at early stages of learning. However, model-based RL should be tolerant to modest model errors. Interestingly, in some cases our models differed from the original games in a way that was harmless or only mildly harmful for policy training.
+
+For example, in Bowling and Pong, the ball sometimes splits into two. While nonphysical, seemingly these errors did not distort much the objective of the game, see Figure 10 and also https://goo.gl/JPi7rB.
+
+In Kung Fu Master our model's predictions deviate from the real game by spawning a different number of opponents, see Figure 11. In Crazy Climber we observed the bird appearing earlier in the game. These cases are probably to be attributed to the stochasticity in the model. Though not aligned with the true environment, the predicted behaviors are plausible, and the resulting policy can still play the original game.
+
+Failures on hard games. On some of the games, our models simply failed to produce useful predictions. We believe that listing such errors may be helpful in designing better training protocols and building better models. The most common failure was due to the presence of very small but highly relevant objects. For example, in Atlantis and Battle Zone bullets are so small that they tend to disappear. Interestingly, Battle Zone has pseudo-3D graphics, which may have added to the difficulty. See videos https://goo.gl/uicccKU.
+
+
+(a) Effect of stochasticity.
+
+
+(b) Effect of recurrent architecture.
+
+
+(c) Effect of adjusting of number of epochs.
+Figure 7: Ablations part 1. The graphs are in the same format as Figure 3: each bar illustrates the number of interactions with environment required by Rainbow to achieve the same score as a particular variant of SimPLe. The red line indicates the $100K$ interactions threshold which is used by SimPLe.
+
+
+(d) Effect of adjusting of number of steps.
+
+
+(a) Effect of extended model training.
+
+
+(b) Effect of adjusting $\gamma$ in PPO training
+
+
+Figure 8: Ablations part 2. The graphs are in the same format as Figure 3: each bar illustrates the number of interactions with environment required by Rainbow to achieve the same score as a particular variant of SimPLe. The red line indicates the $100K$ interactions threshold which is used by SimPLe.
+Figure 9: (left) CDF of the number of iterations to acquire maximum score. The vertical axis represents the fraction of all games. (right) Comparison of random starts vs no random starts on Seaquest (for better readability we clip game rewards to $\{-1,0,1\}$ ). The vertical axis shows a mean reward and the horizontal axis the number of iterations of Algorithm 1.
+
+
+Figure 10: Frames from the Pong environment.
+
+
+Figure 11: Frames from the Kung Fu Master environment (left) and its model (right).
+
+Another interesting example comes from Private Eye in which the agent traverses different scenes, teleporting from one to the other. We found that our model generally struggled to capture such large global changes.
+
+# C ARCHITECTURE DETAILS
+
+The world model is a crucial ingredient of our algorithm. Therefore the neural-network architecture of the model plays a crucial role. The high-level overview of the architecture is given in Section 4 and Figure 2. We stress that the model is general, not Atari specific, and we believe it could handle other visual prediction tasks. The whole model has around 74M parameters and the inference/backpropagation time is approx. $0.5\mathrm{s} / 0.7\mathrm{s}$ respectively, where inference is on batch size 16 and backpropagation on batch size 2, running on NVIDIA Tesla P100. This gives us around 32ms per frame from our simulator, in comparison one step of the ALE simulator takes approximately 0.4ms.
+
+Below we give more details of the architecture. First, the frame prediction network:
+
+| Layer | Number of outputs | Other details |
| Input frame dense | 96 | - |
| Downscale convolution 1 | 192 | kernel 4x4, stride 2x2 |
| Downscale convolution 2 | 384 | kernel 4x4, stride 2x2 |
| Downscale convolution 3 | 768 | kernel 4x4, stride 2x2 |
| Downscale convolution 4 | 768 | kernel 4x4, stride 2x2 |
| Downscale convolution 5 | 768 | kernel 4x4, stride 2x2 |
| Downscale convolution 6 | 768 | kernel 4x4, stride 2x2 |
| Action embedding | 768 | - |
| Latent predictor embedding | 128 | - |
| Latent predictor LSTM | 128 | - |
| Latent predictor output dense | 256 | - |
| Reward predictor hidden | 128 | - |
| Reward predictor output dense | 3 | - |
| Middle convolution 1 | 768 | kernel 3x3, stride 1x1 |
| Middle convolution 2 | 768 | kernel 3x3, stride 1x1 |
| Upscale transposed convolution 1 | 768 | kernel 4x4, stride 2x2 |
| Upscale transposed convolution 2 | 768 | kernel 4x4, stride 2x2 |
| Upscale transposed convolution 3 | 768 | kernel 4x4, stride 2x2 |
| Upscale transposed convolution 4 | 384 | kernel 4x4, stride 2x2 |
| Upscale transposed convolution 5 | 192 | kernel 4x4, stride 2x2 |
| Upscale transposed convolution 6 | 96 | kernel 4x4, stride 2x2 |
| Output frame dense | 768 | - |
+
+The latent inference network, used just during training:
+
+| Layer | Number of outputs | Other details |
| Downscale convolution 1 | 128 | kernel 8x8, stride 4x4 |
| Downscale convolution 2 | 512 | kernel 8x8, stride 4x4 |
+
+All activation functions are ReLU, except for the layers marked as "output", which have softmax activations, and LSTM internal layers. In the frame prediction network, the downscale layers are connected to the corresponding upscale layers with residual connections. All convolution and transposed convolution layers are preceded by dropout 0.15 and followed by layer normalization. The latent predictor outputs 128 bits sequentially, in chunks of 8.
+
+# D NUMERICAL RESULTS
+
+Below we present numerical results of our experiments. We tested SimPLe on 7 configurations (see description in Section A). For each configuration we run 5 experiments. For the evaluation of the $i$ -th experiments we used the policy given by softmax(logits( $\pi_i$ /T)), where $\pi_i$ is the final learnt policy in the experiment and $T$ is the temperature parameter. We found empirically that $T = 0.5$ worked best in most cases. A tentative explanation is that polices with temperatures smaller than 1 are less stochastic and thus more stable. However, going down to $T = 0$ proved to be detrimental in many cases as, possibly, it makes policies more prone to imperfections of models.
+
+In Table 2 we present the mean and standard deviation of the 5 experiments. We observed that the median behaves rather similarly, which is reported it in Table 4. In this table we also show maximal scores over 5 runs. Interestingly, in many cases they turned out to be much higher. This, we hope, indicates that our methods has a further potential of reaching these higher scores.
+
+Human scores are "Avg. Human" from Table 3 in Pohlen et al. (2018).
+
+Table 2: Models comparison. Mean scores and standard deviations over five training runs. Right most columns presents score for random agent and human.
+
+| Game | Ours, deterministic | Ours, det. recurrent | Ours, SD long | Ours, SD | Ours, SD γ = 0.90 | Ours, SD γ = 0.95 | Ours, SD 100 steps | Ours, SD 25 steps | random | human |
| Alien | 378.3 | (85.5) | 321.7 | (50.7) | 616.9 | (252.2) | 405.2 | (130.8) | 413.0 | (89.7) | 590.2 | (57.8) | 435.6 | (78.9) | 534.8 | (166.2) | 184.8 | 7128.0 |
| Amidar | 62.4 | (15.2) | 86.7 | (18.8) | 74.3 | (28.3) | 88.0 | (23.8) | 50.3 | (11.7) | 78.3 | (18.8) | 37.7 | (15.1) | 82.2 | (43.0) | 11.8 | 1720.0 |
| Assault | 361.4 | (166.6) | 490.5 | (143.6) | 527.2 | (112.3) | 369.3 | (107.8) | 406.7 | (118.7) | 549.0 | (127.9) | 311.7 | (88.2) | 664.5 | (298.2) | 233.7 | 742.0 |
| Asterix | 668.0 | (294.1) | 1853.0 | (391.8) | 1128.3 | (211.8) | 1089.5 | (335.3) | 855.0 | (176.4) | 921.6 | (114.2) | 777.0 | (200.4) | 1340.6 | (627.5) | 248.8 | 8503.0 |
| Asteroids | 743.7 | (92.2) | 821.7 | (115.6) | 793.6 | (182.2) | 731.0 | (165.3) | 882.0 | (24.7) | 886.8 | (45.2) | 821.9 | (93.8) | 644.5 | (110.6) | 649.0 | 47389.0 |
| Atlantis | 14623.4 | (2122.5) | 12584.4 | (5823.6) | 20992.5 | (11062.0) | 14481.6 | (2436.9) | 18444.1 | (4616.0) | 14055.6 | (6226.1) | 14139.7 | (2500.9) | 11641.2 | (3385.0) | 16492.0 | 29028.0 |
| BankHeist | 13.8 | (2.5) | 15.1 | (2.2) | 34.2 | (29.2) | 8.2 | (4.4) | 11.9 | (2.5) | 12.0 | (1.4) | 13.1 | (3.2) | 12.7 | (4.7) | 15.0 | 753.0 |
| BattleZone | 3306.2 | (794.1) | 4665.6 | (2799.4) | 4031.2 | (1156.1) | 5184.4 | (1347.5) | 2781.2 | (661.7) | 4000.0 | (788.9) | 4068.8 | (2912.1) | 3746.9 | (1426.8) | 2895.0 | 37188.0 |
| BeamRider | 463.8 | (29.2) | 358.9 | (87.4) | 621.6 | (79.8) | 422.7 | (103.6) | 456.2 | (160.8) | 415.4 | (103.4) | 456.0 | (60.9) | 386.6 | (264.4) | 372.1 | 16926.0 |
| Bowling | 25.3 | (10.4) | 22.3 | (17.0) | 30.0 | (5.8) | 34.4 | (16.3) | 27.7 | (5.2) | 23.9 | (3.3) | 29.3 | (7.5) | 33.2 | (15.5) | 24.2 | 161.0 |
| Boxing | -9.3 | (10.9) | -3.1 | (14.1) | 7.8 | (10.1) | 9.1 | (8.8) | 11.6 | (12.6) | 5.1 | (10.0) | -2.1 | (5.0) | 1.6 | (14.7) | 0.3 | 12.0 |
| Breakout | 6.1 | (2.8) | 10.2 | (5.1) | 16.4 | (6.2) | 12.7 | (3.8) | 7.3 | (2.4) | 8.8 | (5.1) | 11.4 | (3.7) | 7.8 | (4.1) | 0.9 | 30.0 |
| ChopperCommand | 906.9 | (210.2) | 709.1 | (174.1) | 979.4 | (172.7) | 1246.9 | (392.0) | 725.6 | (204.2) | 946.6 | (49.9) | 729.1 | (185.1) | 1047.2 | (221.6) | 671.0 | 7388.0 |
| CrazyClimber | 19380.0 | (6138.8) | 54700.3 | (14480.5) | 62583.6 | (16856.8) | 39827.8 | (22582.6) | 49840.9 | (11920.9) | 34353.1 | (33547.2) | 48651.2 | (14903.5) | 25612.2 | (14037.5) | 7339.5 | 35829.0 |
| DemonAttack | 191.9 | (86.3) | 120.3 | (38.3) | 208.1 | (56.8) | 169.5 | (41.8) | 187.5 | (68.6) | 194.9 | (89.6) | 170.1 | (42.4) | 202.2 | (134.0) | 140.0 | 1971.0 |
| FishingDerby | -94.5 | (3.0) | -96.9 | (1.7) | -90.7 | (5.3) | -91.5 | (2.8) | -91.0 | (4.1) | -92.6 | (3.2) | -90.0 | (2.7) | -94.5 | (2.5) | -93.6 | -39.0 |
| Freeway | 5.9 | (13.1) | 23.7 | (13.5) | 16.7 | (15.7) | 20.3 | (18.5) | 18.9 | (17.2) | 27.7 | (13.3) | 19.1 | (16.7) | 27.3 | (5.8) | 0.0 | 30.0 |
| Frostbite | 196.4 | (4.4) | 219.6 | (21.4) | 236.9 | (31.5) | 254.7 | (4.9) | 234.6 | (26.8) | 239.2 | (19.1) | 226.8 | (16.9) | 252.1 | (54.4) | 74.0 | - |
| Gopher | 510.2 | (158.4) | 225.2 | (105.7) | 596.8 | (183.5) | 771.0 | (160.2) | 845.6 | (230.3) | 612.6 | (273.9) | 698.4 | (213.9) | 509.7 | (273.4) | 245.9 | 2412.0 |
| Gravitar | 237.0 | (73.1) | 213.8 | (57.4) | 173.4 | (54.7) | 198.3 | (39.9) | 219.4 | (7.8) | 213.0 | (37.3) | 188.9 | (27.6) | 116.4 | (84.0) | 227.2 | 3351.0 |
| Hero | 621.5 | (1281.3) | 558.3 | (1143.3) | 2656.6 | (483.1) | 1295.1 | (1600.1) | 2853.9 | (539.5) | 3503.5 | (892.9) | 3052.7 | (169.3) | 1484.8 | (1671.7) | 224.6 | 30826.0 |
| IceHockey | -12.6 | (2.1) | -14.0 | (1.8) | -11.6 | (2.5) | -10.5 | (2.2) | -12.2 | (2.9) | -11.9 | (1.2) | -13.5 | (3.0) | -13.9 | (3.9) | -9.7 | 1.0 |
| Jamesbond | 68.8 | (37.2) | 100.5 | (69.8) | 100.5 | (36.8) | 125.3 | (112.5) | 28.9 | (12.7) | 50.5 | (21.3) | 68.9 | (42.7) | 163.4 | (81.8) | 29.2 | 303.0 |
| Kangaroo | 481.9 | (313.2) | 191.9 | (301.0) | 51.2 | (17.8) | 323.1 | (359.8) | 148.1 | (121.5) | 37.5 | (8.0) | 301.2 | (593.4) | 340.0 | (470.4) | 42.0 | 3035.0 |
| Krull | 834.9 | (166.3) | 1778.5 | (906.9) | 2204.8 | (776.5) | 4539.9 | (2470.4) | 2396.5 | (962.0) | 2620.9 | (856.2) | 3559.0 | (1896.7) | 3320.6 | (2410.1) | 1543.3 | 2666.0 |
| KungFuMaster | 10340.9 | (8835.7) | 4086.6 | (3384.5) | 14862.5 | (4031.6) | 17257.2 | (5502.6) | 12587.8 | (6810.0) | 16926.6 | (6598.3) | 17121.2 | (7211.6) | 15541.2 | (5086.1) | 616.5 | 22736.0 |
| MsPacman | 560.6 | (172.2) | 1098.1 | (450.9) | 1480.0 | (288.2) | 762.8 | (331.5) | 1197.1 | (544.6) | 1273.3 | (59.5) | 921.0 | (306.0) | 805.8 | (261.1) | 235.2 | 6952.0 |
| NameThisGame | 1512.1 | (408.3) | 2007.9 | (367.0) | 2420.7 | (289.4) | 1990.4 | (284.7) | 2058.1 | (103.7) | 2114.8 | (387.4) | 2067.2 | (304.8) | 1805.3 | (453.4) | 2136.8 | 8049.0 |
| Pong | -17.4 | (5.2) | -11.6 | (15.9) | 12.8 | (17.2) | 5.2 | (9.7) | -2.9 | (7.3) | -2.5 | (15.4) | -13.9 | (7.7) | -1.0 | (14.9) | -20.4 | 15.0 |
| PrivateEye | 16.4 | (46.7) | 50.8 | (43.2) | 35.0 | (60.2) | 58.3 | (45.4) | 54.4 | (49.0) | 67.8 | (26.4) | 88.3 | (19.0) | 1334.3 | (1794.5) | 26.6 | 69571.0 |
| Qbert | 480.4 | (158.8) | 603.7 | (150.3) | 1288.8 | (1677.9) | 559.8 | (183.8) | 899.3 | (474.3) | 1120.2 | (697.1) | 534.4 | (162.5) | 603.4 | (138.2) | 166.1 | 13455.0 |
| Riverraid | 1285.6 | (604.6) | 1740.7 | (458.1) | 1957.8 | (758.1) | 1587.0 | (818.0) | 1977.4 | (332.7) | 2115.1 | (106.2) | 1318.7 | (540.4) | 1426.0 | (374.0) | 1451.0 | 17118.0 |
| RoadRunner | 5724.4 | (3093.1) | 1228.8 | (1025.9) | 5640.6 | (3936.6) | 5169.4 | (3939.0) | 1586.2 | (1574.1) | 8414.1 | (4542.8) | 722.2 | (627.2) | 4366.2 | (3867.8) | 0.0 | 7845.0 |
| Seaquest | 419.5 | (236.2) | 289.6 | (110.4) | 683.3 | (171.2) | 370.9 | (128.2) | 364.6 | (138.6) | 337.8 | (79.0) | 247.8 | (72.4) | 350.0 | (136.8) | 61.1 | 42055.0 |
| UpNDown | 1329.3 | (495.3) | 926.7 | (335.7) | 3350.3 | (3540.0) | 2152.6 | (1192.4) | 1291.2 | (324.6) | 1250.6 | (493.0) | 1828.4 | (688.3) | 2136.5 | (2095.0) | 488.4 | 11693.0 |
| YarsRevenge | 3014.9 | (397.4) | 3291.4 | (1097.3) | 5664.3 | (1870.5) | 2980.2 | (778.6) | 2934.2 | (459.2) | 3366.6 | (493.0) | 2673.7 | (216.8) | 4666.1 | (1889.4) | 3121.2 | 54577.0 |
+
+Table 3: Comparison of our method (SimPLe) with model-free benchmarks - PPO and Rainbow, trained with 100 thousands/500 thousands/1 million steps. (1 step equals 4 frames)
+
+| Game | SimPLe | PPO_100k | PPO_500k | PPO_1m | Rainbow_100k | Rainbow_500k | Rainbow_1m | random | human |
| Alien | 616.9 | (252.2) | 291.0 | (40.3) | 269.0 | (203.4) | 362.0 | (102.0) | 290.6 | (14.8) | 828.6 | (54.2) | 945.0 | (85.0) | 184.8 | 7128.0 |
| Amidar | 74.3 | (28.3) | 56.5 | (20.8) | 93.2 | (36.7) | 123.8 | (19.7) | 20.8 | (2.3) | 194.0 | (34.9) | 275.8 | (66.7) | 11.8 | 1720.0 |
| Assault | 527.2 | (112.3) | 424.2 | (55.8) | 552.3 | (110.4) | 1134.4 | (798.8) | 300.3 | (14.6) | 1041.5 | (92.1) | 1581.8 | (207.8) | 233.7 | 742.0 |
| Asterix | 1128.3 | (211.8) | 385.0 | (104.4) | 1085.0 | (354.8) | 2185.0 | (931.6) | 285.7 | (9.3) | 1702.7 | (162.8) | 2151.6 | (202.6) | 248.8 | 8503.0 |
| Asteroids | 793.6 | (182.2) | 1134.0 | (326.9) | 1053.0 | (433.3) | 1251.0 | (377.9) | 912.3 | (62.7) | 895.9 | (82.0) | 1071.5 | (91.7) | 649.0 | 47389.0 |
| Atlantis | 20992.5 | (11062.0) | 34316.7 | (5703.8) | 4836416.7 | (6218247.3) | - | (-) | 17881.8 | (617.6) | 79541.0 | (25393.4) | 84880.0 | (37533.1) | 16492.0 | 29028.0 |
| BankHeist | 34.2 | (29.2) | 16.0 | (12.4) | 641.0 | (352.8) | 856.0 | (376.7) | 34.5 | (2.0) | 727.3 | (198.3) | 1053.3 | (22.9) | 15.0 | 753.0 |
| BattleZone | 4031.2 | (1156.1) | 5300.0 | (3655.1) | 14400.0 | (6476.1) | 19000.0 | (4571.7) | 3363.5 | (523.8) | 19507.1 | (3193.3) | 22391.4 | (7708.9) | 2895.0 | 37188.0 |
| BeamRider | 621.6 | (79.8) | 563.6 | (189.4) | 497.6 | (103.5) | 684.0 | (168.8) | 365.6 | (29.8) | 5890.0 | (525.6) | 6945.3 | (1390.8) | 372.1 | 16926.0 |
| Bowling | 30.0 | (5.8) | 17.7 | (11.2) | 28.5 | (3.4) | 35.8 | (6.2) | 24.7 | (0.8) | 31.0 | (1.9) | 30.6 | (6.2) | 24.2 | 161.0 |
| Boxing | 7.8 | (10.1) | -3.9 | (6.4) | 3.5 | (3.5) | 19.6 | (20.9) | 0.9 | (1.7) | 58.2 | (16.5) | 80.3 | (5.6) | 0.3 | 12.0 |
| Breakout | 16.4 | (6.2) | 5.9 | (3.3) | 66.1 | (114.3) | 128.0 | (153.3) | 3.3 | (0.1) | 26.7 | (2.4) | 38.7 | (3.4) | 0.9 | 30.0 |
| ChopperCommand | 979.4 | (172.7) | 730.0 | (199.0) | 860.0 | (285.3) | 970.0 | (201.5) | 776.6 | (59.0) | 1765.2 | (280.7) | 2474.0 | (504.5) | 671.0 | 7388.0 |
| CrazyClimber | 62583.6 | (16856.8) | 18400.0 | (5275.1) | 33420.0 | (3628.3) | 58000.0 | (16994.6) | 12558.3 | (674.6) | 75655.1 | (9439.6) | 97088.1 | (9975.4) | 7339.5 | 35829.0 |
| DemonAttack | 208.1 | (56.8) | 192.5 | (83.1) | 216.5 | (96.2) | 241.0 | (135.0) | 431.6 | (79.5) | 3642.1 | (478.2) | 5478.6 | (297.9) | 140.0 | 1971.0 |
| FishingDerby | -90.7 | (5.3) | -95.6 | (4.3) | -87.2 | (5.3) | -88.8 | (4.0) | -91.1 | (2.1) | -66.7 | (6.0) | -23.2 | (22.3) | -93.6 | -39.0 |
| Freeway | 16.7 | (15.7) | 8.0 | (9.8) | 14.0 | (11.5) | 20.8 | (11.1) | 0.1 | (0.1) | 12.6 | (15.4) | 13.0 | (15.9) | 0.0 | 30.0 |
| Frostbite | 236.9 | (31.5) | 174.0 | (40.7) | 214.0 | (10.2) | 229.0 | (20.6) | 140.1 | (2.7) | 1386.1 | (321.7) | 2972.3 | (284.9) | 74.0 | - |
| Gopher | 596.8 | (183.5) | 246.0 | (103.3) | 560.0 | (118.8) | 696.0 | (279.3) | 748.3 | (105.4) | 1640.5 | (105.6) | 1905.0 | (211.1) | 245.9 | 2412.0 |
| Gravitar | 173.4 | (54.7) | 235.0 | (197.2) | 235.0 | (134.7) | 325.0 | (85.1) | 231.4 | (50.7) | 214.9 | (27.6) | 260.0 | (22.7) | 227.2 | 3351.0 |
| Hero | 2656.6 | (483.1) | 569.0 | (1100.9) | 1824.0 | (1461.2) | 3719.0 | (1306.0) | 2676.3 | (93.7) | 10664.3 | (1060.5) | 13295.5 | (261.2) | 224.6 | 30826.0 |
| IceHockey | -11.6 | (2.5) | -10.0 | (2.1) | -6.6 | (1.6) | -5.3 | (1.7) | -9.5 | (0.8) | -9.7 | (0.8) | -6.5 | (0.5) | -9.7 | 1.0 |
| Jamesbond | 100.5 | (36.8) | 65.0 | (46.4) | 255.0 | (101.7) | 310.0 | (129.0) | 61.7 | (8.8) | 429.7 | (27.9) | 692.6 | (316.2) | 29.2 | 303.0 |
| Kangaroo | 51.2 | (17.8) | 140.0 | (102.0) | 340.0 | (407.9) | 840.0 | (806.5) | 38.7 | (9.3) | 970.9 | (501.9) | 4084.6 | (1954.1) | 42.0 | 3035.0 |
| Krull | 2204.8 | (776.5) | 3750.4 | (3071.9) | 3056.1 | (1155.5) | 5061.8 | (1333.4) | 2978.8 | (148.4) | 4139.4 | (336.2) | 4971.1 | (360.3) | 1543.3 | 2666.0 |
| KungFuMaster | 14862.5 | (4031.6) | 4820.0 | (983.2) | 17370.0 | (10707.6) | 13780.0 | (3971.6) | 1019.4 | (149.6) | 19346.1 | (3274.4) | 21258.6 | (3210.2) | 616.5 | 22736.0 |
| MsPacman | 1480.0 | (288.2) | 496.0 | (379.8) | 306.0 | (70.2) | 594.0 | (247.9) | 364.3 | (20.4) | 1558.0 | (248.9) | 1881.4 | (112.0) | 235.2 | 6952.0 |
| NameThisGame | 2420.7 | (289.4) | 2225.0 | (423.7) | 2106.0 | (898.8) | 2311.0 | (547.6) | 2368.2 | (318.3) | 4886.5 | (583.1) | 4454.2 | (338.3) | 2136.8 | 8049.0 |
| Pong | 12.8 | (17.2) | -20.5 | (0.6) | -8.6 | (14.9) | 14.7 | (5.1) | -19.5 | (0.2) | 19.9 | (0.4) | 20.6 | (0.2) | -20.4 | 15.0 |
| PrivateEye | 35.0 | (60.2) | 10.0 | (20.0) | 20.0 | (40.0) | 20.0 | (40.0) | 42.1 | (53.8) | -6.2 | (89.8) | 2336.7 | (4732.6) | 26.6 | 69571.0 |
| Qbert | 1288.8 | (1677.9) | 362.5 | (117.8) | 757.5 | (78.9) | 2675.0 | (1701.1) | 235.6 | (12.9) | 4241.7 | (193.1) | 8885.2 | (1690.9) | 166.1 | 13455.0 |
| Riverraid | 1957.8 | (758.1) | 1398.0 | (513.8) | 2865.0 | (327.1) | 2887.0 | (807.0) | 1904.2 | (44.2) | 5068.6 | (292.6) | 7018.9 | (334.2) | 1451.0 | 17118.0 |
| RoadRunner | 5640.6 | (3936.6) | 1430.0 | (760.0) | 5750.0 | (5259.9) | 8930.0 | (4304.0) | 524.1 | (147.5) | 18415.4 | (5280.0) | 31379.7 | (3225.8) | 0.0 | 7845.0 |
| Seaquest | 683.3 | (171.2) | 370.0 | (103.3) | 692.0 | (48.3) | 882.0 | (122.7) | 206.3 | (17.1) | 1558.7 | (221.2) | 3279.9 | (683.9) | 61.1 | 42055.0 |
| UpNDown | 3350.3 | (3540.0) | 2874.0 | (1105.8) | 12126.0 | (1389.5) | 13777.0 | (6766.3) | 1346.3 | (95.1) | 6120.7 | (356.8) | 8010.9 | (907.0) | 488.4 | 11693.0 |
| YarsRevenge | 5664.3 | (1870.5) | 5182.0 | (1209.3) | 8064.8 | (2859.8) | 9495.0 | (2638.3) | 3649.0 | (168.6) | 7005.7 | (394.2) | 8225.1 | (957.9) | 3121.2 | 54577.0 |
+
+Table 4: Models comparison. Scores of median (left) and best (right) models out of five training runs. Right most columns presents score for random agent and human.
+
+| Game | Ours, deterministic | Ours, det. recurrent | Ours, SD long | Ours, SD | Ours, SD γ = 0.90 | Ours, SD γ = 0.95 | SD 100 steps | Ours, SD 25 steps | random | human |
| Alien | 354.4 | 516.6 | 299.2 | 381.1 | 515.9 | 1030.5 | 409.2 | 586.9 | 411.9 | 530.5 | 567.3 | 682.7 | 399.5 | 522.3 | 525.5 | 792.8 | 184.8 | 7128.0 |
| Amidar | 58.0 | 84.8 | 82.7 | 118.4 | 80.2 | 102.7 | 85.1 | 114.0 | 55.1 | 58.9 | 84.3 | 101.4 | 45.2 | 47.5 | 93.1 | 137.7 | 11.8 | 1720.0 |
| Assault | 334.4 | 560.1 | 566.6 | 627.2 | 509.1 | 671.1 | 355.7 | 527.9 | 369.1 | 614.4 | 508.4 | 722.5 | 322.9 | 391.1 | 701.4 | 1060.3 | 233.7 | 742.0 |
| Asterix | 529.7 | 1087.5 | 1798.4 | 2282.0 | 1065.6 | 1485.2 | 1158.6 | 1393.8 | 805.5 | 1159.4 | 923.4 | 1034.4 | 813.3 | 1000.0 | 1128.1 | 2313.3 | 248.8 | 8503.0 |
| Asteroids | 727.3 | 854.7 | 827.7 | 919.8 | 899.7 | 955.6 | 671.2 | 962.0 | 885.5 | 909.1 | 886.1 | 949.5 | 813.8 | 962.2 | 657.5 | 752.7 | 649.0 | 47389.0 |
| Atlantis | 15587.5 | 16545.3 | 15939.1 | 17778.1 | 13695.3 | 34890.6 | 13645.3 | 18396.9 | 19367.2 | 23046.9 | 12981.2 | 23579.7 | 15020.3 | 16790.6 | 12196.9 | 15728.1 | 16492.0 | 29028.0 |
| BankHeist | 14.4 | 16.2 | 14.7 | 18.8 | 31.9 | 77.5 | 8.9 | 13.9 | 12.3 | 14.5 | 12.3 | 13.1 | 12.8 | 17.2 | 14.1 | 17.0 | 15.0 | 753.0 |
| BattleZone | 3312.5 | 4140.6 | 4515.6 | 9312.5 | 3484.4 | 5359.4 | 5390.6 | 7093.8 | 2937.5 | 3343.8 | 4421.9 | 4703.1 | 3500.0 | 8906.2 | 3859.4 | 5734.4 | 2895.0 | 37188.0 |
| BeamRider | 453.1 | 515.5 | 351.4 | 470.2 | 580.2 | 728.8 | 433.9 | 512.6 | 393.5 | 682.8 | 446.6 | 519.2 | 447.1 | 544.6 | 385.7 | 741.9 | 372.1 | 16926.0 |
| Bowling | 27.0 | 36.2 | 28.4 | 43.7 | 28.0 | 39.6 | 24.9 | 55.0 | 27.7 | 34.9 | 22.6 | 28.6 | 28.4 | 39.9 | 37.0 | 54.7 | 24.2 | 161.0 |
| Boxing | -7.1 | 0.2 | 3.5 | 5.0 | 9.4 | 21.0 | 8.3 | 21.5 | 6.4 | 31.5 | 2.5 | 15.0 | -0.7 | 2.2 | -0.9 | 20.8 | 0.3 | 12.0 |
| Breakout | 5.5 | 9.8 | 12.5 | 13.9 | 16.0 | 22.8 | 11.0 | 19.5 | 7.4 | 10.4 | 10.2 | 14.1 | 10.5 | 16.7 | 6.9 | 13.0 | 0.9 | 30.0 |
| ChopperCommand | 942.2 | 1167.2 | 748.4 | 957.8 | 909.4 | 1279.7 | 1139.1 | 1909.4 | 682.8 | 1045.3 | 954.7 | 1010.9 | 751.6 | 989.1 | 1031.2 | 1329.7 | 671.0 | 7388.0 |
| CrazyClimber | 20754.7 | 23831.2 | 49854.7 | 80156.2 | 55795.3 | 87593.8 | 41396.9 | 67250.0 | 56875.0 | 58979.7 | 19448.4 | 84070.3 | 53406.2 | 64196.9 | 19345.3 | 43179.7 | 7339.5 | 35829.0 |
| DemonAttack | 219.2 | 263.0 | 135.8 | 148.4 | 191.2 | 288.9 | 182.4 | 223.9 | 160.3 | 293.8 | 204.1 | 312.8 | 164.4 | 222.6 | 187.5 | 424.8 | 140.0 | 1971.0 |
| FishingDerby | -94.3 | -90.2 | -97.3 | -94.2 | -91.8 | -84.3 | -91.6 | -88.6 | -90.0 | -85.7 | -92.0 | -88.8 | -90.6 | -85.4 | -95.0 | -90.7 | -93.6 | -39.0 |
| Freeway | 0.0 | 29.3 | 29.3 | 32.2 | 21.5 | 32.0 | 33.5 | 34.0 | 31.1 | 32.0 | 33.5 | 33.8 | 30.0 | 32.3 | 29.9 | 33.5 | 0.0 | 30.0 |
| Frostbite | 194.5 | 203.9 | 213.4 | 256.2 | 248.8 | 266.9 | 253.1 | 262.8 | 246.7 | 261.7 | 250.0 | 255.9 | 215.8 | 247.7 | 249.4 | 337.5 | 74.0 | - |
| Gopher | 514.7 | 740.6 | 270.3 | 320.9 | 525.3 | 845.6 | 856.9 | 934.4 | 874.1 | 1167.2 | 604.1 | 1001.6 | 726.9 | 891.6 | 526.2 | 845.0 | 245.9 | 2412.0 |
| Gravitar | 232.8 | 310.2 | 219.5 | 300.0 | 156.2 | 233.6 | 202.3 | 252.3 | 223.4 | 225.8 | 228.1 | 243.8 | 193.8 | 218.0 | 93.0 | 240.6 | 227.2 | 3351.0 |
| Hero | 71.5 | 2913.0 | 75.0 | 2601.5 | 2935.0 | 3061.6 | 237.5 | 3133.8 | 3135.0 | 3147.5 | 3066.2 | 5092.0 | 3067.3 | 3256.9 | 1487.2 | 2964.8 | 224.6 | 30826.0 |
| IceHockey | -12.4 | -9.9 | -14.8 | -11.8 | -12.3 | -7.2 | -10.0 | -7.7 | -11.8 | -8.5 | -11.6 | -10.7 | -12.9 | -10.0 | -12.2 | -11.0 | -9.7 | 1.0 |
| Jamesbond | 64.8 | 128.9 | 64.8 | 219.5 | 110.9 | 141.4 | 87.5 | 323.4 | 25.0 | 46.9 | 58.6 | 69.5 | 61.7 | 139.1 | 139.8 | 261.7 | 29.2 | 303.0 |
| Kangaroo | 500.0 | 828.1 | 68.8 | 728.1 | 62.5 | 65.6 | 215.6 | 909.4 | 103.1 | 334.4 | 34.4 | 50.0 | 43.8 | 1362.5 | 56.2 | 1128.1 | 42.0 | 3035.0 |
| Krull | 852.2 | 1014.3 | 1783.6 | 2943.6 | 1933.7 | 3317.5 | 4264.3 | 7163.2 | 1874.8 | 3554.5 | 2254.0 | 3827.1 | 3142.8 | 6315.2 | 3198.2 | 6833.4 | 1543.3 | 2666.0 |
| KungFuMaster | 7575.0 | 20450.0 | 4848.4 | 8065.6 | 14318.8 | 21054.7 | 17448.4 | 21943.8 | 12964.1 | 21956.2 | 20195.3 | 23690.6 | 19718.8 | 25375.0 | 18025.0 | 20365.6 | 616.5 | 22736.0 |
| MsPacman | 557.3 | 818.0 | 1178.8 | 1685.9 | 1525.0 | 1903.4 | 751.2 | 1146.1 | 1410.5 | 1538.9 | 1277.3 | 1354.5 | 866.2 | 1401.9 | 777.2 | 1227.8 | 235.2 | 6952.0 |
| NameThisGame | 1468.1 | 1992.7 | 1826.7 | 2614.5 | 2460.0 | 2782.8 | 1919.8 | 2377.7 | 2087.3 | 2155.2 | 1994.8 | 2570.3 | 2153.4 | 2471.9 | 1964.2 | 2314.8 | 2136.8 | 8049.0 |
| Pong | -19.6 | -8.5 | -17.3 | 16.7 | 20.7 | 21.0 | 1.4 | 21.0 | -2.0 | 6.6 | 3.8 | 14.2 | -17.9 | -2.0 | -10.1 | 21.0 | -20.4 | 15.0 |
| PrivateEye | 0.0 | 98.9 | 75.0 | 82.8 | 0.0 | 100.0 | 76.6 | 100.0 | 75.0 | 96.9 | 60.9 | 100.0 | 96.9 | 99.3 | 100.0 | 4038.7 | 26.6 | 69571.0 |
| Qbert | 476.6 | 702.7 | 555.9 | 869.9 | 656.2 | 4259.0 | 508.6 | 802.7 | 802.3 | 1721.9 | 974.6 | 2322.3 | 475.0 | 812.5 | 668.8 | 747.3 | 166.1 | 13455.0 |
| Riverraid | 1416.1 | 1929.4 | 1784.4 | 2274.5 | 2360.0 | 2659.8 | 1799.4 | 2158.4 | 2053.8 | 2307.5 | 2143.6 | 2221.2 | 1387.8 | 1759.8 | 1345.5 | 1923.4 | 1451.0 | 17118.0 |
| RoadRunner | 5901.6 | 8484.4 | 781.2 | 2857.8 | 5906.2 | 11176.6 | 2804.7 | 10676.6 | 1620.3 | 4104.7 | 7032.8 | 14978.1 | 857.8 | 1342.2 | 2717.2 | 8560.9 | 0.0 | 7845.0 |
| Seaquest | 414.4 | 768.1 | 236.9 | 470.6 | 711.6 | 854.1 | 386.9 | 497.2 | 330.9 | 551.2 | 332.8 | 460.9 | 274.1 | 317.2 | 366.9 | 527.2 | 61.1 | 42055.0 |
| UpNDown | 1195.9 | 2071.1 | 1007.5 | 1315.2 | 1616.1 | 8614.5 | 2389.5 | 3798.3 | 1433.3 | 1622.0 | 1248.6 | 1999.4 | 1670.3 | 2728.0 | 1825.2 | 5193.1 | 488.4 | 11693.0 |
| YarsRevenge | 3047.0 | 3380.5 | 3416.3 | 4230.8 | 6580.2 | 7547.4 | 2435.5 | 3914.1 | 2955.9 | 3314.5 | 3434.8 | 3896.3 | 2745.3 | 2848.1 | 4276.3 | 6673.1 | 3121.2 | 54577.0 |
+
+# E BASELINES OPTIMIZATION
+
+To assess the performance of SimPle we compare it with model-free algorithms. To make this comparison more reliable we tuned Rainbow in the low data regime. To this end we run an hyperparameter search over the following parameters from https://github.com/google/dopamine/blob/master/dopamine/agents/rainbow/rainbow_agent.py:
+
+- update_horizon in $\{1,3\}$ , best parameter $= 3$
+- min_replay_history in $\{500, 5000, 20000\}$ , best parameter = 20000
+- update_period in $\{1,4\}$ , best parameter $= 4$
+- target_update_period $\{50,100,1000,4000\}$ , best parameter $= 8000$
+- replay Scheme in {uniform, prioritized}, best parameter = prioritized
+
+Each set of hyperparameters was used to train 5 Rainbow agents on the game of Pong until 1 million of interactions with the environment. Their average performance was used to pick the best hyperparameter set.
+
+For PPO we used the standard set of hyperparameters from https://github.com/openai/baselines.
+
+# F RESULTS AT DIFFERENT NUMBERS OF INTERACTIONS
+
+
+(a) Fraction at 100K clipped to 10.
+
+
+(b) Fraction at $200\mathrm{K}$
+
+
+(c) Fraction at $500\mathrm{K}$ .
+Figure 12: Fractions of the rainbow scores at given number of samples. These were calculated with the formula (SimPLe_score - random_score)/(rainbow_score - random_score); if denominator is smaller than 0, both nominator and denominator are increased by 1.
+
+
+(d) Fraction at 1M.
+
+
+(a) Fraction at 100K clipped to 10.
+
+
+(b) Fraction at $200\mathrm{K}$
+
+
+(c) Fraction at $500\mathrm{K}$ .
+Figure 13: Fractions of the ppo scores at given number of samples. These were calculated with the formula (SimPLe_score - random_score)/(ppo_score - random_score); if denominator is smaller than 0, both nominator and denominator are increased by 1.
+
+
+(d) Fraction at 1M.
+
+
+(a) SimPLe compared to Rainbow at $100\mathrm{K}$ .
+
+
+(b) SimPLe compared to Rainbow at $200\mathrm{K}$
+
+
+(c) SimPLE compared to PPO at $100\mathrm{K}$ .
+Figure 14: Comparison of scores from Simple against Rainbow and PPO at different numbers of interactions. The following formula is used: (SimPLe_score@100K - baseline_score)/human_score. Points are normalized by average human score in order to be presentable in one graph.
+
+
+(d) SimPLE compared to PPO at $200\mathrm{K}$ .
\ No newline at end of file
diff --git a/modelbasedreinforcementlearningforatari/images.zip b/modelbasedreinforcementlearningforatari/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..b1a69df9a3328cfd37fc2a2a5fc6378b4a099bf8
--- /dev/null
+++ b/modelbasedreinforcementlearningforatari/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b4d1ecfc30f9a1bd50ed705d6c05d123c9dfad2d38cee8e9c2e2138c3440c81f
+size 2067702
diff --git a/modelbasedreinforcementlearningforatari/layout.json b/modelbasedreinforcementlearningforatari/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..2b70e48a23e67964e21cfc1cbed8188a73366320
--- /dev/null
+++ b/modelbasedreinforcementlearningforatari/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0ddecc136d7061401ec5febc5561aa8a3a58bf77cd3d6bcb1c0c24fba83cb2ea
+size 629740
diff --git a/multiscalerepresentationlearningforspatialfeaturedistributionsusinggridcells/22093e02-8796-40ec-8257-addaa071fd13_content_list.json b/multiscalerepresentationlearningforspatialfeaturedistributionsusinggridcells/22093e02-8796-40ec-8257-addaa071fd13_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..337c0dd69e82517f37b956d7737f8d0fdb608d52
--- /dev/null
+++ b/multiscalerepresentationlearningforspatialfeaturedistributionsusinggridcells/22093e02-8796-40ec-8257-addaa071fd13_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e5a80e0065a326369068b012313c9f2e093781f599a44c8e6a34166090447151
+size 110274
diff --git a/multiscalerepresentationlearningforspatialfeaturedistributionsusinggridcells/22093e02-8796-40ec-8257-addaa071fd13_model.json b/multiscalerepresentationlearningforspatialfeaturedistributionsusinggridcells/22093e02-8796-40ec-8257-addaa071fd13_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..506f8182c1b37d1ac3dfbd6541887a11d73dfc5b
--- /dev/null
+++ b/multiscalerepresentationlearningforspatialfeaturedistributionsusinggridcells/22093e02-8796-40ec-8257-addaa071fd13_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:1769da13b707f9b0f19dffd386f7a5fb3b9afb490bb2aaca2ff4f64224a1b3a4
+size 136961
diff --git a/multiscalerepresentationlearningforspatialfeaturedistributionsusinggridcells/22093e02-8796-40ec-8257-addaa071fd13_origin.pdf b/multiscalerepresentationlearningforspatialfeaturedistributionsusinggridcells/22093e02-8796-40ec-8257-addaa071fd13_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..29fcec265e38deaffe3635cd9c52e52738dd4bb1
--- /dev/null
+++ b/multiscalerepresentationlearningforspatialfeaturedistributionsusinggridcells/22093e02-8796-40ec-8257-addaa071fd13_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f709816b978d52b1cda435bdfe7bb6767d619f11f95a32b0405605d35c67c7bb
+size 2133757
diff --git a/multiscalerepresentationlearningforspatialfeaturedistributionsusinggridcells/full.md b/multiscalerepresentationlearningforspatialfeaturedistributionsusinggridcells/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..96c935f1fbc4b2c6336c25a80ec41f6bce60957b
--- /dev/null
+++ b/multiscalerepresentationlearningforspatialfeaturedistributionsusinggridcells/full.md
@@ -0,0 +1,426 @@
+# MULTI-SCALE REPRESENTATION LEARNING FOR SPATIAL FEATURE DISTRIBUTIONS USING GRID CELLS
+
+Gengchen Mai $^{1}$ , Krzysztof Janowicz $^{1}$ , Bo Yan $^{2}$ , Rui Zhu $^{1}$ , Ling Cai $^{1}$ & Ni Lao $^{3}$
+
+$^{1}$ STKO Lab, University of California, Santa Barbara, CA, USA, 93106
+
+{gengchen_mai,janowicz,ruizhu,lingcai}@ucsb.edu
+
+$^{2}$ LinkedIn Corporation, Mountain View, CA, USA, 94043
+
+boyanl@linkedin.com
+
+$^{3}$ SayMosaic Inc., Palo Alto, CA, USA, 94303
+
+ni.lao@mosaix.ai
+
+# ABSTRACT
+
+Unsupervised text encoding models have recently fueled substantial progress in Natural Language Processing (NLP). The key idea is to use neural networks to convert words in texts to vector space representations (embeddings) based on word positions in a sentence and their contexts, which are suitable for end-to-end training of downstream tasks. We see a strikingly similar situation in spatial analysis, which focuses on incorporating both absolute positions and spatial contexts of geographic objects such as Points of Interest (POIs) into models. A general-purpose representation model for space is valuable for a multitude of tasks. However, no such general model exists to date beyond simply applying discretization or feedforward nets to coordinates, and little effort has been put into jointly modeling distributions with vastly different characteristics, which commonly emerges from GIS data. Meanwhile, Nobel Prize-winning Neuroscience research shows that grid cells in mammals provide a multi-scale periodic representation that functions as a metric for location encoding and is critical for recognizing places and for path-integration. Therefore, we propose a representation learning model called Space2Vec to encode the absolute positions and spatial relationships of places. We conduct experiments on two real-world geographic data for two different tasks: 1) predicting types of POIs given their positions and context, 2) image classification leveraging their geo-locations. Results show that because of its multiscale representations, Space2Vec outperforms well-established ML approaches such as RBF kernels, multi-layer feed-forward nets, and tile embedding approaches for location modeling and image classification tasks. Detailed analysis shows that all baselines can at most well handle distribution at one scale but show poor performances in other scales. In contrast, Space2Vec's multi-scale representation can handle distributions at different scales.
+
+# 1 INTRODUCTION
+
+Unsupervised text encoding models such as Word2Vec (Mikolov et al., 2013), Glove (Pennington et al., 2014), ELMo (Peters et al., 2018), and BERT (Devlin et al., 2018) have been effectively utilized in many Natural Language Processing (NLP) tasks. At their core they train models which encode words into vector space representations based on their positions in the text and their context. A similar situation can be encountered in the field of Geographic Information Science (GIScience). For example, spatial interpolation aims at predicting an attribute value, e.g., elevation, at an unsampled location based on the known attribute values of nearby samples. Geographic information has become an important component to many tasks such as fine-grained image classification (Mac Aodha et al., 2019), point cloud classification and semantic segmentation (Qi et al., 2017), reasoning about Point of Interest (POI) type similarity (Yan et al., 2017), land cover classification (Kussul et al., 2017), and geographic question answering (Mai et al., 2019b). Developing a general model for vector space representation of any point in space would pave the way for many future applications.
+
+
+(a) Women's Cloth
+
+
+(b) Education
+
+
+(c) Ripley's K
+Figure 1: The challenge of joint modeling distributions with very different characteristics. (a)(b) The POI locations (red dots) in Las Vegas and Space2Vec predicted conditional likelihood of Women's Clothing (with a clustered distribution) and Education (with an even distribution). The dark area in (b) indicates that the downtown area has more POIs of other types than education. (c) Ripley's K curves of POI types for which Space2Vec has the largest and smallest improvement over wrap (Mac Aodha et al., 2019). Each curve represents the number of POIs of a certain type inside certain radios centered at every POI of that type; (d) Ripley's K curves renormalized by POI densities and shown in log-scale. To efficiently achieve multi-scale representation Space2Vec concatenates the grid cell encoding of 64 scales (with wave lengths ranging from 50 meters to $40k$ meters) as the first layer of a deep model, and trains with POI data in an unsupervised fashion.
+
+
+(d) Renormalized Ripley's K
+
+However, existing models often utilize specific methods to deal with geographic information and often disregards geographic coordinates. For example, Place2Vec (Yan et al., 2017) converts the coordinates of POIs into spatially collocated POI pairs within certain distance bins, and does not preserve information about the (cardinal) direction between points. Li et al. (2017) propose DCRNN for traffic forecasting in which the traffic sensor network is converted to a distance weighted graph which necessarily forfeits information about the spatial layout of sensors. There is, however, no general representation model beyond simply applying discretization (Berg et al., 2014; Tang et al., 2015) or feed-forward nets (Chu et al., 2019; Mac Aodha et al., 2019) to coordinates.
+
+A key challenge in developing a general-purpose representation model for space is how to deal with mixtures of distributions with very different characteristics (see an example in Figure 1), which often emerges in spatial datasets (McKenzie et al., 2015). For example, there are POI types with clustered distributions such as women's clothing, while there are other POI types with regular distributions such as education. These feature distributions co-exist in the same space, and yet we want a single representation to accommodate all of them in a task such as location-aware image classification (Mac Aodha et al., 2019). Ripley's K is a spatial analysis method used to describe point patterns over a given area of interest. Figure 1c shows the K plot of several POI types in Las Vegas. One can see that as the radius grows the numbers of POIs increase at different rates for different POI types. In order to see the relative change of density at different scales, we renormalize the curves by each POI type's density and show it in log scale in Figure 1d. One can see two distinct POI type groups with different distribution patterns with clustered and even distributions. If we want to model the distribution of these POIs by discretizing the study area into tiles, we have to use small grid sizes for women's clothing while using larger grid sizes for educations because smaller grid sizes lead to over-parameterization of the model and overfitting. In order to jointly describe these distributions and their patterns, we need an encoding method which supports multi-scale representations.
+
+Nobel Prize winning Neuroscience research (Abbott & Callaway, 2014) has demonstrated that grid cells in mammals provide a multi-scale periodic representation that functions as a metric for location encoding, which is critical for integrating self-motion. Moreover, Blair et al. (2007) show that the multi-scale periodic representation of grid cells can be simulated by summing three cosine grating functions oriented $60^{\circ}$ apart, which may be regarded as a simple Fourier model of the hexagonal lattice. This research inspired us to encode locations with multi-scale periodic representations. Our assumption is that decomposed geographic coordinates helps machine learning models, such as deep neural nets, and multi-scale representations deal with the inefficiency of intrinsically single-scale methods such as RFB kernels or discretization (tile embeddings). To validate this intuition, we propose an encoder-decoder framework to encode the distribution of point-features $^{2}$ in space and
+
+train such a model in an unsupervised manner. This idea of using sinusoid functions with different frequencies to encode positions is similar to the position encoding proposed in the Transformer model (Vaswani et al., 2017). However, the position encoding model of Transformer deals with a discrete 1D space – the positions of words in a sentence – while our model works on higher dimensional continuous spaces such as the surface of earth.
+
+# In summary, the contributions of our work are as follows:
+
+1. We propose an encoder-decoder encoding framework called Space2Vec using sinusoid functions with different frequencies to model absolute positions and spatial contexts. We also propose a multi-head attention mechanism based on context points. To the best of our knowledge, this is the first attention model that explicitly considers the spatial relationships between the query point and context points.
+2. We conduct experiments on two real world geographic data for two different tasks: 1) predicting types of POIs given their positions and context, 2) image classification leveraging their geo-locations. Space2Vec outperforms well-established encoding methods such as RBF kernels, multi-layer feed-forward nets, and tile embedding approaches for location modeling and image classification.
+3. To understand the advantages of Space2Vec we visualize the firing patterns (response maps) of location models' encoding layer neurons and show how they handle spatial structures at different scales by integrating multi-scale representations. Furthermore the firing patterns for the spatial context models neurons give insight into how the grid-like cells capture the decreasing distance effect with multi-scale representations.
+
+# 2 PROBLEM FORMULATION
+
+Distributed representation of point-features in space can be formulated as follows. Given a set of points $\mathcal{P} = \{p_i\}$ , i.e., Points of Interests (POIs), in $L$ -D space $(L = 2,3)$ define a function $f_{\mathcal{P},\theta}(\mathbf{x}) : \mathbb{R}^L \to \mathbb{R}^d$ ( $L \ll d$ ), which is parameterized by $\theta$ and maps any coordinate $\mathbf{x}$ in space to a vector representation of $d$ dimension. Each point (e.g., a restaurant) $p_i = (\mathbf{x}_i, \mathbf{v}_i)$ is associated with a location $\mathbf{x}_i$ and attributes $\mathbf{v}_i$ (i.e., POI features such as type, name, capacity, etc.). The function $f_{\mathcal{P},\theta}(\mathbf{x})$ encodes the probability distribution of point features over space and can give a representation of any point in the space. Attributes (e.g. place types such as Museum) and coordinate of point can be seen as analogies to words and word positions in commonly used word embedding models.
+
+# 3 RELATED WORK
+
+There has been theoretical research on neural network based path integration/spatial localization models and their relationships with grid cells. Both Cueva & Wei (2018) and Banino et al. (2018) showed that grid-like spatial response patterns emerge in trained networks for navigation tasks which demonstrate that grid cells are critical for vector-based navigation. Moreover, Gao et al. (2019) propose a representational model for grid cells in navigation tasks which has good quality such as magnified local isometry. All these research is focusing on understanding the relationship between the grid-like spatial response patterns and navigation tasks from a theoretical perspective. In contrast, our goal focuses on utilizing these theoretical results on real world data in geoinformatics.
+
+Radial Basis Function (RBF) kernel is a well-established approach to generating learning friendly representation from points in space for machine learning algorithms such as SVM classification (Baudat & Anouar, 2001) and regression (Bierens, 1994). However, the representation is example based - i.e., the resultant model uses the positions of training examples as the centers of Gaussian kernel functions (Maz'ya & Schmidt, 1996). In comparison, the grid cell based location encoding relies on sine and cosine functions, and the resultant model is inductive and does not store training examples.
+
+Recently the computer vision community shows increasing interests in incorporating geographic information (e.g. coordinate encoding) into neural network architectures for multiple tasks such as image classification (Tang et al., 2015) and fine grained recognition (Berg et al., 2014; Chu et al., 2019; Mac Aodha et al., 2019). Both Berg et al. (2014) and Tang et al. (2015) proposed to discretize the study area into regular grids. To model the geographical prior distribution of the image categories, the grid id is used for GPS encoding instead of the raw coordinates. However, choosing the correct discretization is challenging (Openshaw, 1984; Fotheringham & Wong, 1991),
+
+and incorrect choices can significantly affect the final performance (Moat et al., 2018; Lechner et al., 2012). In addition, discretization does not scale well in terms of memory use. To overcome these difficulties, both Chu et al. (2019) and Mac Aodha et al. (2019) advocated the idea of inductive location encoders which directly encode coordinates into a location embedding. However, both of them directly feed the coordinates into a feed-forward neural network (Chu et al., 2019) or residual blocks (Mac Aodha et al., 2019) without any feature decomposition strategy. Our experiments show that this direct encoding approach is insufficient to capture the spatial feature distribution and Space2Vec significantly outperforms them by integrating spatial representations of different scales.
+
+# 4 METHOD
+
+We solve distributed representation of point-features in space (defined in Section 2) with an encoder-decoder architecture:
+
+1. Given a point $p_i = (\mathbf{x}_i, \mathbf{v}_i)$ a point space encoder $Enc^{(x)}()$ encodes location $\mathbf{x}_i$ into a location embedding $\mathbf{e}[\mathbf{x}_i] \in \mathbb{R}^{d^{(x)}}$ and a point feature encoder $Enc^{(v)}()$ encodes its feature into a feature embedding $\mathbf{e}[\mathbf{v}_i] \in \mathbb{R}^{d^{(v)}}$ . $\mathbf{e} = [\mathbf{e}[\mathbf{x}_i]; \mathbf{e}[\mathbf{v}_i]] \in \mathbb{R}^d$ is the full representation of point $p_i \in \mathcal{P}$ , where $d = d^{(x)} + d^{(v)}$ . [;] represents vector concatenation. In contrast, geographic entities not in $\mathcal{P}$ within the studied space can be represented by their location embedding $\mathbf{e}[\mathbf{x}_j]$ since its $\mathbf{v}_i$ is unknown.
+2. We developed two types of decoders which can be used independently or jointly. A location decoder $Dec_{s}()$ reconstructs point feature embedding $\mathbf{e}[\mathbf{v}_i]$ given location embedding $\mathbf{e}[\mathbf{x}_i]$ , and a spatial context decoder $Dec_{c}()$ reconstructs the feature embedding $\mathbf{e}[\mathbf{v}_i]$ of point $p_i$ based on the space and feature embeddings $\{\mathbf{e}_{i1},\dots,\mathbf{e}_{ij},\dots,\mathbf{e}_{in}\}$ of nearest neighboring points $\{p_{i1},\dots,p_{ij},\dots,p_{in}\}$ , where $n$ is a hyper-parameter.
+
+# 4.1 ENCODER
+
+Point Feature Encoder Each point $p_i = (\mathbf{x}_i, \mathbf{v}_i)$ in a point set $\mathcal{P}$ is often associated with features such as the air pollution station data associate with some air quality measures, a set of POIs with POI types and names, a set of points from survey and mapping with elevation values, a set of points from geological survey with mineral content measure, and so on. The point feature encoder $Enc^{(v)}()$ encodes such features $\mathbf{v}_i$ into a feature embedding $\mathbf{e}[\mathbf{v}_i] \in \mathbb{R}^{d^{(v)}}$ . The implementation of $Enc^{(v)}()$ depends on the nature of these features. For example, if each point represents a POI with multiple POI types (as in this study), the feature embedding $\mathbf{e}[\mathbf{v}_i]$ can simply be the mean of each POI types' embeddings $\mathbf{e}[\mathbf{v}_i] = \frac{1}{H} \sum_{h=1}^{H} \mathbf{t}_h^{(\gamma)}$ , where $\mathbf{t}_h^{(\gamma)}$ indicates the $h$ th POI type embedding of a POI $p_i$ with $H$ POI types. We apply $L_2$ normalization to the POI type embedding matrix.
+
+Point Space Encoder A part of the novelty of this paper is from the point space encoder $Enc^{(x)}(\cdot)$ . We first introduce Theorem 1 which provide an analytical solution $\phi(\mathbf{x})$ as the base of encoding any location $\mathbf{x} \in \mathbb{R}^2$ in 2D space to a distributed representation:
+
+Theorem 1. Let $\Psi(\mathbf{x}) = (e^{i\langle \mathbf{a}_j, \mathbf{x} \rangle}, j = 1, 2, 3)^T \in \mathbb{C}^3$ where $e^{i\theta} = \cos \theta + i\sin \theta$ is the Euler notation of complex values; $\langle \mathbf{a}_j, \mathbf{x} \rangle$ is the inner product of $\mathbf{a}_j$ and $\mathbf{x}$ . $\mathbf{a}_1, \mathbf{a}_2, \mathbf{a}_3 \in \mathbb{R}^2$ are $2D$ vectors such that the angle between $\mathbf{a}_k$ and $\mathbf{a}_l$ is $2\pi/3$ , $\forall j$ , $\|\mathbf{a}_j\| = 2\sqrt{\alpha}$ . Let $\mathbf{C} \in \mathbb{C}^{3 \times 3}$ be a random complex matrix such as $\mathbf{C}^*\mathbf{C} = \mathbf{I}$ . Then $\phi(\mathbf{x}) = \mathbf{C}\Psi(\mathbf{x})$ , $M(\Delta \mathbf{x}) = \mathbf{Cdiag}(\Psi(\Delta \mathbf{x}))\mathbf{C}^*$ satisfies
+
+$$
+\phi (\mathbf {x} + \Delta \mathbf {x}) = M (\Delta \mathbf {x}) \phi (\mathbf {x}) \tag {1}
+$$
+
+and
+
+$$
+\langle \phi (\mathbf {x} + \Delta \mathbf {x}), \phi (\mathbf {x}) \rangle = d (1 - \alpha \| \Delta \mathbf {x} \| ^ {2}) \tag {2}
+$$
+
+where $d = 3$ is the dimension of $\phi (\mathbf{x})$ and $\Delta \mathbf{x}$ is a small displacement from $\mathbf{x}$ .
+
+The proof of Theorem 1 can be seen in Gao et al. (2019). $\phi (\mathbf{x}) = \mathbf{C}\Psi (\mathbf{x})\in \mathbb{C}^3$ amounts to a 6-dimension real value vector and each dimension shows a hexagon firing pattern which models the grid cell behavior. Because of the periodicity of $\sin ()$ and $\cos ()$ , this single scale representation $\phi (\mathbf{x})$ does not form a global codebook of 2D positions, i.e. there can be $\mathbf{x}\neq \mathbf{y}$ , but $\phi (\mathbf{x}) = \phi (\mathbf{y})$ .
+
+Inspired by Theorem 1 and the multi-scale periodic representation of grid cells in mammals (Abbott & Callaway, 2014) we set up our point space encoder $\mathbf{e}[\mathbf{x}] = \mathit{Enc}_{\mathit{theory}}^{(x)}(\mathbf{x})$ to use sine
+
+and cosine functions of different frequencies to encode positions in space. Given any point $\mathbf{x}$ in the studied 2D space, the space encoder $Enc_{theory}^{(x)}(\mathbf{x}) = \mathbf{NN}(PE^{(t)}(\mathbf{x}))$ where $PE^{(t)}(\mathbf{x}) = [PE_0^{(t)}(\mathbf{x});\ldots;PE_s^{(t)}(\mathbf{x});\ldots;PE_{S - 1}^{(t)}(\mathbf{x})]$ is a concatenation of multi-scale representations of $d^{(x)} = 6S$ dimensions. Here $S$ is the total number of grid scales and $s = 0,1,2,\dots,S - 1$ . $\mathbf{NN}()$ represents fully connected ReLU layers. Let $\mathbf{a}_1 = [1,0]^T$ , $\mathbf{a}_2 = [-1/2,\sqrt{3}/2]^T$ , $\mathbf{a}_3 = [-1/2,-\sqrt{3}/2]^T \in \mathbb{R}^2$ be three unit vectors and the angle between any of them is $2\pi/3$ . $\lambda_{min}, \lambda_{max}$ are the minimum and maximum grid scale and $g = \frac{\lambda_{max}}{\lambda_{min}}$ . At each scale $s$ , $PE_s^{(t)}(\mathbf{x}) = [PE_{s,1}^{(t)}(\mathbf{x});PE_{s,2}^{(t)}(\mathbf{x});PE_{s,3}^{(t)}(\mathbf{x})]$ is a concatenation of three components, where
+
+$$
+P E _ {s, j} ^ {(t)} (\mathbf {x}) = \left[ \cos \left(\frac {\langle \mathbf {x} , \mathbf {a} _ {j} \rangle}{\lambda_ {m i n} \cdot g ^ {s / (S - 1)}}\right); \sin \left(\frac {\langle \mathbf {x} , \mathbf {a} _ {j} \rangle}{\lambda_ {m i n} \cdot g ^ {s / (S - 1)}}\right) \right] \forall j = 1, 2, 3; \tag {3}
+$$
+
+$\mathbf{NN}()$ and $PE^{(t)}(\mathbf{x})$ are analogies of $\mathbf{C}$ and $\Psi (\mathbf{x})$ in Theorem 1.
+
+Similarly we can define another space encoder $Enc_{grid}^{(x)}(\mathbf{x}) = \mathbf{NN}(PE^{(g)}(\mathbf{x}))$ inspired by the position encoding model of Transformer (Vaswani et al., 2017), where $PE^{(g)}(\mathbf{x}) = [PE_0^{(g)}(\mathbf{x});\ldots;PE_s^{(g)}(\mathbf{x});\ldots;PE_{S-1}^{(g)}(\mathbf{x})]$ is still a concatenation of its multi-scale representations, while $PE_s^{(g)}(\mathbf{x}) = [PE_{s,1}^{(g)}(\mathbf{x});PE_{s,2}^{(g)}(\mathbf{x})]$ handles each component $l$ of $\mathbf{x}$ separately:
+
+$$
+P E _ {s, l} ^ {(g)} (\mathbf {x}) = \left[ \cos \left(\frac {\mathbf {x} ^ {[ l ]}}{\lambda_ {m i n} \cdot g ^ {s / (S - 1)}}\right); \sin \left(\frac {\mathbf {x} ^ {[ l ]}}{\lambda_ {m i n} \cdot g ^ {s / (S - 1)}}\right) \right] \forall l = 1, 2 \tag {4}
+$$
+
+# 4.2 DECODER
+
+Two types of decoders are designed for two major types of GIS problems: location modeling and spatial context modeling (See Section 5.1).
+
+Location Decoder $Dec_{s}()$ directly reconstructs point feature embedding $\mathbf{e}[\mathbf{v}_i]$ given its space embedding $\mathbf{e}[\mathbf{x}_i]$ . We use one layer feed-forward neural network $\mathbf{NN}_{\mathrm{dec}}()$
+
+$$
+\mathbf {e} \left[ \mathbf {v} _ {i} \right] ^ {\prime} = D e c _ {s} \left(\mathbf {x} _ {i}; \theta_ {\mathrm {d e c} _ {s}}\right) = \mathbf {N N} _ {\mathrm {d e c}} \left(\mathbf {e} \left[ \mathbf {x} _ {i} \right]\right) \tag {5}
+$$
+
+For training we use inner product to compare the reconstructed feature embedding $\mathbf{e}[\mathbf{v}_i]'$ against the real feature embeddings of $\mathbf{e}[\mathbf{v}_i]$ and other negative points (see training detail in Sec 4.3).
+
+Spatial Context Decoder $Dec_{c}()$ reconstructs the feature embedding $\mathbf{e}[\mathbf{v}_i]$ of the center point $p_i$ based on the space and feature embeddings $\{\mathbf{e}_{i1},\dots,\mathbf{e}_{ij},\dots,\mathbf{e}_{in}\}$ of $n$ nearby points $\{p_{i1},\dots,p_{ij},\dots,p_{in}\}$ . Note that the feed-in order of context points should not affect the prediction results, which can be achieved by permutation invariant neural network architectures (Zaheer et al., 2017) like PointNet (Qi et al., 2017).
+
+$$
+\mathbf {e} \left[ \mathbf {v} _ {i} \right] ^ {\prime} = D e c _ {c} \left(\mathbf {x} _ {i}, \left\{\mathbf {e} _ {i 1}, \dots , \mathbf {e} _ {i j}, \dots , \mathbf {e} _ {i n} \right\}; \theta_ {\mathrm {d e c} _ {c}}\right) = g \left(\frac {1}{K} \sum_ {k = 1} ^ {K} \sum_ {j = 1} ^ {n} \alpha_ {i j k} \mathbf {e} \left[ \mathbf {v} _ {i j} \right]\right) \tag {6}
+$$
+
+Here $g$ is an activation function such as sigmoid. $\alpha_{ijk} = \frac{exp(\sigma_{ijk})}{\sum_{o=1}^{n} exp(\sigma_{iok})}$ is the attention of $p_i$ with its $j$ th neighbor through the $k$ th attention head, and
+
+$$
+\sigma_ {i j k} = \operatorname {L e a k y R e L U} \left(\mathbf {a} _ {k} ^ {T} \left[ \mathbf {e} \left[ \mathbf {v} _ {i} \right] _ {\text {i n i t}}; \mathbf {e} \left[ \mathbf {v} _ {i j} \right]; \mathbf {e} \left[ \mathbf {x} _ {i} - \mathbf {x} _ {i j} \right] \right]\right) \tag {7}
+$$
+
+where $\mathbf{a}_k\in \mathbb{R}^{2d^{(v)} + d^{(x)}}$ is the attention parameter in the $k$ th attention head. The multi-head attention mechanism is inspired by Graph Attention Network (Veličković et al., 2018) and Mai et al. (2019a).
+
+To represent the spatial relationship (distance and direction) between each context point $p_{ij} = (\mathbf{x}_{ij},\mathbf{v}_{ij})$ and the center point $p_i = (\mathbf{x}_i,\mathbf{v}_i)$ , we use the space encoder $Enc^{(x)}()$ to encode the displacement between them $\Delta \mathbf{x}_{ij} = \mathbf{x}_i - \mathbf{x}_{ij}$ . Note that we are modeling the spatial interactions between the center point and $n$ context points simultaneously.
+
+In Eq. 7, $\mathbf{e}[\mathbf{v}_i]_{init}$ indicates the initial guess of the feature embedding $\mathbf{e}[\mathbf{v}_i]$ of point $p_i$ which is computed by using another multi-head attention layer as Eq. 6 where the weight $\alpha_{ijk}' = \frac{\exp(\sigma_{ijk}')}{\sum_{o=1}^{n} \exp(\sigma_{iok}')}$ . Here, $\sigma_{ijk}'$ is computed as Eq. 8 where the query embedding $\mathbf{e}[\mathbf{v}_i]$ is excluded.
+
+$$
+\sigma_ {i j k} ^ {\prime} = \text {L e a k y R e L U} \left(\mathbf {a} _ {k} ^ {\prime T} [ \mathbf {e} [ \mathbf {v} _ {i j} ]; \mathbf {e} [ \mathbf {x} _ {i} - \mathbf {x} _ {i j} ] ] ]\right) \tag {8}
+$$
+
+# 4.3 UNSUPERVISED TRAINING
+
+The unsupervised learning task can simply be maximizing the log likelihood of observing the true point $p_i$ at position $\mathbf{x}_i$ among all the points in $\mathcal{P}$
+
+$$
+\mathcal {L} _ {\mathcal {P}} (\theta) = - \sum_ {p _ {i} \in \mathcal {P}} \log P (p _ {i} | p _ {i 1}, \dots , p _ {i j}, \dots , p _ {i n}) = - \sum_ {p _ {i} \in \mathcal {P}} \log \frac {\exp (\mathbf {e} [ \mathbf {v} _ {i} ] ^ {T} \mathbf {e} [ \mathbf {v} _ {i} ] ^ {\prime})}{\sum_ {p _ {o} \in \mathcal {P}} \exp (\mathbf {e} [ \mathbf {v} _ {o} ] ^ {T} \mathbf {e} [ \mathbf {v} _ {i} ] ^ {\prime})} \tag {9}
+$$
+
+Here only the feature embedding of $p_i$ is used (without location embedding) to prevent revealing the identities of the point candidates, and $\theta = [\theta_{\mathrm{enc}}; \theta_{\mathrm{dec}}]$
+
+Negative sampling by Mikolov et al. (2013) can be used to improve the efficiency of training
+
+$$
+\mathcal {L} _ {\mathcal {P}} ^ {\prime} (\theta) = - \sum_ {p _ {i} \in \mathcal {P}} \left(\log \sigma \left(\mathbf {e} \left[ \mathbf {v} _ {i} \right] ^ {T} \mathbf {e} \left[ \mathbf {v} _ {i} \right] ^ {\prime}\right) + \frac {1}{\left| \mathcal {N} _ {i} \right|} \sum_ {p _ {o} \in \mathcal {N} _ {i}} \log \sigma \left(- \mathbf {e} \left[ \mathbf {v} _ {o} \right] ^ {T} \mathbf {e} \left[ \mathbf {v} _ {i} \right] ^ {\prime}\right)\right) \tag {10}
+$$
+
+Here $\mathcal{N}_i\subseteq \mathcal{P}$ is a set of sampled negative points for $p_i$ $(p_i\notin \mathcal{N}_i)$ and $\sigma (x) = 1 / (1 + e^{-x})$
+
+# 5 EXPERIMENT
+
+In this section we compare Space2Vec with commonly used position encoding methods, and analyze them both quantitatively and qualitatively.
+
+Baselines Our baselines include 1) direct directly applying feed-forward nets (Chu et al., 2019); 2) tile discretization (Berg et al., 2014; Adams et al., 2015; Tang et al., 2015); 3) wrap feed-forward nets with coordinate wrapping (Mac Aodha et al., 2019); and 4) $rbf$ Radial Basis Function (RBF) kernels (Baudat & Anouar, 2001; Bierens, 1994). See Appendix A.1 for details of the baselines.
+
+# 5.1 POI TYPE CLASSIFICATION TASKS
+
+Dataset and Tasks To test the proposed model, we conduct experiments on geographic datasets with POI position and type information. We utilize the open-source dataset published by Yelp Data Challenge and select all POIs within the Las Vegas downtown area3. There are 21,830 POIs with 1,191 different POI types in this dataset. Note that each POI may be associated with one or more types, and we do not use any other meta-data such as business names, reviews for this study. We project geographic coordinates into projection coordinates using the NAD83/Conus Albers projection coordinate system4. The POIs are split into training, validation, and test dataset with ratios $80\%:10\%:10\%$ . We create two tasks setups which represent different types of modeling need in Geographic Information Science:
+
+- Location Modeling predicts the feature information associated with a POI based on its location $\mathbf{x}_i$ represented by the location decoder $Dec_s()$ . This represents a large number of location prediction problems such as image fine grained recognition with geographic prior (Chu et al., 2019), and species potential distribution prediction (Zuo et al., 2008).
+- Spatial Context Modeling predicts the feature information associated with a POI based on its context $\{\mathbf{e}_{i1},\dots,\mathbf{e}_{ij},\dots,\mathbf{e}_{in}\}$ represented by the spatial context decoder $Dec_{c}()$ . This represents a collection of spatial context prediction problem such as spatial context based facade image classification (Yan et al., 2018), and all spatial interpolation problems.
+
+We use POI prediction metrics to evaluate these models. Given the real point feature embedding $\mathbf{e}[\mathbf{v}_i]$ and $N$ negative feature embeddings $\mathcal{N}_i = \{\mathbf{e}[\mathbf{v}_i]^{-}\}$ , we compare the predicted $\mathbf{e}[\mathbf{v}_i]^{\prime}$ with them by cosine distance. The cosine scores are used to rank $\mathbf{e}[\mathbf{v}_i]$ and $N$ negative samples. The negative feature embeddings are the feature embeddings of points $p_j$ randomly sampled from $\mathcal{P}$ and $p_i \neq p_j$ . We evaluate each model using Negative Log-Likelihood (NLL), Mean Reciprocal Rank (MRR) and HIT@5 (the chance of the true POI being ranked to top 5). We train and test each model 10 times to estimate standard deviations. See Appendix A.2 for hyper-parameter selection details.
+
+# 5.1.1 LOCATION MODELING EVALUATION
+
+We first study location modeling with the location decoder $Dec_{s}()$ in Section 4.2. We use a negative sample size of $N = 100$ . Table 1 shows the average metrics of different models with their best hyper-
+
+
+(a) direct
+
+
+(b)tile
+
+
+(c) wrap
+Figure 2: Embedding clustering of (a) direct; (b) tile with the best cell size $c = 500$ ; (c) wrap ( $h = 3$ , $o = 512$ ); (d) rbf with the best $\sigma$ (1k) and 200 anchor points (red) and (e)(f)(h) theory models with different $\lambda_{min}$ , but fixed $\lambda_{max} = 40k$ and $S = 64$ . All models use 1 hidden ReLU layers of 512 neurons except wrap.
+
+
+(d) $rbf$ ( $\sigma = 1k$ )
+
+
+(e) $\lambda_{min} = 1k$
+
+
+(f) $\lambda_{min} = 500$
+
+
+(g) $\lambda_{min} = 50$
+
+Table 1: The evaluation results of different location models on the validation and test dataset.
+
+ | Train NLL | Validation | Testing |
| NLL | MRR | HIT@5 | MRR | HIT@5 |
| random | | - | 0.052 (0.002) | 4.8 (0.5) | 0.051 (0.002) | 5.0 (0.5) |
| direct | 1.285 | 1.332 | 0.089 (0.001) | 10.6 (0.2) | 0.090 (0.001) | 11.3 (0.2) |
| tile (c=500) | 1.118 | 1.261 | 0.123 (0.001) | 16.8 (0.2) | 0.120 (0.001) | 17.1 (0.3) |
| wrap(h=3,o=512) | 1.222 | 1.288 | 0.112 (0.001) | 14.6 (0.1) | 0.119 (0.001) | 15.8 (0.2) |
| rbf (σ=1k) | 1.209 | 1.279 | 0.115 (0.001) | 15.2 (0.2) | 0.123 (0.001) | 16.8 (0.3) |
| grid (λmin=50) | 1.156 | 1.258 | 0.128 (0.001) | 18.1 (0.3) | 0.139 (0.001) | 20.0 (0.2) |
| hexa (λmin=50) | 1.230 | 1.297 | 0.107 (0.001) | 14.0 (0.2) | 0.105 (0.001) | 14.5 (0.2) |
| theorydiag (λmin=50) | 1.277 | 1.324 | 0.094 (0.001) | 12.3 (0.3) | 0.094 (0.002) | 11.2 (0.3) |
| theory (λmin=1k) | 1.207 | 1.281 | 0.123 (0.002) | 16.3 (0.5) | 0.121 (0.001) | 16.2 (0.1) |
| theory (λmin=500) | 1.188 | 1.269 | 0.132 (0.001) | 17.6 (0.3) | 0.129 (0.001) | 17.7 (0.2) |
| theory (λmin=50) | 1.098 | 1.249 | 0.137 (0.002) | 19.4 (0.1) | 0.144 (0.001) | 20.0 (0.2) |
+
+parameter setting on the validation set. We can see that direct and theorydiag are less competitive, only beating the random selection baseline. Other methods with single scale representations - including tile, wrap, and rbf - perform better. The best results come from various versions of the grid cell models, which are capable of dealing with multi-scale representations.
+
+In order to understand the reason for the superiority of grid cell models we provide qualitative analysis of their representations. We apply hierarchical clustering to the location embeddings produced by studied models using cosine distance as the distance metric (See Fig. 2). we can see that when restricted to large grid sizes $(\lambda_{min} = 1k)$ , theory has similar representation (Fig. 2d, 2e, and Fig. 4d, 4e) and performance compared to $rbf$ ( $\sigma = 1k$ ). However it is able to significantly outperform $rbf$ ( $\sigma = 1k$ ) (and tile and wrap) when small grid sizes ( $\lambda_{min} = 500, 50$ ) are available. The relative improvements over $rbf$ ( $\sigma = 1k$ ) are $-0.2\%$ , $+0.6\%$ , $+2.1\%$ MRR for $\lambda_{min} = 1k$ , 500, 50 respectively.
+
+# 5.1.2 MULTI-SCALE ANALYSIS OF LOCATION MODELING
+
+In order to show how our multi-scale location representation model will affect the prediction of POI types with different distribution patterns, we classify all 1,191 POI types into three groups based on radius $r$ , which is derived from each POI types' renormalized Ripley's K curve (See Figure 1d for examples). It indicates the x axis value of the intersection between the curve and the line of $y = 3.0$ . A lower $r$ indicates a more clustered distribution patterns. These three groups are listed below:
+
+1. Clustered $(r\leqslant 100m)$ : POI types with clustered distribution patterns;
+2. Middle $(100m < r < 200m)$ : POI types with less extreme scales;
+3. Even $(r\geqslant 200m)$ : POI types with even distribution patterns.
+
+Table 2 shows the performance (MRR) of direct, tile, wrap, rbf, and our theory model on the test dataset of the location modeling task with respect to these three different POI distribution groups. The numbers in () indicate the MRR difference between a baseline and theory. # POI refers to total number of POI belong to each group5. We can see that 1) The two neural net approaches (direct and wrap) have no scale related parameter and are not performing ideally across all scales, with direct
+
+Table 2: Comparing performances in different POI groups. We classify all 1,191 POI types into three groups based on the radius $r$ of their root types, where their renormalized Ripley's K curve (See Figure 1d) reach 3.0: 1) Clustered ( $r \leqslant 100m$ ): POI types with clustered distribution patterns; 2) Middle ( $100m < r < 200m$ ): POI types with unclear distribution patterns; 3) Even ( $r \geqslant 200m$ ): POI types with even distribution patterns. The MRR of wrap and theory on those three groups are shown. The numbers in () indicate the difference between the MRR of a baseline model and the MRR of theory with respect to a specific group. #POI refers to the total number of POIs belonging to each group. Root Types indicates the root categories of those POI types belong to each group.
+
+| POI Groups | Clustered (r ≤ 100m) | Middle (100m < r < 200m) | Even (r ≥ 200m) |
| direct | 0.080 (-0.047) | 0.108 (-0.030) | 0.084 (-0.047) |
| wrap | 0.106 (-0.021) | 0.126 (-0.012) | 0.122 (-0.009) |
| tile | 0.108 (-0.019) | 0.135 (-0.003) | 0.111 (-0.020) |
| rbf | 0.112 (-0.015) | 0.136 (-0.002) | 0.119 (-0.012) |
| theory | 0.127 (-) | 0.138 (-) | 0.131 (-) |
| # POI | 16,016 | 7,443 | 3,915 |
| Root Types | Restaurants; Shopping; Food; Nightlife; Automotive; Active Life; Arts & Entertainment; Financial Services | Beauty & Spas; Health & Medical; Local Services; Hotels & Travel; Professional Services; Public Services & Government | Home Services; Event Planning & Services; Pets; Education |
+
+performs worse because of its simple single layer network. 2) The two approaches with built-in scale parameter (tile and $rbf$ ) have to trade off the performance of different scales. Their best parameter settings lead to close performances to that of Space2Vec at the middle scale, while performing poorly in both clustered and regular groups. These observations clearly show that all baselines can at most well handle distribution at one scale but show poor performances in other scales. In contrast, Space2Vec's multi-scale representation can handle distributions at different scales.
+
+# 5.1.3 SPATIAL CONTEXT MODELING EVALUATION
+
+Next, we evaluate the spatial context decoder $Dec_{c}()$ in Sec. 4.2. We use the same evaluation set up as location modeling. The context points are obtained by querying the $n$ -th nearest points using PostGIS ( $n = 10$ ). As for validation and test datasets, we make sure the center points are all unknown during the training phase. Table 3 shows the evaluation results of different models for spatial context modeling. The baseline approaches (direct, tile, wrap, rbf) generally perform poorly in context modeling. We designed specialized version of these approaches (polar, polar_TILE, scaled_rbf) with polar coordinates, which lead to significantly improvements. Note that these are models proposed by us specialized for context modeling and therefore are less general than the grid cell approaches.
+
+Table 3: The evaluation results of different spatial context models on the validation and test dataset. All encoders contains a 1 hidden layer FFN. All grid cell encoders set $\lambda_{min} = 10$ , $\lambda_{max} = 10k$ .
+
+| Space2Vec | Train NLL | Validation | Testing |
| NLL | MRR | HIT@5 | MRR | HIT@5 |
| none | 1.163 | 1.297 | 0.159 (0.002) | 22.4 (0.5) | 0.167 (0.006) | 23.4 (0.7) |
| direct | 1.151 | 1.282 | 0.170 (0.002) | 24.6 (0.4) | 0.175 (0.003) | 24.7 (0.5) |
| polar | 1.157 | 1.283 | 0.176 (0.004) | 25.4 (0.4) | 0.178 (0.006) | 24.9 (0.1) |
| tile (c = 50) | 1.163 | 1.298 | 0.173 (0.004) | 24.0 (0.6) | 0.173 (0.001) | 23.4 (0.1) |
| polar_TILE(S = 64) | 1.161 | 1.282 | 0.173 (0.003) | 25.0 (0.1) | 0.177 (0.001) | 24.5 (0.3) |
| wrap (h=2,o=512) | 1.167 | 1.291 | 0.159 (0.001) | 23.0 (0.1) | 0.170 (0.001) | 23.9 (0.2) |
| rbf (σ = 50) | 1.160 | 1.281 | 0.179 (0.002) | 25.2 (0.6) | 0.172 (0.001) | 25.0 (0.1) |
| scaled_rbf (σ=40,β=0.1) | 1.150 | 1.272 | 0.177 (0.002) | 25.7 (0.1) | 0.181 (0.001) | 25.3 (0.1) |
| grid(λmin=10) | 1.172 | 1.285 | 0.178 (0.004) | 24.9 (0.5) | 0.181 (0.001) | 25.1 (0.3) |
| hexa (λmin=10) | 1.156 | 1.289 | 0.173 (0.002) | 24.0 (0.2) | 0.183 (0.002) | 25.3 (0.2) |
| theorydiag (λmin=10) | 1.156 | 1.287 | 0.168 (0.001) | 24.1 (0.4) | 0.174 (0.005) | 24.9 (0.1) |
| theory(λmin=200) | 1.168 | 1.295 | 0.159 (0.001) | 23.1 (0.2) | 0.170 (0.001) | 23.2 (0.2) |
| theory(λmin=50) | 1.157 | 1.275 | 0.171 (0.001) | 24.2 (0.3) | 0.173 (0.001) | 24.8 (0.4) |
| theory(λmin=10) | 1.158 | 1.280 | 0.177 (0.003) | 25.2 (0.3) | 0.185 (0.002) | 25.7 (0.3) |
+
+
+(a) direct
+
+
+(b) $polar$
+
+
+(c) wrap
+
+
+(d) polar_TILE
+
+
+(e) scaled_rbf
+
+
+(f) theory
+
+
+(g) direct
+
+
+(h)polar
+
+
+(i) wrap
+Figure 3: Embedding clustering in the original space of (a) direct; (b) polar; (c) wrap, $h = 2, o = 512$ ; (d) polar_TILE, $S = 64$ , (e) scaled_rbf, $\sigma = 40$ , $\beta = 0.1$ ; and (f) theory, $\lambda_{min} = 10$ , $\lambda_{max} = 10k$ , $S = 64$ . (g)(h)(i)(j)(k)(l) are the clustering results of the same models in the polar-distance space using $\log(\|\Delta \mathbf{x}_{ij}\| + 1)$ . All models use 1 hidden ReLU (except wrap) layers of 512 neurons. Most models except wrap can capture a shift when distance is around $e^5 - 1 \approx 150$ meters.
+
+
+(j) polar_TILE
+
+
+(k) scaled_rbf
+
+
+(1) theory
+
+Nevertheless the grid cell approaches are able to perform better than the specialized approaches on the test dataset while have competitive performance on validation dataset. See Appendix ?? for the visualization of context models. Actually the gains are small for all baseline approaches also. The reason is that we expect location encoding to be less important when context information is accessible. Similarly as discussed in (Gao et al., 2019), it is when there is a lack of visual clues that the grid cells of animals are the most helpful for their navigation.
+
+Figure 6 shows the location embedding clustering results in both Cartesian and polar coordinate systems. We can see that direct (Fig. 3a, 3g) only captures the distance information when the context POI is very close ( $\log(\|\Delta \mathbf{x}_{ij}\| + 1) \leqslant 5$ ) while in the farther spatial context it purely models the direction information. polar (Fig. 3b, 3h) has the similar behaviors but captures the distance information in a more fine-grained manner. wrap (Fig. 3c, 3i) mainly focuses on differentiating relative positions in farther spatial context cont which might explain its lower performance6. polar_TILE (Fig. 3d) mostly responds to distance information. Interestingly, scaled_rbf and theory have similar representations in the polar coordinate system (Fig. 3k, 3l) and similar performance (Table 3). While scaled_rbf captures the gradually decreased distance effect with a scaled kernel size which becomes larger in farther distance, theory achieves this by integrating representations of different scales.
+
+# 5.2 FINE-GRAINED IMAGE CLASSIFICATION TASKS
+
+To demonstrate the generalizability of Space2Vec for space representation we utilized the proposed point space encoder $Enc^{(x)}()$ model in a well-known computer vision task: fine-grained image classification. As we discussed in Section 3, many studies (Berg et al., 2014; Chu et al., 2019; Mac Aodha et al., 2019) have shown that geographic prior information - where (and when) the image is taken - is very important additional information for the fine-grained image classification task and can substantially improve the model performance. For example, the appearance information is usually not sufficient to differentiate two visually similar species. In this case, the geographic prior becomes much more important because these two species may have very different spatial prior distributions such as the example of European Toads and Spiny Toads in Figure 1 of Mac Aodha et al. (2019).
+
+We adopt the task setup of Mac Aodha et al. (2019). During training we have a set of tuples $D = \{(I_i, \mathbf{x}_i, y_i, p_i) \mid i = 1, \dots, N\}$ where $I_i$ indicates an image, $y_i \in \{1, 2, \dots, C\}$ is the corresponding class label (species category), $\mathbf{x}_i = [longitude_i, latitude_i]$ is the geographic coordinates where the image was taken, and $p_i$ is the id of the photographer who took this image. At training time, a location encoder is trained to capture the spatial prior information $P(y \mid \mathbf{x})$ . At inference time, $p_i$ information is not available and the final image classification prediction is calculated based on the
+
+Table 4: Fine-grained image classification results on two datasets: BirdSnap† and NABirds†. The classification accuracy is calculated by combining image classification predictions $P(y \mid I)$ with different spatial priors $P(y \mid \mathbf{x})$ . The grid and theory model use 1 hidden ReLU layers of 512 neurons. The evaluation results of the baseline models are from Table 1 of Mac Aodha et al. (2019).
+
+ | BirdSnap† | NABirds† |
| No Prior (i.e. uniform) | 70.07 | 76.08 |
| Nearest Neighbor (num) | 77.76 | 79.99 |
| Nearest Neighbor (spatial) | 77.98 | 80.79 |
| Adaptive Kernel (Berg et al., 2014) | 78.65 | 81.11 |
| tile (Tang et al., 2015) (location only) | 77.19 | 79.58 |
| wrap (Mac Aodha et al., 2019) (location only) | 78.65 | 81.15 |
| rbf (σ=1k) | 78.56 | 81.13 |
| grid (λmin=0.0001, λmax=360, S = 64) | 79.44 | 81.28 |
| theory (λmin=0.0001, λmax=360, S = 64) | 79.35 | 81.59 |
+
+combination of two models: 1) the trained location encoder which captures the spatial priors $P(y \mid \mathbf{x})$ and 2) the pretrained image classification model, InceptionV3 network (Szegedy et al., 2016), which captures $P(y \mid I)$ . Bayesian theory has been used to derive the joint distribution $P(y \mid I, \mathbf{x})$ . See Mac Aodha et al. (2019) for detail explanation as well as the loss function. Note that while Space2Vec outperforms specialized density estimation methods such as Adaptive Kernel (Berg et al., 2014), it would be interesting to explore early fusion Space2Vec's representations with the image module.
+
+We use two versions of our point space encoder $Enc^{(x)}(\cdot)$ model (grid, theory) as the location encoder to capture the spatial prior information $P(y \mid x)$ . The evaluation results of our models as well as multiple baselines are shown in Table 4. We can see that both grid, theory outperform previous models as well as that of Mac Aodha et al. (2019) on two fine-grained image classification datasets with significant sizes: BirdSnap†, NABirds†. theory shows superiority over grid on NABirds† while fail to outperform grid on BirdSnap†. Note that we only pick baseline models which capture spatial-only prior and drop models which additionally consider time information. Both grid and theory use 1 hidden ReLU layers of 512 neurons for NN() and they have the same hyperparameters: $\lambda_{min} = 0.0001$ , $\lambda_{max} = 360$ , $S = 64$ . Like Mac Aodha et al. (2019), the location embedding size $d^{(x)}$ is 1024 and we train the location encoder for 30 epochs. Our implementation is based on the original code7 of Mac Aodha et al. (2019) for both model training and evaluation phase.
+
+# 6 CONCLUSION
+
+We introduced an encoder-decoder framework as a general-purpose representation model for space inspired by biological grid cells' multi-scale periodic representations. The model is an inductive learning model and can be trained in an unsupervised manner. We conduct two experiments on POI type prediction based on 1) POI locations and 2) nearby POIs. The evaluation results demonstrate the effectiveness of our model. Our analysis reveals that it is the ability to integrate representations of different scales that makes the grid cell models outperform other baselines on these two tasks. In the future, we hope to incorporate the presented framework to more complex GIS tasks such as social network analysis, and sea surface temperature prediction.
+
+# ACKNOWLEDGMENTS
+
+The presented work is partially funded by the NSF award 1936677 C-Accel Pilot - Track A1 (Open Knowledge Network): Spatially-Explicit Models, Methods, And Services For Open Knowledge Networks, Esri Inc., and Microsoft AI for Earth Grant: Deep Species Spatio-temporal Distribution Modeling for Biodiversity Hotspot Prediction. We thank Dr. Ruiqi Gao for discussions about grid cells, Dr. Wenyun Zuo for discussion about species potential distribution prediction and Dr. Yingjie Hu for his suggestions about the introduction section.
+
+# REFERENCES
+
+Alison Abbott and Ewen Callaway. Nobel prize for decoding brain's sense of place. Nature News, 514(7521):153, 2014.
+Benjamin Adams, Grant McKenzie, and Mark Gahegan. Frankenplace: interactive thematic mapping for ad hoc exploratory search. In Proceedings of the 24th international conference on world wide web, pp. 12-22. International World Wide Web Conferences Steering Committee, 2015.
+Andrea Banino, Caswell Barry, Benigno Uria, Charles Blundell, Timothy Lillicrap, Piotr Mirowski, Alexander Pritzel, Martin J Chadwick, Thomas Degris, Joseph Modayil, et al. Vector-based navigation using grid-like representations in artificial agents. Nature, 557(7705):429, 2018.
+G Baudat and F Anouar. Kernel-based methods and function approximation. volume 2, pp. 1244 - 1249 vol.2, 02 2001. ISBN 0-7803-7044-9. doi: 10.1109/IJCNN.2001.939539.
+Thomas Berg, Jiongxin Liu, Seung Woo Lee, Michelle L Alexander, David W Jacobs, and Peter N Belhumeur. Birdsnap: Large-scale fine-grained visual categorization of birds. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2011-2018, 2014.
+Herman J. Bierens. The nadaraya-watson kernel regression function estimator. Topics in Advanced Econometrics, 16:212-247, 1994.
+Hugh T Blair, Adam C Welday, and Kochen Zhang. Scale-invariant memory representations emerge from moiré interference between grid fields that produce theta oscillations: a computational model. Journal of Neuroscience, 27(12):3211-3229, 2007.
+Grace Chu, Brian Potetz, Weijun Wang, Andrew Howard, Yang Song, Fernando Brucher, Thomas Leung, and Hartwig Adam. Geo-aware networks for fine grained recognition. arXiv preprint arXiv:1906.01737, 2019.
+Christopher J Cueva and Xue-Xin Wei. Emergence of grid-like representations by training recurrent neural networks to perform spatial localization. arXiv preprint arXiv:1803.07770, 2018.
+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.
+A Stewart Fotheringham and David WS Wong. The modifiable areal unit problem in multivariate statistical analysis. Environment and planning A, 23(7):1025-1044, 1991.
+Ruiqi Gao, Jianwen Xie, Song-Chun Zhu, and Ying Nian Wu. Learning grid cells as vector representation of self-position coupled with matrix representation of self-motion. In Proceedings of ICLR 2019, 2019.
+Natalia Kussul, Mykola Lavreniuk, Sergii Skakun, and Andrii Shelestov. Deep learning classification of land cover and crop types using remote sensing data. IEEE Geoscience and Remote Sensing Letters, 14(5):778-782, 2017.
+Alex M Lechner, William T Langford, Simon D Jones, Sarah A Bekessy, and Ascelin Gordon. Investigating species–environment relationships at multiple scales: Differentiating between intrinsic scale and the modifiable areal unit problem. Ecological Complexity, 11:91–102, 2012.
+Yaguang Li, Rose Yu, Cyrus Shahabi, and Yan Liu. Diffusion convolutional recurrent neural network: Data-driven traffic forecasting. arXiv preprint arXiv:1707.01926, 2017.
+Oisin Mac Aodha, Elijah Cole, and Pietro Perona. Presence-only geographical priors for fine-grained image classification. arXiv preprint arXiv:1906.05272, 2019.
+Gengchen Mai, Krzysztof Janowicz, Bo Yan, Rui Zhu, Ling Cai, and Ni Lao. Contextual graph attention for answering logical queries over incomplete knowledge graphs. In Proceedings of the 10th International Conference on Knowledge Capture, pp. 171-178, 2019a.
+Gengchen Mai, Bo Yan, Krzysztof Janowicz, and Rui Zhu. Relaxing unanswerable geographic questions using a spatially explicit knowledge graph embedding model. In AGILE: The 22nd Annual International Conference on Geographic Information Science, pp. 21-39. Springer, 2019b.
+
+V Maz'ya and G Schmidt. On approximate approximations using gaussian kernels. IMA Journal of Numerical Analysis, 16:13-29, 01 1996.
+Grant McKenzie, Krzysztof Janowicz, Song Gao, Jiue-An Yang, and Yingjie Hu. Poi pulse: A multi-granular, semantic signature-based information observatory for the interactive visualization of big geosocial data. Cartographica: The International Journal for Geographic Information and Geovisualization, 50(2):71-85, 2015.
+Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S Corrado, and Jeff Dean. Distributed representations of words and phrases and their compositionality. In Advances in neural information processing systems, pp. 3111-3119, 2013.
+Justin Moat, Steven P Bachman, Richard Field, and Doreen S Boyd. Refining area of occupancy to address the modifiable areal unit problem in ecology and conservation. Conservation biology, 32 (6):1278-1289, 2018.
+Stan Openshaw. The modifiable areal unit problem. Concepts and techniques in modern geography, 1984.
+Jeffrey Pennington, Richard Socher, and Christopher Manning. Glove: Global vectors for word representation. In Proceedings of the 2014 conference on empirical methods in natural language processing (EMNLP), pp. 1532-1543, 2014.
+Matthew E Peters, Mark Neumann, Mohit Iyyer, Matt Gardner, Christopher Clark, Kenton Lee, and Luke Zettlemoyer. Deep contextualized word representations. arXiv preprint arXiv:1802.05365, 2018.
+Charles R Qi, Hao Su, Kaichun Mo, and Leonidas J Guibas. Pointnet: Deep learning on point sets for 3d classification and segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 652-660, 2017.
+Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jon Shlens, and Zbigniew Wojna. Rethinking the inception architecture for computer vision. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 2818-2826, 2016.
+Kevin Tang, Manohar Paluri, Li Fei-Fei, Rob Fergus, and Lubomir Bourdev. Improving image classification with location context. In Proceedings of the IEEE international conference on computer vision, pp. 1008-1016, 2015.
+Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in Neural Information Processing Systems, pp. 5998-6008, 2017.
+Petar Velickovic, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Lio, and Yoshua Bengio. Graph attention networks. In ICLR 2018, 2018.
+Bo Yan, Krzysztof Janowicz, Gengchen Mai, and Song Gao. From itdl to place2vec: Reasoning about place type similarity and relatedness by learning embeddings from augmented spatial contexts. In Proceedings of the 25th ACM SIGSPATIAL International Conference on Advances in Geographic Information Systems, pp. 35. ACM, 2017.
+Bo Yan, Krzysztof Janowicz, Gengchen Mai, and Rui Zhu. xnet+ sc: Classifying places based on images by incorporating spatial contexts. In 10th International Conference on Geographic Information Science (GIScience 2018). Schloss Dagstuhl-Leibniz-Zentrum fuer Informatik, 2018.
+Manzil Zaheer, Satwik Kottur, Siamak Ravanbakhsh, Barnabas Poczos, Ruslan R Salakhutdinov, and Alexander J Smola. Deep sets. In Advances in neural information processing systems, pp. 3391-3401, 2017.
+Wenyun Zuo, Ni Lao, Yuying Geng, and Keping Ma. Geosvm: an efficient and effective tool to predict species' potential distributions. Journal of Plant Ecology, 1(2):143-145, 2008.
+
+# A APPENDIX
+
+# A.1 BASELINES
+
+To help understand the mechanism of distributed space representation we compare multiple ways of encoding spatial information. Different models use different point space encoder $Enc^{(x)}()$ to encode either location $\mathbf{x}_i$ (for location modeling $loc$ ) or the displacement between the center point and one context point $\Delta \mathbf{x}_{ij} = \mathbf{x}_i - \mathbf{x}_{ij}$ (for spatial context modeling cont) $^8$ .
+
+- random shuffles the order of the correct POI and $N$ negative samples randomly as the predicted ranking. This shows the lower bound of each metrics.
+- direct directly encode location $\mathbf{x}_i$ (or $\Delta \mathbf{x}_{ij}$ for cont) into a location embedding $\mathbf{e}[\mathbf{x}_i]$ (or $\mathbf{e}[\Delta \mathbf{x}_{ij}]$ ) using a feed-forward neural networks (FFNs) $^9$ , denoted as $Enc_{direct}^{(x)}(\mathbf{x})$ without decomposing coordinates into a multi-scale periodic representation. This is essentially the GPS encoding method used by Chu et al. (2019). Note that Chu et al. (2019) is not open sourced and we end up implementing the model architecture ourselves.
+- tile divides the study area $A_{loc}$ (for loc) or the range of spatial context defined by $\lambda_{max}$ , $A_{cont}$ , (for cont) into grids with equal grid sizes $c$ . Each grid has an embedding to be used as the encoding for every location $\mathbf{x}_i$ or displacement $\Delta \mathbf{x}_{ij}$ fall into this grid. This is a common practice by many previous work when dealing with coordinate data (Berg et al., 2014; Adams et al., 2015; Tang et al., 2015).
+- wrap is a location encoder model recently introduced by Mac Aodha et al. (2019). It first normalizes $\mathbf{x}$ (or $\Delta \mathbf{x}$ ) into the range $[-1, 1]$ and uses a coordinate wrap mechanism $[\sin (\pi \mathbf{x}^{[l]}) ; \cos (\pi \mathbf{x}^{[l]})]$ to convert each dimension of $\mathbf{x}$ into 2 numbers. This is then passed through an initial fully connected layer, followed by a series of $h$ residual blocks, each consisting of two fully connected layers ( $o$ hidden neurons) with a dropout layer in between. We adopt the official code of Mac Aodha et al. (2019) $^{10}$ for this implementation.
+- rbf randomly samples $M$ points from the training dataset as RBF anchor points $\{\mathbf{x}_m^{anchor}, m = 1\dots M\}$ (or samples $M\Delta \mathbf{x}_m^{anchor}$ from $A_{cont}$ for cont) $^{11}$ , and use gaussian kernels $\exp \left(-\frac{\|\mathbf{x}_i - \mathbf{x}_m^{anchor}\|^2}{2\sigma^2}\right)$ (or $\exp \left(-\frac{\|\Delta\mathbf{x}_{ij} - \Delta\mathbf{x}_m^{anchor}\|^2}{2\sigma^2}\right)$ for cont) on each anchor points, where $\sigma$ is the kernel size. Each point $p_i$ has a $M$ -dimension RBF feature vector which is fed into a FNN to obtain the spatial embedding. This is a strong baseline for representing floating number features in machine learning models.
+- grid as described in Section 4.1 inspired by the position encoding in Transformer (Vaswani et al., 2017).
+- hexa Same as grid but use $\sin(\theta)$ , $\sin(\theta + 2\pi/3)$ , and $\sin(\theta + 4\pi/3)$ in $PE_{s,l}^{(g)}(\mathbf{x})$ .
+- theory as described in Section 4.1, uses the theoretical models (Gao et al., 2019) as the first layer of $Enc_{theory}^{(x)}(\mathbf{x})$ or $Enc_{theory}^{(x)}(\Delta \mathbf{x}_{ij})$ .
+- theorydiag further constrains $\mathbf{NN}(.)$ as a block diagonal matrix, with each scale as a block.
+
+We also have the following baselines which are specific to the spatial context modeling task.
+
+- none the decoder $Dec_{c}()$ does not consider the spatial relationship between the center point and context points but only the co-locate patterns such as Place2Vec (Yan et al., 2017). That means we drop the $\mathbf{e}[\Delta \mathbf{x}_{ij}]$ from the attention mechanism in Equ. 7 and 8.
+- polar first converts the displacement $\Delta \mathbf{x}_{ij}$ into polar coordinates $(r,\theta)$ centered at the center point where $r = \log (\| \Delta \mathbf{x}_{ij} \| + 1)$ . Then it uses $[r,\theta]$ as the input for a FFN to obtain the spatial relationship embedding in Equ. 7. We find out that it has a significant performance improvement over the variation with $r = \| \Delta \mathbf{x}_{ij} \|$ .
+
+- **polar_TILE** is a modified version of tile but the grids are extracted from polar coordinates $(r, \theta)$ centered at the center point where $r = \log(\|\Delta \mathbf{x}_{ij}\| + 1)$ . Instead of using grid size $c$ , we use the number of grids along $\theta$ (or $r$ ) axis, $F$ , as the only hyperparameter. Similarly, We find that $r = \log(\|\Delta \mathbf{x}_{ij}\| + 1)$ outperform $r = \|\Delta \mathbf{x}_{ij}\|$ significantly.
+- scaled_rbf is a modified version of rbf for cont whose kernel size is proportional to the distance between the current anchor point and the origin, $\|\Delta \mathbf{x}_m^{anchor}\|$ . That is $\exp\left(-\frac{\|\Delta \mathbf{x}_{ij} - \Delta \mathbf{x}_m^{anchor}\|^2}{2\sigma_{scaled}^2}\right)$ . Here $\sigma_{scaled} = \sigma + \beta$ $\|\Delta \mathbf{x}_m^{anchor}\|$ where $\sigma$ is the basic kernel size and $\beta$ is kernel rescale factor, a constant. We developed this mechanism to help RFB to deal with relations at different scale, and we observe that it produces significantly better result than vanilla RBFs.
+
+# A.2 HYPER-PARAMETER SELECTION
+
+We perform grid search for all methods based on their performance on the validation sets.
+
+Location Modeling The hyper-parameters of theory models are based on grid search with $d^{(v)} = (32,64,128,256)$ , $d^{(x)} = (32,64,128,256)$ , $S = (4,8,16,32,64,128)$ , and $\lambda_{min} = (1,5,10,50,100,200,500,1k)$ while $\lambda_{max} = 40k$ is decided based on the total size of the study area. We find out the best performances of different grid cell based models are obtained when $d^{(v)} = 64$ , $d^{(x)} = 64$ , $S = 64$ , and $\lambda_{min} = 50$ . In terms of tile, the hyper-parameters are selected from $c = (10,50,100,200,500,1000)$ while $c = 500$ gives us the best performance. As for rbf, we do grid search on the hyper-parameters: $M = (10,50,100,200,400,800)$ and $\sigma = (10^2,10^3,10^4,10^5,10^6,10^7)$ . The best performance of rbf is obtain when $M = 200$ and $\sigma = 10^3$ . As for wrap, grid search is performed on: $h = (1,2,3,4)$ and $o = (64,128,256,512)$ while $h = 3$ and $o = 512$ gives us the best result. All models use FFNs in their Enc $^{(x)}$ () except wrap. The number of layers $f$ and the number of hidden state neurons $u$ of the FFN are selected from $f = (1,2,3)$ and $u = (128,256,512)$ . We find out $f = 1$ and $u = 512$ give the best performance for direct, tile, rbf, and theory. So we use them for every model for a fair comparison.
+
+Spatial Context Modeling Grid search is used for hyperparameter tuning and the best performance of different grid cell models is obtained when $d^{(v)} = 64$ , $d^{(x)} = 64$ , $S = 64$ , and $\lambda_{\min} = 10$ . We set $\lambda_{\max} = 10k$ based on the maximum displacement between context points and center points to make the location encoding unique. As for multiple baseline models, grid search is used again to obtain the best model. The best model hyperparameters are shown in () besides the model names in Table 3. Note that both $rbf$ and scaled_rbf achieve the best performance with $M = 100$ .
+
+# A.3 FIRING PATTERN FOR THE NEURONS
+
+
+
+
+Figure 4: The firing pattern for the first 8 neurons (out of 64) given different encoders in location modeling.
+
+# A.4 EMBEDDING CLUSTERING OF RBF AND THEORY MODELS
+
+
+(a) $\lambda_{min} = 200$
+
+
+(b) $\lambda_{min} = 100$
+
+
+(c) $\lambda_{min} = 50$
+
+
+(d) $\lambda_{min} = 10$
+
+
+(e) $\lambda_{min} = 200$
+
+
+(f) $\lambda_{min} = 100$
+
+
+(g) $\lambda_{min} = 50$
+
+
+(h) $\lambda_{min} = 10$
+
+
+Figure 5: Embedding clustering in the original space of (a)(b)(c)(d) theory with different $\lambda_{min}$ , but the same $\lambda_{max} = 10k$ and $S = 64$ . (e)(f)(g)(h) are the embedding clustering results of the same models in the polar-distance space. All models use 1 hidden ReLU layers of 512 neurons.
+
+
+(b) $\beta = 0.1$
+
+
+(c) $\beta = 0.2$
+
+
+(d) $\beta = 0.3$
+
+
+(a) $\beta = 0.0$
+(e) $\beta = 0.0$
+
+
+(f) $\beta = 0.1$
+Figure 6: Embedding clustering of RBF models with different kernel rescalar factor $\beta$ (a)(b)(c)(d) in the original space; (e)(f)(g)(h) in the polar-distance space. Here $\beta = 0.0$ indicates the original RBF model. All models use $\sigma = 10\mathrm{m}$ as the basic kernel size and 1 hidden ReLU layers of 512 neurons.
+
+
+(g) $\beta = 0.2$
+
+
+(h) $\beta = 0.3$
\ No newline at end of file
diff --git a/multiscalerepresentationlearningforspatialfeaturedistributionsusinggridcells/images.zip b/multiscalerepresentationlearningforspatialfeaturedistributionsusinggridcells/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..7daf7b629a7d00df4272ac432149992572fe2e7a
--- /dev/null
+++ b/multiscalerepresentationlearningforspatialfeaturedistributionsusinggridcells/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c288d7754c3011fd192584ea4e8034762e3174ec11db660d7335ff21c78c4d0b
+size 821318
diff --git a/multiscalerepresentationlearningforspatialfeaturedistributionsusinggridcells/layout.json b/multiscalerepresentationlearningforspatialfeaturedistributionsusinggridcells/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..d718fc9bc191049b57d4572e5bec12e6985090a6
--- /dev/null
+++ b/multiscalerepresentationlearningforspatialfeaturedistributionsusinggridcells/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:3c469cbe98913d06632a47b4b13a2c5b2e3ee779e41c85ee5a98ca21993a1e4b
+size 788343
diff --git a/nasbench201extendingthescopeofreproducibleneuralarchitecturesearch/42747868-b967-4cde-b3f7-c4f31b205630_content_list.json b/nasbench201extendingthescopeofreproducibleneuralarchitecturesearch/42747868-b967-4cde-b3f7-c4f31b205630_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..7623667d12c6bfbb2ef65a920c7f0b5b0496e48e
--- /dev/null
+++ b/nasbench201extendingthescopeofreproducibleneuralarchitecturesearch/42747868-b967-4cde-b3f7-c4f31b205630_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:5b529d217c899bf0d703eee3d61a37a3191312991fce12a0591af99ab52b4722
+size 104365
diff --git a/nasbench201extendingthescopeofreproducibleneuralarchitecturesearch/42747868-b967-4cde-b3f7-c4f31b205630_model.json b/nasbench201extendingthescopeofreproducibleneuralarchitecturesearch/42747868-b967-4cde-b3f7-c4f31b205630_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..727357dc4c565cfa09cf8d9d60803263265ae93b
--- /dev/null
+++ b/nasbench201extendingthescopeofreproducibleneuralarchitecturesearch/42747868-b967-4cde-b3f7-c4f31b205630_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:caa413a33cce184f9de4ff2e129f755c48b98da405404a9ec3dae6d52a737f13
+size 119750
diff --git a/nasbench201extendingthescopeofreproducibleneuralarchitecturesearch/42747868-b967-4cde-b3f7-c4f31b205630_origin.pdf b/nasbench201extendingthescopeofreproducibleneuralarchitecturesearch/42747868-b967-4cde-b3f7-c4f31b205630_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..1345c153a35504527a5cf052cde053f53a7a7949
--- /dev/null
+++ b/nasbench201extendingthescopeofreproducibleneuralarchitecturesearch/42747868-b967-4cde-b3f7-c4f31b205630_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:356c21ef9e5d3b5c3766198255edb473a4ee2f8b7e5699263b3bfd501bef9899
+size 3424523
diff --git a/nasbench201extendingthescopeofreproducibleneuralarchitecturesearch/full.md b/nasbench201extendingthescopeofreproducibleneuralarchitecturesearch/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..ea2ff24f5bfbef1cb0be6144f4fdad27a2d85ced
--- /dev/null
+++ b/nasbench201extendingthescopeofreproducibleneuralarchitecturesearch/full.md
@@ -0,0 +1,368 @@
+# NAS-BENCH-201: EXTENDING THE SCOPE OF REPRODUCIBLE NEURAL ARCHITECTURE SEARCH
+
+Xuanyi Dong†‡ * and Yi Yang†
+
+†ReLER, CAI, University of Technology Sydney, ‡Baidu Research
+
+# ABSTRACT
+
+Neural architecture search (NAS) has achieved breakthrough success in a great number of applications in the past few years. It could be time to take a step back and analyze the good and bad aspects in the field of NAS. A variety of algorithms search architectures under different search space. These searched architectures are trained using different setups, e.g., hyper-parameters, data augmentation, regularization. This raises a comparability problem when comparing the performance of various NAS algorithms. NAS-Bench-101 has shown success to alleviate this problem. In this work, we propose an extension to NAS-Bench-101: NAS-Bench201 with a different search space, results on multiple datasets, and more diagnostic information. NAS-Bench-201 has a fixed search space and provides a unified benchmark for almost any up-to-date NAS algorithms. The design of our search space is inspired from the one used in the most popular cell-based searching algorithms, where a cell is represented as a directed acyclic graph. Each edge here is associated with an operation selected from a predefined operation set. For it to be applicable for all NAS algorithms, the search space defined in NAS-Bench-201 includes all possible architectures generated by 4 nodes and 5 associated operation options, which results in 15,625 neural cell candidates in total. The training log using the same setup and the performance for each architecture candidate are provided for three datasets. This allows researchers to avoid unnecessary repetitive training for selected architecture and focus solely on the search algorithm itself. The training time saved for every architecture also largely improves the efficiency of most NAS algorithms and brings a more computational cost friendly NAS community for a broader range of researchers. We provide additional diagnostic information such as fine-grained loss and accuracy, which can give inspirations to new designs of NAS algorithms. In further support of the proposed NAS-Bench201, we have analyzed it from many aspects and benchmarked 10 recent NAS algorithms, which verify its applicability.
+
+# 1 INTRODUCTION
+
+The deep learning community is undergoing a transition from hand-designed neural architecture (He et al., 2016; Krizhevsky et al., 2012; Szegedy et al., 2015) to automatically designed neural architecture (Zoph & Le, 2017; Pham et al., 2018; Real et al., 2019; Dong & Yang, 2019b; Liu et al., 2019). In its early era, the great success of deep learning was promoted by novel neural architectures, such as ResNet (He et al., 2016), Inception (Szegedy et al., 2015), VGGNet (Simonyan & Zisserman, 2015), and Transformer (Vaswani et al., 2017). However, manually designing one architecture requires human experts to try numerous different operation and connection choices (Zoph & Le, 2017). In contrast to architectures that are manually designed, those automatically found by neural architecture search (NAS) algorithms require much less human interaction and expert effort. These NAS-generated architectures have shown promising results in many domains, such as image recognition (Zoph & Le, 2017; Pham et al., 2018; Real et al., 2019), sequence modeling (Pham et al., 2018; Dong & Yang, 2019b; Liu et al., 2019), etc.
+
+Recently, a variety of NAS algorithms have been increasingly proposed. While these NAS methods are methodically designed and show promising improvements, many setups in their algorithms are
+
+
+Figure 1: Top: the macro skeleton of each architecture candidate. Bottom-left: examples of neural cell with 4 nodes. Each cell is a directed acyclic graph, where each edge is associated with an operation selected from a predefined operation set as shown in the Bottom-right.
+
+different. (1) Different search space is utilized, e.g., different macro skeletons of the whole architecture (Zoph et al., 2018; Tan et al., 2019) and a different operation set for the micro cell within the skeleton (Pham et al., 2018), etc. (2) After a good architecture is selected, various strategies can be employed to train this architecture and report the performance, e.g., different data augmentation (Ghiasi et al., 2018; Zhang et al., 2018), different regularization (Zoph et al., 2018), different scheduler (Loshchilov & Hutter, 2017), and different selections of hyper-parameters (Liu et al., 2018; Dong & Yang, 2019a). (3) The validation set for testing the performance of the selected architecture is not split in the same way (Liu et al., 2019; Pham et al., 2018). These discrepancies raise a comparability problem when comparing the performance of various NAS algorithms, making it difficult to conclude their contributions.
+
+In response to this problem, NAS-Bench-101 (Ying et al., 2019) and NAS-HPO-Bench (Klein & Hutter, 2019) are proposed. However, some NAS algorithms can not be applied directly on NAS-Bench-101, and NAS-HPO-Bench only has 144 candidate architectures, which maybe insufficient to evaluate NAS algorithms. To extend these two benchmarks and towards better reproducibility of NAS methods1, we propose NAS-Bench-201 with a fixed cell search space, inspired from the search space used in the most popular neural cell-based searching algorithms (Zoph et al., 2018; Liu et al., 2019). As shown in Figure 1, each architecture consists of a predefined skeleton with a stack of the searched cell. In this way, architecture search is transformed into the problem of searching a good cell. Each cell is represented as a densely-connected directed acyclic graph (DAG) as shown in the bottom section of Figure 1. Here the node represents the sum of the feature maps and each edge is associated with an operation transforming the feature maps from the source node to the target node. The size of the search space is related to the number of nodes defined for the DAG and the size of the operation set. In NAS-Bench-201, we choose 4 nodes and 5 representative operation candidates for the operation set, which generates a total search space of 15,625 cells/architectures. Each architecture is trained multiple times on three different datasets. The training log and performance of each architecture are provided for each run. The training accuracy/test accuracy/training loss/test loss after every training epoch for each architecture plus the number of parameters and floating point operations (FLOPs) are accessible.
+
+Hopefully, NAS-Bench-201 will show its value in the field of NAS research. (1) It provides a unified benchmark for most up-to-date NAS algorithms including all cell-based NAS methods. With NAS-Bench-201, researchers can focus on designing robust searching algorithm while avoiding tedious hyper-parameter tuning of the searched architecture. Thus, NAS-Bench-201 provides a relatively fair benchmark for the comparison of different NAS algorithms. (2) It provides the full training log of each architecture. Unnecessary repetitive training procedure of each selected architecture can be avoided (Liu et al., 2018; Zoph & Le, 2017) so that researchers can target on the essence of NAS, i.e., search algorithm. Another benefit is that the validation time for NAS largely decreases when testing in NAS-Bench-201, which provides a computational power friendly environment for more participations in NAS. (3) It provides results of each architecture on multiple datasets. The model transferability can be thoroughly evaluated for most NAS algorithms. (4) In NAS-Bench-201, we provide systematic analysis of the proposed search space. We also evaluate 10 recent advanced NAS
+
+algorithms including reinforcement learning (RL)-based methods, evolutionary strategy (ES)-based methods, differentiable-based methods, etc. We hope our empirical analysis can bring some insights to the future designs of NAS algorithms.
+
+# 2 NAS-Bench-201
+
+Our NAS-Bench-201 is algorithm-agnostic. Put simply, it is applicable to almost any up-to-date NAS algorithms. In this section, we will briefly introduce our NAS-Bench-201. The search space of NAS-Bench-201 is inspired by cell-based NAS algorithms (Section 2.1). NAS-Bench-201 evaluates each architecture on three different datasets (Section 2.2). All implementation details of NAS-Bench-201 are introduced in Section 2.3. NAS-Bench-201 also provides some diagnostic information which can be used for potentially better designs of future NAS algorithms (discussed in Section 2.4).
+
+# 2.1 ARCHITECTURES IN THE SEARCH SPACE
+
+Macro Skeleton. Our search space follows the design of its counterpart as used in the recent neural cell-based NAS algorithms (Liu et al., 2019; Zoph et al., 2018; Pham et al., 2018). As shown in the top of Figure 1, the skeleton is initiated with one 3-by-3 convolution with 16 output channels and a batch normalization layer (Ioffe & Szegedy, 2015). The main body of the skeleton includes three stacks of cells, connected by a residual block. Each cell is stacked $N = 5$ times, with the number of output channels as 16, 32 and 64 for the first, second and third stages, respectively. The intermediate residual block is the basic residual block with a stride of 2 (He et al., 2016), which serves to down-sample the spatial size and double the channels of an input feature map. The shortcut path in this residual block consists of a 2-by-2 average pooling layer with stride of 2 and a 1-by-1 convolution. The skeleton ends up with a global average pooling layer to flatten the feature map into a feature vector. Classification uses a fully connected layer with a softmax layer to transform the feature vector into the final prediction.
+
+Searched Cell. Each cell in the search space is represented as a densely connected DAG. The densely connected DAG is obtained by assigning a direction from the $i$ -th node to the $j$ -th node ( $i < j$ ) for each edge in an undirected complete graph. Each edge in this DAG is associated with an operation transforming the feature map from the source node to the target node. All possible operations are selected from a predefined operation set, as shown in Figure 1(bottom-right). In our NAS-Bench-201, the predefined operation set $\mathcal{O}$ has $L = 5$ representative operations: (1) zeroize, (2) skip connection, (3) 1-by-1 convolution, (4) 3-by-3 convolution, and (5) 3-by-3 average pooling layer. The convolution in this operation set is an abbreviation of an operation sequence of ReLU, convolution, and batch normalization. The DAG has $V = 4$ nodes, where each node represents the sum of all feature maps transformed through the associated operations of the edges pointing to this node. We choose $V = 4$ to allow the search space to contain basic residual block-like cells, which requires 4 nodes. Densely connected DAG does not restrict the searched topology of the cell to be densely connected, since we include zeroize in the operation set, which is an operation of dropping the associated edge. Besides, since we do not impose the constraint on the maximum number of edges (Ying et al., 2019), our search space is applicable to most NAS algorithms, including all cell-based NAS algorithms.
+
+# 2.2 DATASETS
+
+We train and evaluate each architecture on CIFAR-10, CIFAR-100 (Krizhevsky et al., 2009), and ImageNet-16-120 (Chrabaszcz et al., 2017). We choose these three datasets because CIFAR and ImageNet (Russakovsky et al., 2015) are the most popular image classification datasets.
+
+We split each dataset into training, validation and test sets to provide a consistent training and evaluation settings for previous NAS algorithms (Liu et al., 2019). Most NAS methods use the validation set to evaluate architectures after the architecture is optimized on the training set. The validation performance of the architectures serves as supervision signals to update the searching algorithm. The test set is to evaluate the performance of each searching algorithm by comparing the indicators (e.g., accuracy, model size, speed) of their selected architectures. Previous methods use different splitting strategies, which may result in various searching costs and unfair comparisons. We hope to use the proposed splits to unify the training, validation and test sets for a fairer comparison.
+
+CIFAR-10: It is a standard image classification dataset and consists of 60K $32 \times 32$ colour images in 10 classes. The original training set contains 50K images, with 5K images per class. The original test set contains 10K images, with 1K images per class. Due to the need of validation set, we split all 50K training images in CIFAR-10 into two groups. Each group contains 25K images with 10 classes. We regard the first group as the new training set and the second group as the validation set.
+
+CIFAR-100: This dataset is just like CIFAR-10. It has the same images as CIFAR-10 but categorizes each image into 100 fine-grained classes. The original training set on CIFAR-100 has 50K images, and the original test set has 10K images. We randomly split the original test set into two groups of equal size — 5K images per group. One group is regarded as the validation set, and another one is regarded as the new test set.
+
+ImageNet-16-120: We build ImageNet-16-120 from the down-sampled variant of ImageNet (ImageNet $16 \times 16$ ). As indicated in Chrabaszcz et al. (2017), down-sampling images in ImageNet can largely reduce the computation costs for optimal hyper-parameters of some classical models while maintaining similar searching results. Chrabaszcz et al. (2017) down-sampled the original ImageNet to $16 \times 16$ pixels to form ImageNet $16 \times 16$ , from which we select all images with label $\in [1, 120]$ to construct ImageNet-16-120. In sum, ImageNet-16-120 contains 151.7K training images, 3K validation images, and 3K test images with 120 classes.
+
+By default, in this paper, "the training set", "the validation set", "the test set" indicate the new training, validation, and test sets, respectively.
+
+# 2.3 ARCHITECTURE PERFORMANCE
+
+Training Architectures. In order to unify the performance of every architecture, we give the performance of every architecture in our search space. In our NAS-Bench-201, we follow previous
+
+literature to set up the hyper-parameters and training strategies (Zoph et al., 2018; Loshchilov & Hutter, 2017; He et al., 2016). We train each architecture with the same strategy, which is shown in Table 1. For simplification, we denote all hyperparameters for training a model as a set $\mathcal{H}$ , and we use $\mathcal{H}^{\dagger}$ to denote the values of hyper-parameter that we use. Specifically, we train each architecture via Nesterov momentum SGD, using the cross-entropy loss for 200 epochs in total. We set the weight de
+
+Table 1: The training hyper-parameter set ${\mathcal{H}}^{ \dagger }$ .
+
+| optimizer | SGD | initial LR | 0.1 |
| Nesterov | ✓ | ending LR | 0 |
| momentum | 0.9 | LR schedule | cosine |
| weight decay | 0.0005 | epoch | 200 |
| batch size | 256 | initial channel | 16 |
| V | 4 | N | 5 |
| random flip | p=0.5 | random crop | ✓ |
| normalization | ✓ | | |
+
+cay as 0.0005 and decay the learning rate from 0.1 to 0 with a cosine annealing (Loshchilov & Hutter, 2017). We use the same $\mathcal{H}^{\dagger}$ on different datasets, except for the data augmentation which is slightly different due to the image resolution. On CIFAR, we use the random flip with probability of 0.5, the random crop $32\times 32$ patch with 4 pixels padding on each border, and the normalization over RGB channels. On ImageNet-16-120, we use a similar strategy but random crop $16\times 16$ patch with 2 pixels padding on each border. Apart from using $\mathcal{H}^{\dagger}$ for all datasets, we also use a different hyper-parameter set $\mathcal{H}^{\ddagger}$ for CIFAR-10. It is similar to $\mathcal{H}^{\dagger}$ but its total number of training epochs is 12. In this way, we could provide bandit-based algorithms (Falkner et al., 2018; Li et al., 2018) more options for the usage of short training budget (see more details in appendix).
+
+Metrics. We train each architecture with different random seeds on different datasets. We evaluate each architecture $A$ after every training epoch. NAS-Bench-201 provides the training, validation,
+
+and test loss as well as accuracy. We show the supported metrics on different datasets in Table 2. Users can easily use our API to query the results of each trial of $A$ , which has negligible computational costs. In this way, researchers could significantly speed up their searching algorithm on these datasets and focus solely on the essence of NAS.
+
+We list the training/test loss/accuracies over
+
+Table 2: NAS-Bench-201 provides the following metrics with $\mathcal{H}^{\dagger}$ . 'Acc.' means accuracy.
+
+| Dataset | Train Loss/Acc. | Eval Loss/Acc. |
| CIFAR-10 | train set | valid set |
| CIFAR-10 | train+valid set | test set |
| CIFAR-100 | train set | valid set |
| CIFAR-100 | train set | test set |
| ImageNet-16-120 | train set | valid set |
| ImageNet-16-120 | train set | test set |
+
+different split sets on four datasets in Table 2. On CIFAR-10, we train the model on the training set and evaluate it on the validation set. We also train the model on the training and validation set and
+
+ | #archit -ectures | #data -sets | |O| | search space constraint | Supported NAS algorithms | Diagnostic information |
| RL | ES | Diff. | HPO |
| NAS-Bench-101 | 510M | 1 | 3 | constrain #edges | partial | partial | none | most | - fine-grained info., param., etc |
| NAS-Bench-201 | 15.6K | 3 | 5 | no constraint | all | all | all | most |
+
+Table 3: We summarize some characteristics of NAS-Bench-101 and NAS-Bench-201. Our NAS-Bench-201 can directly be applicable to almost any up-to-date NAS algorithms. In contrast, as pointed in (Ying et al., 2019), NAS algorithms based on parameter sharing or network morphisms cannot be directly evaluated on NAS-Bench-101. Besides, NAS-Bench-201 provides train/validation/test performance on three (one for NAS-Bench-101) different datasets so that the generality of NAS algorithms can be evaluated. It also provides some diagnostic information that may provide insights to design better NAS algorithms.
+
+evaluate it on the test set. These two paradigm follow the typical experimental setup on CIFAR-10 in previous literature (Liu et al., 2018; Zoph et al., 2018; Liu et al., 2018; Pham et al., 2018). On CIFAR-100 and ImageNet-16-120, we train the model on the training set and evaluate it on both validation and test sets.
+
+# 2.4 DIAGNOSTIC INFORMATION
+
+Validation accuracy is a commonly used supervision signal for NAS. However, considering the expensive computational costs for evaluating the architecture, the signal is too sparse. In our NAS-Bench-201, we also provide some diagnostic information which is some extra statistics obtained during training each architecture. Collecting these statistics almost involves no extra computation cost but may provide insights for better designs and training strategies of different NAS algorithms, such as platform-aware NAS (Tan et al., 2019), accuracy prediction (Baker et al., 2018), mutation-based NAS (Cai et al., 2018; Chen et al., 2016), etc.
+
+Architecture Computational Costs: NAS-Bench-201 provides three computation metrics for each architecture — the number of parameters, FLOPs, and latency. Algorithms that target on searching architectures with computational constraints, such as models on edge devices, can use these metrics directly in their algorithm designs without extra calculations.
+
+Fine-grained training and evaluation information. NAS-Bench-201 tracks the changes in loss and accuracy of every architecture after every training epochs. These fine-grained training and evaluation information shows the tendency of the architecture performance and could indicate some attributes of the model, such as the speed of convergence, the stability, the over-fitting or under-fitting levels, etc. These attributes may benefit the designs of NAS algorithms. Besides, some methods learn to predict the final accuracy of an architecture based on the results of few early training epochs (Baker et al., 2018). These algorithm can be trained faster and the performance of the accuracy prediction can be evaluated using the fine-grained evaluation information.
+
+Parameters of optimized architecture. Our NAS-Bench-201 releases the trained parameters for each architecture. This can provide ground truth label for hypernetwork-based NAS methods (Zhang et al., 2019; Brock et al., 2018), which learn to generate parameters of an architecture. Other methods mutate an architecture to become another one (Real et al., 2019; Cai et al., 2018). With NAS-Bench-201, researchers could directly use the off-the-shelf parameters instead of training from scratch and analyze how to transfer parameters from one architecture to another.
+
+# 3 DIFFERENCE WITH EXISTING NAS BENCHMARKS
+
+To the best of our knowledge, NAS-Bench-101 (Ying et al., 2019) is the only existing large-scale architecture dataset. Similar to NAS-Bench-201, NAS-Bench-101 also transforms the problem of architecture search into the problem of searching neural cells, represented as a DAG. Differently, NAS-Bench-101 defines operation candidates on the node, whereas we associate operations on the edge as inspired from (Liu et al., 2019; Dong & Yang, 2019b; Zoph et al., 2018). We summarize characteristics of our NAS-Bench-201 and NAS-Bench-101 in Table 3. The main highlights of our NAS-Bench-201 are as follows. (1) NAS-Bench-201 is algorithm-agnostic while NAS-Bench
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Figure 2: Training, validation, test accuracy of each architecture on CIFAR-10, CIFAR-100, and ImageNet-16-120. We also visualize the results of ResNet in the orange star marker.
+
+
+
+
+
+
+
+101 without any modification is only applicable to selected algorithms (Yu et al., 2020; Zela et al., 2020). The original complete search space, based on the nodes in NAS-Bench-101, is extremely huge. So, it is exceedingly difficult to efficiently traverse the training of all architectures. To trade off the computational cost and the size of the search space, they constrain the maximum number of edges in the DAG. However, it is difficult to incorporate this constraint in all NAS algorithms, such as NAS algorithms based on parameter-sharing (Liu et al., 2019; Pham et al., 2018). Therefore, many NAS algorithms cannot be directly evaluated on NAS-Bench-101. Our NAS-Bench-201 solves this problem by sacrificing the number of nodes and including all possible edges so that our search space is algorithm-agnostic. (2) We provide extra diagnostic information, such as architecture computational cost, fine-grained training and evaluation time, etc., which give inspirations to better and efficient designs of NAS algorithms utilizing these diagnostic information.
+
+NAS-HPO-Bench (Klein & Hutter, 2019) evaluated 62208 configurations in the joint NAS and
+
+hyper-parameter space for a simple 2-layer feed-forward network. Since NAS-HPO-Bench has only 144 architectures, it could be insufficient to evaluate different NAS algorithms.
+
+
+
+# 4 ANALYSIS OF NAS-Bench-201
+
+An overview of architecture performance. The performance of each architecture is shown in Figure 2. We show the test accuracy of every architecture in our search space in the left column of Figure 2. The training, validation and test accuracy with respect to the number of parameters are shown in the rest three columns, respectively. Results show that a different number of parameters will affect the performance of the architectures, which indicates that the choices of operations are essential in NAS. We also observe that the performance of the
+
+architecture can vary even when the number of parameters stays the same. This observation indicates the importance of how the operations/cells are connected. We compare the architectures with a clas-
+
+sical human-designed architecture (ResNet) in all cases, which is indicated by an orange star mark. ResNet shows competitive performance in three datasets, however, it still has room to improve, i.e., about $2\%$ compared to the best architecture in CIFAR-100 and ImageNet-16-120, about $1\%$ compared to the best one with the same amount of parameters in CIFAR-100 and ImageNet-16-120.
+
+Architecture ranking on three datasets. The ranking of every architecture in our search space is shown in Figure 3, where the architecture ranked in CIFAR-10 (x-axis) is ranked as in y-axis in CIFAR-100 and ImageNet-16-120, indicated by green and red markers respectively. The performance of the architectures shows a generally consistent ranking over the three datasets with slightly different variance, which serves to test the generality of the searching algorithm.
+
+Correlations of validation and test accuracies. We visualize the correlation between the validation and test accuracy within one dataset and across datasets in Figure 4. The correlation within one dataset is high compared to cross-dataset correlation. The correlation dramatically decreases as we
+
+only pick the top performing architectures. When we directly transfer the best architecture in one dataset to another (a vanilla strategy), it can not $100\%$ secure a good performance. This phenomena is a call for better transferable NAS algorithms instead of vanilla strategy.
+
+
+
+
+
+
+
+Dynamic ranking of architectures. We show the ranking of the performance of all architectures in different time stamps in Figure 5. The ranking based on the validation set (y axis)
+
+Figure 4: We report the correlation coefficient between the accuracy on 6 sets, i.e., CIFAR-10 validation set (C10-V), CIFAR-10 test set (C10-T), CIFAR-100 validation set (C100-V), CIFAR-100 test set (C100-T), ImageNet-16-120 validation set (I120-V), ImageNet-16-120 test set (I120-T).
+
+gradually converges to the ranking based on the final test accuracy (x axis).
+
+
+Figure 5: The ranking of all architectures based on the validation accuracy at different time stamps (y axis) sorted by the final test accuracy (x axis).
+
+
+
+
+
+
+
+
+
+# 5 BENCHMARK
+
+In this section, we evaluate 10 recent searching methods on our NAS-Bench-201, which can serve as baselines for future NAS algorithms in our dataset. Specifically, we evaluate some typical NAS algorithms: (I) Random Search algorithms, e.g., random search (RS) (Bergstra & Bengio, 2012), random search with parameter sharing (RSPS) (Li & Talwalkar, 2019). (II) ES methods, e.g., REA (Real et al., 2019). (III) RL algorithms, e.g., REINFORCE (Williams, 1992), ENAS (Pham et al., 2018). (IV) Differentiable algorithms. e.g., first order DARTS (DARTS-V1) (Liu et al., 2019), second order DARTS (DARTS-V2), GDAS (Dong & Yang, 2019b), and SETN (Dong & Yang, 2019a). (V) HPO methods, e.g., BOHB (Falkner et al., 2018). We experimented all NAS algorithms on a single GeForce GTX 1080 Ti GPU.
+
+| accelerate | RS | RSPS | DARTS-V1 | DARTS-V2 | GDAS | SETN | REA | REINFORCE | ENAS | BOHB |
| search | ✓ | ✗ | ✗ | ✗ | ✗ | ✗ | ✓ | ✓ | ✓ | ✓ |
| evaluation | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
+
+Table 4: The utility of our NAS-Bench-201 for different NAS algorithms. We show whether a NAS algorithm can use our NAS-Bench-201 to accelerate the searching and evaluation procedure.
+
+| Method | Search (seconds) | CIFAR-10 | CIFAR-100 | ImageNet-16-120 |
| validation | test | validation | test | validation | test |
| RSPS | 8007.13 | 80.42±3.58 | 84.07±3.61 | 52.12±5.55 | 52.31±5.77 | 27.22±3.24 | 26.28±3.09 |
| DARTS-V1 | 11625.77 | 39.77±0.00 | 54.30±0.00 | 15.03±0.00 | 15.61±0.00 | 16.43±0.00 | 16.32±0.00 |
| DARTS-V2 | 35781.80 | 39.77±0.00 | 54.30±0.00 | 15.03±0.00 | 15.61±0.00 | 16.43±0.00 | 16.32±0.00 |
| GDAS | 31609.80 | 89.89±0.08 | 93.61±0.09 | 71.34±0.04 | 70.70±0.30 | 41.59±1.33 | 41.71±0.98 |
| SETN | 34139.53 | 84.04±0.28 | 87.64±0.00 | 58.86±0.06 | 59.05±0.24 | 33.06±0.02 | 32.52±0.21 |
| ENAS | 14058.80 | 37.51±3.19 | 53.89±0.58 | 13.37±2.35 | 13.96±2.33 | 15.06±1.95 | 14.84±2.10 |
| \( RSPS^† \) | 7587.12 | 84.16±1.69 | 87.66±1.69 | 59.00±4.60 | 58.33±4.34 | 31.56±3.28 | 31.14±3.88 |
| DARTS-V1† | 10889.87 | 39.77±0.00 | 54.30±0.00 | 15.03±0.00 | 15.61±0.00 | 16.43±0.00 | 16.32±0.00 |
| DARTS-V2† | 29901.67 | 39.77±0.00 | 54.30±0.00 | 15.03±0.00 | 15.61±0.00 | 16.43±0.00 | 16.32±0.00 |
| \( GDAS^† \) | 28925.91 | 90.00±0.21 | 93.51±0.13 | 71.14±0.27 | 70.61±0.26 | 41.70±1.26 | 41.84±0.90 |
| \( SETN^† \) | 31009.81 | 82.25±5.17 | 86.19±4.63 | 56.86±7.59 | 56.87±7.77 | 32.54±3.63 | 31.90±4.07 |
| \( ENAS^† \) | 13314.51 | 39.77±0.00 | 54.30±0.00 | 15.03±0.00 | 15.61±0.00 | 16.43±0.00 | 16.32±0.00 |
| REA | 0.02 | 91.19±0.31 | 93.92±0.30 | 71.81±1.12 | 71.84±0.99 | 45.15±0.89 | 45.54±1.03 |
| RS | 0.01 | 90.93±0.36 | 93.70±0.36 | 70.93±1.09 | 71.04±1.07 | 44.45±1.10 | 44.57±1.25 |
| REINFORCE | 0.12 | 91.09±0.37 | 93.85±0.37 | 71.61±1.12 | 71.71±1.09 | 45.05±1.02 | 45.24±1.18 |
| BOHB | 3.59 | 90.82±0.53 | 93.61±0.52 | 70.74±1.29 | 70.85±1.28 | 44.26±1.36 | 44.42±1.49 |
| ResNet | N/A | 90.83 | 93.97 | 70.42 | 70.86 | 44.53 | 43.63 |
| optimal | 91.61 | 94.37 | 73.49 | 73.51 | 46.77 | 47.31 |
+
+Table 5: We evaluate 10 different searching algorithms in our NAS-Bench-201. The first block shows results of parameter sharing based NAS methods. The second block is similar to the first one, however, BN layers in the searching cells do not keep running estimates but always use batch statistics. The third block shows results of NAS methods without parameter sharing. Each algorithm uses the training and validation set of CIFAR-10 for searching. We show results of their searched architectures for (1) training on the CIFAR-10 train set and evaluating on its validation set; (2) training on the CIFAR-10 train+validation sets and evaluating on its test set; (3) training on the CIFAR-10 or ImageNet-16-120 train set and evaluating on their validation or test sets. "optimal" indicates the highest mean accuracy for each set. We report the mean and std of 500 runs for RS, REA, REINFORCE, and BOHB and of 3 runs for RSPS, DARTS, GDAS, SETN, and ENAS.
+
+
+CIFAR-10
+
+
+CIFAR-100
+Figure 6: We show results of 500 runs for RS, REA, REINFORCE, and BOHB on CIFAR-10. The architecture is searched on CIFAR-10 and we report its validation accuracy (solid line) and test accuracy (dashed line) on three datasets. Each individual run is sorted by the validation accuracy of the searched architecture.
+
+
+ImageNet-16-120
+
+We show the benefits for speed using our NAS-Bench-201 for different NAS algorithms in Table 4. For each NAS algorithm, once the searching procedure finished and the final architecture is found, our NAS-Bench-201 can directly return the performance of this architecture. With NAS-Bench-201, NAS algorithms without parameter sharing can significantly reduce the searching time into seconds. Notably, it still requires several GPU hours for NAS algorithms with parameter sharing to complete the searching.
+
+All algorithms use the training and validation set of CIFAR-10 to search architectures. In Table 5, Figure 6, Figure 7, and Figure 8, we report the performance of the searched architectures plus the optimal architecture on three datasets. We make the following observations: (1) NAS methods without parameter sharing (REA, RS, REINFORCE, and BOHB) outperform others. This be because training a model for a few epochs with the converged LR scheduler $(\mathcal{H}^{\ddagger})$ can provide a good relative
+
+
+CIFAR-10
+
+
+The CIFAR-10 validation
+
+
+The CIFAR-10 test
+
+
+Figure 7: Results keeping keep running estimates for BN layers in each searching cell. We use parameter sharing based NAS methods to search the architecture on CIFAR-10. After each searching epoch, we derive the architecture and show its validation accuracy (VALID) and test accuracy (TEST) on CIFAR-10. The 0-th epoch indicates the architecture is derived from the randomly initialized architecture encoding.
+CIFAR-10
+Figure 8: Results using batch statistics without keeping keep running estimates for BN layers in each searching cell. We use parameter sharing based NAS methods to search the architecture on CIFAR-10. After each searching epoch, we derive the architecture and show its validation accuracy (VALID) and test accuracy (TEST) on CIFAR-10. The 0-th epoch indicates the architecture is derived from the randomly initialized architecture encoding.
+
+
+The CIFAR-10 validation
+
+
+The CIFAR-10 test
+
+ranking of each architecture. (2) DARTS-V1 and DARTS-V2 quickly converge to find the architecture whose edges are all skip connection. A possible reason is that the original hyper-parameters of DARTS are chosen for their search space instead of ours. (3) The strategy of BN layers can significantly effect the NAS methods with parameter sharing. Using batch statistics are better than keep running estimates of the mean and variance. (4) Using our fine-grained information, REA, REINFORCE and RS can be finished in seconds which could significantly reduce the search costs and let researchers focus solely on the search algorithm itself.
+
+In Figure 7 and Figure 8, we show the performance of the architecture derived from each algorithm per searching epoch. DARTS-V1 will gradually over-fit to an architecture with all skip-connection operations. DARTS-V2 can alleviate this problem to some extent but will still over-fit after more epochs. It can further alleviate this problem by using batch statistics for BN layers. We train RSPS, GDAS, SETN, and ENAS five times longer than DARTS (250 epochs vs. 50 epochs). This is because at every iteration, RSPS, GDAS, SETN, and ENAS only optimize $\frac{1}{|\mathcal{O}| = 5}$ parameters of the shared parameters, whereas DARTS optimize all shared parameters. The searched architecture performs similar for GDAS after 50 searching epochs. RSPS and SETN show a higher variance of the searched architecture compared to GDAS.
+
+Clarification. We have tried our best to implement each method. However, still, some algorithms might obtain non-optimal results since their hyper-parameters might not fit our NAS-Bench-201. We empirically found that some NAS algorithms are sensitive to some hyper-parameters, whereas we try to compare them in a fair way as we can (Please see more explanation in Appendix). If researchers can provide better results with different hyper-parameters, we are happy to update results according to the new experimental results. We also welcome more NAS algorithms to test on our dataset and would include them accordingly.
+
+# 6 DISCUSSION
+
+How to avoid over-fitting on NAS-Bench-201? Our NAS-Bench-201 provides a benchmark for NAS algorithms, aiming to provide a fair and computational cost-friendly environment to the NAS community. The trained architecture and the easy-to-access performance of each architecture might provide some insidious ways for designing algorithms to over-fit the best architecture in our NAS-Bench-201. Thus, we propose some rules which we wish the users will follow to achieve the original intention of NAS-Bench-201, a fair and efficient benchmark.
+
+1. No regularization for a specific operation. Since the best architecture is known in our benchmark, specific designs to fit the structural attributes of the best performed architecture are insidious ways to fit our NAS-Bench-201. For example, as mentioned in Section 5, we found that the best architecture with the same amount of parameters for CIFAR10 on NAS-Bench-201 is ResNet. Restrictions on the number of residual connections is a way to over-fit the CIFAR10 benchmark. While this can give a good result on this benchmark, the searching algorithm might not generalize to other benchmarks.
+2. Use the provided performance. The training strategy affects the performance of the architecture. We suggest the users stick to the performance provided in our benchmark even if it is feasible to use other $\mathcal{H}$ to get a better performance. This provides a fair comparison with other algorithms.
+3. Report results of multiple searching runs. Since our benchmark can help to largely decrease the computational cost for a number of algorithms. Multiple searching runs give stable results of the searching algorithm with acceptable time cost.
+
+Limitation regarding hyper-parameter optimization (HPO). The performance of an architecture depends on the hyper-parameters $\mathcal{H}$ for its training and the optimal configuration of $\mathcal{H}$ may vary for different architectures. In NAS-Bench-201, we use the same configuration for all architectures, which may bring biases to the performance of some architectures. One related solution is HPO, which aims to search the optimal hyper-parameter configuration. However, searching the optimal hyper-parameter configurations and the architecture in one shot is too computationally expensive and still is an open problem.
+
+Potential designs using diagnostic information in NAS-Bench-201. As pointed in Section 2.4, different kinds of diagnostic information are provided. We hope that more insights about NAS could be found by analyzing these diagnostic information and further motivate potential solutions for NAS. For example, parameter sharing (Pham et al., 2018) is the crucial technique to improve the searching efficiency, but the shared parameter would sacrifice the accuracy of each architecture. Could we find a better way to share parameters of each architecture from the learned 15,625 models' parameters?
+
+Generalization ability of the search space. It is important to test the generalization of observations on this dataset. An idea strategy is to do all benchmark experiments on a much larger search space. Unfortunately, it is prohibitive regarding the expensive computational cost. We bring some results from (Ying et al., 2019) and (Zela et al., 2020) to provide some preliminary evidence of generalization. In Figure 2, we show the rankings of RS, REA, and REINFORCE is ( $\mathrm{REA} > \mathrm{REINFORCE}>$ RS). This is consistent with results in NAS-Bench-101, which contains more architecture candidates. For NAS methods with parameter sharing, we find that GDAS $\geq$ DARTS $\geq$ ENAS, which is also consistent with results in NAS-Bench-1SHOT1. Therefore, observations from our NAS-Bench201 may generalize to other search spaces.
+
+# 7 CONCLUSION & FUTURE WORK
+
+In this paper, we introduce NAS-Bench-201 that extends the scope of reproducible NAS. In NAS-Bench-201, almost any NAS algorithms can be directly evaluated. We train and evaluate 15,625 architecture on three different datasets, and we provide results regarding different metrics. We comprehensively analyze our dataset and test some recent NAS algorithms on NAS-Bench-201 to serve as baselines for future works. In future, we will (1) consider HPO and NAS together and (2) much larger search space. We welcome researchers to try their NAS algorithms on our NAS-Bench-201 and would update the paper to include their results.
+
+Acknowledgements. We thank the ICLR area chair, ICLR reviewers, and authors of NAS-Bench-101 for the constructive suggestions during the rebuttal and revision period.
+
+# REFERENCES
+
+Bowen Baker, Otkrist Gupta, Ramesh Raskar, and Nikhil Naik. Accelerating neural architecture search using performance prediction. In International Conference on Learning Representations Workshop (ICLR-W), 2018.
+James Bergstra and Yoshua Bengio. Random search for hyper-parameter optimization. The Journal of Machine Learning Research (JMLR), 13(Feb):281-305, 2012.
+Andrew Brock, Theodore Lim, James M Ritchie, and Nick Weston. SMASH: one-shot model architecture search through hypernetworks. In International Conference on Learning Representations (ICLR), 2018.
+Han Cai, Tianyao Chen, Weinan Zhang, Yong Yu, and Jun Wang. Efficient architecture search by network transformation. In AAAI Conference on Artificial Intelligence (AAAI), pp. 2787-2794, 2018.
+Tianqi Chen, Ian Goodfellow, and Jonathon Shlens. Net2net: Accelerating learning via knowledge transfer. In International Conference on Learning Representations (ICLR), 2016.
+Patryk Chrabaszcz, Ilya Loshchilov, and Frank Hutter. A downsampled variant of imagenet as an alternative to the CIFar datasets. arXiv preprint arXiv:1707.08819, 2017.
+Xuanyi Dong and Yi Yang. One-shot neural architecture search via self-evaluated template network. In Proc. of the IEEE International Conference on Computer Vision (ICCV), pp. 3681-3690, 2019a.
+Xuanyi Dong and Yi Yang. Searching for a robust neural architecture in fourgpu hours. In Proc. of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 1761-1770, 2019b.
+Stefan Falkner, Aaron Klein, and Frank Hutter. BOHB: Robust and efficient hyperparameter optimization at scale. In The International Conference on Machine Learning (ICML), pp. 1436-1445, 2018.
+Golnaz Ghiasi, Tsung-Yi Lin, and Quoc V Le. Dropblock: A regularization method for convolutional networks. In The Conference on Neural Information Processing Systems (NeurIPS), pp. 10727-10737, 2018.
+Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proc. of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 770-778, 2016.
+Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv preprint arXiv:1502.03167, 2015.
+Aaron Klein and Frank Hutter. Tabular benchmarks for joint architecture and hyperparameter optimization. arXiv preprint arXiv:1905.04970, 2019.
+Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. Technical report, Citeseer, 2009.
+Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. ImageNet classification with deep convolutional neural networks. In The Conference on Neural Information Processing Systems (NeurIPS), pp. 1097-1105, 2012.
+Liam Li and Ameet Talwalkar. Random search and reproducibility for neural architecture search. In The Conference on Uncertainty in Artificial Intelligence (UAI), 2019.
+Lisha Li, Kevin Jamieson, Giulia DeSalvo, Afshin Rostamizadeh, and Ameet Talwalkar. Hyperband: A novel bandit-based approach to hyperparameter optimization. The Journal of Machine Learning Research (JMLR), 18(1):6765-6816, 2018.
+
+Chenxi Liu, Barret Zoph, Maxim Neumann, Jonathon Shlens, Wei Hua, Li-Jia Li, Li Fei-Fei, Alan Yuille, Jonathan Huang, and Kevin Murphy. Progressive neural architecture search. In Proc. of the European Conference on Computer Vision (ECCV), pp. 19-34, 2018.
+Hanxiao Liu, Karen Simonyan, and Yiming Yang. DARTS: Differentiable architecture search. In International Conference on Learning Representations (ICLR), 2019.
+Ilya Loshchilov and Frank Hutter. SGDR: Stochastic gradient descent with warm restarts. In International Conference on Learning Representations (ICLR), 2017.
+Adam Paszke, Sam Gross, Soumith Chintala, Gregory Chanan, Edward Yang, Zachary DeVito, Zeming Lin, Alban Desmaison, Luca Antiga, and Adam Lerer. Automatic differentiation in pytorch. In The Conference on Neural Information Processing Systems Workshop (NeurIPS-W), 2017.
+Hieu Pham, Melody Guan, Barret Zoph, Quoc Le, and Jeff Dean. Efficient neural architecture search via parameters sharing. In The International Conference on Machine Learning (ICML), pp. 4095-4104, 2018.
+Esteban Real, Alok Aggarwal, Yanping Huang, and Quoc V Le. Regularized evolution for image classifier architecture search. In AAAI Conference on Artificial Intelligence (AAAI), pp. 4780-4789, 2019.
+Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, et al. ImageNet large scale visual recognition challenge. International Journal of Computer Vision (IJCV), 115(3):211-252, 2015.
+Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. In International Conference on Learning Representations (ICLR), 2015.
+Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott Reed, Dragomir Anguelov, Dumitru Erhan, Vincent Vanhoucke, and Andrew Rabinovich. Going deeper with convolutions. In Proc. of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 1-9, 2015.
+Mingxing Tan, Bo Chen, Ruoming Pang, Vijay Vasudevan, Mark Sandler, Andrew Howard, and Quoc V Le. Mnasnet: Platform-aware neural architecture search for mobile. In Proc. of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 2820-2828, 2019.
+Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In The Conference on Neural Information Processing Systems (NeurIPS), pp. 5998-6008, 2017.
+Ronald J Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine Learning, 8(3-4):229-256, 1992.
+Chris Ying, Aaron Klein, Esteban Real, Eric Christiansen, Kevin Murphy, and Frank Hutter. Nasbench-101: Towards reproducible neural architecture search. In The International Conference on Machine Learning (ICML), pp. 7105-7114, 2019.
+Kaicheng Yu, Christian Sciuto, Martin Jaggi, Claudiu Musat, and Mathieu Salzmann. Evaluating the search phase of neural architecture search. In International Conference on Learning Representations (ICLR), 2020.
+Arber Zela, Julien Siems, and Frank Hutter. Nas-bench-1shot1: Benchmarking and dissecting one shot neural architecture search. In International Conference on Learning Representations (ICLR), 2020.
+Chris Zhang, Mengye Ren, and Raquel Urtasun. Graph hypernetworks for neural architecture search. In International Conference on Learning Representations (ICLR), 2019.
+Hongyi Zhang, Moustapha Cisse, Yann N Dauphin, and David Lopez-Paz. mixup: Beyond empirical risk minimization. In International Conference on Learning Representations (ICLR), 2018.
+
+Barret Zoph and Quoc V Le. Neural architecture search with reinforcement learning. In International Conference on Learning Representations (ICLR), 2017.
+
+Barret Zoph, Vijay Vasudevan, Jonathon Shlens, and Quoc V Le. Learning transferable architectures for scalable image recognition. In Proc. of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 8697-8710, 2018.
+
+| EPOCHS | TOTAL | CIFAR-10 | CIFAR-100 | ImageNet-16-120 |
| validation | test | validation | test | validation | test |
| 6 | 12 (H‡) | 0.7767 | 0.7627 | 0.8086 | 0.8095 | 0.8052 | 0.7941 |
| 12 | 12 (H‡) | 0.9110 | 0.8983 | 0.9361 | 0.9368 | 0.9062 | 0.8952 |
| 12 | 200 (H†) | 0.7520 | 0.7396 | 0.8071 | 0.8080 | 0.8167 | 0.8092 |
| 24 | 200 (H†) | 0.7705 | 0.7594 | 0.8280 | 0.8290 | 0.8286 | 0.8217 |
| 100 | 200 (H†) | 0.7938 | 0.7900 | 0.8529 | 0.8540 | 0.8262 | 0.8211 |
| 150 | 200 (H†) | 0.8955 | 0.8926 | 0.9239 | 0.9246 | 0.8506 | 0.8425 |
| 175 | 200 (H†) | 0.9834 | 0.9782 | 0.9743 | 0.9744 | 0.8539 | 0.8423 |
| 200 | 200 (H†) | 0.9993 | 0.9937 | 0.9672 | 0.9671 | 0.8259 | 0.8124 |
+
+Table 6: We compare the correlation of different training strategies. The correlation coefficient between the validation accuracy after several training epochs on CIFAR-10 and (1) the validation accuracy of full trained models on the CIFAR-10 training set, (2) the test accuracy on CIFAR-10 trained with the training and validation sets, (3) the validation/test accuracy on CIFAR-100 trained with the CIFAR-100 training set, (4) the validation/test accuracy on ImageNet-16-120 trained with the ImageNet-16-120 training set. We use the validation accuracy after "EPOCHS" training epochs, where the cosine annealing converged after "TOTAL" epochs.
+
+# A MORE DETAILS OF NAS-Bench-201
+
+Number of unique architectures. In our NAS-Bench-201, we encode each architecture by a 6-dimensional vector. The $i$ -th value in this vector indicates the operation in the $i$ -th edge in a cell. Since we have 5 possible operations, there are $5^6 = 15625$ total unique models in this encoding. If we identify the isomorphic cell caused by the "skip-connect" operation, there are 12751 unique topology structures. If we identify the isomorphic cell caused by both "skip-connect" and "zeroize" operations, there are only 6466 unique topology structures. Note that, due to the numerical error, when given the same inputs, two architectures with the isomorphic cell might have different outputs.
+
+Note that, when we build our NAS-Bench-201, we train and evaluate every architecture without considering isomorphism.
+
+NAS-Bench-201 with bandit-based algorithms. Bandit-based algorithms, such as Hyperband (Li et al., 2018) and BOHB (Falkner et al., 2018), usually train models with a short time budget. In our NAS-Bench-201, on CIFAR-10, we provide two options if you want to obtain the performance of a model trained with a short time budget: (1) Results from $\mathcal{H}^{\ddagger}$ , where the cosine annealing converged at the 12-th epoch. (2) Results from $\mathcal{H}^{\dagger}$ , where the cosine annealing converged at the 200-th epoch. As shown in Table 6, the performance of these converged networks is much more likely to correlate highly with the performance after a larger number of iterations than just taking an earlier point of a single cosine annealing trajectory. Therefore, we choose the first option for all NAS algorithms that do not use parameter sharing.
+
+# B IMPLEMENTATION DETAILS
+
+Based on the publicly available codes, we re-implement 10 NAS algorithms by ourselves to search architectures on our NAS-Bench-201. We provide the implementation details of each searching algorithm below.
+
+We consider the searching time of the first order DARTS as a baseline (about 12000 seconds on CIFAR-10). When evaluating RS, REINFORCE, ENAS, and BOHB, we set the total time budget as 12000 seconds for them. By default, for NAS algorithms with parameter sharing, we follow
+
+most hyper-parameters from DARTS and do not learn the scale and shift parameters for BN layers in each searching cell. We setup the searching procedure of RSPS, GDAS, SETN, ENAS five times longer than DARTS, because they optimize $\frac{1}{5}$ of parameters but DARTS optimize all parameters per iteration. Most configurations can be found at https://github.com/D-X-Y/ AutoDL-Projects/tree/master/configs/nas-benchmark/algos.
+
+Random search (RS) (Bergstra & Bengio, 2012). We randomly select architectures until the total
+
+training time plus the time of one evaluation procedure reaches the total budget. We use the validation accuracy after 12 training epochs $(\mathcal{H}^{\ddagger})$ , which can be obtained directly in our NAS-Bench-201 as discussed in Section 2.4. The architecture with the highest validation accuracy is selected as the final searched architecture.
+
+Regularized evolution for image classifier architecture search (REA) (Real et al., 2019). We set the initial population size as 10, the number of cycles as infinity. The sample size is chosen as 10 from [3, 5, 10], according to Figure 9. We finish the algorithm once the simulated training time of the traversed architecture reaches the time budgets (12000 seconds). We use the validation accuracy after 12 training epochs $(\mathcal{H}^{\ddagger})$ as the fitness.
+
+
+Figure 9: The effect of different sample sizes for REA on the CIFAR-10 validation set.
+
+REINFORCE (Williams, 1992). We follow (Ying et al., 2019) to use the REINFORCE algorithm as
+
+a baseline RL method. We use an architecture encoding to parameterize each candidate in our search space as (Liu et al., 2019; Dong & Yang, 2019b). We use the validation accuracy after 12 training epochs $(\mathcal{H}^{\ddagger}$ as the reward in REINFORCE. The architecture encoding is optimized via Adam. We evaluate the learning rate from [0.01, 0.02, 0.05, 0.1, 0.2, 0.5] following (Ying et al., 2019). According to Figure 10, the learning date is set as . The momentum for exponential moving average of 0.9. We finish the training once the simulated training time reaches the time budgets (12000 seconds).
+
+The first order and second order DARTS (DARTS-V1 and DARTS-V2) (Liu et al., 2019). We train the shared parameters via Nesterov momentum SGD, using the cross-entropy loss for 50 epochs in total. We set weight decay as 0.0005 and momentum of 0.9. We decay the learning rate from 0.025 to 0.001 via cosine learning rate scheduler and clip the gradient by 5. We train the ar
+
+chitecture encoding via Adam with the learning rate of 0.0003 and the weight decay of 0.001. We use the batch size of 64. The random horizontal flipping, random cropping with padding, and normalization are used for data augmentation. We choose these hyper-parameters following (Liu et al., 2019).
+
+
+Figure 10: We evaluate the effect of different learning rates for REINFORCE, and report the CIFAR-10 validation accuracy of the searched architecture.
+
+Random search with parameter sharing (RSPS) (Li & Talwalkar, 2019). We train RSPS with the similar hyper-parameters as that of DARTS. Differently, we train the algorithm in 250 epochs in total. During each searching iteration, we randomly sample one architecture in each batch training. Each architecture uses the training mode for BN during training and the evaluation mode during evaluation (Paszke et al., 2017). After training the shared parameters, we evaluate 100 randomly selected architectures with the shared parameters. For each architecture, we randomly choose one mini-batch with 256 validation samples to estimate the validation accuracy instead of using the whole validation set to calculate the precise validation accuracy. The one with the highest estimated validation accuracy will be selected. With the size of this mini-batch increasing, the more precise validation accuracy would be obtained and the better architecture would be selected. However, the searching costs will also be increased. We use the size of 256 to trade-off the accuracy and cost.
+
+Gradient-based search using differentiable architecture sampler (GDAS) (Dong & Yang, 2019b). We use the most hyper-parameters as that of DARTS but train it for 250 epochs in total. The Gumbel-Softmax temperature is linearly decayed from 10 to 0.1.
+
+Self-Evaluated Template Network (SETN) (Dong & Yang, 2019a). We use the most hyperparameters as that of DARTS but train it for 250 epochs in total. After training the shared parameters, we select 100 architectures with the highest probabilities (coded by the learned architecture en
+
+| Methods | CIFAR-10 Validation Set |
| Probability | OSVA (BN with Train) | OSVA (BN with Eval) |
| DARTS-V1 | 0.0779 | 0.0039 | -0.0071 |
| DARTS-V2 | 0.0862 | 0.0355 | 0.0109 |
| SETN | 0.0682 | 0.9049 | 0.0862 |
| GDAS | 0.2714 | 0.8141 | 0.2466 |
+
+Table 7: The correlation between the probability or the one-shot validation accuracy (OSVA) and the ground truth accuracy on the CIFAR-10 validation set. "BN with Train" indicates that, during evaluation, the mean and variance of BN layers are calculated within each mini-batch. "BN with Eval" indicates that we accumulate mean and variance of BN layers in the training set and use these accumulated mean and variance for evaluation. We report the correlation as the average of 3 runs.
+
+coding). We evaluate these 100 selected architectures with the shared parameters. The evaluation procedure for these 100 architectures are the same as RSPS.
+
+ENAS (Pham et al., 2018). We use a two layer LSTM as the controller with the hidden size of 32. We use the temperature of 5 and the tanh constant of 2.5 for the sampling logits Following (Pham et al., 2018), we also add the the controller's sample entropy to the reward, weighted by 0.0001. We optimize the controller with Adam using the constant learning rate of 0.001. We optimize the network weights with SGD following the learning rate scheduler as the original paper and the batch size of 128. We did not impose any penalty to a specific operation.
+
+BOHB (Falkner et al., 2018). We choose to use BOHB as an HPO algorithm on our NAS-Bench-201. We follow (Ying et al., 2019) to set up the hyper-parameters for BOHB. We set the number of samples for the acquisition function to 4, the random fraction to $0\%$ , the minimum-bandwidth to 0.3, the bandwidth factor to 3. We finish the algorithm once the simulated training time reaches the time budgets (12000 seconds).
+
+# C DISCUSSION FOR NAS WITH PARAMETER SHARING
+
+Parameter sharing (Pham et al., 2018) becomes a common technique to improve the efficiency of differentiable neural architecture search methods (Liu et al., 2019; Dong & Yang, 2019b;a). The shared parameters are shared over millions of architecture candidates. It is almost impossible for the shared parameters to be optimal for all candidates. We hope to evaluate the trained shared parameters quantitatively. Specially, we use DARTS, GDAS, and SETN to optimize the shared parameters and the architecture encoding on CIFAR-10. For each architecture candidate, we can calculate its probability of being a good architecture from the architecture encoding following SETN (Dong & Yang, 2019a). In addition, we can also evaluate a candidate using the shared parameters on the validation set to obtain "the one-shot validation accuracy". It is computationally expensive to evaluate all candidates on the whole validation set. To accelerate this procedure, we evaluate each architecture on a mini-batch with the size of 2048, and use the accuracy on this mini-batch to approximate "the one-shot validation accuracy". Ideally, the architecture ranking sorted by the probability or the one-shot validation accuracy should be similar to the ground truth ranking. We show the correlation between the proxy metric and the ground truth validation accuracy in Table 7. There are several observations: (1) The correlation between the probability (encoded by the architecture encoding) and the ground truth accuracy is low. It suggests that the argmax-based deriving strategy (Liu et al., 2019) can not secure a good architecture. It remains open on how to derive a good architecture after optimizing the shared parameters. (2) The behavior of BN layers is important to one-shot validation accuracy. The accumulated mean and variance from the training set are harmful to one-shot accuracy. Instead, each architecture candidate should re-calculate the mean and variance of the BN layers. (3) GDAS introduced Gumbel-softmax sampling when optimizing the architecture encoding. This strategy leads to a high correlation for the learned probability than that of DARTS. (4) The uniform sampling strategy for training the shared parameters (Dong & Yang, 2019a) can increase the correlation for one-shot accuracy compared to the strategy of the joint optimizing strategy (Dong & Yang, 2019b; Liu et al., 2019).
+
+# D DETAILED INFORMATION OF NAS-Bench-201
+
+In NAS-Bench-201 (version 1.0), every architecture is trained at least once. To be specific, 6219 architectures are trained once, 1621 architectures are trained twice, 7785 architectures are trained three times with different random seeds. Moreover, we are actively training all architectures with more seeds and will continue updating our NAS-Bench-201.
+
+The latency in our NAS-Bench-201 (version 1.0) is computed by running each model on a single GPU (GeForce GTX 1080 Ti) with a batch size of 256. We report the latency on CIFAR-100 and ImageNet-16-120, and the latency on CIFAR-10 should be similar to CIFAR-10.
+
+The usage of API. We provide convenient APIs to access our NAS-Bench-201, which can be easily installed via "pip install nas-bench-201". Some examples are shown as follows:
+
+```txt
+1 from nas_201_api import NASBench201API as API
+2 api = API('NAS-Bench-201-v1_0-e61699.pth')
+3 for i, arch_str in enumerate api: # show every architecture
+4 print '{5d}/{:5d}: {:}'.format(i, len api), arch_str)
+5 info = api(query_meta_info_by_index(1) # get metrics of the 1-th arch
+6 res_dict = info.get.metrics('cifar10', 'train') # a dict saving loss/acc
+7 print ('The accuracy is {:.2f} '.format(res_dict['accuracy']))
+8 print ('The loss is {:.2f} '.format(res_dict['loss']))
+9 cos_dict = info.get_comput-costs('cifar100') # a dict saving costs
+10 print ('The flops is {:.2f} M'.format(cos_dict['flops']))
+11 print ('The #parameters is {:.2f} MB'.format(cos_dict['params']))
+12 print ('The latency is {:.3f} s'.format(cos_dict['latency']))
+13 # query the index of a specific architecture from API
+14 arch_index = api.query_index_by_arch(|nor_conv_3x3~0|+|nor_conv_3x3~0|avg_pool_3x3~1|+|skip_connect~0|nor_conv_3x3~1|skip_connect~2'|)
+15 # get results of each trial for a specific architecture
+16 results = api.query_by_index(arch_index, 'cifar100')
+17 print ('There are {:} trials for this architecture [ {:}] on cifar100'.format(len(results), api[arch_index]))
+```
+
+Please see https://github.com/D-X-Y/NAS-Bench-201 for more kinds of usages. The benchmark data file for API can be downloaded online from https://drive.google.com/file/d/1SKW0Cu0u8-gb18zDpaAGi0f74UdXeGKs/view.
\ No newline at end of file
diff --git a/nasbench201extendingthescopeofreproducibleneuralarchitecturesearch/images.zip b/nasbench201extendingthescopeofreproducibleneuralarchitecturesearch/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..d374bd9432758391b9a1b30db5871f7c5b2ddc4c
--- /dev/null
+++ b/nasbench201extendingthescopeofreproducibleneuralarchitecturesearch/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a871e8e1c3b64687d64e17c9c204a461d93586ee12f94f142aa85c68292c8d6c
+size 935785
diff --git a/nasbench201extendingthescopeofreproducibleneuralarchitecturesearch/layout.json b/nasbench201extendingthescopeofreproducibleneuralarchitecturesearch/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..7db8311920e902656a7f310c71fffed1ccda68ec
--- /dev/null
+++ b/nasbench201extendingthescopeofreproducibleneuralarchitecturesearch/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:6c011d702760e23a2c9bb602c21c33520336c671c51dd3268d9df3c2b818cb2f
+size 418863
diff --git a/networkdeconvolution/d22687b2-e593-4bbc-b830-8eda00ac047e_content_list.json b/networkdeconvolution/d22687b2-e593-4bbc-b830-8eda00ac047e_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..7101aa7c18983193d3172d6212a6969be30f73d7
--- /dev/null
+++ b/networkdeconvolution/d22687b2-e593-4bbc-b830-8eda00ac047e_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:fcbf4ff85461557fbbdb27e7bf344307787951d1f94a89e7ef89bbc5472575d2
+size 129744
diff --git a/networkdeconvolution/d22687b2-e593-4bbc-b830-8eda00ac047e_model.json b/networkdeconvolution/d22687b2-e593-4bbc-b830-8eda00ac047e_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..582ec9b2d42e8c42bd123937554f1a24b493867a
--- /dev/null
+++ b/networkdeconvolution/d22687b2-e593-4bbc-b830-8eda00ac047e_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b8ca85b4594b05d575a98b57b534de6981c592069ca751bd46f463617ba72ba4
+size 154167
diff --git a/networkdeconvolution/d22687b2-e593-4bbc-b830-8eda00ac047e_origin.pdf b/networkdeconvolution/d22687b2-e593-4bbc-b830-8eda00ac047e_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..3c786a971a41079efb3f923d8b3561471d96d25e
--- /dev/null
+++ b/networkdeconvolution/d22687b2-e593-4bbc-b830-8eda00ac047e_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:02c54e1448dda82e544120442fd60caf4ace84776779a507b9ea53abc316ed9c
+size 3183942
diff --git a/networkdeconvolution/full.md b/networkdeconvolution/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..fd37d1543c4d50fe0a79af1367430945f5fab9dc
--- /dev/null
+++ b/networkdeconvolution/full.md
@@ -0,0 +1,685 @@
+# NETWORK DECONVOLUTION
+
+Chengxi Ye,\* Matthew Evanusa, Hua He, Anton Mitrokhin,
+
+Tom Goldstein, James A. Yorke, Cornelia Fermüller, Yiannis Aloimonos
+
+Department of Computer Science, University of Maryland, College Park
+
+{cxy, mevanusa, huah, amitrokh}@umd.edu
+
+{tomg@cs,yorke@,fer@umiacs,yiannis@cs}.umd.edu
+
+# ABSTRACT
+
+Convolution is a central operation in Convolutional Neural Networks (CNNs), which applies a kernel to overlapping regions shifted across the image. However, because of the strong correlations in real-world image data, convolutional kernels are in effect re-learning redundant data. In this work, we show that this redundancy has made neural network training challenging, and propose network deconvolution, a procedure which optimally removes pixel-wise and channel-wise correlations before the data is fed into each layer. Network deconvolution can be efficiently calculated at a fraction of the computational cost of a convolution layer. We also show that the deconvolution filters in the first layer of the network resemble the center-surround structure found in biological neurons in the visual regions of the brain. Filtering with such kernels results in a sparse representation, a desired property that has been missing in the training of neural networks. Learning from the sparse representation promotes faster convergence and superior results without the use of batch normalization. We apply our network deconvolution operation to 10 modern neural network models by replacing batch normalization within each. Extensive experiments show that the network deconvolution operation is able to deliver performance improvement in all cases on the CIFAR-10, CIFAR-100, MNIST, Fashion-MNIST, Cityscapes, and ImageNet datasets.
+
+# 1 INTRODUCTION
+
+Images of natural scenes that the human eye or camera captures contain adjacent pixels that are statistically highly correlated (Olshausen & Field, 1996; Hyvrinen et al., 2009), which can be compared to the correlations introduced by blurring an image with a Gaussian kernel. We can think of images as being convolved by an unknown filter (Figure 1). The correlation effect complicates object recognition tasks and makes neural network training challenging, as adjacent pixels contain redundant information.
+
+It has been discovered that there exists a visual correlation removal processes in animal brains. Visual neurons called retinal ganglion cells and lateral geniculate nucleus cells have developed "Mexican hat"-like circular center-surface receptive field structures to reduce visual information redundancy, as found in Hubel and Wiesel's famous cat experiment (Hubel & Wiesel, 1961; 1962). Furthermore, it has been argued that data compression is an essential and fundamental processing step in natural brains, which inherently involves removing redundant information and only keeping the most salient features (Richert et al., 2016).
+
+In this work, we introduce network deconvolution, a method to reduce redundant correlation in images. Mathematically speaking, a correlated signal is generated by a convolution: $b = k * x = Kx$ (as illustrated in Fig. 1 right), where $k$ is the kernel and $K$ is the corresponding convolution matrix. The purpose of network deconvolution is to remove the correlation effects via: $x = K^{-1}b$ , assuming $K$ is an invertible matrix.
+
+
+Figure 1: Performing convolution on this real world image using a correlative filter, such as a Gaussian kernel, adds correlations to the resulting image, which makes object recognition more difficult. The process of removing this blur is called deconvolution. What if, however, what we saw as the real world image was itself the result of some unknown correlative filter, which has made recognition more difficult? Our proposed network deconvolution operation can decorrelate underlying image features which allows neural networks to perform better.
+
+Image data being fed into a convolutional network (CNN) exhibit two types of correlations. Neighboring pixels in a single image or feature map have high pixel-wise correlation. Similarly, in the case of different channels of a hidden layer of the network, there is a strong correlation or "cross-talk" between these channels; we refer to this as channel-wise correlation. The goal of this paper is to show that both kinds of correlation or redundancy hamper effective learning. Our network deconvolution attempts to remove both correlations in the data at every layer of a network.
+
+Our contributions are the following:
+
+- We introduce network deconvolution, a decorrelation method to remove both the pixel-wise and channel-wise correlation at each layer of the network.
+- Our experiments show that deconvolution can replace batch normalization as a generic procedure in a variety of modern neural network architectures with better model training.
+- We prove that this method is the optimal transform if considering $L_{2}$ optimization.
+- Deconvolution has been a misnomer in convolution architectures. We demonstrate that network deconvolution is indeed a deconvolution operation.
+- We show that network deconvolution reduces redundancy in the data, leading to sparse representations at each layer of the network.
+- We propose a novel implicit deconvolution and subsampling based acceleration technique allowing the deconvolution operation to be done at a cost fractional to the corresponding convolution layer.
+- We demonstrate the network deconvolution operation improves performance in comparison to batch normalization on the CIFAR-10, CIFAR-100, MNIST, Fashion-MNIST, Cityscapes, and ImageNet datasets, using 10 modern neural network models.
+
+# 2 RELATED WORK
+
+# 2.1 NORMALIZATION AND WHITENING
+
+Since its introduction, batch normalization has been the main normalization technique (Ioffe & Szegedy, 2015) to facilitate the training of deep networks using stochastic gradient descent (SGD). Many techniques have been introduced to address cases for which batch normalization does not perform well. These include training with a small batch size (Wu & He, 2018), and on recurrent networks (Salimans & Kingma, 2016). However, to our best knowledge, none of these methods has demonstrated improved performance on the ImageNet dataset.
+
+In the signal processing community, our network deconvolution could be referred to as a whitening deconvolution. There have been multiple complicated attempts to whiten the feature channels and to utilize second-order information. For example, authors of (Martens & Grosse, 2015; Desjardins et al., 2015) approximate second-order information using the Fisher information matrix. There, the whitening is carried out interwoven into the back propagation training process.
+
+The correlation between feature channels has recently been found to hamper the learning. Simple approximate whitening can be achieved by removing the correlation in the channels. Channel-wise
+
+decorrelation was first proposed in the backward fashion (Ye et al., 2017). Equivalently, this procedure can also be done in the forward fashion by a change of coordinates (Ye et al., 2018; Huang et al., 2018; 2019). However, none of these methods has captured the nature of the convolution operation, which specifically deals with the pixels. Instead, these techniques are most appropriate for the standard linear transform layers in fully-connected networks.
+
+# 2.2 DECONVOLUTION OF DNA SEQUENCING SIGNALS
+
+Similar correlation issues also exist in the context of DNA sequencing (Ye et al., 2014) where many DNA sequencers start with analyzing correlated signals. There is a cross-talk effect between different sensor channels, and signal responses of one nucleotide base spread into its previous and next nucleotide bases. As a result the sequencing signals display both channel correlation and pixel correlation. A blind deconvolution technique was developed to estimate and remove kernels to recover the unblurred signal.
+
+# 3 MOTIVATIONS
+
+# 3.1 SUBOPTIMALITY OF EXISTING TRAINING METHODS
+
+Deep neural network training has been a challenging research topic for decades. Over the past decade, with the regained popularity of deep neural networks, many techniques have been introduced to improve the training process. However, most of these methods are sub-optimal even for the most basic linear regression problems.
+
+Assume we are given a linear regression problem with $L_{2}$ loss (Eq. 1). In a typical setting, the output $y = Xw$ is given by multiplying the inputs $X$ with an unknown weight matrix $w$ , which we are solving for. In our paper, with a slight abuse of notation, $X$ can be the data matrix or the augmented data matrix $(X|1)$ .
+
+$$
+L o s s _ {L _ {2}} = \frac {1}{2} \| y - \hat {y} \| ^ {2} = \frac {1}{2} \| X w - \hat {y} \| ^ {2}. \tag {1}
+$$
+
+Here $\hat{y}$ is the response data to be regressed. With neural networks, gradient descent iterations (and its variants) are used to solve the above problem. To conduct one iteration of gradient descent on Eq. 1, we have:
+
+$$
+w _ {n e w} = w _ {o l d} - \alpha \frac {1}{N} \left(X ^ {t} X w _ {o l d} - X ^ {t} \hat {y}\right). \tag {2}
+$$
+
+Here $\alpha$ is the step length or learning rate. Basic numerical experiments tell us these iterations can take long to converge. Normalization techniques, which are popular in training neural networks, are beneficial, but are generally not optimal for this simple problem. If methods are suboptimal for simplest linear problems, it is less likely for them to be optimal for more general problems. Our motivation is to find and apply what is linearly optimal to the more challenging problem of network training.
+
+For the $L_{2}$ regression problem, an optimal solution can be found by setting the gradient to 0: $\frac{\partial Loss_{L_2}}{\partial w} = X^t (Xw - \hat{y}) = 0$
+
+$$
+w = \left(X ^ {t} X\right) ^ {- 1} X ^ {t} \hat {y} \tag {3}
+$$
+
+Here, we ask a fundamental question: When can gradient descent converge in one single iteration?
+
+Proposition 1. Gradient descent converges to the optimal solution in one iteration if $\frac{1}{N} X^t X = I$ .
+
+Proof. Substituting $\frac{1}{N} X^t X = I$ , into the optimal solution (Eq. 3) we have $w = \frac{1}{N} X^t \hat{y}$ .
+
+On the other hand, substituting the same condition with $\alpha = 1$ in Eq. 2 we have $w_{new} = \frac{1}{N} X^t\hat{y}$ .
+
+Since gradient descent converges in one single step, the above proof gives us the optimality condition.
+
+$\frac{1}{N} X^t X = I$ calculates the covariance matrix of the features. The optimal condition suggests that the features should be standardized and uncorrelated with each other. When this condition does not hold, the gradient direction does not point to the optimal solution. In fact, the more correlated the data, the slower the convergence (Richardson, 1911). This problem could be handled equivalently (Section A.8) either by correcting the gradient by multiplying the Hessian matrix $= \frac{1}{N} (X^t X)^{-1}$ , or by a change of coordinates so that in the new space we have $\frac{1}{N} X^t X = I$ . This paper applies the latter method for training convolutional networks.
+
+# 3.2 NEED OF SUPPORT FOR CONVOLUTIONS
+
+Even though normalization methods were developed for training convolutional networks and have been found successful, these methods are more suitable for non-convolutional operations. Existing methods normalize features by channel or by layer, irrespective of whether the underlying operation is convolutional or not. We will show in section 4.1 that if the underlying operation is a convolution, this usually implies a strong violation of the optimality condition.
+
+# 3.3 A NEUROLOGICAL BASIS FOR DECONVOLUTION
+
+Many receptive fields in the primate visual cortex exhibit center-surround type behavior. Some receptive fields, called on-center cells respond maximally when a stimuli is given at the center of the receptive field and a lack of stimuli is given in a circle surrounding it. Some others, called off-center cells respond maximally in the reversed way when a lack of stimuli is at the center and the stimuli is given in a circle surrounding it (Fig. 9) (Hubel & Wiesel, 1961; 1962). It is well-understood that these center-surround fields form the basis of the simple cells in the primate V1 cortex.
+
+If the center-surround structures are beneficial for learning, one might expect such structures to be learned in the network training process. As shown in the proof above, the minima is the same with or without such structures, so gradient descent does not get an incentive to develop a faster solution, rendering the need to develop such structures externally. As shown later in Fig. 2, our deconvolution kernels strongly resemble center-surround filters like those in nature.
+
+# 4 THE DECONVOLUTION OPERATION
+
+# 4.1 THE MATRIX REPRESENTATION OF A CONVOLUTION LAYER
+
+The standard convolution filtering $x * \text{kernel}$ , can be formulated into one large matrix multiplication $Xw$ (Fig. 3). In the 2-dimensional case, $w$ is the flattened 2D kernel. The first column of $X$ corresponds to the flattened image patch of $x[1:H - k,1:W - k]$ , where $k$ is the side length of the kernel. Neighboring columns correspond to shifted patches of $x$ : $X[:,2] = \text{vec}(x[1:H - k,2:W - k + 1])$ , ..., $X[:,k^2] = \text{vec}(x[k:H,k:W])$ . A commonly used function $\text{im2col}$ has been designed for this operation. Since the columns of $X$ are constructed by shifting large patches of $x$ by one pixel, the columns of $X$ are heavily correlated with each other, which strongly violates the optimality condition. This violation slows down the training algorithm (Richardson, 1911), and cannot be addressed by normalization methods (Ioffe & Szegedy, 2015).
+
+For a regular convolution layer in a network, we generally have multiple input feature channels and multiple kernels in a layer. We call $im2col$ in each channel, and horizontally concatenate the resulting data matrices from each individual channel to construct the full data matrix, then vectorize and concatenate all the kernels to get $w$ . Matrix vector multiplication is used to calculate the output $y$ , which is then reshaped into the output shape of the layer. Similar constructions can also be developed for the specific convolution layers such as the grouped convolution, where we carry out such constructions for each group. Other scenarios such as when the group number equals the channel number (channel-wise conv) or when $k = 1$ ( $1 \times 1$ conv) can be considered as special cases.
+
+In Fig. 3 (top right) we show as an illustrative example the resulting calculated covariance matrix of a sample data matrix $X$ in the first layer of a VGG network (Simonyan & Zisserman, 2014) taken from one of our experiments. The first layer is a $3 \times 3$ convolution that mixes RGB channels. The total dimension of the weights is 27, the corresponding covariance matrix is $27 \times 27$ . The diagonal blocks correspond to the pixel-wise correlation within $3 \times 3$ neighborhoods. The off-diagonal blocks
+
+correspond to correlation of pixels across different channels. We have empirically seen that natural images demonstrate stronger pixel-wise correlation than cross-channel correlation, as the diagonal blocks are brighter than the off diagonal blocks.
+
+# 4.2 THE DECONVOLUTION OPERATION
+
+Once the covariance matrix has been calculated, an inverse correction can be applied. It is beneficial to conduct the correction in the forward way for numerical accuracy and because the gradient of the correction can also be included in the gradient descent training.
+
+Given a data matrix $X_{N\times F}$ as described above in section 4.1, where $N$ is the number of samples, and $F$ is the number of features, we calculate the covariance matrix $Cov = \frac{1}{N} (X - \mu)^T (X - \mu)$ .
+
+We then calculate an approximated inverse square root of the covariance matrix $D = Cov^{-\frac{1}{2}}$ (see section 4.5.3) and multiply this with the centered vectors $(X - \mu) \cdot D$ . In a sense, we remove the correlation effects both pixel-wise and channel-wise. If computed perfectly, the transformed data has the identity matrix as covariance: $D^T (X - \mu)^T (X - \mu)D = Cov^{-0.5} \cdot Cov \cdot Cov^{-0.5} = I$ .
+
+Algorithm 1 describes the process to construct $X$ and $D \approx (Cov + \epsilon \cdot I)^{-\frac{1}{2}}$ . Here $\epsilon \cdot I$ is introduced to improve stability. We then apply the deconvolution operation via matrix multiplication to remove the correlation between neighboring pixels and across different channels. The deconvolved data is then multiplied with $w$ . The full equation becomes $y = (X - \mu) \cdot D \cdot w + b$ , or simply $y = X \cdot D \cdot w$ if $X$ is the augmented data matrix (Fig. 3).
+
+We denote the deconvolution operation in the $i$ -th layer as $D_{i}$ . Hence, the input to next layer $x_{i+1}$ is:
+
+$$
+x _ {i + 1} = f _ {i} \circ W _ {i} \circ D _ {i} \circ x _ {i}, \tag {4}
+$$
+
+where $\circ$ is the (right) matrix multiplication operation, $x_{i}$ is the input coming from the $i$ -th layer, $D_{i}$ is the deconvolution operation on that input, $W_{i}$ is the weights in the layer, and $f_{i}$ is the activation function.
+
+# 4.3 JUSTIFICATIONS
+
+# 4.3.1 ONNaming THE METHOD DECONVOLUTION
+
+The name network deconvolution has also been used in inverting the convolution effects in biological networks (Feizi et al., 2013). We prove that our operation is indeed a generalized deconvolution operation.
+
+Proposition 2. Removal of pixel-wise correlation (or patch-based whitening) is a deconvolution operation.
+
+Proof. Let $\delta$ be the delta kernel, $x$ be an arbitrary signal, and $X = im2col(x)$ .
+
+$$
+x = x * \delta = X \cdot \delta = X \cdot C o v ^ {- 0. 5} \cdot C o v ^ {0. 5} \cdot \delta = X \cdot C o v ^ {- 0. 5} \cdot k _ {c o v} = X \cdot \delta = x \tag {5}
+$$
+
+The above equations show that the deconvolution operation negates the effects of the convolution using kernel $k_{cov} = Cov^{0.5} \cdot \delta$ .
+
+# 4.3.2 THE DECONVOLUTION KERNEL
+
+The deconvolution kernel can be found as $Cov^{-0.5} \cdot vec(\delta)$ , where $vec(:)$ is the Vectorize function, or equivalently by slicing the middle row/column of $Cov^{-0.5}$ and reshaping it into the kernel size. We visualize the deconvolution kernel from 1024 random images from the ImageNet dataset. The kernels indeed show center-surround structure, which coincides with the biological observation (Fig. 2). The filter in the green channel is an on-center cell while the other two are off-center cells (Hubel & Wiesel, 1961; 1962).
+
+# 4.4 OPTIMALITY
+
+Motivated by the ubiquity of center-surround and lateral-inhibition mechanisms in biological neural systems, we now ask if removal of redundant information, in a manner like our network deconvolution, is an optimal procedure for learning in neural networks.
+
+
+Figure 2: Visualizing the $15 \times 15$ deconvolution kernels from 1024 random images from the ImageNet dataset. The kernels in the R,G,B channels consistently show center-surround structures.
+
+
+
+
+
+# 4.4.1 $L_{2}$ OPTIMIZATIONS
+
+There is a classic kernel estimation problem (Cho & Lee, 2009; Ye et al., 2014) that requires solving for the kernel given the input data $X$ and the blurred output data $y$ . Because $X$ violates the optimality condition, it takes tens or hundreds of gradient descent iterations to converge to a close enough solution. We have demonstrated that our deconvolution processing is optimal for the kernel estimation, in contrast to all other normalization methods.
+
+# 4.4.2 ON TRAINING NEURAL NETWORKS
+
+Training convolutional neural networks is analogous to a series of kernel estimation problem, where we have to solve for the kernels in each layer. Network deconvolution has a favorable near-optimal property for training neural networks.
+
+For simplicity, we assume the activation function is a sample-variant matrix multiplication throughout the network. The popular $ReLU$ (Nair & Hinton, 2010) activation falls into this category. Let $W$ be the linear transform/convolution in a certain layer, $A$ the inputs to the layer, $B$ the operation from the output of the current layer to the output of the last deconvolution operation in the network. The computation of such a network can be formulated as: $y = AWB$ .
+
+Proposition 3. Network deconvolution is near-optimal if $W$ is an orthogonal transform and if we connect the output $y$ to the $L_{2}$ loss.
+
+Rewriting the matrix equation from the previous subsection using the Kronecker product, we get: $y = AWB = (B^T \otimes A)vec(W) = Xvec(W)$ , where $\otimes$ is the Kronecker product. According to the discussion in the previous subsection, gradient descent is optimal if $X = (B^T \otimes A)$ satisfies the orthogonality condition. In a network trained with deconvolution, the input $A$ is orthogonal for each batch of data. If $B$ is also orthogonal, then according to basic properties of the Kronecker product (Golub & van Loan, 2013)(Ch 12.3.1), $(B^T \otimes A)$ is also orthogonal. $y$ is orthogonal since it is the output of the last deconvolution operation in our network. If we assume $W$ is an orthogonal transform, then $B$ transforms orthogonal inputs to orthogonal outputs, and is approximately orthogonal.
+
+Slight loss of optimality incurs since we do not enforce $W$ to be orthogonal. But the gain here is that the network is unrestricted and is promised to be as powerful as any standard network. On the other hand, it is worth mentioning that many practical loss functions such as the cross entropy loss have similar shapes to the $L_{2}$ loss.
+
+# 4.5 ACCELERATIONS
+
+We note that in a direct implementation, the runtime of our training using deconvolution is slower than convolution using the wallclock as a metric. This is due to the suboptimal support in the implicit calculation of the matrices in existing libraries. We propose acceleration techniques to reduce the deconvolution cost to only a fraction of the convolution layer (Section A.6). Without further optimization, our training speed is similar to training a network using batch normalization on the ImageNet dataset while achieving better accuracy. This is a desired property when faced with difficult models (Goodfellow et al., 2014) and with problems where the network part is not the major bottleneck (Ye et al., 2018).
+
+
+Figure 3: (Left) Given a single channel image, and a $3 \times 3$ kernel, the kernel is first flattened into a 9 dimensional vector $w$ . The 9 image patches, corresponding to the image regions each kernel entry sees when overlaying the kernel over the image and then shifting the kernel one pixel each step, are flattened into a tall matrix $X$ . It is important to note that because the patches are shifted by just one pixel, the columns of $X$ are highly correlated. The output $y$ is calculated with matrix multiplication $Xw$ , which is then reshaped back into a $2D$ image. (Top Right) In a convolution layer the matrix $X$ and $Cov$ is calculated from Algorithm 1. (Bottom Right) The pixel-wise and channel-wise correlation is removed by multiplying this X matrix with $Cov^{-\frac{1}{2}}$ , before the weight training.
+
+# 4.5.1 IMPLICIT DECONVOLUTION
+
+Following from the associative rule of matrix multiplication, $y = X \cdot D \cdot w = X \cdot (D \cdot w)$ , which suggests that the deconvolution can be carried out implicitly by changing the model parameters, without explicitly deconvolving the data. Once we finish the training, we freeze $D$ to be the running average. This change of parameters makes a network with deconvolution perform faster at testing time, which is a favorable property for mobile applications. We provide the practical recipe to include the bias term: $y = (X - \mu) \cdot D \cdot w + b = X \cdot (D \cdot w) + b - \mu \cdot D \cdot w$ .
+
+# 4.5.2 FAST COMPUTATION OF THE COVARIANCE MATRICE
+
+We propose a simple $S = 3 - 5 \times$ subsampling technique that speeds up the computation of the covariance matrix by a factor of $10 - 20$ . Since the number of involved pixels is usually large compared with the degree of freedom in a covariance matrix (Section A.6), this simple strategy provides significant speedups while maintaining the training quality. Thanks to the regularization and the iterative method we discuss below, we found the subsampling method to be robust even when the covariance matrix is large.
+
+# 4.5.3 FAST INVERSE SQUARE ROOT OF THE COVARIANCE MATRIX
+
+Computing the inverse square root has a long and fruitful history in computer graphics and numerical mathematics. Fast computation of the inverse square root of a scalar with Newton-Schulz iterations has received wide attention in game engines (Lomont, 2003). One would expect the same method to seamlessly generalize to the matrix case. However, according to numerous experiments, the standard Newton-Schulz iterations suffer from severe numerical instability and explosion after $\sim 20$ iterations for simple matrices (Section A.3) (Higham, 1986)(Eq. 7.12), (Higham, 2008). Coupled Newton-Schulz iterations have been designed (Denman & Beavers, 1976) (Eq.6.35), (Higham, 2008) and been proved to be numerically stable.
+
+We compute the approximate inverse square root of the covariance matrix at low cost using coupled Newton-Schulz iteration, inspired by the Denman-Beavers iteration method (Denman & Beavers, 1976). Given a symmetric positive definite covariance matrix $Cov$ , the coupled Newton-Schulz iterations start with initial values $Y_0 = Cov$ , $Z_0 = I$ . The iteration is defined as: $Y_{k + 1} = \frac{1}{2} Y_k(3I - Z_kY_k)$ , $Z_{k + 1} = \frac{1}{2} (3I - Z_kY_k)Z_k$ , and $Y_{k}\rightarrow Cov^{\frac{1}{2}}$ , $Z_{k}\rightarrow Cov^{-\frac{1}{2}}$ (Higham, 2008) (Eq.6.35). Note that this coupled iteration has been used in recent works to calculate the square root of a matrix (Lin & Maji, 2017). Instead, we take the inverse square root from the outputs, as first shown in (Ye et al.,
+
+
+Figure 4: (a) The input image. (b) The absolute value of the zero-meaned input image. (c) The deconvolved input image (min-max normalized, gray areas stands for 0). (d) Taking the absolute value of the deconvolved image.
+
+
+
+
+
+
+
+2018). In contrast with the vanilla Newton-Schulz method (Higham, 2008; Huang et al., 2019)(Eq. 7.12), we found the coupled Newton-Schulz iterations are stable even if iterated for thousands of times.
+
+It is important to point out a practical implementation detail: when we have $Ch_{in}$ input feature channels, and the kernel size is $k \times k$ , the size of the covariance matrix is $(Ch_{in} \times k \times k) \times (Ch_{in} \times k \times k)$ . The covariance matrix becomes large in deeper layers of the network, and inverting such a matrix is cumbersome. We take a grouping approach by evenly dividing the feature channels $Ch_{in}$ into smaller blocks (Ye et al., 2017; Wu & He, 2018; Ye et al., 2018); we use $b$ to denote the block size, and usually set $B = 64$ . The mini-batch covariance of each block has a manageable size of $(B \times k \times k) \times (B \times k \times k)$ . Newton-Schulz iterations are therefore conducted on smaller matrices. We notice that only a few ( $\sim 5$ ) iterations are necessary to achieve good performance. Solving for the inverse square root takes $O((k \times k \times B)^3)$ . The computation of the covariance matrix has complexity $O(H \times W \times k \times k \times B \times B \times \frac{Ch_{in}}{B} \times \frac{1}{S \times S}) = O(H \times W \times k \times k \times Ch_{in} \times B \times \frac{1}{S \times S})$ . Implicit deconvolution is a simple matrix multiplication with complexity $O(Ch_{out} \times (B \times k \times k)^2 \times \frac{Ch_{in}}{B})$ . The overall complexity is $O(\frac{H \times W \times k \times k \times Ch_{in} \times B}{S \times S} + (k \times k \times B)^3 + Ch_{out} \times (B \times k \times k)^2 \times \frac{Ch_{in}}{B})$ , which is usually a small fraction of the cost of the convolution operation (Section A.6). In comparison, the computational complexity of a regular convolution layer has a complexity of $O(H \times W \times k \times k \times Ch_{in} \times Ch_{out})$ .
+
+Algorithm 1 Computing the Deconvolution Matrix
+
+1: Input: C channels of input features $[x_1, x_2, \dots, x_C]$
+2: for $i \in \{1, \dots, C\}$ do
+3: $X_{i} = im2col(x_{i})$
+4: end for
+5: $X = [X_{1},\dots,X_{C}]$ %Horizontally Concatenate
+6: $X = \text{Reshape}(\bar{X}) \%$ Divide columns into groups
+7: $Cov = \frac{1}{N} X^t X$
+8: $D\approx (Cov + \epsilon \cdot I)^{-\frac{1}{2}}$
+
+# 4.6 SPARSE REPRESENTATIONS
+
+Our deconvolution applied at each layer removes the pixel-wise and channel-wise correlation and transforms the original dense representations into sparse representations (in terms of heavy-tailed distributions) without losing information. This is a desired property and there is a whole field with wide applications developed around sparse representations (Hyvrinen et al., 2009)(Fig. 7.7), (Olshausen & Field, 1996; Ye et al., 2013). In Fig. 4, we visualize the deconvolution operation on an input and show how the resulting representations (4(d)) are much sparser than the normalized image (4(b)). We randomly sample 1024 images from the ImageNet and plot the histograms and log density functions before and after deconvolution (Fig. 10). After deconvolution, the log density distribution becomes heavy-tailed. This holds true also for hidden layer representations (Section A.5). We show in the supplementary material (Section A.4) that the sparse representation makes classic regularizations more effective.
+
+# 5 A UNIFIED VIEW
+
+Network deconvolution is a forward correction method that has relations to several successful techniques in training neural networks. When we set $k = 1$ , the method becomes channel-wise decorrelation, as in (Ye et al., 2018; Huang et al., 2018). When $k = 1$ , $B = 1$ , network deconvolution is Batch Normalization (Ioffe & Szegedy, 2015). If we apply the decorrelation in a backward way in the gradient direction, network deconvolution is similar to SGD2 (Ye et al., 2017), natural gradient descent (Desjardins et al., 2015) and KFAC (Martens & Grosse, 2015), while being more efficient and having better numerical properties (Section A.8).
+
+# 6 EXPERIMENTS
+
+We now describe experimental results validating that network deconvolution is a powerful and successful tool for sharpening the data. Our experiments show that it outperforms identical networks using batch normalization (Ioffe & Szegedy, 2015), a major method for training neural networks. As we will see across all experiments, deconvolution not only improves the final accuracy but also decreases the amount of iterations it takes to learn a reasonably good set of weights in a small number of epochs.
+
+Linear Regression with $L_{2}$ loss and Logistic Regression: As a first experiment, we ran network deconvolution on a simple linear regression task to show its efficacy. We select the Fashion-MNIST dataset. It is noteworthy that with binary targets and the $L_{2}$ loss, the problem has an explicit solution if we feed the whole dataset as input. This problem is the classic kernel estimation problem, where we need to solve for 10 optimal $28 \times 28$ kernels to convolve with the inputs and minimize the $L_{2}$ loss for binary targets. During our experiment, we notice that it is important to use a small learning rate of $0.02 - 0.1$ for vanilla $SGD$ training to prevent divergence. However, we notice that with deconvolution we can use the optimal learning rate 1.0 and get high accuracy as well. It takes $\sim 5$ iterations to get to a low cost under the mini-batch setting (Fig. 5(a)). This even holds if we change the loss to logistic regression loss (Fig. 5(b)).
+
+
+Figure 5: (a-b): Regression losses on Fashion-MNIST dataset showing the effectiveness of deconvolution versus batch normalization on a non-convolutional type layer. (a) One layer, linear regression model with $L_{2}$ loss. (b) One layer, linear regression model with logistic regression loss. (c-d): Results of a 3-hidden-layer Multi Layer Perceptron (MLP) network on the MNIST dataset.
+
+
+
+
+
+
+
+Convolutional Networks on CIFAR-10/100: We ran deconvolution on the CIFAR-10 and CIFAR-100 datasets (Table 1), where we compared again the use of network deconvolution versus the use of batch normalization. Across 10 modern network architectures for both datasets, deconvolution consistently improves convergence on these well-known datasets. There is a wide performance gap after the first epochs of training. Deconvolution leads to faster convergence: 20-epoch training using deconvolution leads to results that are comparable to 100-epoch training using batch normalization.
+
+In our setting, we remove all batch normalizations in the networks and replace them with deconvolution before each convolution/fully-connected layer. For the convolutional layers, we set $B = 64$ before calculating the covariance matrix. For the fully-connected layers, we set $B$ equal to the input channel number, which is usually 512. We set the batch size to 128 and the weight decay to 0.001. All models are trained with $SGD$ and a learning rate of 0.1.
+
+Convolutional Networks on ImageNet: We tested three widely acknowledged model architectures (VGG-11, ResNet-18, DenseNet-121) from the PyTorch model zoo and find significant improvements on both networks over the reference models. Notably, for the VGG-11 network, we notice our method
+
+ | Net Size | CIFAR-10 | CIFAR-100 |
| BN 1 | ND 1 | BN 20 | ND 20 | BN 100 | ND 100 | BN 1 | ND 1 | BN 20 | ND 20 | BN 100 | ND 100 |
| VGG-16 | 14.71M | 14.12% | 74.18% | 90.07% | 93.25% | 93.58% | 94.56% | 2.01% | 37.94% | 63.22% | 71.97% | 72.75% | 75.32% |
| ResNet-18 | 11.17M | 56.25% | 72.89% | 92.64% | 94.07% | 94.87% | 95.40% | 16.10% | 35.73% | 72.67% | 76.55% | 77.70% | 78.63% |
| Preact-18 | 11.17M | 55.15% | 72.70% | 91.93% | 94.10% | 94.37% | 95.44% | 15.17% | 36.52% | 70.79% | 76.04% | 76.14% | 79.14% |
| DenseNet-121 | 6.88M | 59.56% | 76.63% | 93.25% | 94.89% | 94.71% | 95.88% | 17.90% | 42.91% | 74.79% | 77.63% | 77.99% | 80.69% |
| ResNext-29 | 4.76M | 52.14% | 69.22% | 93.12% | 94.05% | 95.15% | 95.80% | 17.98% | 30.93% | 74.26% | 77.35% | 78.60% | 80.34% |
| MobileNet v2 | 2.28M | 54.29% | 65.40% | 89.86% | 92.52% | 90.51% | 94.35% | 15.88% | 29.01% | 66.31% | 72.33% | 67.52% | 74.90% |
| DPN-92 | 34.18M | 34.00% | 53.02% | 92.87% | 93.74% | 95.14% | 95.82% | 8.84% | 21.89% | 74.87% | 76.12% | 78.87% | 80.38% |
| PNASNetA | 0.13M | 21.81% | 64.19% | 75.85% | 81.97% | 81.22% | 84.45% | 10.49% | 36.52% | 44.60% | 55.65% | 54.52% | 59.44% |
| SENet-18 | 11.26M | 57.63% | 67.21% | 92.37% | 94.11% | 94.57% | 95.38% | 16.60% | 32.22% | 71.10% | 75.79% | 76.41% | 78.63% |
| EfficientNet | 2.91M | 35.40% | 55.67% | 84.21% | 86.78% | 86.07% | 88.42% | 19.03% | 22.40% | 57.23% | 57.59% | 59.09% | 62.37% |
+
+Table 1: Comparison on CIFAR-10/100 over 10 modern CNN architectures. Models are trained for 1, 20, 100 epochs using batch normalization (BN) and network deconvolution (ND). Every single model shows improved accuracy using network deconvolution.
+
+ | VGG-11 | ResNet-18 | DenseNet-121 |
| Original | BN | Deconv | BN | Deconv | BN | Deconv |
| ImageNet top-1 | 69.02% | 70.38% | 71.95% | 69.76% | 71.24% | 74.65% | 75.73% |
| ImageNet top-5 | 88.63% | 89.81% | 90.49% | 89.08% | 90.14% | 92.17% | 92.75% |
+
+Table 2: Comparison of accuracies of deconvolution with the model zoo implementation of VGG-11, ResNet-18, DenseNet-121 on ImageNet with batch normalization using the reference implementation on PyTorch. For VGG-11, we also include the performance of the original network without batch normalization.
+
+has led to significant improved accuracy. The top-1 accuracy is even higher than $71.55\%$ , reported by the reference VGG-13 model trained with batch normalization. The improvement introduced by network deconvolution is twice as large as that from batch normalization $(+1.36\%)$ . This fact also suggests that improving the training method may be more effective than improving the architecture.
+
+We keep most of the default settings when training the models. We set $B = 64$ for all deconvolution operations. The networks are trained for 90 epochs with a batch size of 256, and weight decay of 0.0001. The initial learning rates are 0.01, 0.1 and 0.1, respectively for VGG-11, ResNet-18 and DenseNet-121 as described in the paper. We used cosine annealing to smoothly decrease the learning rate to compare the curves.
+
+Generalization to Other Tasks It is worth pointing out that network deconvolution can be applied to other tasks that have convolution layers. Further results on semantic segmentation on the Cityscapes dataset can be found in (Sec. A.8). Also, the same deconvolution procedure for $1 \times 1$ convolutions can be used for non-convolutional layers, which makes it useful for the broader machine learning community. We constructed a 3-layer fully-connected network that has 128 hidden nodes in each layer and used the sigmoid for the activation function. We compare the result with/without batch normalization, and deconvolution, where we remove the correlation between hidden nodes. Indeed, applying deconvolution to MLP networks outperforms batch normalization, as shown in Fig. 5(c,d).
+
+# 7 CONCLUSION
+
+In this paper we presented network deconvolution, a novel decorrelation method tailored for convolutions, which is inspired by the biological visual system. Our method was evaluated extensively and shown to improve the optimization efficiency over standard batch normalization. We provided a thorough analysis of its performance and demonstrated consistent performance improvement of the deconvolution operation on multiple major benchmarks given 10 modern neural network models. Our proposed deconvolution operation is straightforward in terms of implementation and can serve as a good alternative to batch normalization.
+
+# REFERENCES
+
+Sunghyun Cho and Seungyong Lee. Fast motion deblurring. In ACM SIGGRAPH Asia 2009 Papers, SIGGRAPH Asia '09, pp. 145:1-145:8, New York, NY, USA, 2009. ACM. ISBN 978-1-60558-858-2. doi: 10.1145/1661412.1618491. URL http://doi.acm.org/10.1145/1661412.1618491.
+Eugene D. Denman and Alex N. Beavers, Jr. The matrix sign function and computations in systems. Appl. Math. Comput., 2(1):63-94, January 1976. ISSN 0096-3003. doi: 10.1016/0096-3003(76) 90020-5. URL http://dx.doi.org/10.1016/0096-3003(76)90020-5.
+Guillaume Desjardins, Karen Simonyan, Razvan Pascanu, and koray kavukcuoglu. Natural neural networks. In C. Cortes, N. D. Lawrence, D. D. Lee, M. Sugiyama, and R. Garnett (eds.), Advances in Neural Information Processing Systems 28, pp. 2071-2079. Curran Associates, Inc., 2015. URL http://papers.nips.cc/paper/5953-natural-neural-networks.pdf.
+Soheil Feizi, Daniel Marbach, Muriel Medard, and Manolis Kellis. Network deconvolution as a general method to distinguish direct dependencies in networks. In Nature biotechnology, 2013.
+Gene H. Golub and Charles F. van Loan. Matrix Computations. JHU Press, fourth edition, 2013. ISBN 1421407949 9781421407944. URL http://www.cs.cornell.edu/cv/GVL4/golubandvanloan.htm.
+Ian J. Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial networks, 2014.
+Nicholas J. Higham. Newton's method for the matrix square root. 1986.
+Nicholas J. Higham. Functions of Matrices: Theory and Computation. Society for Industrial and Applied Mathematics, Philadelphia, PA, USA, 2008. ISBN 978-0-898716-46-7.
+Lei Huang, Dawei Yang, Bo Lang, and Jia Deng. Decorrelated batch normalization. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 791-800, 2018.
+Lei Huang, Yi Zhou, Fan Zhu, Li Liu, and Ling Shao. Iterative normalization: Beyond standardization towards efficient whitening. CoRR, abs/1904.03441, 2019. URL http://arxiv.org/abs/1904.03441.
+D. H. Hubel and T. N. Wiesel. Integrative action in the cat's lateral geniculate body. The Journal of Physiology, 155(2):385-398, 1961. doi: 10.1113/jphysiol.1961.sp006635. URL https://physoc.onlinelibrary.wiley.com/doi/abs/10.1113/jphysiol.1961.sp006635.
+David H Hubel and Torsten N Wiesel. Receptive fields, binocular interaction and functional architecture in the cat's visual cortex. The Journal of physiology, 160(1):106-154, 1962.
+Aapo Hyvrinen, Jarmo Hurri, and Patrick O. Hoyer. Natural Image Statistics: A Probabilistic Approach to Early Computational Vision. Springer Publishing Company, Incorporated, 1st edition, 2009. ISBN 1848824904, 9781848824904.
+Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv preprint arXiv:1502.03167, 2015.
+Tsung-Yu Lin and Subhransu Maji. Improved bilinear pooling with cnns. CoRR, abs/1707.06772, 2017. URL http://arxiv.org/abs/1707.06772.
+Chris Lomont. Fast inverse square root. Tech-315 nical Report, 32, 2003.
+James Martens and Roger B. Grosse. Optimizing neural networks with Kronecker-factored approximate curvature. CoRR, abs/1503.05671, 2015. URL http://arxiv.org/abs/1503.05671.
+Vinod Nair and Geoffrey E Hinton. Rectified linear units improve restricted boltzmann machines. In Proceedings of the 27th international conference on machine learning (ICML-10), pp. 807-814, 2010.
+
+Bruno A. Olshausen and David J. Field. Emergence of simple-cell receptive field properties by learning a sparse code for natural images. Nature, 381(6583):607-609, 1996. ISSN 1476-4687. doi: 10.1038/381607a0. URL https://doi.org/10.1038/381607a0.
+L. F. Richardson. The approximate arithmetical solution by finite differences of physical problems involving differential equations, with an application to the stresses in a masonry dam. Philosophical Transactions of the Royal Society of London. Series A, Containing Papers of a Mathematical or Physical Character, 210:307-357, 1911. ISSN 02643952. URL http://www.jstor.org/stable/90994.
+Micah Richert, Dimitry Fisher, Filip Piekniewski, Eugene M Izhikevich, and Todd L Hylton. Fundamental principles of cortical computation: unsupervised learning with prediction, compression and feedback. arXiv preprint arXiv:1608.06277, 2016.
+Tim Salimans and Diederik P. Kingma. Weight normalization: A simple reparameterization to accelerate training of deep neural networks. CoRR, abs/1602.07868, 2016. URL http:// arxiv.org/abs/1602.07868.
+Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014.
+Yuxin Wu and Kaiming He. Group normalization. CoRR, abs/1803.08494, 2018. URL http://arxiv.org/abs/1803.08494.
+Chengxi Ye, Dacheng Tao, Mingli Song, David W. Jacobs, and Min Wu. Sparse norm filtering. CoRR, abs/1305.3971, 2013. URL http://arxiv.org/abs/1305.3971.
+Chengxi Ye, Chiaowen Hsiao, and Héctor Corrada Bravo. BlindCall: Ultra-fast base-calling of high-throughput sequencing data by blind deconvolution. Bioinformatics, 30(9):1214-1219, 01 2014. ISSN 1367-4803. doi: 10.1093/bioinformatics/btu010. URL https://doi.org/10. 1093/bioinformatics/btu010.
+Chengxi Ye, Yezhou Yang, Cornelia Fermüller, and Yiannis Aloimonos. On the importance of consistency in training deep neural networks. CoRR, abs/1708.00631, 2017. URL http:// arxiv.org/abs/1708.00631.
+Chengxi Ye, Anton Mitrokhin, Cornelia Fermüller, James A. Yorke, and Yiannis Aloimonos. Unsupervised learning of dense optical flow and depth from sparse event data. CoRR, abs/1809.08625, 2018. URL http://arxiv.org/abs/1809.08625.
+
+# A APPENDIX
+
+# A.1 SOURCE CODE
+
+Source code can be found at:
+
+https://github.com/yechengxi/deconvolution
+
+The models for CIFAR-10/CIFAR-100 are adapted from the following repository:
+
+https://github.com/kuangliu/pytorch-cifar.
+
+# A.2 GENERALIZATION TO SEMANTIC SEGMENTATION
+
+To demonstrate the applicability of network deconvolution to different tasks, we modify a baseline architecture of DeepLabV3 with a ResNet-50 backbone for semantic segmentation. We remove the batch normalization layers in both the backbone network and the head network and pre-apply deconvolutions in all the convolution layers. The full networks are trained from scratch on the Cityscape dataset (with 2,975 training images) using a learning rate of 0.1 for 30 epochs with batch size 8. All settings are the same with the official PyTorch recipe except we have raised the learning rate from 0.01 to 0.1 for training from scratch. Here we report the mean intersection over union (mIoU) curves of standard training and deconvolution using a crop size of 480. We achieved significantly improved training results (Fig. 6).
+
+
+(a)
+
+
+(b)
+
+
+(c)
+Figure 6: The mean IoU, pixel-wise accuracy and training loss on the Cityscapes dataset using DeepLabV3 with a ResNet-50 backbone. In our setting, we modified all the convolution layers to remove batch normalizations and insert deconvolutions.
+
+# A.3 COUPLED/UNCOUPLED NEWTON SCHULZ ITERATIONS
+
+
+Figure 7: Comparison of coupled/uncoupled Newton-Schulz iterations on a $27 \times 27$ covariance matrix constructed from the Lenna Image.
+
+We take the Lenna image and construct the $27 \times 27$ covariance matrix using pixels from $3 \times 3$ windows in 3 color channels. We apply the vanilla Newton-Schulz iteration and compare it with the coupled Newton-Schulz iteration. The Frobenius Norm of $D \cdot D \cdot Cov - I$ is plotted in Fig. 7. The rounding errors quickly accumulate with the vanilla Newton Schulz iterations, while the coupled iteration is stable. From the curve we set the iteration number to 15 for the first layer of the network to thoroughly remove the correlation in the input data. We freeze the deconvolution matrix $D$ after 200 iterations. For the middle layers of the network we set the iteration number to 5.
+
+# A.4 REGULARIZATIONS
+
+If two features correlate, weight decay regularization is less effective. If $X_{1}, X_{2}$ are strongly correlated features, but differ in scale, and if we look at: $w_{1}X_{1} + w_{2}X_{2}$ , the weights are likely to co-adapt during the training, and weight decay is likely to be more effective on the larger coefficient. The other, small coefficient is left less penalized. Network deconvolution reduces the co-adaptation of weights, and weight decay becomes less ambiguous and more effective. Here we report the accuracies of the VGG-13 network on the CIFAR-100 dataset using weight decays of 0.005 and 0.0005. We notice that a stronger weight decay is detrimental to the performance with standard training using batch normalization. In contrast, the network achieves better performance with deconvolution using a stronger weight decay. Each setting is repeated for 5 times, and the mean accuracy curves with confidence intervals of $(+/- 1.0$ std) are shown in Fig. 8(a).
+
+
+(a)
+
+
+(b)
+
+
+Figure 8: (a) The effects of weight decay on stochastic gradient descent (SGD) and batch normalization (BN) versus SGD and deconvolution (Deconv), training on the CIFAR-100 dataset on the VGG-13 network. Here we notice that increased weight decay leads to worse results for standard training. However, in our case with deconvolution, the final accuracy actually improves with increased weight decay (.0005 to .005). Each experiment is repeated 5 times. We show the confidence interval (+/- 1 std). (b) The training loss of the VGG-11 network on the ImageNet dataset. Only the first 1000 iterations are shown. Comparison is made among SGD, SGD with batch normalization and deconvolution.
+
+
+Figure 9: An on-center cell and off-center cell found in animal vision system. The on-center cell (left) responds maximally when a stimuli is given at the center and a lack of stimuli is given in a circle surrounding it. The off-center cell (right) responds in the opposite way.
+
+# A.5 SPARSE REPRESENTATIONS FOR CONVOLUTION LAYERS
+
+Network deconvolution reduces redundancy similar to the that in the animal vision system (Fig. 9). The center-surround antagonism results in efficient and sparse representations. In Fig. 10 we plot the distribution and log density of the signals at the first layer before and after deconvolution. The distribution after the deconvolution has a well-known heavy-tailed shape (Hyvrinen et al., 2009; Ye et al., 2013).
+
+Fig. 11 shows the inputs to the 5-th convolution layer in $VGG - 11$ . This input is the output of a ReLU activation function. The deconvolution operation removes the correlation between channels and nearby pixels, resulting in a sharper and sparser representation.
+
+# A.6 PERFORMANCE BREAKDOWN
+
+Network deconvolution is a customized new design and relies on less optimized functions such as $\text{Im2col}$ . Even so, the slow down is tunable to be around $\sim 10 - 30\%$ on modern networks. We plot the walltime vs accuracy plot of the VGG network on the ImageNet dataset. For this plot we use $B = 16$ , $S = 4$ (Fig. 12). Here we also break down the computational cost on CPU to show deconvolution is a low-cost and promising approach if properly optimized on GPUs. We take random images at various scales and set the input/output channels to common values in modern networks.
+
+
+(a)
+
+
+(b)
+Figure 10: (a) Histograms of input signals (pixel values) before/after deconvolution. (b) Log density of the input signals before/after deconvolution.) The x-axis represents the normalized pixel value. After applying deconvolution, the resulting data is much sparser, with most values being zero.
+
+
+(a)
+Figure 11: (a) Input features to the 5-th convolution layer in VGG-11. (b) Taking the absolute value of the deconvolved features. The features have been min-max normalized for visualization.(Best view on a display.)
+
+
+(b)
+
+The CPU timing on a batch size of 128 can be found in Table 3. Here we fix the Newton-Schulz iteration times to be 5.
+
+# A.7 ACCELERATED CONVERGENCE
+
+We demonstrate the loss curves using different settings when training the VGG-11 network on the ImageNet dataset(Fig. 8(b)). We can see network deconvolution leads to significantly faster decay in training loss.
+
+
+Figure 12: The accuracy vs walltime curves of VGG-11 networks on the ImageNet dataset using batch normalization and network deconvolution.
+
+| H | W | Chin | Chout | groups | k | stride | Im2Col | Cov | Inv | Conv |
| 256 | 256 | 3 | 64 | 1 | 3 | 3 | 0.069 | 0.0079 | 0.00025 | 0.50 |
| 128 | 128 | 64 | 128 | 1 | 3 | 3 | 0.315 | 0.3214 | 0.02069 | 0.67 |
| 64 | 64 | 128 | 256 | 2 | 3 | 3 | 0.045 | 0.0445 | 0.00076 | 0.55 |
| 32 | 32 | 256 | 512 | 4 | 3 | 3 | 0.022 | 0.0391 | 0.00222 | 0.48 |
| 16 | 16 | 512 | 512 | 8 | 3 | 3 | 0.011 | 0.0444 | 0.01155 | 0.23 |
| 128 | 128 | 64 | 128 | 64 | 3 | 3 | 0.376 | 0.0871 | 0.00024 | 0.66 |
| 64 | 64 | 128 | 256 | 128 | 3 | 3 | 0.042 | 0.0412 | 0.00082 | 0.53 |
| 32 | 32 | 256 | 512 | 256 | 3 | 3 | 0.023 | 0.0377 | 0.00208 | 0.47 |
| 16 | 16 | 512 | 512 | 512 | 3 | 3 | 0.011 | 0.0437 | 0.01194 | 0.22 |
| 128 | 128 | 64 | 128 | 32 | 3 | 3 | 0.360 | 0.0939 | 0.00021 | 0.67 |
| 64 | 64 | 128 | 256 | 32 | 3 | 3 | 0.044 | 0.0425 | 0.00076 | 0.55 |
| 32 | 32 | 256 | 512 | 32 | 3 | 3 | 0.023 | 0.0374 | 0.00204 | 0.46 |
| 16 | 16 | 512 | 512 | 32 | 3 | 3 | 0.011 | 0.0421 | 0.01180 | 0.22 |
| 256 | 256 | 3 | 64 | 1 | 3 | 5 | 0.030 | 0.0046 | 0.00029 | 0.49 |
| 128 | 128 | 64 | 128 | 1 | 3 | 5 | 0.153 | 0.1284 | 0.01901 | 0.66 |
| 256 | 256 | 3 | 64 | 1 | 7 | 3 | 0.338 | 0.1111 | 0.00107 | 0.69 |
| 256 | 256 | 3 | 64 | 1 | 7 | 5 | 0.180 | 0.0408 | 0.00107 | 0.69 |
| 256 | 256 | 3 | 64 | 1 | 7 | 7 | 0.063 | 0.0210 | 0.00104 | 0.70 |
| 256 | 256 | 3 | 64 | 1 | 11 | 3 | 0.681 | 0.4810 | 0.00479 | 0.99 |
| 256 | 256 | 3 | 64 | 1 | 11 | 5 | 0.315 | 0.1909 | 0.00488 | 1.00 |
| 256 | 256 | 3 | 64 | 1 | 11 | 7 | 0.199 | 0.1022 | 0.00494 | 0.99 |
| 256 | 256 | 3 | 64 | 1 | 11 | 11 | 0.069 | 0.0420 | 0.00496 | 1.00 |
+
+Table 3: Breakdown of deconvolution layer component computation time (in sec., measured on CPU) against various layer parameters. The batch size is set to 128, $H \times W$ are layer dimensions, $Ch_{in}$ - number of input channels, $Ch_{out}$ - number of output channels, groups - the number of channel groups, $k$ is the kernel size and stride is the sampling stride.
+
+# A.8 FORWARD BACKWARD EQUIVALENCE
+
+We discuss the relation between the correction in the forward way and in the backward way. We thank Prof. Brian Hunt for providing us this simple proof.
+
+Assuming that in one layer of the network we have $X \cdot W_1 = X \cdot D \cdot W_2 = Y$ , $W_2 = D^{-1} \cdot W_1$ , here $D = Cov^{-0.5}$ .
+
+$$
+\frac {\partial \text {L o s s}}{\partial W _ {1}} = \frac {\partial \text {L o s s}}{\partial Y} \circ \frac {\partial Y}{\partial W _ {1}} = X ^ {t} \cdot \frac {\partial \text {L o s s}}{\partial Y}. \tag {6}
+$$
+
+| BatchSize | Acc | LR | ε | Iter |
| 2 | 89.12% | 0.001 | 0.01 | 2 |
| 8 | 91.26% | 0.01 | 0.01 | 2 |
| 32 | 91.18% | 0.01 | 1e-5 | 5 |
| 128 | 91.56% | 0.1 | 1e-5 | 5 |
| 512 | 91.66% | 0.5 | 1e-5 | 5 |
| 2048 | 90.64% | 1 | 1e-5 | 5 |
+
+Table 4: Performance and settings under different batch sizes.
+
+Assuming $D$ is fixed,
+
+$$
+\frac {\partial L o s s}{\partial W _ {2}} = \frac {\partial L o s s}{\partial Y} \circ \frac {\partial Y}{\partial W _ {2}} = (X \cdot D) ^ {t} \cdot \frac {\partial L o s s}{\partial Y}. \tag {7}
+$$
+
+One iteration of gradient descent with respect to $W_{1}$ is:
+
+$$
+W _ {1} ^ {\text {n e w}} = W _ {1} ^ {\text {o l d}} - \alpha \frac {\partial \text {L o s s}}{\partial W _ {1} ^ {\text {o l d}}} = W _ {1} ^ {\text {o l d}} - \alpha X ^ {t} \cdot \frac {\partial \text {L o s s}}{\partial Y} \tag {8}
+$$
+
+$$
+\frac {\partial L o s s}{\partial W _ {2}} = \frac {\partial L o s s}{\partial Y} \circ \frac {\partial Y}{\partial W _ {2}} = (X \cdot D) ^ {t} \cdot \frac {\partial L o s s}{\partial Y}.
+$$
+
+One iteration of gradient descent with respect to $W_{2}$ is:
+
+$$
+W _ {2} ^ {\text {n e w}} = W _ {2} ^ {\text {o l d}} - \alpha \frac {\partial \text {L o s s}}{\partial W _ {2} ^ {\text {o l d}}} \tag {9}
+$$
+
+$$
+D ^ {- 1} \cdot W _ {1} ^ {\text {n e w}} = D ^ {- 1} W _ {1} ^ {\text {o l d}} - \alpha \frac {\partial \text {L o s s}}{\partial Y} \circ \frac {\partial Y}{\partial W _ {2} ^ {\text {o l d}}} = D ^ {- 1} W _ {1} ^ {\text {o l d}} - \alpha (X \cdot D) ^ {t} \cdot \frac {\partial \text {L o s s}}{\partial Y}. \tag {10}
+$$
+
+We then reach the familiar form (Ye et al., 2017):
+
+$$
+W _ {1} ^ {\text {n e w}} = W _ {1} ^ {\text {o l d}} - \alpha D ^ {2} \cdot X ^ {t} \cdot \frac {\partial \text {L o s s}}{\partial Y} = W _ {1} ^ {\text {o l d}} - \alpha \operatorname {C o v} ^ {- 1} \left(\cdot X ^ {t} \cdot \frac {\partial \text {L o s s}}{\partial Y}\right) \tag {11}
+$$
+
+We have proved the equivalence between forward correction and the Newton's method-like backward correction. Carrying out the forward correction as in our paper is beneficial because as the neural network gets deep, $X$ gets more ill-posed. Another reason is that because $D$ depends on $X$ , the layer gradients are more accurate if we include the inverse square root into the back propagation training. This is easily achievable with the help of automatic differentiation implementations:
+
+$$
+\frac {\partial x _ {i + 1}}{\partial x _ {i}} = D _ {i + 1} \circ f _ {i} \circ W _ {i} + \frac {\partial D _ {i + 1}}{\partial x _ {i}} \circ f _ {i} \circ W _ {i} \tag {12}
+$$
+
+Here $x_{i}$ is an input to the current layer and $x_{i + 1}$ is the input to the next layer.
+
+# A.9 INFLUENCE OF BATCH SIZE
+
+We notice network deconvolution works well under various batch sizes. However, different settings need to be adjusted to achieve optimal performance. High learning rates can be used for large batch sizes, small learning rates should be used for small batch sizes. When the batch size is small, to avoid overfitting the noise, the number of Newton-Schulz iterations should be reduced and the regularization factor $\epsilon$ should be raised. More results and settings can be found in Table 4.
+
+# A.10 IMPLEMENTATION OF FASTDECONV IN PYTORCH
+
+We present the reference implementation in PyTorch. "FastDeconv" can be used to replace instances of "nn.Conv2d" in the network architectures. Batch normalizations should also be removed.
+
+import torch
+
+import torch.mm as nn
+
+import torch.nn.Functional as F
+
+from torch.nn/modules import conv
+
+from torch.nn/modules.utils import __pair
+
+import math
+
+class FastDeconv(conv._ConvNd):
+
+def __init__(self, in_channels, out_channels, kernel_size, stride=1, padding=0, dilation=1, groups=1, bias=True,
+
+```txt
+eps=1e-5, n_iter=5, momentum=0.1, block=64, sampling_stride=3, freeze=False, freeze_iter=100):
+```
+
+self.momentum = momentum
+
+self.n_iter = n_iter
+
+self.eps = eps
+
+self.counter $= 0$
+
+super(FastDeconv, self).__init__(
+
+in_channels, out_channels, _pair(kernel_size), _pair(stride), _pair(padding), _pair(
+
+dilation),
+
+False, _pair(0), groups, bias, padding_mode='zeros')
+
+if block > in channels:
+
+block = in_channels
+
+else:
+
+if in_channels % block != 0:
+
+block $=$ math.gcd(block,in_channels)
+
+if groups $>1$
+
+grouped conv
+
+block = in_channels // groups
+
+self.block = block
+
+self num_features = kernel_size ** 2 * block
+
+if groups $= = 1$
+
+self.register_buffer('running_mean',torch.zeros(self.num_features))
+
+self.register_buffer('running_deconv',torch.eye(self.num_features))
+
+else:
+
+self.register_buffer('running_mean',torch.zeros(kernel_size ** 2 * in_channels))
+
+self.register_buffer('running_deconv', torch.eye(self.num_features).repeat(
+
+in_channels // block, 1, 1))
+
+self.sampling_stride = sampling_stride * stride
+
+self.counter $= 0$
+
+self.freeze_iter $=$ freeze_iter
+
+self.freeze $=$ freeze
+
+def forward(self, x):
+
+N, C, H, W = x.shape
+
+B $=$ self.block
+
+frozen $=$ self.freeze and (self.counter $\rightharpoondown$ self.freeze_iter)
+
+if self.training:
+
+self.counter $+ = 1$
+
+self.counter $\% =$ (self.free iterate $\ast 10$
+
+if self.trainng and (not frozen):
+
+1. im2col: N x cols x pixels -> N*pixels x cols
+
+```python
+if self_kernel_size[0] > 1:
+ X = torch.nnfunctionalunfold(x, self_kernel_size, self.dilation, self(padding, self.sampling_stride).transpose(1, 2).contiguous()
+```
+
+```python
+else: # channel wise X = x.permute(0, 2, 3, 1).contiguous().view(-1, C)[::self.sampling_stride ** 2, :]
+```
+
+```python
+if self_groups == 1:
+ # (C//B*N*pixels, k*k*B)
+ X = X.view(-1, self.num_features, C // B).transpose(1, 2).contiguous().view(-1, self(num_features))
+```
+
+```python
+else: X = X.view(-1, X.shape[-1]) # 2. subtract mean X_mean = X.mean(0) X = X - X_mean. unsqueeze(0) self running_mean.mul_(1 - self.momentum) self running_mean.add_(X_meandetach() * self.momentum)
+```
+
+```python
+3. calculate COV, COV(-0.5), then deconv
+if self_groups == 1:
+ # Cov = X.t() @ X / X.shape[0] + self.eps * torch.eye(X.shape[1], dtype=X.dtype, device=X_device)
+ Id = torch.eye(X.shape[1], dtype=X.dtype, device=X_device)
+ Cov = torch.addmm(self.eps, Id, 1. / X.shape[0], X.t(), X)
+ deconv = isqrt_newton_schulz_autograd(Cov, self.n_iter)
+```
+
+```python
+else: # Cov = X.transpose(1, 2) @ (X / X.shape[1]) + self.eps * Id X = X.view(-1, self/groups, self.num_features).transpose(0, 1) Id = torch.eye(self.num_features, dtype=X.dtype, device=Xdevice).expand(self/groups, self(num_features,
+```
+
+```txt
+num_features) Cov $=$ torch.baddbmnm(self.eps,Id,1./X.shape[1],X.transpose(1,2),X) deconv $=$ isqrt_newton_schulz_autograd_batch(Cov,self.n_iter)
+```
+
+```python
+# track stats for evaluation
+selfrunning_deconv.mul_(1 - self.momentum)
+selfrunning_deconv.add_(deconvdetach() * self.momentum)
+```
+
+# else:
+
+```txt
+X_mean = selfrunning_mean
+deconv = self running_deconv
+```
+
+4. $X * \text{deconv} * \text{conv} = X * (\text{deconv} * \text{conv})$
+
+```python
+if self_groups == 1:
+ w = self.weight.view(-1, self.num_features, C // B). \ transpose(1, 2).contiguous().view(-1, self(num_features) @ deconv b = self.bias - (w @ (X_mean unsqueeze(1))).view(self.weight.shape[0], -1).sum(1) w = w.view(-1, C // B, self(num_features).transpose(1, 2).contiguous()
+```
+
+```txt
+else: w = self.weight.view(C // B, -1, self.num_features) @ deconv
+```
+
+b = self.bias - (w @ (X_mean.view(-1, self.num_features, 1))).view(self.bias.shape)
+
+w = w.view(self.weight.shape)
+
+$\mathrm{x} = \mathrm{F}$ .conv2d(x,w,b,self Pridee,self(padding,self.dilation,self_groups)
+
+return x
+
+def isqrt_newton_schulz_autograd(A, numIters, norm='norm', method='denman_beavers'):
+
+dim = A.shape[0]
+
+if norm == 'norm':
+
+$\mathrm{normA} = \mathrm{A}$ .norm()
+
+else:
+
+normA = A(trace()
+
+I = torch.eye(dim, dtype=A.dtype, device=A_device)
+
+Y = A.div(normA)
+
+Z = torch.eye(dim, dtype=A.dtype, device=A.device)
+
+if method $= =$ 'denman_beavers':
+
+for i in range(numIters):
+
+$T = 0.5*(3.0*I - Z@Y)$
+
+$\mathrm{T} =$ torch.addmm(1.5,I,-0.5,Z,Y)
+
+Y = Y.mm(T)
+
+Z = T. mm(Z)
+
+else:
+
+for i in range(numIters):
+
+$\# Z = 1.5 * Z - 0.5 * Z @ Z @ Z @ Y$
+
+Z = torch.addmm(1.5, Z, -0.5, torch.matrix_power(Z, 3), Y)
+
+A_sqrt = Y* torch.sqrt(normA)
+
+A_isqrt = Z / torch.sqrt(normA)
+
+return A_isqrt
+
+def isqrt_newton_schulz_autograd_batch(A, numIters):
+
+batchSize, dim, _ = A.shape
+
+normA = A.view(batchSize, -1).norm(2, 1).view(batchSize, 1, 1)
+
+Y = A.div(normA)
+
+I = torch.eye(dim, dtype=A. dtype, device=Adevice).unsqueeze(0).expand_as(A)
+
+Z = torch.eye(dim, dtype=A. dtype, device=Adevice).unsqueeze(0).expand_as(A)
+
+for i in range(numIters):
+
+$\mathrm{T} = 0.5 * (3.0 * \mathrm{I} - Z.\mathrm{bmm}(\mathrm{Y}))$
+
+$\mathrm{Y} = \mathrm{Y.bmm(T)}$
+
+$\mathrm{Z} = \mathrm{T.bmm(Z)}$
+
+A_sqrt = Y*torch.sqrt(normA)
+
+A_isqrt = Z / torch.sqrt(normA)
+
+return A_isqrt
\ No newline at end of file
diff --git a/networkdeconvolution/images.zip b/networkdeconvolution/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..4ce108fab5f27db657516150c7af38c8f5fb49e4
--- /dev/null
+++ b/networkdeconvolution/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:9eba32c27f5b4b140ff9767de167a5aebad1e5e0532a1b016fa3ea24afdba8ed
+size 763973
diff --git a/networkdeconvolution/layout.json b/networkdeconvolution/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..c3bc07267039b6bcb04bf50fe60f2fce9a38d9c7
--- /dev/null
+++ b/networkdeconvolution/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:5773a49b8f1c07223299c44e7246df38b613c589c6e41f357daabfd083b9d0ed
+size 727395
diff --git a/neuralarithmeticunits/3dc42ad9-029e-46bf-aeea-043a6b8fb9a5_content_list.json b/neuralarithmeticunits/3dc42ad9-029e-46bf-aeea-043a6b8fb9a5_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..e55d99ff8d4daaf4c2eab26e8708bb84b64d59f2
--- /dev/null
+++ b/neuralarithmeticunits/3dc42ad9-029e-46bf-aeea-043a6b8fb9a5_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:85e9d3b2473baa8ba4ccb0c37c4153250f4c730cbed0864bce7395adda563e11
+size 195097
diff --git a/neuralarithmeticunits/3dc42ad9-029e-46bf-aeea-043a6b8fb9a5_model.json b/neuralarithmeticunits/3dc42ad9-029e-46bf-aeea-043a6b8fb9a5_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..bf6bdd6a6807c17fae6e61fe15ce77ce25e14988
--- /dev/null
+++ b/neuralarithmeticunits/3dc42ad9-029e-46bf-aeea-043a6b8fb9a5_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c8dcba683a41eae623e8be94a96b148960b20bad227ef89d9b0aaa616e218c7b
+size 220233
diff --git a/neuralarithmeticunits/3dc42ad9-029e-46bf-aeea-043a6b8fb9a5_origin.pdf b/neuralarithmeticunits/3dc42ad9-029e-46bf-aeea-043a6b8fb9a5_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..f65bcd9452837d2a2eece73f07be8f96b012e3d3
--- /dev/null
+++ b/neuralarithmeticunits/3dc42ad9-029e-46bf-aeea-043a6b8fb9a5_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c5f0d2424ffceed4dc1e7d973b144414a9f868e50fb3a34a34261a3450ba21dc
+size 1172941
diff --git a/neuralarithmeticunits/full.md b/neuralarithmeticunits/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..c8ec034dd5a65234ceff25510e653728d6bff154
--- /dev/null
+++ b/neuralarithmeticunits/full.md
@@ -0,0 +1,941 @@
+# NEURAL ARITHMETIC UNITS
+
+Andreas Madsen
+
+Computationally Demanding
+
+amwebdk@gmail.com
+
+Alexander Rosenberg Johansen
+
+Technical University of Denmark
+
+aler@dtu.dk
+
+# ABSTRACT
+
+Neural networks can approximate complex functions, but they struggle to perform exact arithmetic operations over real numbers. The lack of inductive bias for arithmetic operations leaves neural networks without the underlying logic necessary to extrapolate on tasks such as addition, subtraction, and multiplication. We present two new neural network components: the Neural Addition Unit (NAU), which can learn exact addition and subtraction; and the Neural Multiplication Unit (NMU) that can multiply subsets of a vector. The NMU is, to our knowledge, the first arithmetic neural network component that can learn to multiply elements from a vector, when the hidden size is large. The two new components draw inspiration from a theoretical analysis of recently proposed arithmetic components. We find that careful initialization, restricting parameter space, and regularizing for sparsity is important when optimizing the NAU and NMU. Our proposed units NAU and NMU, compared with previous neural units, converge more consistently, have fewer parameters, learn faster, can converge for larger hidden sizes, obtain sparse and meaningful weights, and can extrapolate to negative and small values. $^{1}$
+
+# 1 INTRODUCTION
+
+When studying intelligence, insects, reptiles, and humans have been found to possess neurons with the capacity to hold integers, real numbers, and perform arithmetic operations (Nieder, 2016; Rugani et al., 2009; Gallistel, 2018). In our quest to mimic intelligence, we have put much faith in neural networks, which in turn has provided unparalleled and often superhuman performance in tasks requiring high cognitive abilities (Silver et al., 2016; Devlin et al., 2018; OpenAI et al., 2018). However, when using neural networks to solve simple arithmetic problems, such as counting, multiplication, or comparison, they systematically fail to extrapolate onto unseen ranges (Lake & Baroni, 2018; Suzgun et al., 2019; Trask et al., 2018). The absence of inductive bias makes it difficult for neural networks to extrapolate well on arithmetic tasks as they lack the underlying logic to represent the required operations.
+
+A neural component that can solve arithmetic problems should be able to: take an arbitrary hidden input, learn to select the appropriate elements, and apply the desired arithmetic operation. A recent attempt to achieve this goal is the Neural Arithmetic Logic Unit (NALU) by Trask et al. (2018).
+
+The NALU models the inductive bias explicitly via two sub-units: the $\mathrm{NAC}_{+}$ for addition/subtraction and the $\mathrm{NAC}_{\bullet}$ for multiplication/division. The sub-units are softly gated between, using a sigmoid function, to exclusively select one of the sub-units. However, we find that the soft gating-mechanism and the $\mathrm{NAC}_{\bullet}$ are fragile and hard to learn.
+
+In this paper, we analyze and improve upon the $\mathrm{NAC}_{+}$ and $\mathrm{NAC}_{\bullet}$ with respect to addition, subtraction, and multiplication. Our proposed improvements, namely the Neural Addition Unit (NAU) and Neural Multiplication Unit (NMU), are more theoretically founded and improve performance regarding stability, speed of convergence, and interpretability of weights. Most importantly, the NMU supports both negative and small numbers and a large hidden input-size, which is paramount as neural networks are overparameterized and hidden values are often unbounded.
+
+The improvements, which are based on a theoretical analysis of the NALU and its components, are achieved by a simplification of the parameter matrix for a better gradient signal, a sparsity regularizer, and a new multiplication unit that can be optimally initialized. The NMU does not support division.
+
+
+Figure 1: Visualization of the NMU, where the weights $(W_{i,j})$ controls gating between 1 (identity) or $x_{i}$ , each intermediate result is then multiplied explicitly to form $z_{j}$ .
+
+However, we find that the NAC $_{\bullet}$ in practice also only supports multiplication and cannot learn division (theoretical analysis on division discussed in section 2.3).
+
+To analyze the impact of each improvement, we introduce several variants of the NAC. We find that allowing division makes optimization for multiplication harder, linear and regularized weights improve convergence, and the NMU way of multiplying is critical when increasing the hidden size.
+
+Furthermore, we improve upon existing benchmarks in Trask et al. (2018) by expanding the "simple function task", expanding "MNIST Counting and Arithmetic Tasks" with a multiplicative task, and using an improved success-criterion Madsen & Johansen (2019). This success-criterion is important because the arithmetic units are solving a logical problem. We propose the MNIST multiplication variant as we want to test the NMU's and NAC's ability to learn from real data and extrapolate.
+
+# 1.1 LEARNING A 10 PARAMETER FUNCTION
+
+Consider the static function $t = (x_{1} + x_{2})\cdot (x_{1} + x_{2} + x_{3} + x_{4})$ for $x\in \mathbb{R}^4$ . To illustrate the ability of NAC, NALU, and our proposed NMU, we conduct 100 experiments for each model to learn this function. Table 1 shows that the NMU has a higher success rate and converges faster.
+
+Table 1: Comparison of the success-rate, when the model converged, and the sparsity error for all weight matrices, with $95\%$ confidence interval on the $t = (x_{1} + x_{2}) \cdot (x_{1} + x_{2} + x_{3} + x_{4})$ task. Each value is a summary of 100 different seeds.
+
+| Op | Model | Success | Solved at iteration step | Sparsity error |
| | Rate | Median | Mean | Mean |
| × | NAC. | 13% +8% -5% | 5.5 · 104 | 5.9 · 104 +7.8·10-3-6.6·103 | 7.5 · 10-6+2.0·10-6-2.0·10-6 |
| NALU | 26% +9% -8% | 7.0 · 104 | 7.8 · 104 +6.2·10-3-8.6·103 | 9.2 · 10-6+1.7·10-6-1.7·10-6 |
| NMU | 94% +3% -6% | 1.4 · 104 | 1.4 · 104 +2.2·10-2-2.1·102 | 2.6 · 10-8+6.4·10-9-6.4·10-9 |
+
+# 2 INTRODUCING DIFFERENTIABLE BINARY ARITHMETIC OPERATIONS
+
+We define our problem as learning a set of static arithmetic operations between selected elements of a vector. E.g. for a vector $\mathbf{x}$ learn the function $(x_{5} + x_{1})\cdot x_{7}$ . The approach taking in this paper is to develop a unit for addition/subtraction and a unit for multiplication, and then let each unit decide which inputs to include using backpropagation.
+
+We develop these units by taking inspiration from a theoretical analysis of Neural Arithmetic Logic Unit (NALU) by Trask et al. (2018).
+
+# 2.1 INTRODUCING NALU
+
+The Neural Arithmetic Logic Unit (NALU) consists of two sub-units; the $\mathrm{NAC}_{+}$ and $\mathrm{NAC}_{\bullet}$ . The sub-units represent either the $(+, -)$ or the $(\times, \div)$ operations. The NALU then assumes that either $\mathrm{NAC}_{+}$ or $\mathrm{NAC}_{\bullet}$ will be selected exclusively, using a sigmoid gating-mechanism.
+
+The $\mathrm{NAC}_{+}$ and $\mathrm{NAC}_{\bullet}$ are defined accordingly,
+
+$$
+W _ {h _ {\ell}, h _ {\ell - 1}} = \tanh \left(\hat {W} _ {h _ {\ell}, h _ {\ell - 1}}\right) \sigma \left(\hat {M} _ {h _ {\ell}, h _ {\ell - 1}}\right) \tag {1}
+$$
+
+$$
+\mathrm {N A C} _ {+}: z _ {h _ {\ell}} = \sum_ {h _ {\ell - 1} = 1} ^ {H _ {\ell - 1}} W _ {h _ {\ell}, h _ {\ell - 1}} z _ {h _ {\ell - 1}} \tag {2}
+$$
+
+$$
+\mathrm {N A C} _ {\bullet}: z _ {h _ {\ell}} = \exp \left(\sum_ {h _ {\ell - 1} = 1} ^ {H _ {\ell - 1}} W _ {h _ {\ell}, h _ {\ell - 1}} \log \left(\left| z _ {h _ {\ell - 1}} \right| + \epsilon\right)\right) \tag {3}
+$$
+
+where $\hat{\mathbf{W}},\hat{\mathbf{M}}\in \mathbb{R}^{H_{\ell}\times H_{\ell -1}}$ are weight matrices and $z_{h_{\ell -1}}$ is the input. The matrices are combined using a tanh-sigmoid transformation to bias the parameters towards a $\{-1,0,1\}$ solution. Having $\{-1,0,1\}$ allows $\mathrm{NAC}_{+}$ to compute exact $\{+, - \}$ operations between elements of a vector. The $\mathrm{NAC}_{\bullet}$ uses an exponential-log transformation for the $\{\times ,\div \}$ operations, which works within $\epsilon$ precision and for positive inputs only.
+
+The NALU combines these units with a gating mechanism $\mathbf{z} = \mathbf{g} \odot \mathrm{NAC}_{+} + (1 - \mathbf{g}) \odot \mathrm{NAC}_{\bullet}$ given $\mathbf{g} = \sigma(\mathbf{G}\mathbf{x})$ . Thus allowing NALU to decide between all of $\{+, -, \times, \div\}$ using backpropagation.
+
+# 2.2 WEIGHT MATRIX CONSTRUCTION AND THE NEURAL ADDITION UNIT
+
+Glorot & Bengio (2010) show that $E[z_{h_\ell}] = 0$ at initialization is a desired property, as it prevents an explosion of both the output and the gradients. To satisfy this property with $W_{h_{\ell -1},h_\ell} = \tanh (\hat{W}_{h_{\ell -1},h_\ell})\sigma (\hat{M}_{h_{\ell -1},h_\ell})$ , an initialization must satisfy $E[\tanh (\hat{W}_{h_{\ell -1},h_\ell})] = 0$ . In NALU, this initialization is unbiased as it samples evenly between $+$ and $-$ , or $\times$ and $\div$ . Unfortunately, this initialization also causes the expectation of the gradient to become zero, as shown in (4).
+
+$$
+E \left[ \frac {\partial \mathcal {L}}{\partial \hat {M} _ {h _ {\ell - 1} , h _ {\ell}}} \right] = E \left[ \frac {\partial \mathcal {L}}{\partial W _ {h _ {\ell - 1} , h _ {\ell}}} \right] E \left[ \tanh \left(\hat {W} _ {h _ {\ell - 1}, h _ {\ell}}\right) \right] E \left[ \sigma^ {\prime} \left(\hat {M} _ {h _ {\ell - 1}, h _ {\ell}}\right) \right] = 0 \tag {4}
+$$
+
+Besides the issue of initialization, our empirical analysis (table 2) shows that this weight construction (1) do not create the desired bias for $\{-1,0,1\}$ . This bias is desired as it restricts the solution space to exact addition, and in section 2.5 also exact multiplication, which is an intrinsic property of an underlying arithmetic function. However, this bias does not necessarily restrict the output space as a plain linear transformation will always be able to scale values accordingly.
+
+To solve these issues, we add a sparsifying regularizer to the loss function $(\mathcal{L} = \hat{\mathcal{L}} + \lambda_{\mathrm{sparse}} \mathcal{R}_{\ell, \mathrm{sparse}})$ and use a simple linear construction, where $W_{h_{\ell-1}, h_\ell}$ is clamped to $[-1, 1]$ in each iteration.
+
+$$
+W _ {h _ {\ell - 1}, h _ {\ell}} = \min (\max \left(W _ {h _ {\ell - 1}, h _ {\ell}}, - 1\right), 1), \tag {5}
+$$
+
+$$
+\mathcal {R} _ {\ell , \text {s p a r s e}} = \frac {1}{H _ {\ell} \cdot H _ {\ell - 1}} \sum_ {h _ {\ell} = 1} ^ {H _ {\ell}} \sum_ {h _ {\ell - 1} = 1} ^ {H _ {\ell - 1}} \min \left(\left| W _ {h _ {\ell - 1}, h _ {\ell}} \right|, 1 - \left| W _ {h _ {\ell - 1}, h _ {\ell}} \right|\right) \tag {6}
+$$
+
+$$
+\mathrm {N A U}: z _ {h _ {\ell}} = \sum_ {h _ {\ell - 1} = 1} ^ {H _ {\ell - 1}} W _ {h _ {\ell}, h _ {\ell - 1}} z _ {h _ {\ell - 1}} \tag {7}
+$$
+
+# 2.3 CHALLENGES OF DIVISION
+
+The $\mathrm{NAC}_{\bullet}$ , as formulated in equation 3, has the capability to compute exact multiplication and division, or more precisely multiplication of the inverse of elements from a vector, when a weight in $W_{h_{\ell -1},h_{\ell}}$ is $-1$ .
+
+However, this flexibility creates critical optimization challenges. By expanding the exp-log-transformation, NAC can be expressed as
+
+$$
+\mathrm {N A C} _ {\bullet}: z _ {h _ {\ell}} = \prod_ {h _ {\ell - 1} = 1} ^ {H _ {\ell - 1}} \left(\left| z _ {h _ {\ell - 1}} \right| + \epsilon\right) ^ {W _ {h _ {\ell}, h _ {\ell - 1}}} \tag {8}
+$$
+
+In equation (8), if $|z_{h_{\ell -1}}|$ is near zero $E[z_{h_{\ell -1}}] = 0$ is a desired property when initializing (Glorot & Bengio, 2010)), $W_{h_{\ell -1},h_\ell}$ is negative, and $\epsilon$ is small, then the output will explode. This issue is present even for a reasonably large $\epsilon$ value (such as $\epsilon = 0.1$ ), and just a slightly negative $W_{h_{\ell -1},h_\ell}$ , as visualized in figure 2. Also note that the curvature can cause convergence to an unstable area.
+
+This singularity issue in the optimization space also makes multiplication challenging, which further suggests that supporting division is undesirable. These observations are also found empirically in Trask et al. (2018, table 1) and Appendix C.7.
+
+
+(a) $\mathrm{NAC}_{\bullet}$ with $\epsilon = 10^{-7}$
+
+
+(b) $\mathrm{NAC}_{\bullet}$ with $\epsilon = 0.1$
+Figure 2: RMS loss curvature for a $\mathrm{NAC}_{+}$ unit followed by a $\mathrm{NAC}_{\bullet}$ . The weight matrices are constrained to $\mathbf{W}_1 = \left[ \begin{array}{ccc}w_1 & w_1 & 0\\ w_1 & w_1 & w_1 \end{array} \right],\mathbf{W}_2 = \left[ \begin{array}{cc}w_2 & w_2 \end{array} \right]$ . The problem is $(x_{1} + x_{2})\cdot (x_{1} + x_{2} + x_{3} + x_{4})$ for $x = (1,1.2,1.8,2)$ . The solution is $w_{1} = w_{2} = 1$ in (a), with many unstable alternatives.
+
+
+(c) $\mathrm{NAC}_{\bullet}$ with $\epsilon = 1$
+
+# 2.4 INITIALIZATION OF NAC.
+
+Initialization is important for fast and consistent convergence. A desired property is that weights are initialized such that $E[z_{h_\ell}] = 0$ (Glorot & Bengio, 2010). Using second order Taylor approximation and assuming all $z_{h_{\ell -1}}$ are uncorrelated; the expectation of NAC can be estimated as
+
+$$
+E \left[ z _ {h _ {\ell}} \right] \approx \left(1 + \frac {1}{2} \operatorname {V a r} \left[ W _ {h _ {\ell}, h _ {\ell - 1}} \right] \log \left(\left| E \left[ z _ {h _ {\ell - 1}} \right] \right| + \epsilon\right) ^ {2}\right) ^ {H _ {\ell - 1}} \Rightarrow E \left[ z _ {h _ {\ell}} \right] > 1. \tag {9}
+$$
+
+As shown in equation 9, satisfying $E[z_{h_\ell}] = 0$ for NAC $_\bullet$ is likely impossible. The variance cannot be input-independently initialized and is expected to explode (proofs in Appendix B.3).
+
+# 2.5 THE NEURAL MULTIPLICATION UNIT
+
+To solve the gradient and initialization challenges for NAC, we propose a new unit for multiplication: the Neural Multiplication Unit (NMU)
+
+$$
+W _ {h _ {\ell - 1}, h _ {\ell}} = \min (\max \left(W _ {h _ {\ell - 1}, h _ {\ell}}, 0\right), 1), \tag {10}
+$$
+
+$$
+\mathcal {R} _ {\ell , \text {s p a r s e}} = \frac {1}{H _ {\ell} \cdot H _ {\ell - 1}} \sum_ {h _ {\ell} = 1} ^ {H _ {\ell}} \sum_ {h _ {\ell - 1} = 1} ^ {H _ {\ell - 1}} \min \left(W _ {h _ {\ell - 1}, h _ {\ell}}, 1 - W _ {h _ {\ell - 1}, h _ {\ell}}\right) \tag {11}
+$$
+
+$$
+\mathrm {N M U}: z _ {h _ {\ell}} = \prod_ {h _ {\ell - 1} = 1} ^ {H _ {\ell - 1}} \left(W _ {h _ {\ell - 1}, h _ {\ell}} z _ {h _ {\ell - 1}} + 1 - W _ {h _ {\ell - 1}, h _ {\ell}}\right) \tag {12}
+$$
+
+The NMU is regularized similar to the NAU and has a multiplicative identity when $W_{h_{\ell -1},h_\ell} = 0$ . The NMU does not support division by design. As opposed to the NAC, the NMU can represent input of both negative and positive values and is not $\epsilon$ bounded, which allows the NMU to extrapolate to $z_{h_{\ell -1}}$ that are negative or smaller than $\epsilon$ . Its gradients are derived in Appendix A.3.
+
+# 2.6 MOMENTS AND INITIALIZATION
+
+The NAU is a linear layer and can be initialized using Glorot & Bengio (2010). The $\mathrm{NAC}_{+}$ unit can also achieve an ideal initialization, although it is less trivial (details in Appendix B.2).
+
+The NMU is initialized with $E[W_{h_{\ell}, h_{\ell - 1}}] = 1/2$ . Assuming all $z_{h_{\ell - 1}}$ are uncorrelated, and $E[z_{h_{\ell - 1}}] = 0$ , which is the case for most neural units (Glorot & Bengio, 2010), the expectation can be approximated to
+
+$$
+E \left[ z _ {h _ {\ell}} \right] \approx \left(\frac {1}{2}\right) ^ {H _ {\ell - 1}}, \tag {13}
+$$
+
+which approaches zero for $H_{\ell -1} \to \infty$ (see Appendix B.4). The NMU can, assuming $Var[z_{h_{\ell -1}}] = 1$ and $H_{\ell -1}$ is large, be optimally initialized with $Var[W_{h_{\ell -1},h_\ell}] = \frac{1}{4}$ (proof in Appendix B.4.3).
+
+# 2.7 REGULARIZER SCALING
+
+We use the regularizer scaling as defined in (14). We motivate this by observing optimization consists of two parts: a warmup period, where $W_{h_{\ell - 1}, h_\ell}$ should get close to the solution, unhindered by the sparsity regularizer, followed by a period where the solution is made sparse.
+
+$$
+\lambda_ {\text {s p a r s e}} = \hat {\lambda} _ {\text {s p a r s e}} \max \left(\min \left(\frac {t - \lambda_ {\text {s t a r t}}}{\lambda_ {\text {e n d}} - \lambda_ {\text {s t a r t}}}, 1\right), 0\right) \tag {14}
+$$
+
+# 2.8 CHALLENGES OF GATING BETWEEN ADDITION AND MULTIPLICATION
+
+The purpose of the gating-mechanism is to select either $\mathrm{NAC}_{+}$ or $\mathrm{NAC}_{\bullet}$ exclusively. This assumes that the correct sub-unit is selected by the NALU, since selecting the wrong sub-unit leaves no gradient signal for the correct sub-unit.
+
+Empirically we find this assumption to be problematic. We observe that both sub-units converge at the beginning of training whereafter the gating-mechanism, seemingly random, converge towards either the addition or multiplication unit. Our study shows that gating behaves close to random for both NALU and a gated NMU/NAU variant. However, when the gate correctly selects multiplication our NMU converges much more consistently. We provide empirical analysis in Appendix C.5 for both NALU and a gated version of NAU/NMU.
+
+As the output-size grows, randomly choosing the correct gating value becomes an exponential increasing problem. Because of these challenges we leave solving the issue of sparse gating for future work and focus on improving the sub-units $\mathrm{NAC}_{+}$ and $\mathrm{NAC}_{\bullet}$ .
+
+# 3 RELATED WORK
+
+Pure neural models using convolutions, gating, differentiable memory, and/or attention architectures have attempted to learn arithmetic tasks through backpropagation (Kaiser & Sutskever, 2016; Kalchbrenner et al., 2016; Graves et al., 2014; Freivalsd & Liepins, 2017). Some of these results have close to perfect extrapolation. However, the models are constrained to only work with well-defined arithmetic setups having no input redundancy, a single operation, and one-hot representations of numbers for input and output. Our proposed models does not have these restrictions.
+
+The Neural Arithmetic Expression Calculator (Chen et al., 2018) can learn real number arithmetic by having neural network sub-components and repeatedly combine them through a memory-encoder-decoder architecture learned with hierarchical reinforcement learning. While this model has the ability to dynamically handle a larger variety of expressions compared to our solution they require an explicit definition of the operations, which we do not.
+
+In our experiments, the NAU is used to do a subset-selection, which is then followed by either a summation or a multiplication. An alternative, fully differentiable version, is to use a gumbel-softmax that can perform exact subset-selection (Xie & Ermon, 2019). However, this is restricted to a predefined subset size, which is a strong assumption that our units are not limited by.
+
+# 4 EXPERIMENTAL RESULTS
+
+# 4.1 ARITHMETIC DATASETS
+
+The arithmetic dataset is a replica of the "simple function task" by Trask et al. (2018). The goal is to sum two random contiguous subsets of a vector and apply an arithmetic operation as defined in (15)
+
+$$
+t = \sum_ {i = s _ {1, \text {s t a r t}}} ^ {s _ {1, \text {e n d}}} x _ {i} \circ \sum_ {i = s _ {2, \text {s t a r t}}} ^ {s _ {2, \text {e n d}}} x _ {i} \quad \text {w h e r e} \mathbf {x} \in \mathbb {R} ^ {n}, x _ {i} \sim \operatorname {U n i f o r m} \left[ r _ {\text {l o w e r}}, r _ {\text {u p p e r}} \right], \circ \in \{+, -, \times \} \tag {15}
+$$
+
+where $n$ (default 100), $U[r_{\mathrm{lower}}, r_{\mathrm{upper}}]$ (interpolation default is $U[1,2]$ and extrapolation default is $U[2,6]$ ), and other dataset parameters are used to assess learning capability (see details in Appendix C.1 and the effect of varying the parameters in Appendix C.4).
+
+# 4.1.1 MODEL EVALUATION
+
+We define the success-criterion as a solution that is acceptably close to a perfect solution. To evaluate if a model instance solves the task consistently, we compare the MSE to a nearly-perfect solution on the extrapolation range over many seeds. If $\mathbf{W}_1, \mathbf{W}_2$ defines the weights of the fitted model, $\mathbf{W}_1^\epsilon$ is nearly-perfect, and $\mathbf{W}_2^*$ is perfect (example in equation 16), then the criteria for successful convergence is $\mathcal{L}_{\mathbf{W}_1, \mathbf{W}_2} < \mathcal{L}_{\mathbf{W}_1^\epsilon, \mathbf{W}_2^*}$ , measured on the extrapolation error, for $\epsilon = 10^{-5}$ . We report a $95\%$ confidence interval using a binomial distribution (Wilson, 1927).
+
+$$
+\mathbf {W} _ {1} ^ {\epsilon} = \left[ \begin{array}{l l l l} 1 - \epsilon & 1 - \epsilon & 0 + \epsilon & 0 + \epsilon \\ 1 - \epsilon & 1 - \epsilon & 1 - \epsilon & 1 - \epsilon \end{array} \right], \mathbf {W} _ {2} ^ {*} = \left[ \begin{array}{l l} 1 & 1 \end{array} \right] \tag {16}
+$$
+
+To measure the speed of convergence, we report the first iteration for which $\mathcal{L}_{\mathbf{W}_1,\mathbf{W}_2} < \mathcal{L}_{\mathbf{W}_1^*,\mathbf{W}_2^*}$ is satisfied, with a $95\%$ confidence interval calculated using a gamma distribution with maximum likelihood profiling. Only instances that solved the task are included.
+
+We assume an approximate discrete solution with parameters close to $\{-1,0,1\}$ is important for inferring exact arithmetic operations. To measure the sparsity, we introduce a sparsity error (defined in equation 17). Similar to the convergence metric, we only include model instances that did solve the task and report the $95\%$ confidence interval, which is calculated using a beta distribution with maximum likelihood profiling.
+
+$$
+E _ {\text {s p a r s i t y}} = \max _ {h _ {\ell - 1}, h _ {\ell}} \min \left(\left| W _ {h _ {\ell - 1}, h _ {\ell}} \right|, \left| 1 - \left| W _ {h _ {\ell - 1}, h _ {\ell}} \right| \right|\right) \tag {17}
+$$
+
+# 4.1.2 ARITHMETIC OPERATION COMPARISON
+
+We compare models on different arithmetic operations $\circ \in \{+, -, \times\}$ . The multiplication models, NMU and $\mathrm{NAC}_{\bullet}$ , have an addition unit first, either NAU or $\mathrm{NAC}_{+}$ , followed by a multiplication unit. The addition/subtraction models are two layers of the same unit. The NALU model consists of two NALU layers. See explicit definitions and regularization values in Appendix C.2.
+
+Each experiment is trained for $5 \cdot 10^{6}$ iterations with early stopping by using the validation dataset, which is based on the interpolation range (details in Appendix C.2). The results are presented in table 2. For multiplication, the NMU succeeds more often and converges faster than the $\mathrm{NAC}_{\bullet}$ and NALU. For addition and subtraction, the NAU and $\mathrm{NAC}_{+}$ has similar success-rate (100%), but the NAU is significantly faster at solving both of the task. Moreover, the NAU reaches a significantly sparser solution than the $\mathrm{NAC}_{+}$ . Interestingly, a linear model has a hard time solving subtraction. A more extensive comparison is included in Appendix C.7 and an ablation study is included in Appendix C.3.
+
+# 4.1.3 EVALUATING THEORETICAL CLAIMS
+
+To validate our theoretical claim, that the NMU model works better than NAC, for a larger hidden input-size, we increase the hidden size of the network thereby adding redundant units. Redundant units are very common in neural networks, which are often overparameterized.
+
+Additionally, the NMU model is, unlike the NAC. model, capable of supporting inputs that are both negative and positive. To validate this empirically, the training and validation datasets are sampled for $\mathrm{U}[-2,2]$ , and then tested on $\mathrm{U}[-6, - 2]\cup \mathrm{U}[2,6]$ . The other ranges are defined in Appendix C.4.
+
+Table 2: Comparison of: success-rate, first iteration reaching success, and sparsity error, all with $95\%$ confidence interval on the "arithmetic datasets" task. Each value is a summary of 100 different seeds.
+
+| Op | Model | Success | Solved at iteration step | Sparsity error |
| | Rate | Median | Mean | Mean |
| × | NAC. | 31% +10% | 2.8·106 | 3.0·106+2.9·105 | 5.8·10-4+4.8·10-4 |
| NALU | -8% | — | - | -2.6·10-4 |
| NMU | 0% +4% | 1.4·106 | 1.5·106+5.0·104 | 4.2·10-7+2.9·10-8 |
| -0% | -6.6·104 |
| + | NAC+ | 100% +0% | 2.5·105 | 4.9·105+5.2·104 | 2.3·10-1+6.5·10-3 |
| Linear | -4% | 6.1·104 | -4.5·104 | -6.5·10-3 |
| NALU | 100% +0% | 6.1·104 | 6.3·104+2.5·103 | 2.5·10-1+3.6·10-4 |
| -4% | 6.3·104 | -3.3·103 | -3.6·10-4 |
| NAU | 14% +8% | 1.5·106 | 1.6·106+3.8·105 | 1.7·10-1+2.7·10-2 |
| -5% | -3.3·105 | -3.3·105 | -2.5·10-2 |
| NAC+ | 100% +0% | 1.8·104 | 3.9·105+4.5·104 | 3.2·10-5+1.3·10-5 |
| Linear | -4% | 9.0·103 | 3.7·105+3.8·104 | 2.3·10-1+5.4·10-3 |
| 7% +7% | 3.3·106 | 1.4·106+7.0·105 | -5.4·10-3 |
| - | NALU | 14% +8% | 1.9·106 | 1.9·106+4.4·105 | 1.8·10-1+7.2·10-2 |
| NAU | -5% | -4.5·105 | -4.5·105 | -5.8·10-2 |
| 100% +0% | 5.0·103 | 1.6·105+1.7·104 | 2.1·10-1+2.2·10-2 |
| -4% | -1.6·104 | -1.6·104 | -2.2·10-2 |
+
+Finally, for a fair comparison we introduce two new units: A variant of $\mathrm{NAC}_{\bullet}$ , denoted $\mathrm{NAC}_{\bullet,\sigma}$ , that only supports multiplication by constraining the weights with $W = \sigma(\hat{W})$ . And a variant, named $\mathrm{NAC}_{\bullet,\mathrm{NU}}$ , that uses clamped linear weights and sparsity regularization identically to the NMU.
+
+Figure 3 shows that the NMU can handle a much larger hidden-size and negative inputs. Furthermore, results for $\mathrm{NAC}_{\bullet,\sigma}$ and $\mathrm{NAC}_{\bullet,\mathrm{NMU}}$ validate that removing division and adding bias improves the success-rate, but are not enough when the hidden-size is large, as there is no ideal initialization. Interestingly, no models can learn U[1.1, 1.2], suggesting certain input ranges might be troublesome.
+
+
+
+
+
+
+
+Figure 3: Multiplication task results when varying the hidden input-size and when varying the input-range. Extrapolation ranges are defined in Appendix C.4.
+
+model NAC.NMU NAC. NAC. NU NMU
+
+
+
+
+
+# 4.2 PRODUCT OF SEQUENTIAL MNIST
+
+To investigate if a deep neural network can be optimized when backpropagating through an arithmetic unit, the arithmetic units are used as a recurrent-unit over a sequence of MNIST digits, where the target is to fit the cumulative product. This task is similar to "MNIST Counting and Arithmetic Tasks" in Trask et al. (2018)2, but uses multiplication rather than addition (addition is in Appendix D.2). Each model is trained on sequences of length 2 and tested on sequences of up to 20 MNIST digits.
+
+We define the success-criterion by comparing the MSE of each model with a baseline model that has a correct solution for the arithmetic unit. If the MSE of each model is less than the upper $1\%$ MSE-confidence-interval of the baseline model, then the model is considered successfully converged.
+
+Sparsity and "solved at iteration step" is determined as described in experiment 4.1. The validation set is the last 5000 MNIST digits from the training set, which is used for early stopping.
+
+In this experiment, we found that having an unconstrained "input-network" can cause the multiplication-units to learn an undesired solution, e.g. $(0.1\cdot 81 + 1 - 0.1) = 9$ . Such network do solve the problem but not in the intended way. To prevent this solution, we regularize the CNN output with $\mathcal{R}_{\mathrm{z}} = \frac{1}{H_{\ell - 1}H_{\ell}}\sum_{h_{\ell}}^{H_{\ell}}\sum_{h_{\ell -1}}^{H_{\ell -1}}(1 - W_{h_{\ell -1},h_{\ell}})\cdot (1 - \bar{z}_{h_{\ell -1}})^{2}$ . This regularizer is applied to the NMU and $\mathrm{NAC}_{\bullet ,\mathrm{NMU}}$ models. See Appendix D.4 for the results where this regularizer is not used.
+
+Figure 4 shows that the NMU does not hinder learning a more complex neural network. Moreover, the NMU can extrapolate to much longer sequences than what it is trained on.
+
+Figure 4: MNIST sequential multiplication task. Each model is trained on sequences of two digits, results are for extrapolating to longer sequences. Error-bars represent the $95\%$ confidence interval.
+
+model $\rightarrow$ NAC.NMU $\rightarrow$ NAC. $\rightarrow$ NAC. $\rightarrow$ LSTM $\rightarrow$ NALU $\rightarrow$ NMU
+
+
+
+
+
+# 5 CONCLUSION
+
+By including theoretical considerations, such as initialization, gradients, and sparsity, we have developed the Neural Multiplication Unit (NMU) and the Neural Addition Unit (NAU), which outperforms state-of-the-art models on established extrapolation and sequential tasks. Our models converge more consistently, faster, to an more interpretable solution, and supports all input ranges.
+
+A natural next step would be to extend the NMU to support division and add gating between the NMU and NAU, to be comparable in theoretical features with NALU. However we find, both experimentally and theoretically, that learning division is impractical, because of the singularity when dividing by zero, and that a sigmoid-gate choosing between two functions with vastly different convergences properties, such as a multiplication unit and an addition unit, cannot be consistently learned.
+
+Finally, when considering more than just two inputs to the multiplication unit, our model performs significantly better than previously proposed methods and their variations. The ability for a neural unit to consider more than two inputs is critical in neural networks which are often overparameterized.
+
+# ACKNOWLEDGMENTS
+
+We would like to thank Andrew Trask and the other authors of the NALU paper, for highlighting the importance and challenges of extrapolation in Neural Networks.
+
+We would also like to thank the students Raja Shan Zaker Kreen and William Frisch Møller from The Technical University of Denmark, who initially showed us that the NALU do not converge consistently.
+
+Alexander R. Johansen and the computing resources from the Technical University of Denmark, where funded by the Innovation Foundation Denmark through the DABAI project.
+
+# REFERENCES
+
+Kaiyu Chen, Yihan Dong, Xipeng Qiu, and Zitian Chen. Neural arithmetic expression calculator. CoRR, abs/1809.08590, 2018. URL http://arxiv.org/abs/1809.08590.
+Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: pre-training of deep bidirectional transformers for language understanding. CoRR, abs/1810.04805, 2018. URL http://arxiv.org/abs/1810.04805.
+Karlis Freivalds and Renars Liepins. Improving the neural GPU architecture for algorithm learning. CoRR, abs/1702.08727, 2017. URL http://arxiv.org/abs/1702.08727.
+Charles R. Gallistel. Finding numbers in the brain. Philosophical Transactions of the Royal Society B: Biological Sciences, 373(1740):20170119, 2018. doi: 10.1098/rstb.2017.0119. URL https://royalsocietypublishing.org/doi/abs/10.1098/rstb.2017.0119.
+Xavier Glorot and Yoshua Bengio. Understanding the difficulty of training deep feedforward neural networks. In JMLR W&CP: Proceedings of the Thirteenth International Conference on Artificial Intelligence and Statistics (AISTATS 2010), volume 9, pp. 249-256, May 2010.
+Alex Graves, Greg Wayne, and Ivo Danihelka. Neural Turing machines. CoRR, abs/1410.5401, 2014. URL http://arxiv.org/abs/1410.5401.
+Lukasz Kaiser and Ilya Sutskever. Neural gpus learn algorithms. In 4th International Conference on Learning Representations, ICLR 2016, San Juan, Puerto Rico, May 2-4, 2016, Conference Track Proceedings, 2016. URL http://arxiv.org/abs/1511.08228.
+Nal Kalchbrenner, Ivo Danihelka, and Alex Graves. Grid long short-term memory. In 4th International Conference on Learning Representations, ICLR 2016, San Juan, Puerto Rico, May 2-4, 2016, Conference Track Proceedings, 2016. URL http://arxiv.org/abs/1507.01526.
+Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In The 3rd International Conference for Learning Representations, San Diego, 2015, pp. arXiv:1412.6980, Dec 2014.
+Brenden M. Lake and Marco Baroni. Generalization without systematicity: On the compositional skills of sequence-to-sequence recurrent networks. In Proceedings of the 35th International Conference on Machine Learning, ICML 2018, Stockholm, Sweden, July 10-15, 2018, pp. 2879-2888, 2018. URL http://proceedings.mlr.press/v80/lake18a.html.
+Andreas Madsen and Alexander R. Johansen. Measuring arithmetic extrapolation performance. In Science meets Engineering of Deep Learning at 33rd Conference on Neural Information Processing Systems (NeurIPS 2019), volume abs/1910.01888, Vancouver, Canada, October 2019. URL http://arxiv.org/abs/1910.01888.
+Andreas Nieder. The neuronal code for number. Nature Reviews Neuroscience, 17:366 EP -, 05 2016. URL https://doi.org/10.1038/nrn.2016.40.
+
+OpenAI, Marcin Andrychowicz, Bowen Baker, Maciek Chogiej, Rafal Józefowicz, Bob McGrew, Jakub W. Pachocki, Jakub Pachocki, Arthur Petron, Matthias Plappert, Glenn Powell, Alex Ray, Jonas Schneider, Szymon Sidor, Josh Tobin, Peter Welinder, Lilian Weng, and Wojciech Zaremba. Learning dexterous in-hand manipulation. CoRR, abs/1808.00177, 2018. URL http://arxiv.org/abs/1808.00177.
+Rosa Rugani, Laura Fontanari, Eleonora Simoni, Lucia Regolin, and Giorgio Vallortigara. Arithmetic in newborn chicks. Proceedings of the Royal Society B: Biological Sciences, 276(1666):2451-2460, 2009. doi: 10.1098/rspb.2009.0044. URL https://royalsocietypublishing.org/doi/abs/10.1098/rspb.2009.0044.
+David Silver, Aja Huang, Chris J. Maddison, Arthur Guez, Laurent Sifre, George van den Driessche, Julian Schrittwieser, Ioannis Antonoglou, Vedavyas Panneershelvam, Marc Lanctot, Sander Dieleman, Dominik Grewe, John Nham, Nal Kalchbrenner, Ilya Sutskever, Timothy P. 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, 2016. doi: 10.1038/nature16961. URL https://doi.org/10.1038/nature16961.
+Mirac Suzgun, Yonatan Belinkov, and Stuart M. Shieber. On evaluating the generalization of LSTM models in formal languages. In Proceedings of the Society for Computation in Linguistics (SCiL), pp. 277-286, January 2019.
+Andrew Trask, Felix Hill, Scott E Reed, Jack Rae, Chris Dyer, and Phil Blunsom. Neural arithmetic logic units. In Advances in Neural Information Processing Systems 31, pp. 8035-8044. 2018. URL http://papers.nips.cc/paper/8027-neural-arithmetic-logic-units.pdf.
+Edwin B. Wilson. Probable inference, the law of succession, and statistical inference. Journal of the American Statistical Association, 22(158):209-212, 1927. doi: 10.1080/01621459.1927.10502953. URL https://www.tandfonline.com/doi/abs/10.1080/01621459.1927.10502953.
+Sang Michael Xie and Stefano Ermon. Differentiable subset sampling. CoRR, abs/1901.10517, 2019. URL http://arxiv.org/abs/1901.10517.
+
+# A GRADIENT DERIVATIVES
+
+# A.1 WEIGHT MATRIX CONSTRUCTION
+
+For clarity the weight matrix construction is defined using scalar notation
+
+$$
+W _ {h _ {\ell}, h _ {\ell - 1}} = \tanh \left(\hat {W} _ {h _ {\ell}, h _ {\ell - 1}}\right) \sigma \left(\hat {M} _ {h _ {\ell}, h _ {\ell - 1}}\right) \tag {18}
+$$
+
+The loss with respect to $\hat{W}_{h_{\ell},h_{\ell -1}}$ and $\hat{M}_{h_{\ell},h_{\ell -1}}$ is then derived using backpropagation.
+
+$$
+\begin{array}{l} \frac {\partial \mathcal {L}}{\partial \hat {W} _ {h _ {\ell} , h _ {\ell - 1}}} = \frac {\partial \mathcal {L}}{\partial W _ {h _ {\ell} , h _ {\ell - 1}}} \frac {\partial W _ {h _ {\ell} , h _ {\ell - 1}}}{\partial \hat {W} _ {h _ {\ell} , h _ {\ell - 1}}} \\ = \frac {\partial \mathcal {L}}{\partial W _ {h _ {\ell} , h _ {\ell - 1}}} \left(1 - \tanh ^ {2} \left(\hat {W} _ {h _ {\ell}, h _ {\ell - 1}}\right)\right) \sigma \left(\hat {M} _ {h _ {\ell}, h _ {\ell - 1}}\right) \\ \end{array}
+$$
+
+$$
+\begin{array}{l} \frac {\partial \mathcal {L}}{\partial \hat {M} _ {h _ {\ell} , h _ {\ell - 1}}} = \frac {\partial \mathcal {L}}{\partial W _ {h _ {\ell} , h _ {\ell - 1}}} \frac {\partial W _ {h _ {\ell} , h _ {\ell - 1}}}{\partial \hat {M} _ {h _ {\ell} , h _ {\ell - 1}}} \\ = \frac {\partial \mathcal {L}}{\partial W _ {h _ {\ell} , h _ {\ell - 1}}} \tanh (\hat {W} _ {h _ {\ell}, h _ {\ell - 1}}) \sigma (\hat {M} _ {h _ {\ell}, h _ {\ell - 1}}) (1 - \sigma (\hat {M} _ {h _ {\ell}, h _ {\ell - 1}})) \\ \end{array}
+$$
+
+As seen from this result, one only needs to consider $\frac{\partial\mathcal{L}}{\partial W_{h_\ell,h_{\ell - 1}}}$ for $\mathrm{NAC}_{+}$ and $\mathrm{NAC}_{\bullet}$ , as the gradient with respect to $\hat{W}_{h_{\ell},h_{\ell -1}}$ and $\hat{M}_{h_{\ell},h_{\ell -1}}$ is a multiplication on $\frac{\partial\mathcal{L}}{\partial W_{h_\ell,h_{\ell - 1}}}$ .
+
+# A.2 GRADIENT OF NAC.
+
+The NAC is defined using scalar notation.
+
+$$
+z _ {h _ {\ell}} = \exp \left(\sum_ {h _ {\ell - 1} = 1} ^ {H _ {\ell - 1}} W _ {h _ {\ell}, h _ {\ell - 1}} \log \left(\left| z _ {h _ {\ell - 1}} \right| + \epsilon\right)\right) \tag {20}
+$$
+
+The gradient of the loss with respect to $W_{h_\ell, h_{\ell-1}}$ can be derived using backpropagation.
+
+$$
+\begin{array}{l} \frac {\partial z _ {h _ {\ell}}}{\partial W _ {h _ {\ell} , h _ {\ell - 1}}} = \exp \left(\sum_ {h _ {\ell - 1} ^ {\prime} = 1} ^ {H _ {\ell - 1}} W _ {h _ {\ell}, h _ {\ell - 1} ^ {\prime}} \log \left(\left| z _ {h _ {\ell - 1} ^ {\prime}} \right| + \epsilon\right)\right) \log \left(\left| z _ {h _ {\ell - 1}} \right| + \epsilon\right) \tag {21} \\ = z _ {h _ {\ell}} \log \left(\left| z _ {h _ {\ell - 1}} \right| + \epsilon\right) \\ \end{array}
+$$
+
+We now wish to derive the backpropagation term $\delta_{h_\ell} = \frac{\partial\mathcal{L}}{\partial z_{h_\ell}}$ , because $z_{h_\ell}$ affects $\left\{z_{h_{\ell +1}}\right\}_{h_{\ell +1} = 1}^{H_{\ell +1}}$ this becomes:
+
+$$
+\delta_ {h _ {\ell}} = \frac {\partial \mathcal {L}}{\partial z _ {h _ {\ell}}} = \sum_ {h _ {\ell + 1} = 1} ^ {H _ {\ell + 1}} \frac {\partial \mathcal {L}}{\partial z _ {h _ {\ell + 1}}} \frac {\partial z _ {h _ {\ell + 1}}}{\partial z _ {h _ {\ell}}} = \sum_ {h _ {\ell + 1} = 1} ^ {H _ {\ell + 1}} \delta_ {h _ {\ell + 1}} \frac {\partial z _ {h _ {\ell + 1}}}{\partial z _ {h _ {\ell}}} \tag {22}
+$$
+
+To make it easier to derive $\frac{\partial z_{h_{\ell + 1}}}{\partial z_{h_{\ell}}}$ we re-express the $z_{h_{\ell}}$ as $z_{h_{\ell +1}}$
+
+$$
+z _ {h _ {\ell + 1}} = \exp \left(\sum_ {h _ {\ell} = 1} ^ {H _ {\ell}} W _ {h _ {\ell + 1}, h _ {\ell}} \log \left(\left| z _ {h _ {\ell}} \right| + \epsilon\right)\right) \tag {23}
+$$
+
+The gradient of $\frac{\partial z_{h_{\ell + 1}}}{\partial z_{h_{\ell}}}$ is then:
+
+$$
+\begin{array}{l} \frac {\partial z _ {h _ {\ell + 1}}}{\partial z _ {h _ {\ell}}} = \exp \left(\sum_ {h _ {\ell} = 1} ^ {H _ {\ell}} W _ {h _ {\ell + 1}, h _ {\ell}} \log (| z _ {h _ {\ell}} | + \epsilon)\right) W _ {h _ {\ell + 1}, h _ {\ell}} \frac {\partial \log (| z _ {h _ {\ell}} | + \epsilon)}{\partial z _ {h _ {\ell}}} \\ = \exp \left(\sum_ {h _ {\ell} = 1} ^ {H _ {\ell}} W _ {h _ {\ell + 1}, h _ {\ell}} \log \left(\left| z _ {h _ {\ell}} \right| + \epsilon\right)\right) W _ {h _ {\ell + 1}, h _ {\ell}} \frac {\operatorname {a b s} ^ {\prime} \left(z _ {h _ {\ell}}\right)}{\left| z _ {h _ {\ell}} \right| + \epsilon} \tag {24} \\ = z _ {h _ {\ell + 1}} W _ {h _ {\ell + 1}, h _ {\ell}} \frac {\mathrm {a b s} ^ {\prime} \left(z _ {h _ {\ell}}\right)}{\left| z _ {h _ {\ell}} \right| + \epsilon} \\ \end{array}
+$$
+
+$\mathrm{abs}'(z_{h_\ell})$ is the gradient of the absolute function. In the paper we denote this as $\mathrm{sign}(z_{h_\ell})$ for brevity. However, depending on the exact definition used there may be a difference for $z_{h_\ell} = 0$ , as $\mathrm{abs}'(0)$ is undefined. In practicality this doesn't matter much though, although theoretically it does mean that the expectation of this is theoretically undefined when $E[z_{h_\ell}] = 0$ .
+
+# A.3 GRADIENT OF NMU
+
+In scalar notation the NMU is defined as:
+
+$$
+z _ {h _ {\ell}} = \prod_ {h _ {\ell - 1} = 1} ^ {H _ {\ell - 1}} \left(W _ {h _ {\ell - 1}, h _ {\ell}} z _ {h _ {\ell - 1}} + 1 - W _ {h _ {\ell - 1}, h _ {\ell}}\right) \tag {25}
+$$
+
+The gradient of the loss with respect to $W_{h_{\ell -1},h_\ell}$ is fairly trivial. Note that every term but the one for $h_{\ell -1}$ , is just a constant with respect to $W_{h_{\ell -1},h_\ell}$ . The product, except the term for $h_{\ell -1}$ can be expressed as $\frac{z_{h_\ell}}{W_{h_{\ell - 1},h_\ell}z_{h_{\ell - 1}} + 1 - W_{h_{\ell -1},h_\ell}}$ . Using this fact, the gradient can be expressed as:
+
+$$
+\frac {\partial \mathcal {L}}{\partial w _ {h _ {\ell} , h _ {\ell - 1}}} = \frac {\partial \mathcal {L}}{\partial z _ {h _ {\ell}}} \frac {\partial z _ {h _ {\ell}}}{\partial w _ {h _ {\ell} , h _ {\ell - 1}}} = \frac {\partial \mathcal {L}}{\partial z _ {h _ {\ell}}} \frac {z _ {h _ {\ell}}}{W _ {h _ {\ell - 1} , h _ {\ell}} z _ {h _ {\ell - 1}} + 1 - W _ {h _ {\ell - 1} , h _ {\ell}}} \left(z _ {h _ {\ell - 1}} - 1\right) \tag {26}
+$$
+
+Similarly, the gradient $\frac{\partial\mathcal{L}}{\partial z_{h_\ell}}$ which is essential in backpropagation can equally easily be derived as:
+
+$$
+\frac {\partial \mathcal {L}}{\partial z _ {h _ {\ell - 1}}} = \sum_ {h _ {\ell} = 1} ^ {H _ {\ell}} \frac {\partial \mathcal {L}}{\partial z _ {h _ {\ell}}} \frac {\partial z _ {h _ {\ell}}}{\partial z _ {h _ {\ell - 1}}} = \sum_ {h _ {\ell} = 1} ^ {H _ {\ell}} \frac {z _ {h _ {\ell}}}{W _ {h _ {\ell - 1} , h _ {\ell}} z _ {h _ {\ell - 1}} + 1 - W _ {h _ {\ell - 1} , h _ {\ell}}} W _ {h _ {\ell - 1}, h _ {\ell}} \tag {27}
+$$
+
+# B MOMENTS
+
+# B.1 OVERVIEW
+
+# B.1.1 MOMENTS AND INITIALIZATION FOR ADDITION
+
+The desired properties for initialization are according to Glorot et al. (Glorot & Bengio, 2010):
+
+$$
+E \left[ z _ {h _ {\ell}} \right] = 0 \quad E \left[ \frac {\partial \mathcal {L}}{\partial z _ {h _ {\ell - 1}}} \right] = 0 \tag {28}
+$$
+
+$$
+V a r \left[ z _ {h _ {\ell}} \right] = V a r \left[ z _ {h _ {\ell - 1}} \right] \quad V a r \left[ \frac {\partial \mathcal {L}}{\partial z _ {h _ {\ell - 1}}} \right] = V a r \left[ \frac {\partial \mathcal {L}}{\partial z _ {h _ {\ell}}} \right]
+$$
+
+# B.1.2 INITIALIZATION FOR ADDITION
+
+Glorot initialization can not be used for $\mathrm{NAC}_{+}$ as $W_{h_{\ell -1},h_{\ell}}$ is not sampled directly. Assuming that $\hat{W}_{h_{\ell},h_{\ell -1}}\sim \mathrm{Uniform}[-r,r]$ and $\hat{M}_{h_{\ell},h_{\ell -1}}\sim \mathrm{Uniform}[-r,r]$ , then the variance can be derived (see proof in Appendix B.2) to be:
+
+$$
+\operatorname {V a r} \left[ W _ {h _ {\ell - 1}, h _ {\ell}} \right] = \frac {1}{2 r} \left(1 - \frac {\tanh (r)}{r}\right) \left(r - \tanh \left(\frac {r}{2}\right)\right) \tag {29}
+$$
+
+One can then solve for $r$ , given the desired variance $(Var[W_{h_{\ell -1},h_\ell}] = \frac{2}{H_{\ell - 1} + H_\ell})$ (Glorot & Bengio, 2010).
+
+# B.1.3 MOMENTS AND INITIALIZATION FOR MULTIPLICATION
+
+Using second order multivariate Taylor approximation and some assumptions of uncorrelated stochastic variables, the expectation and variance of the NAC. layer can be estimated to:
+
+$$
+f \left(c _ {1}, c _ {2}\right) = \left(1 + c _ {1} \frac {1}{2} \operatorname {V a r} \left[ W _ {h _ {\ell}, h _ {\ell - 1}} \right] \log \left(\left| E \left[ z _ {h _ {\ell - 1}} \right] \right| + \epsilon\right) ^ {2}\right) ^ {c _ {2} H _ {\ell - 1}}
+$$
+
+$$
+E \left[ z _ {h _ {\ell}} \right] \approx f (1, 1)
+$$
+
+$$
+V a r \left[ z _ {h _ {\ell}} \right] \approx f (4, 1) - f (1, 2)
+$$
+
+$$
+E \left[ \frac {\partial \mathcal {L}}{\partial z _ {h _ {\ell - 1}}} \right] = 0 \tag {30}
+$$
+
+$$
+\begin{array}{l} V a r \left[ \frac {\partial \mathcal {L}}{\partial z _ {h _ {\ell - 1}}} \right] \approx V a r \left[ \frac {\partial \mathcal {L}}{\partial z _ {h _ {\ell}}} \right] H _ {\ell} f (4, 1) \operatorname {V a r} \left[ W _ {h _ {\ell}, h _ {\ell - 1}} \right] \\ \cdot \left(\frac {1}{\left(| E [ z _ {h _ {\ell - 1}} ] | + \epsilon\right) ^ {2}} + \frac {3}{\left(| E [ z _ {h _ {\ell - 1}} ] | + \epsilon\right) ^ {4}} \operatorname {V a r} \left[ z _ {h _ {\ell - 1}} \right]\right) \\ \end{array}
+$$
+
+This is problematic because $E[z_{h_\ell}] \geq 1$ , and the variance explodes for $E[z_{h_{\ell -1}}] = 0$ . $E[z_{h_{\ell -1}}] = 0$ is normally a desired property (Glorot & Bengio, 2010). The variance explodes for $E[z_{h_{\ell -1}}] = 0$ and can thus not be initialized to anything meaningful.
+
+For our proposed NMU, the expectation and variance can be derived (see proof in Appendix B.4) using the same assumptions as before, although no Taylor approximation is required:
+
+$$
+E \left[ z _ {h _ {\ell}} \right] \approx \left(\frac {1}{2}\right) ^ {H _ {\ell - 1}}
+$$
+
+$$
+E \left[ \frac {\partial \mathcal {L}}{\partial z _ {h _ {\ell - 1}}} \right] \approx 0
+$$
+
+$$
+\operatorname {V a r} \left[ z _ {h _ {\ell}} \right] \approx \left(\operatorname {V a r} \left[ W _ {h _ {\ell - 1}, h _ {\ell}} \right] + \frac {1}{4}\right) ^ {H _ {\ell - 1}} \left(\operatorname {V a r} \left[ z _ {h _ {\ell - 1}} \right] + 1\right) ^ {H _ {\ell - 1}} - \left(\frac {1}{4}\right) ^ {H _ {\ell - 1}} \tag {31}
+$$
+
+$$
+\begin{array}{l} V a r \left[ \frac {\partial \mathcal {L}}{\partial z _ {h _ {\ell - 1}}} \right] \approx V a r \left[ \frac {\partial \mathcal {L}}{\partial z _ {h _ {\ell}}} \right] H _ {\ell} \\ \cdot \left(\left(V a r \left[ W _ {h _ {\ell - 1}, h _ {\ell}} \right] + \frac {1}{4}\right) ^ {H _ {\ell - 1}} \left(V a r \left[ z _ {h _ {\ell - 1}} \right] + 1\right) ^ {H _ {\ell - 1} - 1}\right) \\ \end{array}
+$$
+
+These expectations are better behaved. It is unlikely that the expectation of a multiplication unit can become zero, since the identity for multiplication is 1. However, for a large $H_{\ell -1}$ it will be near zero.
+
+The variance is also better behaved, but do not provide a input-independent initialization strategy. We propose initializing with $Var[W_{h_{\ell -1},h_\ell}] = \frac{1}{4}$ , as this is the solution to $Var[z_{h_\ell}] = Var[z_{h_{\ell -1}}]$ assuming $Var[z_{h_{\ell -1}}] = 1$ and a large $H_{\ell -1}$ (see proof in Appendix B.4.3). However, more exact solutions are possible if the input variance is known.
+
+# B.2 EXPECTATION AND VARIANCE FOR WEIGHT MATRIX CONSTRUCTION IN NAC LAYERS
+
+The weight matrix construction in NAC, is defined in scalar notation as:
+
+$$
+W _ {h _ {\ell}, h _ {\ell - 1}} = \tanh \left(\tilde {W} _ {h _ {\ell}, h _ {\ell - 1}}\right) \sigma \left(\hat {M} _ {h _ {\ell}, h _ {\ell - 1}}\right) \tag {32}
+$$
+
+Simplifying the notation of this, and re-expressing it using stochastic variables with uniform distributions this can be written as:
+
+$$
+W \sim \tanh (\hat {W}) \sigma (\hat {M})
+$$
+
+$$
+\hat {W} \sim U [ - r, r ] \tag {33}
+$$
+
+$$
+\hat {M} \sim U [ - r, r ]
+$$
+
+Since $\tanh (\hat{W})$ is an odd-function and $E[\hat{W}] = 0$ , deriving the expectation $E[W]$ is trivial.
+
+$$
+\operatorname {E} [ W ] = \operatorname {E} \left(\tanh (\hat {W})\right) \operatorname {E} [ \sigma (\hat {M}) ] = 0 \cdot \operatorname {E} [ \sigma (\hat {M}) ] = 0 \tag {34}
+$$
+
+The variance is more complicated, however as $\hat{W}$ and $\hat{M}$ are independent, it can be simplified to:
+
+$$
+\operatorname {V a r} [ W ] = \mathrm {E} \left[ \tanh (\hat {W}) ^ {2} \right] \mathrm {E} \left[ \sigma (\hat {M}) ^ {2} \right] - \mathrm {E} \left[ \tanh (\hat {W}) \right] ^ {2} \mathrm {E} \left[ \sigma (\hat {M}) \right] ^ {2} = \mathrm {E} \left[ \tanh (\hat {W}) ^ {2} \right] \mathrm {E} \left[ \sigma (\hat {M}) ^ {2} \right] \tag {35}
+$$
+
+These second moments can be analyzed independently. First for $\operatorname{E}[\tanh (\hat{W})^2 ]$ :
+
+$$
+\begin{array}{l} \operatorname {E} \left[ \tanh (\hat {W}) ^ {2} \right] = \int_ {- \infty} ^ {\infty} \tanh (x) ^ {2} f _ {U [ - r, r ]} (x) d x \\ = \frac {1}{2 r} \int_ {- r} ^ {r} \tanh (x) ^ {2} d x \tag {36} \\ = \frac {1}{2 r} \cdot 2 \cdot (r - \tanh (r)) \\ = 1 - \frac {\tanh (r)}{r} \\ \end{array}
+$$
+
+Then for $\operatorname{E}[\tanh (\hat{M})^2]$ :
+
+$$
+\begin{array}{l} \operatorname {E} [ \sigma (\hat {M}) ^ {2} ] = \int_ {- \infty} ^ {\infty} \sigma (x) ^ {2} f _ {U [ - r, r ]} (x) \mathrm {d} x \\ = \frac {1}{2 r} \int_ {- r} ^ {r} \sigma (x) ^ {2} \mathrm {d} x \tag {37} \\ = \frac {1}{2 r} \left(r - \tanh \left(\frac {r}{2}\right)\right) \\ \end{array}
+$$
+
+Which results in the variance:
+
+$$
+\operatorname {V a r} [ W ] = \frac {1}{2 r} \left(1 - \frac {\tanh (r)}{r}\right) \left(r - \tanh \left(\frac {r}{2}\right)\right) \tag {38}
+$$
+
+# B.3 EXPECTATION AND VARIANCE OF NAC.
+
+# B.3.1 FORWARD PASS
+
+Expectation Assuming that each $z_{h_{\ell -1}}$ are uncorrelated, the expectation can be simplified to:
+
+$$
+\begin{array}{l} E [ z _ {h _ {\ell}} ] = E \left[ \exp \left(\sum_ {h _ {\ell - 1} = 1} ^ {H _ {\ell - 1}} W _ {h _ {\ell}, h _ {\ell - 1}} \log (| z _ {h _ {\ell - 1}} | + \epsilon)\right) \right] \\ = E \left[ \prod_ {h _ {\ell - 1} = 1} ^ {H _ {\ell - 1}} \exp \left(W _ {h _ {\ell}, h _ {\ell - 1}} \log \left(\left| z _ {h _ {\ell - 1}} \right| + \epsilon\right)\right) \right] \\ \approx \prod_ {h _ {\ell - 1} = 1} ^ {H _ {\ell - 1}} E \left[ \exp \left(W _ {h _ {\ell}, h _ {\ell - 1}} \log \left(\left| z _ {h _ {\ell - 1}} \right| + \epsilon\right)\right) \right] \tag {39} \\ = E \left[ \exp \left(W _ {h _ {\ell}, h _ {\ell - 1}} \log \left(\left| z _ {h _ {\ell - 1}} \right| + \epsilon\right)\right) \right] ^ {H _ {\ell - 1}} \\ = E \left[ \left(\left| z _ {h _ {\ell - 1}} \right| + \epsilon\right) ^ {W _ {h _ {\ell}, h _ {\ell - 1}}} \right] ^ {H _ {\ell - 1}} \\ = E \left[ f \left(z _ {h _ {\ell - 1}}, W _ {h _ {\ell}, h _ {\ell - 1}}\right) \right] ^ {H _ {\ell - 1}} \\ \end{array}
+$$
+
+Here we define $g$ as a non-linear transformation function of two independent stochastic variables:
+
+$$
+f \left(z _ {h _ {\ell - 1}}, W _ {h _ {\ell}, h _ {\ell - 1}}\right) = \left(\left| z _ {h _ {\ell - 1}} \right| + \epsilon\right) ^ {W _ {h _ {\ell}, h _ {\ell - 1}}} \tag {40}
+$$
+
+We then apply second order Taylor approximation of $f$ , around $(E[z_{h_{\ell -1}}], E[W_{h_{\ell},h_{\ell -1}}])$ .
+
+$$
+\begin{array}{l} E [ f (z _ {h _ {\ell - 1}}, W _ {h _ {\ell}, h _ {\ell - 1}}) ] \approx E \Bigg [ \\ f \left(E \left[ z _ {h _ {\ell - 1}} \right], E \left[ W _ {h _ {\ell}, h _ {\ell - 1}} \right]\right) \\ \left. + \left[ \begin{array}{c} z _ {h _ {\ell - 1}} - E \big [ z _ {h _ {\ell - 1}} \big ] \\ W _ {h _ {\ell}, h _ {\ell - 1}} - E \big [ W _ {h _ {\ell}, h _ {\ell - 1}} \big ] \end{array} \right] ^ {T} \left[ \begin{array}{c} \frac {\partial f (z _ {h _ {\ell - 1}} , W _ {h _ {\ell} , h _ {\ell - 1}})}{\partial z _ {h _ {\ell - 1}}} \\ \frac {\partial f (z _ {h _ {\ell - 1}} , W _ {h _ {\ell} , h _ {\ell - 1}})}{\partial W _ {h _ {\ell} , h _ {\ell - 1}}} \end{array} \right] \right| \left\{ \begin{array}{l} z _ {h _ {\ell - 1}} = E \big [ z _ {h _ {\ell - 1}} \big ] \\ W _ {h _ {\ell}, h _ {\ell - 1}} = E \big [ W _ {h _ {\ell}, h _ {\ell - 1}} \big ] \end{array} \right. \\ + \frac {1}{2} \left[ \begin{array}{c} z _ {h _ {\ell - 1}} - E \left[ z _ {h _ {\ell - 1}} \right] \\ W _ {h _ {\ell}, h _ {\ell - 1}} - E \left[ W _ {h _ {\ell}, h _ {\ell - 1}} \right] \end{array} \right] ^ {T} \tag {41} \\ \bullet \left[ \begin{array}{c c} \frac {\partial^ {2} f (z _ {h _ {\ell - 1}} , W _ {h _ {\ell} , h _ {\ell - 1}})}{\partial^ {2} z _ {h _ {\ell - 1}}} & \frac {\partial^ {2} f (z _ {h _ {\ell - 1}} , W _ {h _ {\ell} , h _ {\ell - 1}})}{\partial z _ {h _ {\ell - 1}} \partial W _ {h _ {\ell} , h _ {\ell - 1}}} \\ \frac {\partial^ {2} f (z _ {h _ {\ell - 1}} , W _ {h _ {\ell} , h _ {\ell - 1}})}{\partial z _ {h _ {\ell - 1}} \partial W _ {h _ {\ell} , h _ {\ell - 1}}} & \frac {\partial^ {2} f (z _ {h _ {\ell - 1}} , W _ {h _ {\ell} , h _ {\ell - 1}})}{\partial^ {2} W _ {h _ {\ell} , h _ {\ell - 1}}} \end{array} \right] \left| \begin{array}{l} z _ {h _ {\ell - 1}} = E [ z _ {h _ {\ell - 1}} ] \\ W _ {h _ {\ell}, h _ {\ell - 1}} = E [ W _ {h _ {\ell}, h _ {\ell - 1}} ] \end{array} \right. \\ \bullet \left[ \begin{array}{c} z _ {h _ {\ell - 1}} - E [ z _ {h _ {\ell - 1}} ] \\ W _ {h _ {\ell}, h _ {\ell - 1}} - E [ W _ {h _ {\ell}, h _ {\ell - 1}} ] \end{array} \right] \Bigg ] \\ \end{array}
+$$
+
+Because $E[z_{h_{\ell - 1}} - E[z_{h_{\ell - 1}}]] = 0$ , $E[W_{h_{\ell}, h_{\ell - 1}} - E[W_{h_{\ell}, h_{\ell - 1}}]] = 0$ , and $Cov[z_{h_{\ell - 1}}, W_{h_{\ell}, h_{\ell - 1}}] = 0$ .
+
+This simplifies to:
+
+$$
+\begin{array}{l} E \left[ g \left(z _ {h _ {\ell - 1}}, W _ {h _ {\ell}, h _ {\ell - 1}}\right) \right] \approx g \left(E \left[ z _ {h _ {\ell - 1}} \right], E \left[ W _ {h _ {\ell}, h _ {\ell - 1}} \right]\right) \\ + \frac {1}{2} \operatorname {V a r} \left[ \begin{array}{c} z _ {h _ {\ell - 1}} \\ W _ {h _ {\ell}, h _ {\ell - 1}} \end{array} \right] ^ {T} \left[ \begin{array}{c} \frac {\partial^ {2} g \left(z _ {h _ {\ell - 1}} , W _ {h _ {\ell} , h _ {\ell - 1}}\right)}{\partial^ {2} z _ {h _ {\ell - 1}}} \\ \frac {\partial^ {2} g \left(z _ {h _ {\ell - 1}} , W _ {h _ {\ell} , h _ {\ell - 1}}\right)}{\partial^ {2} W _ {h _ {\ell} , h _ {\ell - 1}}} \end{array} \right] \Bigg | \left\{ \begin{array}{l} z _ {h _ {\ell - 1}} = E \left[ z _ {h _ {\ell - 1}} \right] \\ W _ {h _ {\ell}, h _ {\ell - 1}} = E \left[ W _ {h _ {\ell}, h _ {\ell - 1}} \right] \end{array} \right. \tag {42} \\ \end{array}
+$$
+
+Inserting the derivatives and computing the inner products yields:
+
+$$
+\begin{array}{l} E [ f (z _ {h _ {\ell - 1}}, W _ {h _ {\ell}, h _ {\ell - 1}}) ] \approx \left(| E [ z _ {h _ {\ell - 1}} ] | + \epsilon\right) ^ {E [ W _ {h _ {\ell}, h _ {\ell - 1}} ]} \\ + \frac {1}{2} V a r [ z _ {h _ {\ell - 1}} ] (| E [ z _ {h _ {\ell - 1}} ] | + \epsilon) ^ {E [ W _ {h _ {\ell}, h _ {\ell - 1}} ] - 2} E [ W _ {h _ {\ell}, h _ {\ell - 1}} ] (E [ W _ {h _ {\ell}, h _ {\ell - 1}} ] - 1) \\ + \frac {1}{2} \operatorname {V a r} \left[ W _ {h _ {\ell}, h _ {\ell - 1}} \right] \left(\left| E \left[ z _ {h _ {\ell - 1}} \right] \right| + \epsilon\right) ^ {E \left[ W _ {h _ {\ell}, h _ {\ell - 1}} \right]} \log \left(\left| E \left[ z _ {h _ {\ell - 1}} \right] \right| + \epsilon\right) ^ {2} \tag {43} \\ = 1 + \frac {1}{2} \operatorname {V a r} \left[ W _ {h _ {\ell}, h _ {\ell - 1}} \right] \log \left(\left| E \left[ z _ {h _ {\ell - 1}} \right] \right| + \epsilon\right) ^ {2} \\ \end{array}
+$$
+
+This gives the final expectation:
+
+$$
+\begin{array}{l} E \left[ z _ {h _ {\ell}} \right] = E \left[ g \left(z _ {h _ {\ell - 1}}, W _ {h _ {\ell}, h _ {\ell - 1}}\right) \right] ^ {H _ {\ell - 1}} \\ \approx \left(1 + \frac {1}{2} \operatorname {V a r} \left[ W _ {h _ {\ell}, h _ {\ell - 1}} \right] \log \left(\left| E \left[ z _ {h _ {\ell - 1}} \right] \right| + \epsilon\right) ^ {2}\right) ^ {H _ {\ell - 1}} \tag {44} \\ \end{array}
+$$
+
+We evaluate the error of the approximation, where $W_{h_{\ell}, h_{\ell-1}} \sim U[-r_w, r_w]$ and $z_{h_{\ell-1}} \sim U[0, r_z]$ . These distributions are what is used in the arithmetic dataset. The error is plotted in figure 5.
+
+
+Figure 5: Error between theoretical approximation and the numerical approximation estimated by random sampling of 100000 observations at each combination of $r_z$ and $r_w$ .
+
+Variance The variance can be derived using the same assumptions as used in "expectation", that all $z_{h_{\ell -1}}$ are uncorrelated.
+
+$$
+\begin{array}{l} V a r [ z _ {h _ {\ell}} ] = E [ z _ {h _ {\ell}} ^ {2} ] - E [ z _ {h _ {\ell}} ] ^ {2} \\ = E \left[ \prod_ {h _ {\ell - 1} = 1} ^ {H _ {\ell - 1}} \left(\left| z _ {h _ {\ell - 1}} \right| + \epsilon\right) ^ {2 \cdot W _ {h _ {\ell}, h _ {\ell - 1}}} \right] - E \left[ \prod_ {h _ {\ell - 1} = 1} ^ {H _ {\ell - 1}} \left(\left| z _ {h _ {\ell - 1}} \right| + \epsilon\right) ^ {W _ {h _ {\ell}, h _ {\ell - 1}}} \right] ^ {2} \tag {45} \\ = E \left[ f \left(z _ {h _ {\ell - 1}}, 2 \cdot W _ {h _ {\ell}, h _ {\ell - 1}}\right) \right] ^ {H _ {\ell - 1}} - E \left[ f \left(z _ {h _ {\ell - 1}}, W _ {h _ {\ell}, h _ {\ell - 1}}\right) \right] ^ {2 \cdot H _ {\ell - 1}} \\ \end{array}
+$$
+
+We already have from the expectation result in (43) that:
+
+$$
+E \left[ f \left(z _ {h _ {\ell - 1}}, W _ {h _ {\ell}, h _ {\ell - 1}}\right) \right] \approx 1 + \frac {1}{2} \operatorname {V a r} \left[ W _ {h _ {\ell}, h _ {\ell - 1}} \right] \log \left(\left| E \left[ z _ {h _ {\ell - 1}} \right] \right| + \epsilon\right) ^ {2} \tag {46}
+$$
+
+By substitution of variable we have that:
+
+$$
+\begin{array}{l} E \left[ f \left(z _ {h _ {\ell - 1}}, 2 \cdot W _ {h _ {\ell}, h _ {\ell - 1}}\right) \right] \approx 1 + \frac {1}{2} \operatorname {V a r} \left[ 2 \cdot W _ {h _ {\ell}, h _ {\ell - 1}} \right] \log \left(\left| E \left[ z _ {h _ {\ell - 1}} \right] \right| + \epsilon\right) ^ {2} \tag {47} \\ \approx 1 + 2 \cdot V a r [ W _ {h _ {\ell}, h _ {\ell - 1}} ] \log (| E [ z _ {h _ {\ell - 1}} ] | + \epsilon) ^ {2} \\ \end{array}
+$$
+
+This gives the variance:
+
+$$
+\begin{array}{l} V a r \left[ z _ {h _ {\ell}} \right] = E \left[ g \left(z _ {h _ {\ell - 1}}, 2 \cdot W _ {h _ {\ell}, h _ {\ell - 1}}\right) \right] ^ {H _ {\ell - 1}} - E \left[ f \left(z _ {h _ {\ell - 1}}, W _ {h _ {\ell}, h _ {\ell - 1}}\right) \right] ^ {2 \cdot H _ {\ell - 1}} \\ \approx \left(1 + 2 \cdot \operatorname {V a r} \left[ W _ {h _ {\ell}, h _ {\ell - 1}} \right] \log \left(\left| E \left[ z _ {h _ {\ell - 1}} \right] \right| + \epsilon\right) ^ {2}\right) ^ {H _ {\ell - 1}} \tag {48} \\ \left. - \left(1 + \frac {1}{2} \cdot \operatorname {V a r} \left[ W _ {h _ {\ell}, h _ {\ell - 1}} \right] \log \left(\left| E \left[ z _ {h _ {\ell - 1}} \right] \right| + \epsilon\right) ^ {2}\right) ^ {2 \cdot H _ {\ell - 1}} \right. \\ \end{array}
+$$
+
+# B.3.2 BACKWARD PASS
+
+Expectation The expectation of the back-propagation term assuming that $\delta_{h_{\ell +1}}$ and $\frac{\partial z_{h_{\ell + 1}}}{\partial z_{h_{\ell}}}$ are mutually uncorrelated:
+
+$$
+E \left[ \delta_ {h _ {\ell}} \right] = E \left[ \sum_ {h _ {\ell + 1} = 1} ^ {H _ {\ell + 1}} \delta_ {h _ {\ell + 1}} \frac {\partial z _ {h _ {\ell + 1}}}{\partial z _ {h _ {\ell}}} \right] \approx H _ {\ell + 1} E \left[ \delta_ {h _ {\ell + 1}} \right] E \left[ \frac {\partial z _ {h _ {\ell + 1}}}{\partial z _ {h _ {\ell}}} \right] \tag {49}
+$$
+
+Assuming that $z_{h_{\ell +1}},W_{h_{\ell +1},h_{\ell}}$ , and $z_{h_\ell}$ are uncorrelated:
+
+$$
+E \left[ \frac {\partial z _ {h _ {\ell + 1}}}{\partial z _ {h _ {\ell}}} \right] \approx E \left[ z _ {h _ {\ell + 1}} \right] E \left[ W _ {h _ {\ell + 1}, h _ {\ell}} \right] E \left[ \frac {\mathrm {a b s} ^ {\prime} \left(z _ {h _ {\ell}}\right)}{\left| z _ {h _ {\ell}} \right| + \epsilon} \right] = E \left[ z _ {h _ {\ell + 1}} \right] \cdot 0 \cdot E \left[ \frac {\mathrm {a b s} ^ {\prime} \left(z _ {h _ {\ell}}\right)}{\left| z _ {h _ {\ell}} \right| + \epsilon} \right] = 0 \tag {50}
+$$
+
+Variance Deriving the variance is more complicated:
+
+$$
+V a r \left[ \frac {\partial z _ {h _ {\ell + 1}}}{\partial z _ {h _ {\ell}}} \right] = V a r \left[ z _ {h _ {\ell + 1}} W _ {h _ {\ell + 1}, h _ {\ell}} \frac {\operatorname {a b s} ^ {\prime} \left(z _ {h _ {\ell}}\right)}{\left| z _ {h _ {\ell}} \right| + \epsilon} \right] \tag {51}
+$$
+
+Assuming again that $z_{h_{\ell +1}},W_{h_{\ell +1},h_{\ell}}$ , and $z_{h_\ell}$ are uncorrelated, and likewise for their second moment:
+
+$$
+\begin{array}{l} V a r \left[ \frac {\partial z _ {h _ {\ell + 1}}}{\partial z _ {h _ {\ell}}} \right] \approx E [ z _ {h _ {\ell + 1}} ^ {2} ] E [ W _ {h _ {\ell + 1}, h _ {\ell}} ^ {2} ] E \left[ \left(\frac {\mathrm {a b s} ^ {\prime} (z _ {h _ {\ell}})}{| z _ {h _ {\ell}} | + \epsilon}\right) ^ {2} \right] \\ - E [ z _ {h _ {\ell + 1}} ] ^ {2} E [ W _ {h _ {\ell + 1}, h _ {\ell}} ] ^ {2} E \left[ \frac {\mathrm {a b s} ^ {\prime} (z _ {h _ {\ell}})}{| z _ {h _ {\ell}} | + \epsilon} \right] ^ {2} \\ = E \left[ z _ {h _ {\ell + 1}} ^ {2} \right] \operatorname {V a r} \left[ W _ {h _ {\ell + 1}, h _ {\ell}} \right] E \left[ \left(\frac {\operatorname {a b s} ^ {\prime} \left(z _ {h _ {\ell}}\right)}{\left| z _ {h _ {\ell}} \right| + \epsilon}\right) ^ {2} \right] \tag {52} \\ - E [ z _ {h _ {\ell + 1}} ] ^ {2} \cdot 0 \cdot E \left[ \frac {\mathrm {a b s} ^ {\prime} (z _ {h _ {\ell}})}{| z _ {h _ {\ell}} | + \epsilon} \right] ^ {2} \\ = E [ z _ {h _ {\ell + 1}} ^ {2} ] V a r [ W _ {h _ {\ell + 1}, h _ {\ell}} ] E \left[ \left(\frac {\mathrm {a b s} ^ {\prime} (z _ {h _ {\ell}})}{| z _ {h _ {\ell}} | + \epsilon}\right) ^ {2} \right] \\ \end{array}
+$$
+
+Using Taylor approximation around $E[z_{h_\ell}]$ we have:
+
+$$
+\begin{array}{l} E \left[ \left(\frac {\operatorname {a b s} ^ {\prime} \left(z _ {h _ {\ell}}\right)}{| z | + \epsilon}\right) ^ {2} \right] \approx \frac {1}{\left(| E \left[ z _ {h _ {\ell}} \right] | + \epsilon\right) ^ {2}} + \frac {1}{2} \frac {6}{\left(| E \left[ z _ {h _ {\ell}} \right] | + \epsilon\right) ^ {4}} V a r \left[ z _ {h _ {\ell}} \right] \tag {53} \\ = \frac {1}{\left(| E [ z _ {h _ {\ell}} ] | + \epsilon\right) ^ {2}} + \frac {3}{\left(| E [ z _ {h _ {\ell}} ] | + \epsilon\right) ^ {4}} V a r [ z _ {h _ {\ell}} ] \\ \end{array}
+$$
+
+Finally, by reusing the result for $E[z_{h_\ell}^2]$ from earlier the variance can be expressed as:
+
+$$
+\begin{array}{l} V a r \left[ \frac {\partial \mathcal {L}}{\partial z _ {h _ {\ell - 1}}} \right] \approx V a r \left[ \frac {\partial \mathcal {L}}{\partial z _ {h _ {\ell}}} \right] H _ {\ell} (1 + 2 \cdot V a r [ W _ {h _ {\ell}, h _ {\ell - 1}} ] \log (| E [ z _ {h _ {\ell - 1}} ] | + \epsilon) ^ {2}) ^ {H _ {\ell - 1}} \\ \cdot \operatorname {V a r} \left[ W _ {h _ {\ell}, h _ {\ell - 1}} \right] \left(\frac {1}{\left(| E \left[ z _ {h _ {\ell - 1}} \right] | + \epsilon\right) ^ {2}} + \frac {3}{\left(| E \left[ z _ {h _ {\ell - 1}} \right] | + \epsilon\right) ^ {4}} \operatorname {V a r} \left[ z _ {h _ {\ell - 1}} \right]\right) \\ \end{array}
+$$
+
+# B.4 EXPECTATION AND VARIANCE OF NMU
+
+# B.4.1 FORWARD PASS
+
+Expectation Assuming that all $z_{h_{\ell -1}}$ are independent:
+
+$$
+\begin{array}{l} E \left[ z _ {h _ {\ell}} \right] = E \left[ \prod_ {h _ {\ell - 1} = 1} ^ {H _ {\ell - 1}} \left(W _ {h _ {\ell - 1}, h _ {\ell}} z _ {h _ {\ell - 1}} + 1 - W _ {h _ {\ell - 1}, h _ {\ell}}\right) \right] \tag {55} \\ \approx E \left[ W _ {h _ {\ell - 1}, h _ {\ell}} z _ {h _ {\ell - 1}} + 1 - W _ {h _ {\ell - 1}, h _ {\ell}} \right] ^ {H _ {\ell - 1}} \\ \approx \left(E \left[ W _ {h _ {\ell - 1}, h _ {\ell}} \right] E \left[ z _ {h _ {\ell - 1}} \right] + 1 - E \left[ W _ {h _ {\ell - 1}, h _ {\ell}} \right]\right) ^ {H _ {\ell - 1}} \\ \end{array}
+$$
+
+Assuming that $E[z_{h_{\ell -1}}] = 0$ which is a desired property and initializing $E[W_{h_{\ell -1},h_\ell}] = 1 / 2$ , the expectation is:
+
+$$
+\begin{array}{l} E \left[ z _ {h _ {\ell}} \right] \approx \left(E \left[ W _ {h _ {\ell - 1}, h _ {\ell}} \right] E \left[ z _ {h _ {\ell - 1}} \right] + 1 - E \left[ W _ {h _ {\ell - 1}, h _ {\ell}} \right]\right) ^ {H _ {\ell - 1}} \\ \approx \left(\frac {1}{2} \cdot 0 + 1 - \frac {1}{2}\right) ^ {H _ {\ell - 1}} \tag {56} \\ = \left(\frac {1}{2}\right) ^ {H _ {\ell - 1}} \\ \end{array}
+$$
+
+Variance Reusing the result for the expectation, assuming again that all $z_{h_{\ell -1}}$ are uncorrelated, and using the fact that $W_{h_{\ell -1},h_{\ell}}$ is initially independent from $z_{h_{\ell -1}}$ :
+
+$$
+\begin{array}{l} V a r [ z _ {h _ {\ell}} ] = E [ z _ {h _ {\ell}} ^ {2} ] - E [ z _ {h _ {\ell}} ] ^ {2} \\ \approx E \left[ z _ {h _ {\ell}} ^ {2} \right] - \left(\frac {1}{2}\right) ^ {2 \cdot H _ {\ell - 1}} \\ = E \left[ \prod_ {h _ {\ell - 1} = 1} ^ {H _ {\ell - 1}} \left(W _ {h _ {\ell - 1}, h _ {\ell}} z _ {h _ {\ell - 1}} + 1 - W _ {h _ {\ell - 1}, h _ {\ell}}\right) ^ {2} \right] - \left(\frac {1}{2}\right) ^ {2 \cdot H _ {\ell - 1}} \tag {57} \\ \approx E \left[ \left(W _ {h _ {\ell - 1}, h _ {\ell}} z _ {h _ {\ell - 1}} + 1 - W _ {h _ {\ell - 1}, h _ {\ell}}\right) ^ {2} \right] ^ {H _ {\ell - 1}} - \left(\frac {1}{2}\right) ^ {2 \cdot H _ {\ell - 1}} \\ = \left(E \left[ W _ {h _ {\ell - 1}, h _ {\ell}} ^ {2} \right] E \left[ z _ {h _ {\ell - 1}} ^ {2} \right] - 2 E \left[ W _ {h _ {\ell - 1}, h _ {\ell}} ^ {2} \right] E \left[ z _ {h _ {\ell - 1}} \right] + E \left[ W _ {h _ {\ell - 1}, h _ {\ell}} ^ {2} \right] \right. \\ \left. + 2 E \left[ W _ {h _ {\ell - 1}, h _ {\ell}} \right] E \left[ z _ {h _ {\ell - 1}} \right] - 2 E \left[ W _ {h _ {\ell - 1}, h _ {\ell}} \right] + 1\right) ^ {H _ {\ell - 1}} - \left(\frac {1}{2}\right) ^ {2 \cdot H _ {\ell - 1}} \\ \end{array}
+$$
+
+Assuming that $E[z_{h_{\ell - 1}}] = 0$ , which is a desired property and initializing $E[W_{h_{\ell - 1}, h_{\ell}}] = 1/2$ , the variance becomes:
+
+$$
+\begin{array}{l} V a r \left[ z _ {h _ {\ell}} \right] \approx \left(E \left[ W _ {h _ {\ell - 1}, h _ {\ell}} ^ {2} \right] \left(E \left[ z _ {h _ {\ell - 1}} ^ {2} \right] + 1\right)\right) ^ {H _ {\ell - 1}} - \left(\frac {1}{2}\right) ^ {2 \cdot H _ {\ell - 1}} \\ \approx \left(\left(V a r \left[ W _ {h _ {\ell - 1}, h _ {\ell}} \right] + E \left[ W _ {h _ {\ell - 1}, h _ {\ell}} \right] ^ {2}\right) \left(V a r \left[ z _ {h _ {\ell - 1}} \right] + 1\right)\right) ^ {H _ {\ell - 1}} - \left(\frac {1}{2}\right) ^ {2 \cdot H _ {\ell - 1}} \tag {58} \\ = \left(V a r \left[ W _ {h _ {\ell - 1}, h _ {\ell}} \right] + \frac {1}{4}\right) ^ {H _ {\ell - 1}} \left(V a r \left[ z _ {h _ {\ell - 1}} \right] + 1\right) ^ {H _ {\ell - 1}} - \left(\frac {1}{2}\right) ^ {2 \cdot H _ {\ell - 1}} \\ \end{array}
+$$
+
+# B.4.2 BACKWARD PASS
+
+Expectation For the backward pass the expectation can, assuming that $\frac{\partial\mathcal{L}}{\partial z_{h_\ell}}$ and $\frac{\partial z_{h_\ell}}{\partial z_{h_{\ell - 1}}}$ are uncorrelated, be derived to:
+
+$$
+\begin{array}{l} E \left[ \frac {\partial \mathcal {L}}{\partial z _ {h _ {\ell - 1}}} \right] = H _ {\ell} E \left[ \frac {\partial \mathcal {L}}{\partial z _ {h _ {\ell}}} \frac {\partial z _ {h _ {\ell}}}{\partial z _ {h _ {\ell - 1}}} \right] \\ \approx H _ {\ell} E \left[ \frac {\partial \mathcal {L}}{\partial z _ {h _ {\ell}}} \right] E \left[ \frac {\partial z _ {h _ {\ell}}}{\partial z _ {h _ {\ell - 1}}} \right] \tag {59} \\ = H _ {\ell} E \left[ \frac {\partial \mathcal {L}}{\partial z _ {h _ {\ell}}} \right] E \left[ \frac {z _ {h _ {\ell}}}{W _ {h _ {\ell - 1} , h _ {\ell}} z _ {h _ {\ell - 1}} + 1 - W _ {h _ {\ell - 1} , h _ {\ell}}} W _ {h _ {\ell - 1}, h _ {\ell}} \right] \\ = H _ {\ell} E \left[ \frac {\partial \mathcal {L}}{\partial z _ {h _ {\ell}}} \right] E \left[ \frac {z _ {h _ {\ell}}}{W _ {h _ {\ell - 1} , h _ {\ell}} z _ {h _ {\ell - 1}} + 1 - W _ {h _ {\ell - 1} , h _ {\ell}}} \right] E \left[ W _ {h _ {\ell - 1}, h _ {\ell}} \right] \\ \end{array}
+$$
+
+Initializing $E[W_{h_{\ell -1},h_{\ell}}] = 1 / 2$ , and inserting the result for the expectation $E\left[\frac{z_{h_\ell}}{W_{h_{\ell - 1},h_\ell}z_{h_{\ell - 1}} + 1 - W_{h_{\ell - 1},h_\ell}}\right]$ .
+
+$$
+\begin{array}{l} E \left[ \frac {\partial \mathcal {L}}{\partial z _ {h _ {\ell - 1}}} \right] \approx H _ {\ell} E \left[ \frac {\partial \mathcal {L}}{\partial z _ {h _ {\ell}}} \right] \left(\frac {1}{2}\right) ^ {H _ {\ell - 1} - 1} \frac {1}{2} \tag {60} \\ = E \left[ \frac {\partial \mathcal {L}}{\partial z _ {h _ {\ell}}} \right] H _ {\ell} \left(\frac {1}{2}\right) ^ {H _ {\ell - 1}} \\ \end{array}
+$$
+
+Assuming that $E\left[\frac{\partial\mathcal{L}}{\partial z_{h_\ell}}\right] = 0$ , which is a desired property (Glorot & Bengio, 2010).
+
+$$
+\begin{array}{l} E \left[ \frac {\partial \mathcal {L}}{\partial z _ {h _ {\ell - 1}}} \right] \approx 0 \cdot H _ {\ell} \cdot \left(\frac {1}{2}\right) ^ {H _ {\ell - 1}} \tag {61} \\ = 0 \\ \end{array}
+$$
+
+Variance For the variance of the backpropagation term, we assume that $\frac{\partial\mathcal{L}}{\partial z_{h_\ell}}$ is uncorrelated with $\frac{\partial z_{h_\ell}}{\partial z_{h_{\ell - 1}}}$ .
+
+$$
+\begin{array}{l} V a r \left[ \frac {\partial \mathcal {L}}{\partial z _ {h _ {\ell - 1}}} \right] = H _ {\ell} V a r \left[ \frac {\partial \mathcal {L}}{\partial z _ {h _ {\ell}}} \frac {\partial z _ {h _ {\ell}}}{\partial z _ {h _ {\ell - 1}}} \right] \\ \approx H _ {\ell} \left(V a r \left[ \frac {\partial \mathcal {L}}{\partial z _ {h _ {\ell}}} \right] E \left[ \frac {\partial z _ {h _ {\ell}}}{\partial z _ {h _ {\ell - 1}}} \right] ^ {2} + E \left[ \frac {\partial \mathcal {L}}{\partial z _ {h _ {\ell}}} \right] ^ {2} V a r \left[ \frac {\partial z _ {h _ {\ell}}}{\partial z _ {h _ {\ell - 1}}} \right]\right) \tag {62} \\ \left. + \operatorname {V a r} \left[ \frac {\partial \mathcal {L}}{\partial z _ {h _ {\ell}}} \right] \operatorname {V a r} \left[ \frac {\partial z _ {h _ {\ell}}}{\partial z _ {h _ {\ell - 1}}} \right]\right) \\ \end{array}
+$$
+
+Assuming again that $E\left[\frac{\partial\mathcal{L}}{\partial z_{h_{\ell}}}\right] = 0$ , and reusing the result $E\left[\frac{\partial z_{h_{\ell}}}{\partial z_{h_{\ell - 1}}}\right] = \left(\frac{1}{2}\right)^{H_{\ell -1}}$ .
+
+$$
+\operatorname {V a r} \left[ \frac {\partial \mathcal {L}}{\partial z _ {h _ {\ell - 1}}} \right] \approx \operatorname {V a r} \left[ \frac {\partial \mathcal {L}}{\partial z _ {h _ {\ell}}} \right] H _ {\ell} \left(\left(\frac {1}{2}\right) ^ {2 \cdot H _ {\ell - 1}} + \operatorname {V a r} \left[ \frac {\partial z _ {h _ {\ell}}}{\partial z _ {h _ {\ell - 1}}} \right]\right) \tag {63}
+$$
+
+Focusing now on $Var\left[\frac{\partial z_{h_{\ell}}}{\partial z_{h_{\ell - 1}}}\right]$ , we have:
+
+$$
+\begin{array}{l} \operatorname {V a r} \left[ \frac {\partial z _ {h _ {\ell}}}{\partial z _ {h _ {\ell - 1}}} \right] = E \left[ \left(\frac {z _ {h _ {\ell}}}{W _ {h _ {\ell - 1} , h _ {\ell}} z _ {h _ {\ell - 1}} + 1 - W _ {h _ {\ell - 1} , h _ {\ell}}}\right) ^ {2} \right] E \left[ W _ {h _ {\ell - 1}, h _ {\ell}} ^ {2} \right] \tag {64} \\ - E \left[ \frac {z _ {h _ {\ell}}}{W _ {h _ {\ell - 1} , h _ {\ell}} z _ {h _ {\ell - 1}} + 1 - W _ {h _ {\ell - 1} , h _ {\ell}}} \right] ^ {2} E [ W _ {h _ {\ell - 1}, h _ {\ell}} ] ^ {2} \\ \end{array}
+$$
+
+Inserting the result for the expectation $E\left[\frac{z_{h_\ell}}{W_{h_{\ell-1}, h_\ell} z_{h_{\ell-1}} + 1 - W_{h_{\ell-1}, h_\ell}}\right]$ and Initializing again $E[W_{h_{\ell-1}, h_\ell}] = 1/2$ .
+
+$$
+\begin{array}{l} \operatorname {V a r} \left[ \frac {\partial z _ {h _ {\ell}}}{\partial z _ {h _ {\ell - 1}}} \right] \approx E \left[ \left(\frac {z _ {h _ {\ell}}}{W _ {h _ {\ell - 1} , h _ {\ell}} z _ {h _ {\ell - 1}} + 1 - W _ {h _ {\ell - 1} , h _ {\ell}}}\right) ^ {2} \right] E \left[ W _ {h _ {\ell - 1}, h _ {\ell}} ^ {2} \right] \\ - \left(\frac {1}{2}\right) ^ {2 \cdot (H _ {\ell - 1} - 1)} \left(\frac {1}{2}\right) ^ {2} \\ = E \left[ \left(\frac {z _ {h _ {\ell}}}{W _ {h _ {\ell - 1} , h _ {\ell}} z _ {h _ {\ell - 1}} + 1 - W _ {h _ {\ell - 1} , h _ {\ell}}}\right) ^ {2} \right] E \left[ W _ {h _ {\ell - 1}, h _ {\ell}} ^ {2} \right] \tag {63} \\ - \left(\frac {1}{2}\right) ^ {2 \cdot H _ {\ell - 1}} \\ \end{array}
+$$
+
+Using the identity that $E[W_{h_{\ell - 1}, h_{\ell}}^{2}] = \text{Var}[W_{h_{\ell - 1}, h_{\ell}}] + E[W_{h_{\ell - 1}, h_{\ell}}]^{2}$ , and again using $E[W_{h_{\ell - 1}, h_{\ell}}] = \frac{1}{2}$ .
+
+$$
+\begin{array}{l} \operatorname {V a r} \left[ \frac {\partial z _ {h _ {\ell}}}{\partial z _ {h _ {\ell - 1}}} \right] \approx E \left[ \left(\frac {z _ {h _ {\ell}}}{W _ {h _ {\ell - 1} , h _ {\ell}} z _ {h _ {\ell - 1}} + 1 - W _ {h _ {\ell - 1} , h _ {\ell}}}\right) ^ {2} \right] \left(\operatorname {V a r} \left[ W _ {h _ {\ell - 1}, h _ {\ell}} \right] + \frac {1}{4}\right) \tag {66} \\ - \left(\frac {1}{2}\right) ^ {2 \cdot H _ {\ell - 1}} \\ \end{array}
+$$
+
+To derive $E\left[\left(\frac{z_{h_\ell}}{W_{h_{\ell-1},h_\ell}z_{h_{\ell-1}}+1-W_{h_{\ell-1},h_\ell}}\right)^2\right]$ the result for $Var[z_{h_\ell}]$ can be used, but for $\hat{H}_{\ell-1} = H_{\ell-1}-1$ , because there is one less term. Inserting $E\left[\left(\frac{z_{h_\ell}}{W_{h_{\ell-1},h_\ell}z_{h_{\ell-1}}+1-W_{h_{\ell-1},h_\ell}}\right)^2\right] = \left(Var[W_{h_{\ell-1},h_\ell}] + \frac{1}{4}\right)^{H_{\ell-1}-1}\left(Var[z_{h_{\ell-1}}]+1\right)^{H_{\ell-1}-1}$ , we have:
+
+$$
+\begin{array}{l} V a r \left[ \frac {\partial z _ {h _ {\ell}}}{\partial z _ {h _ {\ell - 1}}} \right] \approx \left(V a r \left[ W _ {h _ {\ell - 1}, h _ {\ell}} \right] + \frac {1}{4}\right) ^ {H _ {\ell - 1} - 1} \left(V a r \left[ z _ {h _ {\ell - 1}} \right] + 1\right) ^ {H _ {\ell - 1} - 1} \\ \cdot \left(V a r \left[ W _ {h _ {\ell - 1}, h _ {\ell}} \right] + \frac {1}{4}\right) - \left(\frac {1}{2}\right) ^ {2 \cdot H _ {\ell - 1}} \tag {67} \\ = \left(V a r \left[ W _ {h _ {\ell - 1}, h _ {\ell}} \right] + \frac {1}{4}\right) ^ {H _ {\ell - 1}} \left(V a r \left[ z _ {h _ {\ell - 1}} \right] + 1\right) ^ {H _ {\ell - 1} - 1} - \left(\frac {1}{2}\right) ^ {2 \cdot H _ {\ell - 1}} \\ \end{array}
+$$
+
+Inserting the result for $Var\left[\frac{\partial z_{h_{\ell}}}{\partial z_{h_{\ell - 1}}}\right]$ into the result for $Var\left[\frac{\partial \mathcal{L}}{\partial z_{h_{\ell - 1}}}\right]$ :
+
+$$
+\begin{array}{l} V a r \left[ \frac {\partial \mathcal {L}}{\partial z _ {h _ {\ell - 1}}} \right] \approx V a r \left[ \frac {\partial \mathcal {L}}{\partial z _ {h _ {\ell}}} \right] H _ {\ell} \left(\left(\frac {1}{2}\right) ^ {2 \cdot H _ {\ell - 1}} \right. \\ + \left(V a r \left[ W _ {h _ {\ell - 1}, h _ {\ell}} \right] + \frac {1}{4}\right) ^ {H _ {\ell - 1}} \left(V a r \left[ z _ {h _ {\ell - 1}} \right] + 1\right) ^ {H _ {\ell - 1} - 1} - \left(\frac {1}{2}\right) ^ {2 \cdot H _ {\ell - 1}} \tag {68} \\ = \operatorname {V a r} \left[ \frac {\partial \mathcal {L}}{\partial z _ {h _ {\ell}}} \right] H _ {\ell} \\ \cdot \left(\left(V a r \left[ W _ {h _ {\ell - 1}, h _ {\ell}} \right] + \frac {1}{4}\right) ^ {H _ {\ell - 1}} \left(V a r \left[ z _ {h _ {\ell - 1}} \right] + 1\right) ^ {H _ {\ell - 1} - 1}\right) \\ \end{array}
+$$
+
+# B.4.3 INITIALIZATION
+
+The $W_{h_{\ell -1},h_\ell}$ should be initialized with $E[W_{h_{\ell -1},h_\ell}] = \frac{1}{2}$ , in order to not bias towards inclusion or exclusion of $z_{h_{\ell -1}}$ . Using the derived variance approximations (68), the variance should be according to the forward pass:
+
+$$
+\operatorname {V a r} \left[ W _ {h _ {\ell - 1}, h _ {\ell}} \right] = \left(\left(1 + \operatorname {V a r} \left[ z _ {h _ {\ell}} \right]\right) ^ {- H _ {\ell - 1}} \operatorname {V a r} \left[ z _ {h _ {\ell}} \right] + \left(4 + 4 \operatorname {V a r} \left[ z _ {h _ {\ell}} \right]\right) ^ {- H _ {\ell - 1}}\right) ^ {\frac {1}{H _ {\ell - 1}}} - \frac {1}{4} \tag {69}
+$$
+
+And according to the backward pass it should be:
+
+$$
+\operatorname {V a r} \left[ W _ {h _ {\ell - 1}, h _ {\ell}} \right] = \left(\frac {\left(\operatorname {V a r} \left[ z _ {h _ {\ell}} \right] + 1\right) ^ {1 - H _ {\ell - 1}}}{H _ {\ell}}\right) ^ {\frac {1}{H _ {\ell - 1}}} - \frac {1}{4} \tag {70}
+$$
+
+Both criteria are dependent on the input variance. If the input variance is known then optimal initialization is possible. However, as this is often not the case one can perhaps assume that $Var[z_{h_{\ell -1}}] = 1$ . This is not an unreasonable assumption in many cases, as there may either be a normalization layer somewhere or the input is normalized. If unit variance is assumed, the variance for the forward pass becomes:
+
+$$
+V a r \left[ W _ {h _ {\ell - 1}, h _ {\ell}} \right] = \left(2 ^ {- H _ {\ell - 1}} + 8 ^ {- H _ {\ell - 1}}\right) ^ {\frac {1}{H _ {\ell - 1}}} - \frac {1}{4} = \frac {1}{8} \left(\left(4 ^ {H _ {\ell - 1}} + 1\right) ^ {H _ {\ell - 1}} - 2\right) \tag {71}
+$$
+
+And from the backward pass:
+
+$$
+V a r \left[ W _ {h _ {\ell - 1}, h _ {\ell}} \right] = \left(\frac {2 ^ {1 - H _ {\ell - 1}}}{H _ {\ell}}\right) ^ {\frac {1}{H _ {\ell - 1}}} - \frac {1}{4} \tag {72}
+$$
+
+The variance requirement for both the forward and backward pass can be satisfied with $Var[W_{h_{\ell - 1}, h_{\ell}}] = \frac{1}{4}$ for a large $H_{\ell - 1}$ .
+
+# C ARITHMETIC TASK
+
+The aim of the "Arithmetic task" is to directly test arithmetic models ability to extrapolate beyond the training range. Additionally, our generalized version provides a high degree of flexibility in how the input is shaped, sampled, and the problem complexity.
+
+Our "arithmetic task" is identical to the "simple function task" in the NALU paper (Trask et al., 2018). However, as they do not describe their setup in details, we use the setup from Madsen & Johansen (2019), which provide Algorithm 3, an evaluation-criterion to if and when the model has converged, the sparsity error, as well as methods for computing confidence intervals for success-rate and the sparsity error.
+
+
+Figure 6: Shows how the dataset is parameterized.
+
+# C.1 DATASET GENERATION
+
+The goal is to sum two random subsets of a vector $\mathbf{x}$ ( $a$ and $b$ ), and perform an arithmetic operation on these ( $a \circ b$ ).
+
+$$
+a = \sum_ {i = s _ {1, \text {s t a r t}}} ^ {s _ {1, \text {e n d}}} x _ {i}, \quad b = \sum_ {i = s _ {2, \text {s t a r t}}} ^ {s _ {2, \text {e n d}}} x _ {i}, \quad t = a \circ b \tag {73}
+$$
+
+Algorithm 1 defines the exact procedure to generate the data, where an interpolation range will be used for training and validation and an extrapolation range will be used for testing. Default values are defined in table 3.
+
+Table 3: Default dataset parameters for "Arithmetic task"
+
+| Parameter name | Default value |
| Input size | 100 |
| Subset ratio | 0.25 |
| Overlap ratio | 0.5 |
| Interpolation range | U[1, 2] |
| Extrapolation range | U[2, 6] |
+
+Algorithm 1 Dataset generation algorithm for "Arithmetic task"
+
+| 1: function DATASET(OP(·,·): Operation, i: InputSize, s: SubsetRatio, o: OverlapRatio, R: Range) |
| 2: x← UNIFORM(Rlower, Rupper, i) | ▷ Sample i elements uniformly |
| 3: k← UNIFORM(0, 1 - 2s - o) | ▷ Sample offset |
| 4: a← SUM(x[ik : i(k + s)]) | ▷ Create sum a from subset |
| 5: b← SUM(x[i(k + s - o) : i(k + 2s - 0)]) | ▷ Create sum b from subset |
| 6: t← OP(a, b) | ▷ Perform operation on a and b |
| 7: return x, t | |
+
+# C.2 MODEL DEFINITIONS AND SETUP
+
+Models are defined in table 4 and are all optimized with Adam optimization (Kingma & Ba, 2014) using default parameters, and trained over $5 \cdot 10^{6}$ iterations. Training takes about 8 hours on a single CPU core(8-Core Intel Xeon E5-2665 2.4GHz). We run 19150 experiments on a HPC cluster.
+
+The training dataset is continuously sampled from the interpolation range where a different seed is used for each experiment, all experiments use a mini-batch size of 128 observations, a fixed validation dataset with $1 \cdot 10^{4}$ observations sampled from the interpolation range, and a fixed test dataset with $1 \cdot 10^{4}$ observations sampled from the extrapolation range.
+
+Table 4: Model definitions
+
+| Model | Layer 1 | Layer 2 | λsparse | λstart | λend |
| N MU | NAU | N MU | 10 | 10^6 | 2·10^6 |
| NAU | NAU | NAU | 0.01 | 5·10^3 | 5·10^4 |
| NAC | NAC+ | NAC | - | - | - |
| NAC,σ | NAC+ | NAC,σ | - | - | - |
| NAC, N MU | NAC+ | NAC, N MU | 10 | 10^6 | 2·10^6 |
| NAC+ | NAC+ | NAC+ | - | - | - |
| NALU | NALU | NALU | - | - | - |
| Linear | Linear | Linear | - | - | - |
| ReLU | ReLU | ReLU | - | - | - |
| ReLU6 | ReLU6 | ReLU6 | - | - | - |
+
+# C.3 ABLATION STUDY
+
+To validate our model, we perform an ablation on the multiplication problem. Some noteworthy observations:
+
+1. None of the $W$ constraints, such as $\mathcal{R}_{\text{sparse}}$ and clamping $W$ to be in $[0, 1]$ , are necessary when the hidden size is just 2.
+2. Removing the $\mathcal{R}_{\text{sparse}}$ causes the NMU to immediately fail for larger hidden sizes.
+3. Removing the clamping of $W$ does not cause much difference. This is because $\mathcal{R}_{\text{sparse}}$ also constrains $W$ outside of [0, 1]. The regularizer used here is $\mathcal{R}_{\text{sparse}} = \min(|W|, |1 - W|)$ , which is identical to the one used in other experiments in [0, 1], but is also valid outside [0, 1]. Doing this gives only a slightly slower convergence. Although, this can not be guaranteed in general, as the regularizer is omitted during the initial optimization.
+4. Removing both constraints, gives a somewhat satisfying solution, but with a lower success rate, slower convergence, and higher sparsity error.
+
+In conclusion both constraints are valuable, as they provide faster convergence and a sparser solution, but they are not critical to the success-rate of the NMU.
+
+Figure 7: Ablation study where $\mathcal{R}_{\text {sparse }}$ is removed and the clamping of W is removed. There are 50 experiments with different seeds, for each configuration.
+
+model $\rightarrow$ NMU $\rightarrow$ NMU, no $R_{\mathrm{spare}}$ $\rightarrow$ NMU, no $R_{\mathrm{spare}}$ , no W-clamp $\rightarrow$ NMU, no W-clamp
+
+
+
+
+
+# C.4 EFFECT OF DATASET PARAMETER
+
+To stress test the models on the multiplication task, we vary the dataset parameters one at a time while keeping the others at their default value (default values in table 3). Each runs for 50 experiments with different seeds. The results, are visualized in figure 8.
+
+In figure 3, the interpolation-range is changed, therefore the extrapolation-range needs to be changed such it doesn't overlap. For each interpolation-range the following extrapolation-range is used: $\mathrm{U}[-2, -1]$ uses $\mathrm{U}[-6, -2]$ , $\mathrm{U}[-2, 2]$ uses $\mathrm{U}[-6, -2] \cup \mathrm{U}[2, 6]$ , $\mathrm{U}[0, 1]$ uses $\mathrm{U}[1, 5]$ , $\mathrm{U}[0.1, 0.2]$ uses $\mathrm{U}[0.2, 2]$ , $\mathrm{U}[1.1, 1.2]$ uses $\mathrm{U}[1.2, 6]$ , $\mathrm{U}[1, 2]$ uses $\mathrm{U}[2, 6]$ , $\mathrm{U}[10, 20]$ uses $\mathrm{U}[20, 40]$ .
+
+
+
+
+
+
+Figure 8: Shows the effect of the dataset parameters.
+
+# C.5 GATING CONVERGENCE EXPERIMENT
+
+In the interest of adding some understanding of what goes wrong in the NALU gate, and the shared weight choice that NALU employs to remedy this, we introduce the following experiment.
+
+We train two models to fit the arithmetic task. Both use the $\mathrm{NAC}_{+}$ in the first layer and NALU in the second layer. The only difference is that one model shares the weight between $\mathrm{NAC}_{+}$ and $\mathrm{NAC}_{\bullet}$ in the NALU, and the other treat them as two separate units with separate weights. In both cases NALU should gate between $\mathrm{NAC}_{+}$ and $\mathrm{NAC}_{\bullet}$ and choose the appropriate operation. Note that this NALU
+
+model is different from the one presented elsewhere in this paper, including the original NALU paper (Trask et al., 2018). The typical NALU model is just two NALU layers with shared weights.
+
+Furthermore, we also introduce a new gated unit that simply gates between our proposed NMU and NAU, using the same sigmoid gating-mechanism as in the NALU. This combination is done with separate weights, as NMU and NAU use different weight constrains and can therefore not be shared.
+
+The models are trained and evaluated over 100 different seeds on the multiplication and addition task. A histogram of the gate-value for all seeds is presented in figure 9 and table 5 contains a summary. Some noteworthy observations:
+
+1. When the NALU weights are separated far more trials converge to select $\mathrm{NAC}_{+}$ for both the addition and multiplication task. Sharing the weights between $\mathrm{NAC}_{+}$ and $\mathrm{NAC}_{\bullet}$ makes the gating less likely to converge for addition.
+2. The performance of the addition task is dependent on NALU selecting the right operation. In the multiplication task, when the right gate is selected, $\mathrm{NAC}_{\bullet}$ do not converge consistently, unlike our NMU that converges more consistently.
+3. Which operation the gate converges to appears to be mostly random and independent of the task. These issues are caused by the sigmoid gating-mechanism and thus exists independent of the used sub-units.
+
+These observations validate that the NALU gating-mechanism does not converge as intended. This becomes a critical issue when more gates are present, as is normally the case. E.g. when stacking multiple NALU layers together.
+
+
+Figure 9: Shows the gating-value in the NALU layer and a variant that uses NAU/NMU instead of $\mathrm{NAC}_{+} / \mathrm{NAC}_{\bullet}$ . Separate/shared refers to the weights in $\mathrm{NAC}_{+} / \mathrm{NAC}_{\bullet}$ used in NALU.
+
+Table 5: Comparison of the success-rate, when the model converged, and the sparsity error, with $95\%$ confidence interval on the "arithmetic datasets" task. Each value is a summary of 100 different seeds.
+
+| Op | Model | Success | Solved at iteration step | Sparsity error |
| | Rate | Median | Mean | Mean |
| × | Gated NAU/NMU | 62% +9% -10% | 1.5 · 106 | 1.5 · 106 +3.9·104-3.8·104 | 5.0 · 10-5 +2.3·10-5-1.8·10-5 |
| NALU (separate) | 22% +9% -7% | 2.8 · 106 | 3.3 · 106 +3.9·105-3.6·105 | 5.8 · 10-2 +4.1·10-2-2.3·10-2 |
| NALU (shared) | 24% +9% -7% | 2.9 · 106 | 3.3 · 106 +3.7·105-3.6·105 | 1.0 · 10-3 +1.1·10-3-4.5·10-4 |
| + | Gated NAU/NMU | 37% +10% -9% | 1.9 · 104 | 4.2 · 105 +7.3·104-6.7·104 | 1.7 · 10-1 +4.6·10-2-4.0·10-2 |
| NALU (separate) | 51% +10% -10% | 1.4 · 105 | 2.9 · 105 +3.5·104-4.3·104 | 1.8 · 10-1 +1.4·10-2-1.4·10-2 |
| NALU (shared) | 34% +10% -9% | 1.8 · 105 | 3.1 · 105 +4.3·104-5.4·104 | 1.8 · 10-1 +2.3·10-2-2.1·10-2 |
+
+# C.6 REGULARIZATION
+
+The $\lambda_{start}$ and $\lambda_{end}$ are simply selected based on how much time it takes for the model to converge. The sparsity regularizer should not be used during early optimization as this part of the optimization is exploratory and concerns finding the right solution by getting each weight on the right side of $\pm 0.5$ .
+
+In figure 10, 11 and 12 the scaling factor $\hat{\lambda}_{\mathrm{sparse}}$ is optimized.
+
+$$
+\lambda_ {\text {s p a r s e}} = \hat {\lambda} _ {\text {s p a r s e}} \max \left(\min \left(\frac {t - \lambda_ {\text {s t a r t}}}{\lambda_ {\text {e n d}} - \lambda_ {\text {s t a r t}}}, 1\right), 0\right) \tag {74}
+$$
+
+
+Figure 10: Shows effect of $\hat{\lambda}_{\mathrm{sparse}}$ in NAU on the arithmetic dataset for the $+$ operation.
+
+
+
+
+
+
+Figure 11: Shows effect of $\hat{\lambda}_{\mathrm{sparse}}$ in NAU on the arithmetic dataset for the - operation.
+
+
+
+
+
+
+Figure 12: Shows effect of $\hat{\lambda}_{\mathrm{sparse}}$ in NMU on the arithmetic dataset for the $\times$ operation.
+
+
+
+
+
+# C.7 COMPARING ALL MODELS
+
+Table 6 compares all models on all operations used in NALU (Trask et al., 2018). All variations of models and operations are trained for 100 different seeds to build confidence intervals. Some noteworthy observations are:
+
+1. Division does not work for any model, including the NAC and NALU models. This may seem surprising but is actually in line with the results from the NALU paper (Trask et al. (2018), table 1) where there is a large error given the interpolation range. The extrapolation range has a smaller error, but this is an artifact of their evaluation method where they normalize with a random baseline. Since a random baseline will have a higher error for the extrapolation range, errors just appear to be smaller. A correct solution to division should have both a small interpolation and extrapolation error.
+2. NAC $_{\bullet}$ and NALU are barely able to learn $\sqrt{z}$ , with just $2\%$ success-rate for NALU and $7\%$ success-rate for NAC $_{\bullet}$ .
+3. NMu is fully capable of learning $z^2$ . It learn this by learning the same subset twice in the NAU layer, this is also how NAC. learn $z^2$
+4. The Gated NAU/NMU (discussed in section C.5) works very poorly, because the NMU initialization assumes that $E[z_{h_{\ell -1}}] = 0$ . This is usually true, as discussed in section 2.6, but not in this case for the first layer. In the recommended NMU model, the NMU layer appears after NAU, which causes that assumption to be satisfied.
+
+Table 6: Comparison of the success-rate, when the model converged, and the sparsity error, with $95\%$ confidence interval on the "arithmetic datasets" task. Each value is a summary of 100 different seeds.
+
+| Op | Model | Success | Solved at iteration step | Sparsity error |
| | Rate | Median | Mean | Mean |
| × | NAC_,NMU | 93% +4%-7% | 1.8·10^6 | 2.0·10^6+1.0·10^-5-9.7·10^4 | 9.5·10^-7+4.2·10^-7-4.2·10^-7 |
| NAC_,σ | 100% +0%-4% | 2.5·10^6 | 2.6·10^6+8.8·10^-4-7.2·10^4 | 4.6·10^-5+5.0·10^-6-5.6·10^-6 |
| NAC_ | 31% +10%-8% | 2.8·10^6 | 3.0·10^6+2.9·10^-5-2.4·10^5 | 5.8·10^-4+4.8·10^-4-2.6·10^-4 |
| NAC_+ | 0% +4%-0% | — | — | — |
| Gated NAMU | 0% +4%-0% | — | — | — |
| Linear | 0% +4%-0% | — | — | — |
| NALU | 0% +4%-0% | — | — | — |
| NAU | 0% +4%-0% | — | — | — |
| NMU | 98% +1%-5% | 1.4·10^6 | 1.5·10^6+5.0·10^-4-6.6·10^4 | 4.2·10^-7+2.9·10^-8-2.9·10^-8 |
| ReLU | 0% +4%-0% | — | — | — |
| ReLU6 | 0% +4%-0% | — | — | — |
| / | NAC_,NMU | 0% +4%-0% | — | — | — |
| NAC_,σ | 0% +4%-0% | — | — | — |
| NAC_ | 0% +4%-0% | — | — | — |
| NAC_+ | 0% +4%-0% | — | — | — |
| Gated NAMU | 0% +4%-0% | — | — | — |
| Linear | 0% +4%-0% | — | — | — |
| NALU | 0% +4%-0% | — | — | — |
| NAU | 0% +4%-0% | —— | —— | —— |
| NIMU | 0% +4%-0% | — | — | — |
| ReLU | 0% +4%-0% | — | — | — |
| ReLU6 | 0% +4%-0% | — | — | — |
+
+Table 6: Comparison of the success-rate, when the model converged, and the sparsity error, with $95\%$ confidence interval on the "arithmetic datasets" task. Each value is a summary of 100 different seeds. (continued)
+
+| Op | Model | Success | Solved at | Sparsity error |
| | Rate | Median | Mean | Mean |
| + | NAC_,NMU | 0% +4% | — | — | — |
| NAC_,σ | 0% +4% | — | — | — |
| NAC_ | 0% +4% | — | — | — |
| NAC+ | 100% +0% | 2.5·10^5 | 4.9·10^5 +5.2·10^4 | 2.3·10^-1 +6.5·10^-3 |
| Gated NAMU | 0% +4% | — | — | — |
| Linear | 100% +0% | 6.1·10^4 | 6.3·10^4 +2.5·10^3 | 2.5·10^-1 +3.6·10^-4 |
| -4% | - | - | -3.6·10^-4 |
| NALU | 14% +8% | 1.5·10^6 | 1.6·10^6 +3.8·10^5 | 1.7·10^-1 +2.7·10^-2 |
| -5% | - | - | -2.5·10^-2 |
| NAU | 100% +0% | 1.8·10^4 | 3.9·10^5 +4.5·10^4 | 3.2·10^-5 +1.3·10^-5 |
| -4% | - | - | -1.3·10^-5 |
| N MU | 0% +4% | — | — | — |
| ReLU | 62% +9% | 6.2·10^4 | 7.6·10^4 +8.3·10^3 | 2.5·10^-1 +2.4·10^-3 |
| ReLU6 | 0% +4% | — | — | -2.4·10^-3 |
| - | NAC_,N MU | 0% +4% | — | — | — |
| NAC_,σ | 0% +4% | — | — | — |
| NAC_ | 0% +4% | — | — | — |
| NAC+ | 100% +0% | 9.0·10^3 | 3.7·10^5 +3.8·10^4 | 2.3·10^-1 +5.4·10^-3 |
| Gated NAMU | 0% +4% | — | — | -5.4·10^-3 |
| Linear | 7% +7% | 3.3·10^6 | 1.4·10^6 +7.0·10^5 | 1.8·10^-1 +7.2·10^-2 |
| -4% | - | - | -5.8·10^-2 |
| NALU | 14% +8% | 1.9·10^6 | 1.9·10^6 +4.4·10^5 | 2.1·10^-1 +2.2·10^-2 |
| -5% | - | - | -2.2·10^-2 |
| NAU | 100% +0% | 5.0·10^3 | 1.6·10^5 +1.7·10^4 | 6.6·10^-2 +2.5·10^-2 |
| -4% | - | - | -1.9·10^-2 |
| N MU | 56% +9% | 1.0·10^6 | 1.0·10^6 +5.8·10^2 | 3.4·10^-4 +3.2·10^-5 |
| ReLU | 0% +4% | — | — | -2.6·10^-5 |
| ReLU6 | 0% +4% | — | — | — |
| √z | NAC_,N MU | 3% +5% | 1.0·10^6 | 1.0·10^6 +NaN·10^-Inf | 1.7·10^-1 +8.3·10^-3 |
| -2% | — | - | -8.1·10^-3 |
| NAC_,σ | 0% +4% | — | — | — |
| NAC_ | 7% +7% | 4.0·10^5 | 1.5·10^6 +6.0·10^5 | 2.4·10^-1 +1.7·10^-2 |
| NAC+ | 0% +4% | — | — | -1.7·10^-2 |
| Gated NAMU | 0% +4% | — | — | — |
| Linear | 0% +4% | — | — | — |
| -0% | — | — | — |
| NALU | 2% +5% | 2.6·10^6 | 3.3·10^6 +1.8·10^6 | 5.0·10^-1 +2.5·10^-6 |
| NAU | 0% +4% | — | — | -8.0·10^-6 |
| N MU | 0% +4% | — | — | — |
| ReLU | 0% +4% | — | — | — |
| ReLU6 | 0% +4% | — | — | — |
+
+Table 6: Comparison of the success-rate, when the model converged, and the sparsity error, with $95\%$ confidence interval on the "arithmetic datasets" task. Each value is a summary of 100 different seeds. (continued)
+
+| Op | Model | Success | Solved at | Sparsity error |
| | Rate | Median | Mean | Mean |
| z2 | NAC, NMU | 100% +0% -4% | 1.4 · 106 | 1.5 · 106 +8.4·104-7.9·104 | 2.9 · 10-7+1.4·10-8-1.4·10-8 |
| NAC, σ | 100% +0% -4% | 1.9 · 106 | 1.9 · 106 +5.3·104-6.2·104 | 1.8 · 10-2+4.3·10-4-4.3·10-4 |
| NAC, | 77% +7% -9% | 3.3 · 106 | 3.2 · 106 +1.6·105-2.0·105 | 1.8 · 10-2+5.8·10-4-5.7·10-4 |
| NAC+ | 0% +4% -0% | — | — | — |
| Gated NAU | 0% +4% | — | — | — |
| Gated NMU | 0% -0% | — | — | — |
| Linear | 0% +4% -0% | — | — | — |
| NALU | 0% +4% -0% | — | — | — |
| NAU | 0% +4% -0% | — | — | — |
| NMU | 100% +0% -4% | 1.2 · 106 | 1.3 · 106 +3.1·104-3.6·104 | 3.7 · 10-5+5.4·10-5-3.7·10-5 |
| ReLU | 0% +4% -0% | — | — | — |
| ReLU6 | 0% +4% -0% | — | — | — |
+
+# D SEQUENTIAL MNIST
+
+# D.1 TASK AND EVALUATION CRITERIA
+
+The simple function task is a purely synthetic task, that does not require a deep network. As such it does not test if an arithmetic layer inhibits the networks ability to be optimized using gradient decent.
+
+The sequential MNIST task takes the numerical value of a sequence of MNIST digits and applies a binary operation recursively. Such that $t_i = O p(t_{i-1}, z_t)$ , where $z_t$ is the MNIST digit's numerical value. This is identical to the "MNIST Counting and Arithmetic Tasks" in Trask et al. (2018, section 4.2). We present the addition variant to validate the NAU's ability to backpropagate, and we add an additional multiplication variant to validate the NMU's ability to backpropagate.
+
+The performance of this task depends on the quality of the image-to-scalar network and the arithmetic layer's ability to model the scalar. We use mean-square-error (MSE) to evaluate joint image-to-scalar and arithmetic layer model performance. To determine an MSE threshold from the correct prediction we use an empirical baseline. This is done by letting the arithmetic layer be solved, such that only the image-to-scalar is learned. By learning this over multiple seeds an upper bound for an MSE threshold can be set. In our experiment we use the $1\%$ one-sided upper confidence-interval, assuming a student-t distribution.
+
+Similar to the simple function task we use a success-criteria as reporting the MSE is not interpretable and models that do not converge will obscure the mean. Furthermore, because the operation is applied recursively, natural error from the dataset will accumulate over time, thus exponentially increasing the MSE. Using a baseline model and reporting the successfulness solves this interpretation challenge.
+
+# D.2 ADDITION OFSEQUENTIAL MNIST
+
+Figure 13 shows results for sequential addition of MNIST digits. This experiment is identical to the MNIST Digit Addition Test from Trask et al. (2018, section 4.2). The models are trained on a sequence of 10 digits and evaluated on sequences between 1 and 1000 MNIST digits.
+
+Note that the NAU model includes the $R_{z}$ regularizer, similarly to the "Multiplication of sequential MNIST" experiment in section 4.2. However, because the weights are in $[-1,1]$ , and not $[0,1]$ , and the identity of addition is 0, and not 1, $R_{z}$ is
+
+$$
+\mathcal {R} _ {\mathrm {z}} = \frac {1}{H _ {\ell - 1} H _ {\ell}} \sum_ {h _ {\ell}} ^ {H _ {\ell}} \sum_ {h _ {\ell - 1}} ^ {H _ {\ell - 1}} \left(1 - \left| W _ {h _ {\ell - 1}, h _ {\ell}} \right|\right) \cdot \bar {z} _ {h _ {\ell - 1}} ^ {2}. \tag {75}
+$$
+
+To provide a fair comparison, a variant of $\mathrm{NAC}_{+}$ that also uses this regularizer is included, this variant is called $\mathrm{NAC}_{+,R_z}$ . Section D.3 provides an ablation study of the $R_{z}$ regularizer.
+
+Figure 13: Shows the ability of each model to learn the arithmetic operation of addition and backpropagate through the arithmetic layer in order to learn an image-to-scalar value for MNIST digits. The model is tested by extrapolating to larger sequence lengths than what it has been trained on. The NAU and $\mathrm{NAC}_{+,R_z}$ models use the $R_{z}$ regularizer from section 4.2.
+
+model $\rightarrow$ NAC+R2 $\rightarrow$ NAC+ LSTM $\rightarrow$ NALU $\rightarrow$ NAU
+
+
+Extrapolation length
+
+
+
+# D.3 SEQUENTIAL ADDITION WITHOUT THE $\mathbb{R}_z$ REGULARIZER
+
+As an ablation study of the $\mathrm{R}_z$ regularizer, figure 14 shows the NAU model without the $\mathrm{R}_z$ regularizer. Removing the regularizer causes a reduction in the success-rate. The reduction is likely larger, as compared to sequential multiplication, because the sequence length used for training is longer. The loss function is most sensitive to the 10th output in the sequence, as this has the largest scale. This causes some of the model instances to just learn the mean, which becomes passable for very long sequences, which is why the success-rate increases for longer sequences. However, this is not a valid solution. A well-behavior model should be successful independent of the sequence length.
+
+
+model $\rightarrow$ NAC+R2 $\rightarrow$ NAC+ LSTM $\rightarrow$ NALU $\rightarrow$ NAU
+
+
+Extrapolation length
+
+
+Figure 14: Same as figure 13, but where the NAU model do not use the $\mathbb{R}_z$ regularizer.
+
+# D.4 SEQUENTIAL MULTIPLICATION WITHOUT THE $\mathbb{R}_z$ REGULARIZER
+
+As an ablation study of the $\mathrm{R}_z$ regularizer figure 15 shows the NMU and $\mathrm{NAC}_{\bullet,\mathrm{NMU}}$ models without the $\mathrm{R}_z$ regularizer. The success-rate is somewhat similar to figure 4. However, as seen in the "sparsity error" plot, the solution is quite different.
+
+Figure 15: Shows the ability of each model to learn the arithmetic operation of addition and backpropagate through the arithmetic layer in order to learn an image-to-scalar value for MNIST digits. The model is tested by extrapolating to larger sequence lengths than what it has been trained on. The NMU and $\mathrm{NAC}_{\bullet,\mathrm{NMU}}$ models do not use the $\mathbb{R}_z$ regularizer.
+
+model $\rightarrow$ NAC $_{*,\text{NU}}$ $\rightarrow$ NAC $_{*,\sigma}$ $\rightarrow$ NAC. LSTM $\rightarrow$ NALU $\rightarrow$ NMU
+
+
+Extrapolation length
+
+
\ No newline at end of file
diff --git a/neuralarithmeticunits/images.zip b/neuralarithmeticunits/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..204cdc285c8dbbbe40d61a6d971b3df184f6d0e0
--- /dev/null
+++ b/neuralarithmeticunits/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:01485068957b8958a222ef607155ae439faaa7e13afb0deee42f9ad73731ec4a
+size 2306909
diff --git a/neuralarithmeticunits/layout.json b/neuralarithmeticunits/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..d3d6c0ea2f76b1c219c03a1ea7cbb205bbf4030d
--- /dev/null
+++ b/neuralarithmeticunits/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f588ef6fbc6f9438da5946ae0aea56bb3c20e6176c3ce464a6ca28e1a4b6eb66
+size 1024540
diff --git a/neuralmachinetranslationwithuniversalvisualrepresentation/05b8561d-41a1-4371-afec-f9dcf1cce83a_content_list.json b/neuralmachinetranslationwithuniversalvisualrepresentation/05b8561d-41a1-4371-afec-f9dcf1cce83a_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..72e521f468939d07af47f54c492aa0dd8285d8fb
--- /dev/null
+++ b/neuralmachinetranslationwithuniversalvisualrepresentation/05b8561d-41a1-4371-afec-f9dcf1cce83a_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:22993967f83781a3288023a9795828c38c8aa90d8a472b82fccf45d2107bf7fd
+size 74835
diff --git a/neuralmachinetranslationwithuniversalvisualrepresentation/05b8561d-41a1-4371-afec-f9dcf1cce83a_model.json b/neuralmachinetranslationwithuniversalvisualrepresentation/05b8561d-41a1-4371-afec-f9dcf1cce83a_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..fe11977cfee04efc89870c943f979cdc4efd8779
--- /dev/null
+++ b/neuralmachinetranslationwithuniversalvisualrepresentation/05b8561d-41a1-4371-afec-f9dcf1cce83a_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ab4ea69b56bac307ead1a61480ac334a035db43fff59726e8637525d72f1d4c8
+size 93869
diff --git a/neuralmachinetranslationwithuniversalvisualrepresentation/05b8561d-41a1-4371-afec-f9dcf1cce83a_origin.pdf b/neuralmachinetranslationwithuniversalvisualrepresentation/05b8561d-41a1-4371-afec-f9dcf1cce83a_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..7a0664200faeff9c08fe2402162238dcf0c87a5c
--- /dev/null
+++ b/neuralmachinetranslationwithuniversalvisualrepresentation/05b8561d-41a1-4371-afec-f9dcf1cce83a_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:6fe2183a7fc6ba3a1509a150740b9bcee67dccabe8f8f0b27e6da39aa102c85d
+size 16268109
diff --git a/neuralmachinetranslationwithuniversalvisualrepresentation/full.md b/neuralmachinetranslationwithuniversalvisualrepresentation/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..24da5bfad9abe0c23bf04e5129d872c0a62dbf6f
--- /dev/null
+++ b/neuralmachinetranslationwithuniversalvisualrepresentation/full.md
@@ -0,0 +1,297 @@
+# NEURAL MACHINE TRANSLATION WITH UNIVERSAL VISUAL REPRESENTATION
+
+Zhuosheng Zhang $^{1,2,3}$ , Kehai Chen $^{4}$ , Rui Wang $^{4,*}$ , Masao Utiyama $^{4}$ , Eiichiro Sumita $^{4}$ , Zuchao Li $^{1,2,3}$ , Hai Zhao $^{1,2,3,*}$
+
+$^{1}$ Department of Computer Science and Engineering, Shanghai Jiao Tong University
+$^{2}$ Key Laboratory of Shanghai Education Commission for Intelligent Interaction and Cognitive Engineering, Shanghai Jiao Tong University, Shanghai, China
+$^{3}$ MoE Key Lab of Artificial Intelligence, AI Institute, Shanghai Jiao Tong University
+$^{4}$ National Institute of Information and Communications Technology (NICT), Kyoto, Japan
+zhangzs@sjtu.edu.cn, charlee@sjtu.edu.cn, zhaohai@cs.sjtu.edu.cn, {khchen, wangrui, mutiyama, eiichiro,sumita}@nict.go.jp
+
+# ABSTRACT
+
+Though visual information has been introduced for enhancing neural machine translation (NMT), its effectiveness strongly relies on the availability of large amounts of bilingual parallel sentence pairs with manual image annotations. In this paper, we present a universal visual representation learned over the monolingual corpora with image annotations, which overcomes the lack of largescale bilingual sentence-image pairs, thereby extending image applicability in NMT. In detail, a group of images with similar topics to the source sentence will be retrieved from a light topic-image lookup table learned over the existing sentence-image pairs, and then is encoded as image representations by a pretrained ResNet. An attention layer with a gated weighting is to fuse the visual information and text information as input to the decoder for predicting target translations. In particular, the proposed method enables the visual information to be integrated into large-scale text-only NMT in addition to the multimodal NMT. Experiments on four widely used translation datasets, including the WMT'16 English-to-Romanian, WMT'14 English-to-German, WMT'14 English-to-French, and Multi30K, show that the proposed approach achieves significant improvements over strong baselines.
+
+# 1 INTRODUCTION
+
+Visual information has been introduced for neural machine translation in some previous studies (NMT) (Specia et al., 2016; Elliott et al., 2017; Barrault et al., 2018; Ive et al., 2019) though the contribution of images is still an open question (Elliott, 2018; Caglayan et al., 2019). Typically, each bilingual (or multilingual) parallel sentence pair is annotated manually by one image describing the content of this sentence pair. The bilingual parallel corpora with manual image annotations are used to train a multimodal NMT model by an end-to-end framework, and results are reported on a specific data set, Multi30K (Calixto & Liu, 2017; Calixto et al., 2017).
+
+One strong point of the multimodal NMT model is the ability to use visual information to improve the quality of the target translation. However, the effectiveness heavily relies on the availability of bilingual parallel sentence pairs with manual image annotations, which hinders the image applicability to the NMT. As a result, the visual information is only applied to the translation task over a small and specific multimodal data set Multi30K (Elliott et al., 2016), but not to large-scale text-only NMT (Bahdanau et al., 2014; Gehring et al., 2017; Vaswani et al., 2017) and low-resource
+
+text-only NMT (Fadaee et al., 2017; Lample et al., 2018; Ma et al., 2019; Zhou et al., 2019). In addition, because of the high cost of annotation, the content of one bilingual parallel sentence pair is only represented by a single image, which is weak in capturing the diversity of visual information. The current situation of introducing visual information results in a bottleneck in the multimodal NMT and is not feasible for text-only NMT and low-resource NMT.
+
+In this paper, we present a universal visual representation (VR) method relying only on image-monolingual annotations instead of the existing approach that depends on image-bilingual annotations, thus breaking the bottleneck of using visual information in NMT. In detail, we transform the existing sentence-image pairs into a topic-image lookup table from a small-scale multimodal data set Multi30K. During the training and decoding process, a group of images with a similar topic to the source sentence will be retrieved from the topic-image lookup table learned by the term frequency-inverse document frequency, and thus is encoded as image representations by a pretrained ResNet (He et al., 2016). A simple and effective attention layer is then designed to fuse the image representations and the original source sentence representations as input to the decoder for predicting target translations. In particular, the proposed approach can be easily integrated into the text-only NMT model without annotating large-scale bilingual parallel corpora. The proposed method was evaluated on four widely-used translation datasets, including the WMT'16 English-to-Romanian, WMT'14 English-to-German, WMT'14 English-to-French, and Multi30K which are standard corpora for NMT and multimodal machine translation (MMT) evaluation. Experiments and analyses show effectiveness. In summary, our contributions are primarily three-fold:
+
+1. We present a universal visual representation method that overcomes the shortcomings of the bilingual (or multilingual) parallel data with manual image annotations for MMT.
+2. The proposed method enables the text-only NMT to use the multimodality of visual information without annotating the existing large scale bilingual parallel data.
+3. Experiments on different scales of translation tasks verified the effectiveness and generality of the proposed approach.
+
+# 2 RELATED WORK
+
+Building fine-grained representation with extra knowledge is an essential topic in language modeling (Li et al., 2020a;b; Zhang et al., 2020b;a), among which adopting visual modality could potentially benefit the machine with a more comprehensive perception of the real world. Inspired by the studies on the image description generation (IDG) task (Mao et al., 2014; Elliott et al., 2015; Venugopalan et al., 2015; Xu et al., 2015), a new shared translation task for multimodal machine translation was addressed by the machine translation community (Specia et al., 2016). In particular, the released dataset Multi30K (Elliott et al., 2016) includes 29,000 multilingual (English, German, and French) parallel sentence pairs with image annotations (Elliott et al., 2017; Barrault et al., 2018). Subsequently, there has been a rise in the number of studies (Caglayan et al., 2016; 2017; Calixto et al., 2016; Huang et al., 2016; Libovický & Helcl, 2017; Helcl et al., 2018). For example, Calixto et al. (2017) proposed a doubly-attentive multimodal NMT model to incorporate spatial-visual features, improving translation performance. Compared with spatial-visual features, Calixto & Liu (2017) further incorporated global image features as words in the source sentence and to enhance the encoder or decoder hidden state. In contrast, some recent studies indicated that the visual modality is either unnecessary (Zhang et al., 2017) or only marginally beneficial (Grönroos et al., 2018). More recently, Ive et al. (2019) showed that visual information is only needed in particular cases, such as for ambiguous words where the textual context is not sufficient.
+
+However, these approaches only center around a small and specific Multi30K data set to build a multimodal NMT model, which hinders image applicability to NMT. The reason would be the high cost of image annotations, resulting potentially in the image information not being adequately discovered. We believe that the capacity of MMT has not yet been excavated sufficiently, and there is still a long way to go before the potential of MMT is fully discovered. In this work, we seek to break this constraint and enable visual information to benefit NMT, especially text-only NMT.
+
+# 3 UNIVERSAL VISUAL RETRIEVAL
+
+Algorithm 1 Topic-image Lookup Table Conversion Algorithm
+Require: Input sentences, $S = \{X_1,X_2,\dots X_I\}$ and paired images $E = \{e_1,e_2,\dots ,e_I\}$
+Ensure: Topic-image lookup table $\mathcal{Q}$ where each word is associated with a group of images 1:Obtain the TF-IDF dictionary $\mathcal{F} =$ TF-IDF(S)
+2:Transform sentence-image pair to topic-image lookup table $\mathcal{Q} =$ LookUp(S,E,F)
+3: procedure TF-IDF(S)
+4: for each sentence in $S$ do
+5: Filter stop-words in the sentence
+6: Calculate the TF-IDF weight for each word
+7: end for
+8: return TF-IDF dictionary $\mathcal{F}$
+9: end procedure
+10: procedure LOOKUP(S,E,F)
+11: For each pair $\{T_i,e_i\} \in$ zip $\{S,E\}$ do
+12: Rank and pick out the top- $w$ "topic" words in the sentence according to the TF-IDF score in the dictionary $\mathcal{F}$ , and each sentence is reformed as $T = \{t_1,t_2,\ldots ,t_w\}$
+13: Pair the $w$ words with the corresponding image $e_i$
+14: for For each word $t_j$ in $T$ do
+15: if $e_i$ not in $\mathcal{Q}[t_j]$ then
+16: Add $e_j$ to the corresponding image set $\mathcal{Q}[t_j]$ for word $t_j$
+17: end if
+18: end for
+19: end for
+20: return Topic-image lookup table $\mathcal{Q}$
+21: end procedure
+
+In this section, we will introduce the proposed universal visual representation method. Generally, the default input setting of the MMT is a sentence-image pair. Our basic intuition is to transform the existing sentence-image pairs into topic-image lookup table2, which assumes the topic words in a sentence should be relevant to the paired image. Consequently, a sentence can possess a group of images by retrieving the topic-image lookup table.
+
+Topic-image Lookup Table Conversion To focus on the major part of the sentence and suppress the noise such as stopwords and low-frequency words, we design a filtering method to extract the "topic" words of the sentence through the term frequency-inverse document frequency (TF-IDF)3 inspired by Chen et al. (2019). Specifically, given an original input sentence $X = \{x_{1}, x_{2}, \ldots, x_{I}\}$ of length $I$ and its paired image $e$ , $X$ is first filtered by a stopwords list4 and then the sentence is treated as a document $g$ . We then compute TF-IDF $T I_{i,j}$ for each word $x_{i}$ in $g$ ,
+
+$$
+T I _ {i, j} = \frac {o _ {i , j}}{\sum_ {k} o _ {k , j}} \times \log \frac {| G |}{1 + | j : x _ {i} \in g |}, \tag {1}
+$$
+
+where $o_{i,j}$ represents the number of occurrences of the word $x_i$ in the input sentence $g$ , $|G|$ the total number of source language sentences in the training data, and $|j : x_i \in g|$ the number of source sentences including word $x_i$ in the training data. We then select the top- $w$ high TF-IDF words as the new image description $T = \{t_1, t_2, \ldots, t_w\}$ for the input sentence $X$ . After preprocessing, each filtered sentence $T$ is paired with an image $e$ , and each word $t_i \in T$ is regarded as the topic word for image $e$ . After processing the whole corpus (i.e., Multi30K), we form a topic-image lookup table $Q$ as described in Algorithm 1, in which each topic word $t_i$ would be paired with dozens of images.
+
+Image Retrieval For the input sentence, we first obtain its topic words according to the text preprocessing method described above. Then we retrieve the associated images for each topic word
+
+
+Figure 1: Illustration of the proposed visual retrieval.
+
+from the lookup table $\mathcal{Q}$ and group all the retrieved images together to form an image list $\mathcal{G}$ . We observe that an image might be associated with multiple topic words so that it would occur multiple times in the list $\mathcal{G}$ . Therefore, we sort the images according to the frequency of occurrences in $\mathcal{G}$ to maintain the total number of images for each sentence at $m$ .
+
+Figure 1 illustrates the retrieval process5. In the left block, we show six examples of sentence-image pairs in which the topic words are in boldface. Then we process the corpus using the topic-image transformation method demonstrated above and obtain the topic-image lookup table. For example, the word dog is associated with 1,512 images. For an input source sentence, we obtain the topic words (in boldface) using the same preprocessing. Then we retrieve the corresponding images from the lookup table for each topic word. Now we have a list of images, and some images appear multiple times as they have various topics (like the boxed image in Figure 1). So we sort the retrieved image list by the count of occurrence to pick out the top- $m$ images that cover the most topics of the sentence.
+
+At test time, the process of getting images is done using the image lookup table built by the training set, so we do not need to use the images from the dev and test sets in Multi30K dataset. Intuitively, we do not strictly require the manual alignment of the word (or concept) and image, but rely on the co-occurrence of topic word and image, which is simpler and more general. In this way, we call our method as universal visual retrieval.
+
+# 4 NMT WITH UNIVERSAL VISUAL REPRESENTATION
+
+In this section, we introduce the proposed universal visual representation (VR) method for NMT. The overview of the framework of our proposed method is shown in Figure 2.
+
+# 4.1 SOURCE REPRESENTATION FOR NEURAL MACHINE TRANSLATION
+
+In the state-of-the-art Transformer-based NMT (Vaswani et al., 2017), source information is encoded as source representation by an SAN-based encoder with multiple layers. Specifically, the encoder is composed of a stack of $L$ identical layers, each of which includes two sub-layers. The first sub-layer is a self-attention module, whereas the second is a position-wise, fully connected feed-forward network. A residual connection (He et al., 2016) is applied between the two sub-layers, and then
+
+
+Figure 2: Overview of the framework of our proposed method.
+
+a layer normalization (Ba et al., 2016) is performed. Formally, the stack of learning the source representation is organized as follows:
+
+$$
+\overline {{\mathbf {H}}} ^ {l} = \operatorname {L N} (\operatorname {A T T} ^ {l} (\mathbf {Q} ^ {l - 1}, \mathbf {K} ^ {l - 1}, \mathbf {V} ^ {l - 1}) + \mathbf {H} ^ {l - 1}),
+$$
+
+$$
+\mathbf {H} ^ {l} = \operatorname {L N} \left(\operatorname {F F N} ^ {l} \left(\overline {{\mathbf {H}}} ^ {l}\right) + \overline {{\mathbf {H}}} ^ {l}\right), \tag {2}
+$$
+
+where $\mathrm{ATT}^l (\cdot)$ , $\mathrm{LN}(\cdot)$ , and $\mathrm{FFN}^l (\cdot)$ are the attention module, layer normalization, and the feedforward network for the $l$ -th identical layer, respectively. $\{\mathbf{Q}^{l - 1},\mathbf{K}^{l - 1},\mathbf{V}^{l - 1}\}$ are query, key, and value vectors that are transformed from the $(l - 1)$ -th layer $\mathbf{H}^{l - 1}$ . For example, $\{\pmb {Q}^0,\pmb {K}^0,\pmb {V}^0\}$ are packed from the summation $\mathbf{H}^0$ of the positional embeddings and word embeddings. Finally, the output of the stack of $L$ identical layers $\mathbf{H}^L$ is the final source sentence representation.
+
+# 4.2 AGGREGATION FOR TEXT AND IMAGE REPRESENTATIONS
+
+After retrieval as described in Section 3, each original sentence $X = \{x_{1}, x_{2}, \ldots, x_{I}\}$ is paired with $m$ images $E = \{e_{1}, e_{2}, \ldots, e_{m}\}$ retrieved from the topic-image lookup table $\mathcal{Q}$ . First, the source sentence $X = \{x_{1}, x_{2}, \ldots, x_{I}\}$ is fed into the encoder (Eq.2) to learn the source sentence representation $\mathbf{H}^{L}$ . Second, the images $E = \{e_{1}, e_{2}, \ldots, e_{m}\}$ are the inputs to a pre-trained ResNet (He et al., 2016) followed by a feed forward layer to learn the source image representation $textM \in R^{m \times 2048}$ . Then, we apply an attention mechanism7 to append the image representation to the text representation:
+
+$$
+\overline {{\mathcal {H}}} = \operatorname {A T T} _ {\mathcal {M}} \left(\mathbf {H} ^ {L}, \mathbf {K} _ {\mathcal {M}}, \mathbf {V} _ {\mathcal {M}}\right), \tag {3}
+$$
+
+where $\{\mathbf{K}_{\mathcal{M}},\mathbf{V}_{\mathcal{M}}\}$ are packed from the learned source image representation $\mathcal{M}$ .
+
+Intuitively, NMT aims to produce a target word sequence with the same meaning as the source sentence rather than a group of images. In other words, the image information may play an auxiliary effect during the translation prediction. Therefore, we compute $\lambda \in [0,1]$ to weight the expected importance of source image representation for each source word:
+
+$$
+\lambda = \operatorname {s i g m o i d} \left(\mathbf {W} _ {\lambda} \overline {{\boldsymbol {\mathcal {H}}}} + \mathbf {U} _ {\lambda} \mathbf {H} ^ {L}\right), \tag {4}
+$$
+
+where $\mathbf{W}_{\lambda}$ and $\mathbf{U}_{\lambda}$ are model parameters. We then fuse $\mathbf{H}^L$ and $\overline{\mathcal{H}}$ to learn an effective source representation:
+
+$$
+\boldsymbol {\mathcal {H}} = \mathbf {H} ^ {L} + \lambda \overline {{\boldsymbol {\mathcal {H}}}}. \tag {5}
+$$
+
+Finally, $\mathcal{H}$ is fed to the decoder to learn a dependent-time context vector for predicting target translation. Note that there is a single aggregation layer to fuse image and text information.
+
+# 5 EXPERIMENTS
+
+# 5.1 DATA
+
+The proposed method was evaluated on four widely-used translation datasets, including WMT'16 English-to-Romanian (EN-RO), WMT'14 English-to-German (EN-DE), WMT'14 English-to-French (EN-DE), and Multi30K which are standard corpora for NMT and MMT evaluation.
+
+1) For the EN-RO task, we experimented with the officially provided parallel corpus: Europarl v7 and SETIMES2 from WMT'16 with 0.6M sentence pairs. We used newsdev2016 as the dev set and newstest2016 as the test set.
+2) For the EN-DE translation task, 4.43M bilingual sentence pairs of the WMT14 dataset were used as training data, including Common Crawl, News Commentary, and Europarl v7. The newstest2013 and newstest2014 datasets were used as the dev set and test set, respectively.
+3) For the EN-FR translation task, 36M bilingual sentence pairs from the WMT14 dataset were used as training data. Newstest12 and newstest13 were combined for validation and newstest14 was used as the test set, following the setting of Gehring et al. (2017).
+4) The Multi30K dataset contains 29K English $\rightarrow$ {German, French} parallel sentence pairs with visual annotations. The 1,014 English $\rightarrow$ {German, French} sentence pairs visual annotations are as dev set. The test sets are test2016 and test2017 with 1,000 pairs for each.
+
+# 5.2 SYSTEM SETTING
+
+Image Retrieval Implementation We used 29,000 sentence-image pairs from Multi30K to build the topic-image lookup table. We segmented the sentences using the same BPE vocabulary as that for each source language. We selected top-8 ( $w = 8$ ) high TF-IDF words, and the default number of images $m$ was set 5. The detailed case study is shown in Section 6.2. After preprocessing, we had about 3K topic words, associated with a total of 10K images for retrieval. Image features were extracted from the averaged pooled features of a pre-trained ResNet50 CNN (He et al., 2016). This led to feature maps $V \in R^{2048}$ .
+
+**Baseline** Our baseline was text-only Transformer (Vaswani et al., 2017). We used six layers for the encoder and the decoder. The number of dimensions of all input and output layers was set to 512 and 1024 for base and big models. The inner feed-forward neural network layer was set to 2048. The heads of all multi-head modules were set to eight in both encoder and decoder layers. For the Multi30K dataset, we further evaluated a multimodal baseline (denoted as MMT) where each source sentence was paired with an original image. The other settings were the same as our proposed model.
+
+Model Implementation The byte pair encoding algorithm was adopted, and the size of the vocabulary was set to 40,000. In each training batch, a set of sentence pairs contained approximately $4096 \times 4$ source tokens and $4096 \times 4$ target tokens. During training, the value of label smoothing was set to 0.1, and the attention dropout and residual dropout were $p = 0.1$ . We used Adam optimizer (Kingma & Ba, 2014) to tune the parameters of the model. The learning rate was varied
+
+| System | Architecture | EN-RO | EN-DE | EN-FR |
| BLEU | #Param | BLEU | #Param | BLEU | #Param |
| Existing NMT systems |
| Vaswani et al. (2017) | Trans. (base) | N/A | N/A | 27.3 | N/A | 38.1 | N/A |
| Trans. (big) | N/A | N/A | 28.4 | N/A | 41.0 | N/A |
| Lee et al. (2018) | Trans. (base) | 32.40 | N/A | 24.57 | N/A | N/A | N/A |
| Our NMT systems |
| This work | Trans. (base) | 32.66 | 61.54M | 27.31 | 63.44M | 38.52 | 63.83M |
| +VR | 33.78++ | 63.04M | 28.14++ | 64.94M | 39.64++ | 65.33M |
| Trans. (big) | 33.85 | 207.02M | 28.45 | 210.88M | 41.10 | 211.66M |
| +VR | 34.46+ | 211.02M | 29.14++ | 214.89M | 41.83+ | 215.66M |
+
+Table 1: Results on EN-RO, EN-DE, and EN-FR for the NMT tasks. Trans. is short for transformer. N/A denotes that those numbers are not reported in the corresponding literature. “++/+” after the BLEU score indicate that the proposed method was significantly better than the corresponding baseline Transformer (base or big) at significance level $p < 0.01 / 0.05$ .
+
+under a warm-up strategy with 8,000 steps. For evaluation, we validated the model with an interval of 1,000 batches on the dev set. For the Multi30K dataset, we trained the model up to 10,000 steps, and the training was early-stopped if dev set BLEU score did not improve for ten epochs. For the EN-DE, EN-RO, and EN-FR tasks, following the training of 200,000 batches, the model with the highest BLEU score of the dev set was selected to evaluate the test sets. During the decoding, the beam size was set to five. All models were trained and evaluated on a single V100 GPU. Multi-bleu.perl8 was used to compute case-sensitive 4-gram BLEU scores for all test sets. The signtest (Collins et al., 2005) is a standard statistical-significance test. In addition, we followed the model configurations of Vaswani et al. (2017) to train Big models for WMT EN-RO, EN-DE, and EN-FR translation tasks. All experiments were conducted with fairseq9 (Ott et al., 2019). The analysis in Section 6 is conducted on base models.
+
+# 5.3 RESULTS
+
+Table 1 shows the results for the WMT'14 EN-DE, EN-FR, and WMT'16 EN-RO translation tasks. Our implemented Transformer (base/big) models showed similar BLEU scores with the original Transformer (Vaswani et al., 2017), ensuring that the proposed method can be evaluated over strong baseline NMT systems. As seen, the proposed +VR significantly outperformed the baseline Transformer (base), demonstrating the effectiveness of modeling visual information for text-only NMT. In particular, the effectiveness was adapted to the translation tasks of the three language pairs, which have different scales of training data, verifying that the proposed approach is a universal method for improving translation performance.
+
+Our method introduced only 1.5M and 4.0M parameters for the base and big transformers, respectively. The number is less than $3\%$ of the baseline parameters as we used the fixed image embeddings from the pre-trained ResNet feature extractor. Besides, the training time was basically the same as the baseline model (Section 6.4).
+
+In addition, the proposed method was also evaluated for MMT on the multimodal dataset, Multi30K. Results in Table 2 show that our model also outperformed the transformer baseline. Compared with the results in text-only NMT, we find that the image presentation gave marginal contribution, which was consistent with the findings in previous work (Zhang et al., 2017; Gronroos et al., 2018; Caglayan et al., 2019). The most plausible reason might be that the sentences in Multi30K are so simple, short, and repetitive that the source text is sufficient to perform the translation (Caglayan et al., 2019; Ive et al., 2019). This verifies our assumption of the current bottleneck of MMT due to the limitation of Multi30K and shows the necessity of our new setting of transferring multimodality into more standard and mature text-only NMT tasks.
+
+| System | Architecture | EN-DE | EN-FR |
| Test2016 | Test2017 | #Param | Test2016 | Test2017 | #Param |
| Existing NMT systems |
| Calixto et al. (2017) | RNN | 33.7 | N/A | N/A | N/A | N/A | N/A |
| Elliott et al. (2017) | RNN | N/A | 19.3 | N/A | N/A | 44.3 | N/A |
| Elliott & Kádár (2017) | Imagination | 36.8 | N/A | N/A | N/A | N/A | N/A |
| Ive et al. (2019) | Trans. (big) | 36.4 | N/A | N/A | 59.0 | N/A | N/A |
| Del | 38.0 | N/A | N/A | 60.1 | N/A | N/A |
| Our NMT systems |
| This work | MMT. (base) | 35.09 | 27.10 | 50.72M | 57.40 | 48.02 | 50.65M |
| MMT. (big) | 35.60 | 28.02 | 190.58M | 57.87 | 49.63 | 190.43M |
| Trans. (base) | 35.59 | 26.31 | 49.15M | 57.88 | 48.55 | 49.07M |
| +VR | 35.72 | 26.87 | 50.72M | 58.32 | 48.69 | 50.65M |
| Trans. (big) | 36.86 | 27.62 | 186.38M | 56.97 | 48.17 | 186.23M |
| +VR | 36.94 | 28.63 | 190.58M | 57.53 | 48.46 | 190.43M |
+
+Table 2: Results from the test2016 and test2017 for the MMT task. Del denotes the deliberation network in (Ive et al., 2019). Elliott et al. (2017) is the official baseline (text-only NMT) on WMT17-Multi30K 2017 test data. Trans. is short for transformer and MMT is the multimodal baseline described in Section 5.2. Because we used the same model for test2016 and test2017 evaluation, the numbers of parameters are the same.
+
+# 6 ANALYSIS
+
+# 6.1 WHY DOES THE LOOKUP TABLE WORK
+
+The contribution of the lookup table could be two folds: 1) the content connection of the sentences and images; 2) the topic-aware co-occurrence of similar images and sentences. There are cases when paired images are not accurately related to the given sentence. A simple solution is to set a threshold heuristically for the TF-IDF retrieval to filter out the "improper" images. However, we maintain the specific number of the images in this work because of the second potential benefits of the co-occurrence, by taking images as diverse topic information. According to Distributional Hypothesis (Harris, 1954), which states that words that occur in similar contexts tend to have similar meanings, we are inspired to extend the concept in the multimodal world, the sentences with similar meanings would be likely to pair with similar even the same images. Therefore, the consistent images (with a related topic) could play the role of topic or type hints for similar sentence modeling.
+
+This is also very similar to the idea of word embedding by taking each image as a "word". Because we use the average pooled output of ResNet, each image is represented as a 2400-d vector. For all the 29,000 images, we have an embedding layer with size (29000, 2400). The "content" of the image is regarded as the embedding initialization. It indeed makes effects, but the capacity of the neural network is not up to it. In contrast, the mapping from text word to the index in the word embedding is critical. Similarly, the mapping of sentence to image in image embedding would be essential, i.e., the similar sentences (with the same topic words) tend to map the same or similar image.
+
+To verify the hypotheses, we replace our ResNet features with 1) Shuffle: shuffle the image features but keep the lookup table; 2) Random Init: randomly initialize the image embedding but keep the lookup table; 3) Random Mapping: randomly retrieve unrelated images. The BLEU scores are on EN-RO are 33.53, 33,28, 32.14, respectively. The results of 1-2 are close to the proposed VR (33.78) and outperform the baseline (32.66), which shows that the content of images would not be very important. The ablation 3) gives a lower result, which verifies the necessity of the mapping, especially the topic relationship.
+
+# 6.2 INFLUENCE OF THE NUMBER OF IMAGES
+
+To evaluate the influence of the number of paired images $m$ , we constrained $m$ in $\{0, 1, 3, 5, 7, 9, 15, 20, 30\}$ for experiments on the EN-RO test set, as shown in Figure 4. When $m = 0$ , the model is the baseline NMT model, whose BLEU score was lower than all the models with images. As the number of images increases, the BLEU score also increased at the beginning (from 32.66 to 33.78)
+
+and then slightly decreased when $m$ exceeds 5. The reason might be that too many images for a sentence would have a higher chance of noise. Therefore, we set $m = 5$ in our models.
+
+The number of sentence-image pairs to create the lookup table could also make effects. We randomly split the pairs of Multi30K into the proportion in [0.1, 0.3, 0.5, 0.7, 0.9], the corresponding BLEU scores for EN-RO are [33.07, 33.44, 34.01, 34.06, 33.80]. Furthermore, we also evaluate the performance by adding external sentence-pairs from the training set of MS COCO image caption dataset (Lin et al., 2014). The BLEU scores are 33.55 and 33.71, respectively, for COCO only and Multi30K+COCO. These results indicate that a modest number of pairs would be beneficial.
+
+# 6.3 THE INFLUENCE OF GATING WEIGHT $\lambda$
+
+
+Figure 5: Quantitative study of the gating weight $\lambda$ .
+
+
+Figure 4: Influence of the number of images on the BLEU score.
+
+In our model, the weight $\lambda$ of the gated aggregation method was learned automatically to measure the importance of the visual information. We compared by manually setting the weight $\lambda$ into scalar values in $\{0.1, 0.3, 0.5, 0.7, 0.9\}$ for experiments on the EN-RO test set. Figure 5 shows that all models with manual $\lambda$ outperformed the baseline Trans. (base), indicating the effectiveness of image information. In contrast, they were inferior to the performance of our model. This means that the degree of dependency for image information varies for each source sentence, indicating the necessity of automatically learning the gating weights of image representations.
+
+# 6.4 EXTRA COMPUTATION TIME
+
+There are mainly two extra computation costs using our method, including 1) obtaining image data for sentences and 2) learning image representations, which are negligible compared with training an NMT model. The time of obtaining image data for MT sentences for the EN-RO dataset is less than 1 minute using GPU. The lookup table is formed as the mapping of token (only topic words) index to image id. Then, the retrieval method is applied as the tensor indexing from the sentence token indices (only topic words) to image ids, which is the same as the procedure of word embedding. The retrieved image ids are then sorted by frequency. Learning image representations takes about 2 minutes for all the 29,000 images in Multi30K using 6G GPU memory for feature extraction and eight threads of CPU for transforming images. The extracted features are formed as the "image embedding layer" with the size of (29000, 2400) for quick access in the neural network.
+
+# 7 CONCLUSION
+
+This work presents a universal visual representation method for neural machine translation relying on monolingual image annotations, which breaks the restraint of heavy dependency on bilingual sentence-image pairs in the current multimodal NMT setting. In particular, this method enables visual information to be applied to large-scale text-only NMT through a topic-image lookup. We hope this work sheds some light on future MMT research. In the future, we will try to adopt the proposed method for other tasks.
+
+# REFERENCES
+
+Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016.
+Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. arXiv preprint arXiv:1409.0473, 2014.
+Loic Barrault, Fethi Bougares, Lucia Specia, Chiraag Lala, Desmond Elliott, and Stella Frank. Findings of the third shared task on multimodal machine translation. In Proceedings of the Third Conference on Machine Translation: Shared Task Papers, pp. 304-323, 2018.
+Ozan Caglayan, Loic Barrault, and Fethi Bouguares. Multimodal attention for neural machine translation. arXiv preprint arXiv:1609.03976, 2016.
+Ozan Caglayan, Walid Aransa, Adrien Bardet, Mercedes García-Martínez, Fethi Bougares, Loic Barrault, Marc Masana, Luis Herranz, and Joost van de Weijer. Lium-cvc submissions for wmt17 multimodal translation task. In Proceedings of the Second Conference on Machine Translation, pp. 432-439, 2017.
+Ozan Caglayan, Pranava Swaroop Madhyastha, Lucia Specia, and Loic Barrault. Probing the need for visual context in multimodal machine translation. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pp. 4159-4170, 2019.
+Iacer Calixto and Qun Liu. Incorporating global visual features into attention-based neural machine translation. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pp. 992-1003, 2017.
+Iacer Calixto, Desmond Elliott, and Stella Frank. Dcu-uva multimodal mt system report. In Proceedings of the First Conference on Machine Translation: Volume 2, Shared Task Papers, pp. 634-638, 2016.
+Iacer Calixto, Qun Liu, and Nick Campbell. Doubly-attentive decoder for multi-modal neural machine translation. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 1913-1924, 2017.
+Kehai Chen, Rui Wang, Masao Utiyama, Eiichiro Sumita, and Tiejun Zhao. Neural machine translation with sentence-level topic context. IEEE/ACM Transactions on Audio, Speech, and Language Processing, 2019.
+Michael Collins, Philipp Koehn, and Ivona Kucerova. Clause restructuring for statistical machine translation. In Proceedings of the 43rd Annual Meeting of the Association for Computational Linguistics, Ann Arbor, Michigan, 2005.
+Desmond Elliott. Adversarial evaluation of multimodal machine translation. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pp. 2974-2978, 2018.
+Desmond Elliott and Ákos Kádár. Imagination improves multimodal translation. In Proceedings of the Eighth International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pp. 130-141, 2017.
+Desmond Elliott, Stella Frank, and Eva Hasler. Multilingual image description with neural sequence models. arXiv preprint arXiv:1510.04709, 2015.
+Desmond Elliott, Stella Frank, Khalil Sima'an, and Lucia Specia. Multi30k: Multilingual english-german image descriptions. In Proceedings of the 5th Workshop on Vision and Language, pp. 70-74, 2016.
+Desmond Elliott, Stella Frank, Loic Barrault, Fethi Bougares, and Lucia Specia. Findings of the second shared task on multimodal machine translation and multilingual image description. In Proceedings of the Second Conference on Machine Translation, pp. 215-233, 2017.
+
+Marzieh Fadaee, Arianna Bisazza, and Christof Monz. Data augmentation for low-resource neural machine translation. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics, pp. 567-573, 2017.
+Jonas Gehring, Michael Auli, David Grangier, and Yann Dauphin. A convolutional encoder model for neural machine translation. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 123-135, 2017.
+Stig-Arne Gronroos, Benoit Huet, Mikko Kurimo, Jorma Laaksonen, Bernard Merialdo, Phu Pham, Mats Sjoberg, Umut Sulubacak, Jorg Tiedemann, Raphael Troncy, et al. The memad submission to the wmt18 multimodal translation task. In Proceedings of the Third Conference on Machine Translation: Shared Task Papers, pp. 603-611, 2018.
+Zellig S Harris. Distributional structure. Word, 10(2-3):146-162, 1954.
+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.
+Jindrich Helcl, Jindrich Libovický, and Dusan Varis. Cuni system for the wmt18 multimodal translation task. In Proceedings of the Third Conference on Machine Translation: Shared Task Papers, pp. 616-623, 2018.
+Po-Yao Huang, Frederick Liu, Sz-Rung Shiang, Jean Oh, and Chris Dyer. Attention-based multimodal neural machine translation. In Proceedings of the First Conference on Machine Translation: Volume 2, Shared Task Papers, pp. 639-645, 2016.
+Julia Ive, Pranava Madhyastha, and Lucia Specia. Distilling translations with visual awareness. arXiv preprint arXiv:1906.07701, 2019.
+Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
+Guillaume Lample, Myle Ott, Alexis Conneau, Ludovic Denoyer, et al. Phrase-based & neural unsupervised machine translation. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pp. 5039-5049, 2018.
+Jason Lee, Elman Mansimov, and Kyunghyun Cho. Deterministic -autoregressive neural sequence modeling by iterative refinement. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pp. 1173-1182, 2018.
+Zuchao Li, Rui Wang, Kehai Chen, Masao Utiyama, Eiichiro Sumita, Zhuosheng Zhang, and Hai Zhao. Explicit sentence compression for neural machine translation. In Proceedings of the Thirty-Fourth AAAI Conference on Artificial Intelligence, 2020a.
+Zuchao Li, Rui Wang, Kehai Chen, Masao Utiyama, Eiichiro Sumita, Zhuosheng Zhang, and Hai Zhao. Data-dependent gaussian prior objective for language generation. In Eighth International Conference on Learning Representations, 2020b.
+Jindrich Libovický and Jindrich Helcl. Attention strategies for multi-source sequence-to-sequence learning. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pp. 196-202, 2017.
+Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dólar, and C Lawrence Zitnick. Microsoft coco: Common objects in context. In European conference on computer vision, pp. 740-755. Springer, 2014.
+Xuezhe Ma, Chunting Zhou, Xian Li, Graham Neubig, and Eduard Hovy. Flowseq: Non-autoregressive conditional sequence generation with generative flow. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pp. 4273-4283, 2019.
+Junhua Mao, Wei Xu, Yi Yang, Jiang Wang, and Alan L Yuille. Explain images with multimodal recurrent neural networks. arXiv preprint arXiv:1410.1090, 2014.
+
+Myle Ott, Sergey Edunov, Alexei Baevski, Angela Fan, Sam Gross, Nathan Ng, David Grangier, and Michael Auli. *fairoseq: A fast, extensible toolkit for sequence modeling.* In *Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics (Demonstrations)*, pp. 48-53, 2019.
+Lucia Specia, Stella Frank, Khalil Sima'an, and Desmond Elliott. A shared task on multimodal machine translation and crosslingual image description. In Proceedings of the First Conference on Machine Translation: Volume 2, Shared Task Papers, pp. 543-553, 2016.
+Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In I. Guyon, U. V. Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett (eds.), Advances in Neural Information Processing Systems 30, pp. 5998-6008, 2017.
+Subhashini Venugopalan, Marcus Rohrbach, Jeffrey Donahue, Raymond Mooney, Trevor Darrell, and Kate Saenko. Sequence to sequence-video to text. In Proceedings of the IEEE international conference on computer vision, pp. 4534-4542, 2015.
+Kelvin Xu, Jimmy Ba, Ryan Kiros, Kyunghyun Cho, Aaron Courville, Ruslan Salakhudinov, Rich Zemel, and Yoshua Bengio. Show, attend and tell: Neural image caption generation with visual attention. In International conference on machine learning, pp. 2048-2057, 2015.
+Jingyi Zhang, Masao Utiyama, Eiichro Sumita, Graham Neubig, and Satoshi Nakamura. Nict-naist system for wmt17 multimodal translation task. In Proceedings of the Second Conference on Machine Translation, pp. 477-482, 2017.
+Zhuosheng Zhang, Yuwei Wu, Hai Zhao, Zuchao Li, Shuaijiang Zhang, Xi Zhou, and Xiang Zhou. Semantics-aware BERT for language understanding. In Proceedings of the Thirty-Fourth AAAI Conference on Artificial Intelligence, 2020a.
+Zhuosheng Zhang, Yuwei Wu, Junru Zhou, Sufeng Duan, Hai Zhao, and Rui Wang. SG-Net: Syntax-guided machine reading comprehension. In Proceedings of the Thirty-Fourth AAAI Conference on Artificial Intelligence, 2020b.
+Chunting Zhou, Xuezhe Ma, Junjie Hu, and Graham Neubig. Handling syntactic divergence in low-resource machine translation. arXiv preprint arXiv:1909.00040, 2019.
+
+# A APPENDIX
+
+A.1 EXAMPLES OF RETRIEVED IMAGES
+
+# Topic-image Lookup Table
+
+
+man (6,675)
+
+
+woman (3,484)
+
+
+food (342)
+
+# Retrieved Images for Sentences
+
+
+a man walks by a silver vehicle
+an elderly woman pan frying food in a kitchen
+
+
+
+
+small boy carries a soccer ball on a field
+Figure 5: Examples of the topic-image lookup table and retrieved images for sentences in Multi30K dataset. We only show six images for each topic or sentence for instance. The topics in each sentence are in boldface.
+
+# Retrieved Images for Sentences (WMT)
+
+The old system of private arbitration courts is off the table
+
+
+
+This issue is shaping as a potential early rift with the business community
+
+
+
+He said he then heard his friend, Hamza calling to him
+
+
+
+The red flag has been risen
+
+
+
+The character attempts to pass human smugglers and then border police on his way to a refugee centre in the European Union.
+
+
+Figure 6: Examples of the retrieved images for sentences in WMT datasets. We only show six images for each sentence for instance. The topics in each sentence are in boldface.
\ No newline at end of file
diff --git a/neuralmachinetranslationwithuniversalvisualrepresentation/images.zip b/neuralmachinetranslationwithuniversalvisualrepresentation/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..47d3ff1507ccc7bebec88bbbe3739232e619a818
--- /dev/null
+++ b/neuralmachinetranslationwithuniversalvisualrepresentation/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:4b249d990a56ee7ccaa934bfbc4dba9c2bc051b7d8cabd41c353e2e00fdce7e9
+size 869179
diff --git a/neuralmachinetranslationwithuniversalvisualrepresentation/layout.json b/neuralmachinetranslationwithuniversalvisualrepresentation/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..5c2efc6c8a695404e5c29942ba7c868d64ed6561
--- /dev/null
+++ b/neuralmachinetranslationwithuniversalvisualrepresentation/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:7ccdd8fab0d53a3baf33456bc57728281c49232528c499c3212b3fc034e44557
+size 407584
diff --git a/neuralsymbolicreaderscalableintegrationofdistributedandsymbolicrepresentationsforreadingcomprehension/2732b125-d3e2-4bbc-bf90-a0651cf0cf00_content_list.json b/neuralsymbolicreaderscalableintegrationofdistributedandsymbolicrepresentationsforreadingcomprehension/2732b125-d3e2-4bbc-bf90-a0651cf0cf00_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..88730f5b54eb11a27c7e3204ffce74be963fc754
--- /dev/null
+++ b/neuralsymbolicreaderscalableintegrationofdistributedandsymbolicrepresentationsforreadingcomprehension/2732b125-d3e2-4bbc-bf90-a0651cf0cf00_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:fdef1859eef222b178a652277ba063faaae39ca5cfb2616c648ab6ca7c0543fc
+size 104286
diff --git a/neuralsymbolicreaderscalableintegrationofdistributedandsymbolicrepresentationsforreadingcomprehension/2732b125-d3e2-4bbc-bf90-a0651cf0cf00_model.json b/neuralsymbolicreaderscalableintegrationofdistributedandsymbolicrepresentationsforreadingcomprehension/2732b125-d3e2-4bbc-bf90-a0651cf0cf00_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..903f6aebd69b0cf3faeee3c1012bd47b5befcae1
--- /dev/null
+++ b/neuralsymbolicreaderscalableintegrationofdistributedandsymbolicrepresentationsforreadingcomprehension/2732b125-d3e2-4bbc-bf90-a0651cf0cf00_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:98492f9598ab6257d0167442f2742918c69d89828686715c112884fc0e6a38fa
+size 124292
diff --git a/neuralsymbolicreaderscalableintegrationofdistributedandsymbolicrepresentationsforreadingcomprehension/2732b125-d3e2-4bbc-bf90-a0651cf0cf00_origin.pdf b/neuralsymbolicreaderscalableintegrationofdistributedandsymbolicrepresentationsforreadingcomprehension/2732b125-d3e2-4bbc-bf90-a0651cf0cf00_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..aa7237bad89da902eaf194dcc741ad46e5de2fca
--- /dev/null
+++ b/neuralsymbolicreaderscalableintegrationofdistributedandsymbolicrepresentationsforreadingcomprehension/2732b125-d3e2-4bbc-bf90-a0651cf0cf00_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c320c013335eda106ac0d0d38f0ce3484df4879c4164995fd66ed978c85e372d
+size 340981
diff --git a/neuralsymbolicreaderscalableintegrationofdistributedandsymbolicrepresentationsforreadingcomprehension/full.md b/neuralsymbolicreaderscalableintegrationofdistributedandsymbolicrepresentationsforreadingcomprehension/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..a87405a6ec4e540434589f2042707f663456ea90
--- /dev/null
+++ b/neuralsymbolicreaderscalableintegrationofdistributedandsymbolicrepresentationsforreadingcomprehension/full.md
@@ -0,0 +1,441 @@
+# NEURAL SYMBOLIC READER: SCALABLE INTEGRATION OF DISTRIBUTED AND SYMBOLIC REPRESENTATIONS FOR READING COMPREHENSION
+
+Xinyun Chen *
+
+UC Berkeley
+
+xinyun.chen@berkeley.edu
+
+Chen Liang, Adams Wei Yu, Denny Zhou
+
+Google Brain
+
+{crazydonkey, adamsyuwei, dennyzhou}@google.com
+
+Dawn Song
+
+UC Berkeley
+
+dawnsong@cs.berkeley.edu
+
+Quoc V. Le
+
+Google Brain
+
+qvl@google.com
+
+# ABSTRACT
+
+Integrating distributed representations with symbolic operations is essential for reading comprehension requiring complex reasoning, such as counting, sorting and arithmetics, but most existing approaches rely on specialized neural modules and are hard to adapt to multiple domains or multi-step reasoning. In this work, we propose the Neural Symbolic Reader (NeRd), which includes a reader, e.g., BERT, to encode the passage and question, and a programmer, e.g., LSTM, to generate a program for multi-step reasoning. By using operators like span selection, the program can be executed over text to generate the answer. Compared to previous works, NeRd is more scalable in two aspects: (1) domain-agnostic, i.e., the same neural architecture works for different domains; (2) compositional, i.e., complex programs can be generated by compositionally applying the symbolic operators. Furthermore, to overcome the challenge of training NeRd with weak supervision, we apply data augmentation techniques and hard Expectation-Maximization (EM) with thresholding. On DROP, a challenging reading comprehension dataset requiring discrete reasoning, NeRd achieves $1.37\% / 1.18\%$ absolute gain over the state-of-the-art on Exact-Match/F1 metrics. With the same architecture, NeRd significantly outperforms the baselines on MathQA, a math problem benchmark that requires multiple steps of reasoning, by $25.5\%$ absolute gain on accuracy when trained on all the annotated programs, and more importantly, still beats the baselines even with only $20\%$ of the program annotations.
+
+# 1 INTRODUCTION
+
+Deep neural networks have achieved remarkable successes in natural language processing recently. In particular, pretrained language models, e.g., BERT (Devlin et al., 2019), have significantly advanced the state-of-the-art in reading comprehension. While neural models have demonstrated performance superior to humans on some benchmarks, e.g., SQuAD (Rajpurkar et al., 2016), so far such progress is mostly limited to extractive question answering, in which the answer is a single span from the text. In other words, this type of benchmarks usually test the capability of text pattern matching, but not of reasoning. Some recent datasets, e.g., DROP (Dua et al., 2019) and MathQA (Amini et al., 2019), are collected to examine the capability of both language understanding and discrete reasoning, where the direct application of the state-of-the-art pre-trained language models, such as BERT or QANet (Yu et al., 2018), achieves very low accuracy. This is especially challenging for pure neural network approaches, because discrete operators learned by neural networks, such as addition and sorting, can hardly generalize to inputs of arbitrary size without specialized design (Reed & de Freitas, 2016; Cai et al., 2017; Kaiser & Sutskever, 2015). Therefore, integrating neural networks with symbolic reasoning is crucial for solving those new tasks.
+
+The recent progress on neural semantic parsing (Jia & Liang, 2016; Liang et al., 2017) is sparked to address this problem. However, such success is mainly restricted to question answering with structured data sources, e.g., knowledge graphs (Berant et al., 2013) or tabular databases (Pasupat
+
+
+Figure 1: Comparison of NeRd with previous approaches for reading comprehension requiring complex reasoning. The components in grey boxes are the neural architectures. Previous works mainly take two approaches: (1) augmenting pre-trained language model such as BERT with specialized modules for each type of questions, which is hard to scale to multiple domains or multi-step complex reasoning; (2) applying neural semantic parser to the structured parses of the passage, which suffers severely from the cascade error. In contrast, the neural architecture of NeRd is domain-agnostic, which includes a reader, e.g., BERT, and a programmer, e.g., LSTM, to generate compositional programs that are directly executed over the passages.
+
+& Liang, 2015). Extending it to reading comprehension by parsing the text into structured representations suffers severely from the cascade errors, i.e., the issues of the structured parsing for data preprocessing account for the poor performance of the learned neural model (Dua et al., 2019).
+
+A recent line of work (Dua et al., 2019; Hu et al., 2019; Andor et al., 2019) extends BERT/QANet to perform reasoning on the DROP dataset. However, they cannot easily scale to multiple domains or multi-step complex reasoning because: (1) they usually rely on handcrafted and specialized modules for each type of questions; (2) they don't support compositional applications of the operators, so it is hard to perform reasoning of more than one step.
+
+In this work, we propose the Neural Symbolic Reader (NeRd) for reading comprehension, which consists of (1) a reader that encodes passages and questions into vector representations; and (2) a programmer that generates programs, which are executed to produce answers. The key insights behind NeRd are as follows: (1) by introducing a set of span selection operators, the compositional programs, usually executed against structured data such as databases in semantic parsing, can now be executed over text; (2) the same architecture can be applied to different domains by simply extending the set of symbolic operators.
+
+A main challenge of training NeRd is that it is often expensive to collect program annotations, so the model needs to learn from weak supervision, i.e., with access only to the final answers. This raises two problems for learning: (1) cold start problem. There are no programs available at the beginning of training, so the training cannot proceed. We address this problem through data augmentation that generates noisy training data to bootstrap the training; (2) spurious program problem, where some programs produce the right answer for wrong rationales. We propose an iterative process using hard EM with thresholding, which filters out the spurious programs during training.
+
+In our evaluation, NeRd demonstrates three major advantages over previous methods: (1) better accuracy. It outperforms the previous state-of-the-art on DROP by $1.37\% / 1.18\%$ on EM/F1, and the baselines on MathQA by a large margin of $25.5\%$ on accuracy if trained with all annotated programs. Notably, it still outperforms the MathQA baselines using only $20\%$ of the program annotations; (2) more scalable (domain-agnostic and compositional). Unlike previous approaches, which rely on specialized modules that do not support compositional application of the operators, NeRd can be applied to tasks of different domains, e.g., DROP and MathQA, without changing the architecture, and more complex programs can be simply generated by extending the set of operators and compo
+
+sitionally applying them; (3) better interpretability. It is easier to interpret and verify an answer by inspecting the program that produces it, especially for the questions involving complex reasoning such as counting and sorting.
+
+# 2 NEURAL SYMBOLIC READER
+
+In this section, we present the design of NeRd. It consists of a reader that encodes the passages and questions into vector representations, and a programmer that generates programs in a domain specific language. The overall comparison between NeRd and previous works is visualized in Figure 1.
+
+# 2.1 NEURAL ARCHITECTURE
+
+We provide an overview of the two components in NeRd, and defer more details to Appendix C.
+
+Reader. Given the natural language text including a question and a passage, the reader component encodes each token $t_i$ in the text into an embedding $e_i$ . Note that our framework is agnostic to the architecture choice of the encoder, so any neural module that turns words into vectors is applicable, e.g., BERT (Devlin et al., 2019).
+
+Programmer. The programmer takes the output of the reader as input, and then decodes a program as a sequence of tokens. Again, our model is agnostic to the design of decoder. For simplicity, we use an LSTM (Hochreiter & Schmidhuber, 1997) decoder with attention (Bahdanau et al., 2014) over the encoded text, and self-attention (Vaswani et al., 2017) over the previously generated tokens.
+
+A major advantage of our architecture is that it is domain-agnostic, i.e., the same architecture can be used for different domains. Compared to previous approaches that craft separate specialized modules for each answer type, we use a unified programmer component to generate programs for multi-step reasoning, and we can simply extend the operator set in the domain specific language (see the next section) to adapt to a different domain. See Section 4.3 for a more detailed discussion.
+
+# 2.2 DOMAIN SPECIFIC LANGUAGE
+
+In this section, we introduce our domain specific language (DSL), which is used to interpret the tokens generated by the programmer component as an executable program.
+
+We list the operators in our DSL in Table 1. To handle discrete reasoning, the DSL includes operators that perform arithmetics (DIFF, SUM), counting (COUNT) and sorting (ARGMAX, ARGMIN, MAX, MIN). These operators have been used in previous work in semantic parsing over structured data sources such as a knowledge graph or a tabular database.
+
+However, the main challenge of applying such operations for reading comprehension is that the model needs to manipulate unstructured data, i.e., natural language text, and parsing the text into structured representations may introduce a lot of cascade errors. For example, Dua et al. (2019) found that their best performing semantic parsing pipeline using SRL (Carreras & Marquez, 2004) can only find the logical forms for $35\%$ of the questions, resulting in poor performance.
+
+To address this issue, a key insight in our DSL design is to introduce the span selection operators, so that all the arithmetics, counting and sorting operators can be applied to text. Specifically, we introduce PASSAGE_SPAN, QUESTION_SPAN, VALUE, KEY-VALUE for selecting spans or numbers from the passage and question. For example, COUNT can use PASSAGE_SPAN to pick out the spans that mention the relevant entities or events, e.g., touchdowns made by a certain person, and then returns the total number; ARGMAX relies on applying KEY-VALUE to pick out the spans (keys) for relevant mentions and their associated numbers (values), e.g., touchdowns and their lengths, and then returns the key with the highest value, e.g., the player kicking the longest touchdown. More examples can be found in Table 2. In summary, the introduction of span selection operators in the DSL enables the application of the discrete reasoning operators to text, and the resulting programs act as executable and interpretable representations of the reasoning process.
+
+As mentioned above, our architecture is domain-agnostic and the only change needed, to apply to a different domain, is to extend the DSL with new operators. For example, MathQA benchmark requires adding more advanced mathematical operations beyond addition and subtraction, which are defined in Amini et al. (2019). We defer the details to Section 4.1.
+
+A major advantage of our DSL is its compositionality, i.e., complex programs can be generated by compositionally applying the operators. Previous works (Andor et al., 2019) only allow applying the operators for one step, which requires them to introduce operators to mimic two-step compositions,
+
+| Operator | Arguments | Outputs | Description |
| PASSAGE_SPAN | v0: the start index. | a span. | Select a span from the passage or question. |
| QUESTION_SPAN | v1: the end index. |
| VALUE | v0: an index. | a number. | Select a number from the passage. |
| KEY-VALUE (KV) | v0: a span. | a key-value pair. | Select a key (span) value (number) pair from the passage. |
| v1: a number. |
| DIFF | v0: a number or index. | a number. | Compute the difference or sum of two numbers. |
| SUM | v1: a number or index. |
| COUNT | v: a set of spans. | a number. | Count the number of given spans. |
| MAX | v: a set of numbers. | a number. | Select the maximum / minimum among the given numbers. |
| MIN | | | |
| ARGMAX | v: a set of key-value pairs. | a span. | Select the key (span) with the highest / lowest value. |
| ARGMIN | | | |
+
+Table 1: Overview of our domain-specific language. See Table 2 for the sample usage.
+
+e.g., Merge (selecting two spans) and Sum3 (summing up three numbers). However, this would not scale to more steps of reasoning, as the number of required operators will grow exponentially w.r.t the number of steps. In contrast, NeRd can compose different operators to synthesize complex programs for multi-step reasoning. For example, on MathQA, the average number of operations per question is 5, and some programs apply more than 30 operations to compute the final answer.
+
+# 3 TRAINING WITH WEAK SUPERVISION
+
+Although it is relatively easy to collect question-answer pairs, it is often hard and expensive to obtain program annotations that represent the reasoning behind the answers. Thus, how to train NeRd with only weak supervision becomes a main challenge. In this section, we revisit the cold start and spurious program problems described in Section 1, and present our solutions.
+
+# 3.1 DATA AUGMENTATION FOR COLD START
+
+The cold start problem means that the training cannot get started when there isn't any program available. For example, a question "How many touchdowns did Brady throw" annotated with only an answer "3" cannot be directly used to train our model due to the lack of the target program to optimize on. To obtain program annotations from question-answer pairs, we first follow previous work to find programs for questions answerable by span selection or arithmetic operations via an exhaustive search, and we defer the details to Section 4.2. However, for questions involving counting or sorting operations, the space becomes too large for an exhaustive search, since these operations rely on the span selection as their sub-routines. For example, the number of possible spans in a text with 200 words is in the order of $10^{4}$ , and what's more, counting and sorting operators usually include more than one span as their arguments.
+
+We apply data augmentation to address the search space explosion problem for counting and sorting operations. For counting, we augment the span selection questions by replacing the interrogatives, e.g., "what" and "who", with "how many" when applicable, and adding a call to COUNT over the selected spans in the answer. For example, a question "What areas have a Muslim population of more than 50000 people?" is changed into "How many areas...". For sorting, we extract the key-value pairs by first applying CoreNLP (Manning et al., 2014) for entity recognition, and then heuristically find an associated number for each entity. If including them as the arguments of any sorting operator yields the correct answer, then such programs are added to the training set. More details can be found in Appendix D.1. Although the programs found for counting and sorting through this data augmentation process is noisy, they help bootstrap the training. Throughout the training, we also use the model to decode programs, and add those leading to correct answers into our training set.
+
+# 3.2 HARD EM WITH THRESHOLDING AGAINST SPURIOUS PROGRAMS
+
+After collecting a set of programs for each question-answer pair, another obstacle is the spurious program problem, the phenomenon that a wrong program accidentally predicts a right answer. For example, per arithmetic question in DROP, there are on average 9.8 programs that return correct answers, but usually only one of them is semantically correct.
+
+Algorithm 1 Hard EM with Thresholding
+Input: question-answer pairs $\{(x_i,y_i)\}_{i = 1}^N$ a model $p_{\theta}$ , initial threshold $\alpha_0$ , decay factor $\gamma$
+for each $(x_{i},y_{i})$ do $Z_{i}\gets DataAugmentation(x_{i},y_{i})$ $T\gets 0$
+repeat
+ $\alpha \leftarrow \alpha_0*\gamma^T$ $\mathcal{D}\gets \emptyset$
+for each $(x_{i},y_{i})$ do $z_{i}^{*} = \arg \max_{k}p_{\theta}(z_{i}^{k}|x_{i}),z_{i}^{k}\in Z_{i}$ if $p_{\theta}(z_i^*) > \alpha$ or $T = 0$ and $|Z_{i}| = 1$ then $\mathcal{D}\gets \mathcal{D}\cup (x_i,z_i^*)$ Update $\theta$ by maximizing $\sum_{\mathcal{D}}\log p_{\theta}(z^{*}|x)$ $T\gets T + 1$
+until converge or early stop
+
+To filter out spurious programs, we adopt hard EM (Liang et al., 2018; Min et al., 2019) due to its simplicity and efficiency. Specifically, this approach uses the current model to select the program with the highest model probability among the ones that return the correct answer, and then maximizes the likelihood of the selected program. In other words, it relies on the neural model itself to filter out spurious programs. This algorithm is usually faster than the marginalized approach (Berant et al., 2013) because at most one program per question-answer pair is used to compute the gradient, and the selection process is fast since it only has a forward pass.
+
+Hard EM assumes that for any question-
+
+answer pair, at least one of the generated programs is correct. However, there exist questions without any semantically correct program found, e.g., when the annotated answer itself is wrong. In this case, when directly applying the hard EM algorithm, even if the model probabilities for all the programs are very small, it will still select a program for training. RL-based approaches such as MAPO (Liang et al., 2018) avoid this issue by optimizing the expected return, which weighs the gradient by the model probability. Thus, when all the programs of a question-answer pair have very small probabilities, they will be largely ignored during training. We incorporate this intuition into hard EM by introducing a decaying threshold $\alpha$ , so that a program's probability has to be at least $\alpha$ in order to be included for training. Our experiments show that both hard EM and thresholding are crucial for successful training. The pseudo-code of our training procedure is presented in Algorithm 1, and we defer more details to Appendix D.2.
+
+# 4 EVALUATION
+
+In this section, we demonstrate the effectiveness of our approach on DROP (Dua et al., 2019) and MathQA (Amini et al., 2019), two recent benchmarks that require discrete reasoning over passages.
+
+# 4.1 DATASETS
+
+DROP. DROP (Discrete Reasoning Over Paragraphs) (Dua et al., 2019) is designed to combine the challenges from both reading comprehension and semantic parsing communities. Specifically, the passages are collected from Wikipedia, each having at least twenty numbers. The question-answer pairs are crowdsourced in an adversarial way that they are accepted only when the questions cannot be correctly answered by the BiDAF model (Seo et al., 2017). The dataset has 96.6K question-answer pairs from 6.7K passages. Unlike most existing datasets that are solely based on the single span selection, the questions in DROP require complex reasoning, such as selecting multiple spans, arithmetic operations over numbers in the passage, counting and sorting, etc., which poses extra challenge for existing models. For example, vanilla BERT only gets around $30\%$ F1 score. Table 2 provides some sample questions in DROP, and their corresponding programs in our DSL (Table 1).
+
+For evaluation, we use the same metrics in Dua et al. (2019): (1) Exact Match (EM), where the score is 1 if the prediction exactly matches the ground truth, and 0 otherwise; (2) F1 score, which gives partial credits to a prediction that is not exactly the same as the ground truth, but overlaps with it.
+
+MathQA. MathQA (Amini et al., 2019) is a dataset with 37K question-answer pairs selected from AQuA (Ling et al., 2017), but it is further annotated with gold programs in their domain-specific language. The passage length in MathQA is 38 on average, much shorter than DROP with 224. However, the questions in MathQA require more complex and advanced mathematical reasoning than DROP. To this aim, they design 58 math operations, which cover various advanced math topics including geometry, physics, probability, etc. Accordingly, we augment our DSL with those operators to support more advanced numerical reasoning. In these annotated programs, the average number of operations per question is 5, and some programs involve more than 30 steps of computation. Table 3 shows an example from MathQA.
+
+| Passage | Question & Answer |
| Multiple spans |
| ...the population was spread out with 26.20% under the age of 18, 9.30% from 18 to 24, 26.50% from 25 to 44, 23.50% from 45 to 64, and 14.60% who were 65 years of age or older... | Question: Which groups in percent are larger than 16%?
+Program:
+PASSAGE_SPAN(26,30),
+PASSAGE_SPAN(46,48),
+PASSAGE_SPAN(55,57)
+Result: ‘under the age of 18’, ‘25 to 44’, ‘45 to 64’ |
| Date |
| When major general Nathanael Greene took command in the south, Marion and lieutenant colonel Henry Lee were ordered in January 1781... On August 31, Marion rescued a small American force trapped by 500 British soldiers... | Question: When did Marion rescue the American force?
+Program:
+PASSAGE_SPAN(71,71),
+PASSAGE_SPAN(72,72),
+PASSAGE_SPAN(32,32)
+Result: ‘August’, ‘31’, ‘1781’ |
| Numerical operations |
| ...Lassen county had a population of 34,895.
+The racial makeup of Lassen county was 25,532 (73.2%) white (U.S. census), 2,834 (8.1%) African American (U.S. census)... | Question: How many people were not either solely white or solely African American?
+Program: DIFF(9,SUM(10,12))
+Result: 34895 - (25532 + 2834) = 6529 |
| Counting |
| ...the Bolshevik party came to power in November 1917 through the simultaneous election in the soviet and an organized uprising supported by military mutiny... | Question: How many factors were involved in bringing the Bolsheviks to power?
+Program:
+COUNT( PASSAGE_SPAN(62, 66), PASSAGE_SPAN(69, 74))
+Result:
+COUNT( ‘simultaneous election in the soviets’, ‘organized uprising supported by military mutiny’) = 2 |
| Sorting |
| ...Jaguars kicker Josh Scobee managed to get a 48-yard field goal...with kicker Nate Kaeding getting a 23-yard field goal... | Question: Who kicked the longest field goal?
+Program:
+ARGMAX( KV(PASSAGE_SPAN(50,53), VALUE(9)), KV(PASSAGE_SPAN(92,94), VALUE(11)))
+Result:
+ARGMAX( KV('Josh Scobee', 48), KV('Nate Kaeding', 23)) = 'Josh Scobee' |
| ...Leftwich flipped a 1-yard touchdown pass to Wrigster...Leftwich threw a 16- yard touchdown pass to Williams for a 38-0 lead... | Question: How many yards was the shortest touchdown pass?
+Program: MIN(VALUE(17), VALUE(19))
+Result: MIN(1, 16) = 1 |
+
+Table 2: Examples of correct predictions on DROP development set.
+
+| Question | Answer |
| Someone on a skateboard is traveling 8 miles per hour. How many feet does she travel in 5 seconds? (1 mile = 5280 feet) | Program:
+multiply(5,divide(multiply(8,5280),const_3600))
+Result: 5 * ((8 * 5280) / 3600) = 58.67 ft |
+
+Table 3: An example in MathQA dataset.
+
+Note that each question in MathQA is accompanied with 4 options, where 1 of them is the correct answer. However, since we do not have the full knowledge of the operation semantics, we choose a conservative metric to evaluate the accuracy: a predicted program is considered to be correct only if it is exactly the same as the annotated program. Thus, this metric is an under-estimation of the accuracy based on the execution results. Despite that we use a much stricter measurement in our evaluation, we show that NeRd still outperforms the baselines by a large margin.
+
+# 4.2 IMPLEMENTATION DETAILS
+
+DROP. Similar to previous work (Dua et al., 2019), for span prediction, we perform an exhaustive search to find all mentions of the ground truth spans in the passage, then include all of them as candidate programs. For numerical questions, we perform another exhaustive search over all expressions applying addition and subtraction over up to 3 numbers. In this way, we are able to find at least one
+
+program for over $95\%$ of the training samples with a number as the answer. Our data augmentation approach for counting and sorting questions can be seen in Section 3.1.
+
+MathQA. Besides the setting where all the ground truth programs are provided during training, we also evaluate the weak supervision setting on MathQA. Due to the lack of program executor, we are unable to perform the search similar to what we have done on DROP. To enable the first training iteration of the model, we assume that we have access to the ground truth programs for a small fraction of training samples at the beginning, and only know the final answer for the rest of training samples. In the first training iteration, the model only trains on the samples annotated with programs. In each of the following iterations, we first run a beam search with a beam size 64 to generate programs for each training sample that has not been annotated in previous iterations, and add the generated program only if it is exactly the same as the ground truth annotation.
+
+For a fair comparison, our reader uses the same pre-trained model as (Hu et al., 2019; Andor et al., 2019), i.e., $\mathrm{BERT}_{\mathrm{LARGE}}$ . For both benchmarks, we perform greedy decoding during the evaluation.
+
+# 4.3 BASELINES
+
+DROP. We evaluate NeRd against three types of baselines: (1) previous models on DROP; (2) NeRd with and without counting and sorting operations; (3) NeRd with different training algorithms, and we discuss the details below.
+
+Previous approaches. We compare with NAQANet (Dua et al., 2019), NABERT (Hu et al., 2019), MTMSN (Hu et al., 2019), and BERT-Calc (Andor et al., 2019). We have discussed the key differences between NeRd and BERT-Calc, the baseline with the best performance, in Section 2.2. On the other hand, NAQANet, NABERT, MTMSN share the same overall framework, where they augment an existing model to include individual modules for span selection, numerical expression generation, counting, negation, etc. While NAQANet is based on QANet, other baselines as well as NeRd are based on BERT. Note that the span selection modules themselves are not able to handle questions that return multiple spans as the answer, which causes the exact match accuracy to be zero on multiple-span selection questions for both NAQANet and NABERT. To tackle this issue, MTMSN adapts the non-maximum suppression algorithm (Rosenfeld & Thurston, 1971) to select multiple spans from the candidates with the top prediction probabilities.
+
+Operator variants of NeRd. To show that NeRd learns to apply counting and sorting operations appropriately, we also evaluate the following two variants: (1) NeRd without counting: we remove the COUNT operation in Table 1, and introduce 10 operations COUNT_0, COUNT_1, ..., COUNT_9, where the execution engine returns the number $x$ for operation COUNT_X. This counting process is the same as (Andor et al., 2019). (2) NeRd without sorting: we remove ARGMAX, ARGMIN, MAX and MIN operations, so that the model needs to use span selection operations for sorting questions.
+
+Training variants of NeRd. To show the effectiveness of our training algorithm, we compare with the following baselines: (1) Hard EM described in Section 3.2; and (2) Maximum Likelihood, which maximizes the likelihood of each program that returns the correct answer for a training sample.
+
+MathQA. We compare with Seq2prog and Seq2prog+cat models in Amini et al. (2019), which are LSTM-based encoder-decoder architectures implemented in OpenNMT (Klein et al., 2018). In particular, Seq2prog+cat extracts the category label of each question, then trains separate LSTMs to handle different categories, which improves the accuracy by $2.3\%$ .
+
+# 4.4 RESULTS
+
+DROP. Table 4 summarizes our main evaluation results on DROP dataset, with 9.5K samples in the development set and 9.6K hidden samples in the test set. Note that $\mathrm{NABERT}_{\mathrm{LARGE}}$ was not evaluated on the test set (Hu et al., 2019). Specifically, we train 10 NeRd models with the best configuration from different random initialization, present the mean and standard error of the results on the development set, and submit a single model to obtain the result on the hidden test set. We can observe that on test set, NeRd outperforms previous models by $1.37\%$ on exact match, and $1.18\%$ on F1 score. Notice that in (Andor et al., 2019), they train their BERT-Calc model on CoQA (Reddy et al., 2019) in addition to DROP, and they also evaluate an ensemble with 6 models, resulting in the exact match of 78.14, and F1 score of 81.78 on test set. However, we can see that without additional training data and ensembling, NeRd still beats their single model, and the performance is on par with their ensemble model.
+
+ | Overall Dev | Overall Test | Number (62%) | Span (32%) | Spans (4.4%) | Date (1.6%) |
| EM | F1 | EM | F1 | EM | F1 | EM | F1 | EM | F1 | EM | F1 |
| NAQANet | 46.75 | 50.39 | 44.24 | 47.77 | 44.9 | 45.0 | 58.2 | 64.8 | 0.0 | 27.3 | 32.0 | 39.6 |
| NABERTLARGE | 64.61 | 67.35 | - | - | 63.8 | 64.0 | 75.9 | 80.6 | 0.0 | 22.7 | 55.7 | 60.8 |
| MTMSNLARGE | 76.68 | 80.54 | 75.85 | 79.85 | 80.9 | 81.1 | 77.5 | 82.8 | 25.1 | 62.8 | 55.7 | 69.0 |
| BERT-Calc | 78.09 | 81.65 | 76.96 | 80.53 | 82.0 | 82.1 | 78.8 | 83.4 | 5.1 | 45.0 | 58.1 | 61.8 |
| NeRd | 78.55 ± 0.27 | 81.85 ± 0.20 | 78.33 | 81.71 | 82.4 ± 0.3 | 82.6 ± 0.2 | 76.2 ± 0.4 | 81.8 ± 0.2 | 51.3 ± 0.8 | 77.6 ± 1.2 | 58.3 ± 1.8 | 67.2 ± 1.7 |
+
+Table 4: Results on DROP dataset. On the development set, we present the mean and standard error of 10 NeRd models, and the test result of a single model. For all models, the performance breakdown of different question types is on the development set. Note that the training data of BERT-Calc model (Andor et al., 2019) for test set evaluation is augmented with CoQA (Reddy et al., 2019).
+
+ | with Count Op | w/o Count op |
| EM | 73.1 | 71.2 |
| F1 | 73.1 | 71.2 |
+
+(a)
+
+ | with Sort Ops | w/o Sort Ops |
| EM | 83.9 | 82.1 |
| F1 | 86.8 | 85.5 |
+
+(b)
+
+Table 5: Results of counting and sorting questions on DROP development set, where we compare variants of NeRd with and without the corresponding operations. (a): counting; (b): sorting. For each setting, we present the best results on development set.
+
+To understand the strengths of NeRd, we first show examples of correct predictions in Table 2. We can observe that NeRd is able to compose multiple operations so as to obtain the correct answer, which helps boost the performance. In particular, for questions that require the selection of multiple spans, the exact match accuracy of NeRd is more than double of the best previous approach that specially designed for multi-span prediction, and the F1 score also improves around $15\%$ . Meanwhile, NeRd is able to generate more complicated arithmetic expressions than Andor et al. (2019), thanks to the compositionality of our approach.
+
+We further present our ablation studies of counting and sorting operations in Tables 5 and 6. Specifically, we evaluate on two subsets of DROP development set that include counting and sorting questions only, using the variants of NeRd with and without the corresponding operations. We can observe that adding these advanced operations can not only boost the performance, but also enable the model to provide the rationale behind its predictions. For counting problems, NeRd is able to select the spans related to the question. For sorting problems, NeRd first associates the entities with their corresponding values to compose the key-value pairs, then picks the most relevant ones for prediction. None of the previous models is able to demonstrate such reasoning processes, which suggests better interpretability of NeRd.
+
+Finally, we present the results of different training algorithms in Table 7. First, we observe that by filtering spurious programs, the hard EM significantly boosts the performance of the maximum likelihood training for $10\%$ , which may be due to the fact that the exhaustive search finds plenty of spurious programs that yield the correct answer. Adding the threshold for program selection provides further improvement of about $7\%$ , indicating that our training algorithm can better handle the issue of spurious programs and be more tolerant to the noise of answer annotations. In Appendix E, we show some examples discarded by NeRd using the threshold, which mostly have the wrong answer annotations, e.g., incorrect numerical operations or missing part of the information in the question.
+
+MathQA. We present the results on MathQA test set with around 3K samples in Table 8. NeRd dramatically boosts the accuracy of the baselines by $25.5\%$ . In addition, we also evaluate a variant of NeRd with the same model architecture, but the BERT encoder is not pre-trained and is randomly initialized. We observe that this variant still yields a performance gain of $17.4\%$ . Note that NeRd is measured by the program accuracy, which is a much stricter criterion and thus is an underestimation of the execution accuracy computed in (Amini et al., 2019). Moreover, even with only $20\%$ training data labeled with ground truth programs, NeRd still outperforms the baseline.
+
+# 5 RELATED WORK
+
+Reading comprehension and question answering have recently attracted a lot of attention from the NLP community. A plethora of datasets have been available to evaluate different capabilities of
+
+| Passage | Question & Prediction |
| ...with field goals of 38 and 36 yards by kicker Dan Carpenter ... followed by a 43-yard field goal by Carpenter ... 52-yard field goal ... | Question: How many total field goals were kicked in the game? |
| Predicted Program: COUNT( PASSAGE_SPAN(75,75), PASSAGE_SPAN(77,78), PASSAGE_SPAN(133,135), PASSAGE_SPAN(315,317)) Result: COUNT( '38', '36 yards', '43-yard', '52-yard') = 4 |
| Predicted Program (-counting): COUNT5 Result: 5 |
| ... with the five most common surgeries being breast augmentation, liposuction, breast reduction, eyelid surgery and abdominoplasty ... | Question: How many of the five most common procedures are not done on the breasts? |
| Predicted Program: COUNT( PASSAGE_SPAN(132,135), PASSAGE_SPAN(140,142), PASSAGE_SPAN(144,149)) Result: COUNT( 'liposuction', 'eyelid surgery', 'abdominoplasty') = 3 |
| Predicted Program (-counting): COUNT4 Result: 4 |
+
+(a)
+
+| Passage | Question & Prediction |
| ...In the third quarter, Arizona's deficit continued to climb as Cassel completed a 76-yard touchdown pass to wide receiver Randy Moss ... quarterback Matt Leinart completed a 78-yard touchdown pass to wide receiver Larry Fitzgerald ... | Question: Who threw the longest touchdown pass? |
| Predicted Program:
+ARGMAX(
+KV(PASSAGE_SPAN(205,208),VALUE(18)),
+KV(PASSAGE_SPAN(142,143),VALUE(14)))
+Result: ARGMAX(KV('Matt Leinart', 78),KV('Cassel', 76)) = 'Matt Leinart' |
| Predicted Program (-sorting): PASSAGE_SPAN(82,84) Result: Matt Cassel |
| ... Carney got a 38-yard field goal ... with Carney connecting on a 39-yard field goal ... | Question: How many yards was the longest field goal? |
| Predicted Program: MAX(Value(14),VALUE(11))
+Result: MAX(39, 38) = 39 |
| Predicted Program (-sorting): VALUE(11) Result: 38 |
+
+Table 6: Examples of counting and sorting questions on DROP development set, where NeRd with the corresponding operations gives the correct predictions, while the variants without them do not. (a): counting; (b): sorting.
+
+(b)
+
+ | EM | F1 |
| Hard EM with thresholding | 80.58 | 83.42 |
| Hard EM | 73.72 | 77.46 |
| Maximum Likelihood | 63.96 | 67.98 |
+
+Table 7: Results of different training algorithms on DROP development set. For each setting, we present the best results on the development set.
+
+ | Accuracy |
| Seq2prog | 51.9 |
| Seq2prog+cat | 54.2 |
| NeRd | 79.7 |
| NeRd (-pretraining) | 71.6 |
| NeRd (20%) | 56.5 |
+
+Table 8: Results on MathQA test set, with NeRd and two variants: (1) no pre-training; (2) using $20\%$ of the program annotations in training.
+
+the models, such as SQuAD (Rajpurkar et al., 2016), CoQA (Reddy et al., 2019), GLUE (Wang et al., 2019), etc. A bunch of representative models are proposed for these benchmarks, including BiDAF (Seo et al., 2017), r-net (Wang et al., 2017), DrQA (Chen et al., 2017), DCN (Xiong et al., 2016) and QANet (Yu et al., 2018). More recently, massive text pre-training techniques, e.g., ELMo (Peters et al., 2018), BERT (Devlin et al., 2019), XLNet (Yang et al., 2019) and Roberta (Liu et al., 2019), have achieved superior performance on these tasks. However, for more complicated tasks that require logical reasoning, pre-trained models alone are insufficient.
+
+On the other hand, semantic parsing has recently seen a lot of progress from the neural symbolic approaches. Jia & Liang (2016); Dong & Lapata (2016); Zhong et al. (2017) applied neural sequence-to-sequence and sequence-to-tree models to semantic parsing with full supervision. Liang et al. (2017); Neelakantan et al. (2016); Krishnamurthy et al. (2017); Guu et al. (2017); Liang et al. (2018) have advanced the state-of-the-art in weakly supervised semantic parsing on knowledge graphs and tabular databases. However, most of the successes of semantic parsing are limited to structured data sources. In contrast, our work naturally extends the complex reasoning in semantic parsing to reading comprehension by introducing the span selection operators. Several methods for training with weak supervision have been proposed in the context of weakly supervised semantic parsing including Maximum Marginal Likelihood (Berant et al., 2013; Krishnamurthy et al., 2017; Dasigi et al., 2019; Guu et al., 2017), RL (Liang et al., 2017; 2018) and Hard EM (Liang et al., 2017; Min
+
+et al., 2019). Our approach is based on Hard EM due to its simplicity and efficiency, and extends it by adding a decaying threshold, which improves its robustness against spurious programs.
+In the broader context, neural symbolic approaches have been applied to Visual Question Answering (Andreas et al., 2016; Mao et al., 2019; Johnson et al., 2017), where the neural architecture is composed with sub-modules based on the structured parses of the questions. Another line of work studied neural symbolic approaches to learn the execution of symbolic operations such as addition and sorting (Graves et al., 2014; Reed & de Freitas, 2016; Cai et al., 2017; Dong et al., 2019). In this work, we study neural symbolic approaches for reading comprehension tasks that require discrete reasoning over the text (Dua et al., 2019; Hu et al., 2019; Andor et al., 2019; Amini et al., 2019).
+
+# 6 CONCLUSION
+
+We presented the Neural Symbolic Reader (NeRd) as a scalable integration of distributed representations and symbolic operations for reading comprehension. NeRd architecture consists of a reader that encodes text into vector representation, and a programmer that generates programs, which will be executed to produce the answer. By introducing the span selection operators, our domain-agnostic architecture can generate compositional programs to perform complex reasoning over text for different domains by only extending the set of operators. We also overcome the challenge of weak supervision by applying data augmentation techniques and hard EM with thresholding. In our evaluation, using the same model architecture without any change, NeRd significantly surpasses previous state-of-the-arts on two challenging reading comprehension tasks, DROP and MathQA. We hope to motivate future works to introduce complex reasoning to other domains or other tasks in NLP, e.g., machine translation and language modeling, by extending the set of operators.
+
+# REFERENCES
+
+Aida Amini, Saadia Gabriel, Peter Lin, Rik Koncel-Kedziorski, Yejin Choi, and Hannaneh Hajishirzi. Mathqa: Towards interpretable math word problem solving with operation-based formalisms. arXiv preprint arXiv:1905.13319, 2019.
+Daniel Andor, Luheng He, Kenton Lee, and Emily Pitler. Giving bert a calculator: Finding operations and arguments with reading comprehension. arXiv preprint arXiv:1909.00109, 2019.
+Jacob Andreas, Marcus Rohrbach, Trevor Darrell, and Dan Klein. Learning to compose neural networks for question answering. arXiv:1601.01705, 2016.
+Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. arXiv:1409.0473, 2014.
+Jonathan Berant, Andrew Chou, Roy Frostig, and Percy Liang. Semantic parsing on freebase from question-answer pairs. EMNLP, 2(5):6, 2013.
+Rudy Bunel, Matthew Hausknecht, Jacob Devlin, Rishabh Singh, and Pushmeet Kohli. Leveraging grammar and reinforcement learning for neural program synthesis. In International Conference on Learning Representations, 2018.
+Jonathon Cai, Richard Shin, and Dawn Song. Making neural programming architectures generalize via recursion. *ICLR*, 2017.
+Xavier Carreras and Lluis Márquez. Introduction to the conll-2004 shared task: Semantic role labeling. In Proceedings of the Eighth Conference on Computational Natural Language Learning (CoNLL-2004) at HLT-NAACL 2004, pp. 89-97, 2004.
+Danqi Chen, Adam Fisch, Jason Weston, and Antoine Bordes. Reading wikipedia to answer open-domain questions. 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. 1870-1879, 2017.
+Pradeep Dasigi, Matt Gardner, Shikhar Murty, Luke Zettlemoyer, and Eduard Hovy. Iterative search for weakly supervised semantic parsing. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pp. 2669-2680, 2019.
+
+Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pp. 4171–4186, 2019.
+Honghua Dong, Jiayuan Mao, Tian Lin, Chong Wang, Lihong Li, and Denny Zhou. Neural logic machines. In 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019, 2019.
+Li Dong and Mirella Lapata. Language to logical form with neural attention. ACL, 2016.
+Dheeru Dua, Yizhong Wang, Pradeep Dasigi, Gabriel Stanovsky, Sameer Singh, and Matt Gardner. DROP: A reading comprehension benchmark requiring discrete reasoning over paragraphs. In Proc. of NAACL, 2019.
+Alex Graves, Greg Wayne, and Ivo Danihelka. Neural tuning machines. CoRR, abs/1410.5401, 2014. URL http://arxiv.org/abs/1410.5401.
+Kelvin Guu, Panupong Pasupat, Evan Liu, and Percy Liang. From language to programs: Bridging reinforcement learning and maximum marginal likelihood. ACL, 2017.
+Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural Comput., 1997.
+Minghao Hu, Yuxing Peng, Zhen Huang, and Dongsheng Li. A multi-type multi-span network for reading comprehension that requires discrete reasoning. arXiv preprint arXiv:1908.05514, 2019.
+Robin Jia and Percy Liang. Data recombination for neural semantic parsing. ACL, 2016.
+Justin Johnson, Bharath Hariharan, Laurens van der Maaten, Judy Hoffman, Li Fei-Fei, C Lawrence Zitnick, and Ross Girshick. Inferring and executing programs for visual reasoning. In Proceedings of the IEEE International Conference on Computer Vision, pp. 2989-2998, 2017.
+Lukasz Kaiser and Ilya Sutskever. Neural gpus learn algorithms. arXiv:1511.08228, 2015.
+Guillaume Klein, Yoon Kim, Yuntian Deng, Vincent Nguyen, Jean Senellart, and Alexander M Rush. Opennmt: Neural machine translation toolkit. arXiv preprint arXiv:1805.11462, 2018.
+Jayant Krishnamurthy, Pradeep Dasigi, and Matt Gardner. Neural semantic parsing with type constraints for semi-structured tables. EMNLP, 2017.
+Chen Liang, Jonathan Berant, Quoc Le, Kenneth D. Forbus, and Ni Lao. Neural symbolic machines: Learning semantic parsers on freebase with weak supervision. ACL, 2017.
+Chen Liang, Mohammad Norouzi, Jonathan Berant, Quoc V. Le, and Ni Lao. Memory augmented policy optimization for program synthesis and semantic parsing. In NeurIPS, pp. 10015-10027, 2018.
+Wang Ling, Dani Yogatama, Chris Dyer, and Phil Blunsom. Program induction by rationale generation: Learning to solve and explain algebraic word problems. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 158-167, 2017.
+Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov. *Roberta: A robustly optimized BERT pretraining approach. CoRR*, abs/1907.11692, 2019.
+Christopher Manning, Mihai Surdeanu, John Bauer, Jenny Finkel, Steven Bethard, and David McClosky. The stanford corenlp natural language processing toolkit. In Proceedings of 52nd annual meeting of the association for computational linguistics: system demonstrations, pp. 55-60, 2014.
+Jiayuan Mao, Chuang Gan, Pushmeet Kohli, Joshua B. Tenenbaum, and Jiajun Wu. The neurosymbolic concept learner: Interpreting scenes, words, and sentences from natural supervision. In 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019, 2019.
+
+Sewon Min, Danqi Chen, Hannaneh Hajishirzi, and Luke Zettlemoyer. A discrete hard em approach for weakly supervised question answering. arXiv preprint arXiv:1909.04849, 2019.
+Arvind Neelakantan, Quoc V Le, Martin Abadi, Andrew McCallum, and Dario Amodei. Learning a natural language interface with neural programmer. arXiv preprint arXiv:1611.08945, 2016.
+Panupong Pasupat and Percy Liang. Compositional semantic parsing on semi-structured tables. ACL, 2015.
+Matthew E. Peters, Mark Neumann, Mohit Iyyer, Matt Gardner, Christopher Clark, Kenton Lee, and Luke Zettlemoyer. Deep contextualized word representations. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, NAACL-HLT 2018, New Orleans, Louisiana, USA, June 1-6, 2018, Volume 1 (Long Papers), pp. 2227-2237, 2018.
+Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. Squad: 100,000+ questions for machine comprehension of text. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, EMNLP 2016, Austin, Texas, USA, November 1-4, 2016, pp. 2383-2392, 2016.
+Siva Reddy, Danqi Chen, and Christopher D. Manning. Coqa: A conversational question answering challenge. TACL, 7:249-266, 2019.
+Scott Reed and Nando de Freitas. Neural programmer-interpreters. ICLR, 2016.
+Azriel Rosenfeld and Mark Thurston. Edge and curve detection for visual scene analysis. IEEE Transactions on computers, (5):562-569, 1971.
+Min Joon Seo, Aniruddha Kembhavi, Ali Farhadi, and Hannaneh Hajishirzi. Bidirectional attention flow for machine comprehension. In ICLR, 2017.
+Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in neural information processing systems, pp. 5998-6008, 2017.
+Oriol Vinyals, Meire Fortunato, and Navdeep Jaitly. Pointer networks. NIPS, 2015.
+Alex Wang, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel R. Bowman. GLUE: A multi-task benchmark and analysis platform for natural language understanding. In 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019, 2019.
+Wenhui Wang, Nan Yang, Furu Wei, Baobao Chang, and Ming Zhou. Gated self-matching networks for reading comprehension and question answering. 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. 189-198, 2017.
+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.
+Zhilin Yang, Zihang Dai, Yiming Yang, Jaime G. Carbonell, Ruslan Salakhutdinov, and Quoc V. Le. Xlnet: Generalized autoregressive pretraining for language understanding. CoRR, abs/1906.08237, 2019.
+Adams Wei Yu, David Dohan, Minh-Thang Luong, Rui Zhao, Kai Chen, Mohammad Norouzi, and Quoc V. Le. Qanet: Combining local convolution with global self-attention for reading comprehension. In 6th International Conference on Learning Representations, ICLR 2018, Vancouver, BC, Canada, April 30 - May 3, 2018, Conference Track Proceedings, 2018.
+Victor Zhong, Caiming Xiong, and Richard Socher. Seq2sql: Generating structured queries from natural language using reinforcement learning. arXiv:1709.00103, 2017.
+
+# A MORE DETAILS ABOUT THE INPUT PREPROCESSING
+
+We preprocess the input passages and questions in a similar way as the input preprocessing of DROP dataset described in (Andor et al., 2019). Specifically, to facilitate the usage of BERT, we split up the documents longer than $L = 512$ tokens. Meanwhile, we extract the locations and values of the numbers, so that they can be retrieved via indices when applying numerical operators. We apply the same input preprocessing on MathQA as well.
+
+# B MORE DISCUSSION ABOUT THE DOMAIN SPECIFIC LANGUAGE
+
+To better support numerical reasoning, sometimes we need to leverage pre-defined constants for our computation. On MathQA, we have shown that applying the constant 3600, which is provided in their pre-defined question-agnostic constant list, is necessary for the calculation in Table 3. Meanwhile, we find that defining such a constant list is also helpful on DROP benchmark. For example, a variant of the sample numerical operation question in Table 2 is "How many people, in terms of percentage, were not either solely white or solely African American?", and such questions are included in DROP dataset as well. In this case, unless we are able to use the number 100 in our calculation, there is no way to obtain the correct answer. Again, previous works design specialized modules to deal with such questions, which is the main role of the negation module illustrated in Figure 1. On the contrary, we introduce a constant list that is callable for every question, so that the model can learn to apply any constant covered in the list, without the need of manually designing separate modules for questions requiring different constants.
+
+In our evaluation, for DROP, we used [100, 12, 28, 29, 30, 31, 1, 0] as the constant list, which is helpful for percentage and date time calculation. For MathQA, we used the constant list provided in their public dataset, which includes 23 constants that cover common conversion between different units, domain-specific constants for geometry, physics and probability, etc.
+
+# C MORE DETAILS ABOUT THE MODEL ARCHITECTURE
+
+# C.1 READER
+
+The reader implementation is largely the same as (Andor et al., 2019). Specifically, for the embedding representation of the reader component, we feed the question and passage jointly into BERT, which provides the output vector of each input token $t_i$ as $e_i$ . Unless otherwise specified, the encoder is initialized with the uncased whole-word-masking version of BERTLarge. We denote the size of $e_i$ as $H_0$ .
+
+# C.2 PROGRAMMER
+
+The core architecture of the programmer is a 1-layer LSTM with the hidden size of $H = 512$ . To formally describe the input space and output space of the programmer, we denote $R$ as the size of the reserved tokens, which include both operators and constants in a domain-specific language, and the special start and end tokens [GO] and [EOF]; and $L = 512$ as the total number of the question and passage tokens in a single sample. Samples with fewer than $L = 512$ tokens will be padded with [EOF] tokens to achieve this length. In the following, we discuss the details of each component.
+
+Input embedding. At each timestep, the programmer could generate a program token from: (1) the reserved tokens of the domain-specific language; and (2) the input question and passage tokens. The embedding of the $i$ -th reserved token is
+
+$$
+h r _ {i} = E _ {r} ^ {T} r _ {i}
+$$
+
+Where $E_{r}$ is a trainable embedding matrix of size $R\times H$ , and $r_i$ is the one-hot encoding of the token.
+
+For the $i$ -th token in the input question and passage token list, their embedding is
+
+$$
+h t _ {i} = P _ {t} e _ {i}
+$$
+
+Where $P_{t}$ is a trainable projection matrix of size $H\times H_0$
+
+Attention module over the input. At each timetstep $T$ , let $[p_1, p_2, \dots, p_{T-1}]$ denote the list of program tokens that are already generated in previous timesteps, and we define $[hp_0, hp_1, hp_2, \dots, hp_{T-1}]$ as the decoder history, where $hp_0$ is the embedding vector of the [GO] token calculated as above; $[hp_1, hp_2, \dots, hp_{T-1}]$ are $H$ -dimensional vectors corresponding to the generated program token list, and we will discuss how they are computed later.
+
+Denote $(h_T, c_T) = \mathrm{LSTM}(hp_{T-1}, (h_{T-1}, c_{T-1}))$ as the hidden state of the LSTM decoder at timestep $T$ , where $(h_0, c_0)$ is the trainable initial state, and $hp_{T-1}$ is the LSTM input.
+
+For each of $hp_{i}$ in the decoder history, we compute
+
+$$
+v h _ {i} = W _ {h} h p _ {i}
+$$
+
+Where $W_{h}$ is a trainable matrix of size $H\times H$
+
+The attention weight of each $hp_{i}$ in the decoder history is computed as
+
+$$
+w h _ {i} = \frac {\exp (h _ {T} ^ {T} v h _ {i})}{\sum_ {j = 0} ^ {T - 1} \exp (h _ {T} ^ {T} v h _ {j})}
+$$
+
+The attention vector of the decoder history is thus
+
+$$
+a t t _ {h} = \sum_ {i = 0} ^ {T - 1} w h _ {i} \cdot h p _ {i}
+$$
+
+This formulation is similar to the attention mechanism introduced in prior work (Bahdanau et al., 2014). Correspondingly, we compute the attention vector of the passage tokens $att_{p}$ , and the attention vector of the question tokens $att_{q}$ .
+
+Afterwards, we compute
+
+$$
+v _ {T} = W _ {v} \left[ a t t _ {h}; a t t _ {q}; a t t _ {p}; h _ {T} \right]
+$$
+
+Where $W_{v}$ is a trainable matrix of size $H \times 4H$ , and $[a; b]$ denotes the concatenation of $a$ and $b$ .
+
+Program token prediction. We compute another attention vector of the question tokens $att_q'$ in a similar way as above, but with a different set of trainable parameters. Then for each input token, we have
+
+$$
+h t _ {i} ^ {\prime} = P ^ {\prime} [ h t _ {i}; h t _ {i} \circ a t t _ {q} ^ {\prime} ]
+$$
+
+$$
+h r _ {i} ^ {\prime} = P ^ {\prime} [ h r _ {i}; h r _ {i} \circ a t t _ {q} ^ {\prime} ]
+$$
+
+Where $P'$ is a trainable matrix of size $H \times 2H$ , and $\circ$ is the Hadamard product.
+
+Let $H_T'$ be a $(R + L) \times H$ -dimensional matrix, where the first $R$ rows are $hr_i'$ for $0 \leq i < R$ , and the next $L$ rows are $ht_i'$ for $0 \leq i < L$ . Then we compute
+
+$$
+w _ {T} ^ {\prime} = H _ {T} ^ {\prime} \cdot v _ {T}
+$$
+
+Where $w_{Ti}^{\prime}$ denotes the weight of selecting the $i$ -th token as the next program token. This design is similar to the pointer network (Vinyals et al., 2015).
+
+Note that a valid program should satisfy the grammar constraints, for instance, those listed in Table 1 on DROP dataset. Therefore, we compute a mask $m_T$ as an $(R + L)$ -dimensional vector, where $m_{Ti} = 1$ when the $i$ -th token is a valid next program token, and $m_{Ti} = 0$ if it is invalid. In the following, we take the DROP dataset as the example, and list some sample rules for mask generation:
+
+(1) At the beginning of the program generation, $m_{T_i} = 1$ iff the $i$ -th token denotes an operator;
+(2) When the previous generated program token $p_{T-1}$ is PASSAGE_SPAN, then $m_{Ti} = 1$ iff the $i$ -th token is from the passage. Similarly, if $p_{T-1}$ is QUESTION_SPAN, then $m_{Ti} = 1$ iff the $i$ -th token is from the question.
+(3) As discussed in Appendix A, we preprocess the data to extract the locations and values of numbers in the input question and passage, thus we can leverage it to generate masks for numerical calculation operators. Specifically, when $p_{T-1} \in \{\text{DIFF}, \text{SUM}, \text{VALUE}\}$ , $m_{T_i} = 1$ iff the $i$ -th token is from the constant list, or a number from either the input question or the passage.
+
+With the generated program mask, we compute
+
+$$
+w _ {T} = w _ {T} ^ {\prime} - C (1 - m _ {T})
+$$
+
+Where $C$ is a large positive constant to ensure that the weight of an invalid program token is much smaller than the valid program tokens. In practice, we use $C = 1e6$ . Such a grammar-based decoding process is a common practice in order to ensure the syntactic correctness of the generated programs (Krishnamurthy et al., 2017; Liang et al., 2017; Bunel et al., 2018).
+
+Afterwards, the model predicts $p_{T} = \arg \max_{i}(w_{T})$ as the next program token. We can also apply the beam search for decoding, but we find that the greedy decoding is already sufficient to provide good results, while the inference process is also much faster than the beam search.
+
+Finally, $hp_{T} = H_{Tp_{T}}^{\prime}$ is the vector representation corresponding to $p_T$ , which is appended to the decoder history for generating the next program token.
+
+# D MORE DETAILS ABOUT TRAINING
+
+# D.1 DATA AUGMENTATION
+
+In this section, we discuss the details of our data augmentation process for counting and sorting questions on DROP. To obtain training samples for counting questions with ground truth annotations, starting from the span selection questions in the training set, we filter out those questions that either can be answered by using the QUESTION_SPAN operation, or do not start with any interrogative in ["What", "Which", "Who", "Where"]. Afterwards, we replace the interrogative with "How many", and modify the ground truth program correspondingly. In this way, we can augment 15K additional questions for counting in DROP training set.
+
+To annotate the key-value pairs, for each entity recognized by the CoreNLP tool, we search for the numbers that are in the same clause as the entity, i.e., not separated by any punctuation mark, and discard those entities that do not have any nearby number satisfying this constraint. Afterwards, we filter out those questions that do not include any superlative in ["longest", "shortest", "largest", "smallest", "most" and "least"]. For the remaining questions, we call each of the sorting operations, i.e., ARGMAX, ARGMIN, MAX, MIN, with all extracted key-value pairs as the arguments. For ARGMAX and MAX operators, the key-value pairs are sorted in the descending order of their values; for ARGMIN and MIN operators, they are sorted in the increasing order of their values. If any of the resulted sorting program yields the correct answer, the program is included into the training set. In this way, we can annotate 0.9K questions using ARGMAX or ARGMIN operations, and 1.8K questions using MAX or MIN operations in DROP training set.
+
+# D.2 TRAINING CONFIGURATION
+
+For the training algorithm described in Algorithm 1, the initial threshold $\alpha_0 = 0.5$ , and the decay factor $\gamma = 0.5$ . We perform early stopping when both exact match and F1 score on the development
+
+| Passage | Question | Ground truth |
| ... but had to settle for a 23-yard field goal by kicker Matt Bryant ... | How many field goals shorter than 30 yards did Matt Bryant kick? | 3 |
| ... from a sample of 40 Sherman tanks, 33 tanks burned (82 percent) and 7 tanks remained unburned ... | How many more Sherman tanks burned out than survived in the Nor-mandy Campaign? | 22 |
+
+Table 9: Some samples in DROP training set with the wrong annotations, which are discarded by NeRd because none of the annotated programs passes the threshold of our training algorithm.
+
+| Question type | Passage | Question | Prediction |
| Question span | The campaigns of 1702 and 1703 showed his limitations as a field of ficer... In early 1704 , he spoke with the envoy of Savoy about possible opportunities in their army ... | What happened first, the Hague campaigns as field officer or he spoke with envoy of Savoy for opportunities in the army? | Prediction:
+QUESTION_SPAN(7,10)
+Result: “campaigns as field officer”
+Ground truth: “campaigns of 1702 and 1703” |
| Counting | ... The five regions with the lowest fertility rates were Beijing (0.71), Shanghai (0.74), Liaoning (0.74), Heilongjiang (0.75) ... | How many areas had a fertility rate of .74? | Prediction: COUNT( PASSAGE_SPAN(216, 216), PASSAGE_SPAN(223, 223), PASSAGE_SPAN(230, 231))
+Result: COUNT('Beijing”, “Shanghai”, “Liaoning”) = 3 Ground truth: 2 |
| Sorting | ... to set up Nugent's career-long 54-yard field goal to give the Jets a 9-3 lead ... The half ended when Brown came up five yards short on a 59-yard field goal attempt ... | How many yards was the longest field goal? | Program: MAX(Value(16), VALUE(20))
+Result: MAX(54, 59) = 59 Ground truth: 54 |
+
+Table 10: Examples of wrong predictions on DROP dev set.
+
+set do not improve for two consecutive training iterations. For both DROP and MathQA datasets, the training typically takes around $50K \sim 60K$ training steps.
+
+For both tasks in our evaluation, we train the model with Adam optimizer, with an initial learning rate of 5e-5, and batch size of 32. Gradients with $L_{2}$ norm larger than 1.0 are clipped.
+
+# E EXAMPLES OF WRONG ANNOTATIONS ON DROP
+
+Table 9 lists some examples of wrong annotations in DROP training set. Specifically, the first annotation is wrong because the crowd worker simply counts the number of field goals included in the entire passage, without considering the constraints of lengths and the kicker's name; on the other hand, the second mistake comes from the wrong numerical calculations. For both samples, the highest likelihood among all programs with the annotated answer is smaller than 1e-4, thus are not included during training, which is why the thresholding helps significantly.
+
+# F EXAMPLES OF WRONG PREDICTIONS ON DROP
+
+Table 10 presents some error cases of NeRd on DROP development set.
\ No newline at end of file
diff --git a/neuralsymbolicreaderscalableintegrationofdistributedandsymbolicrepresentationsforreadingcomprehension/images.zip b/neuralsymbolicreaderscalableintegrationofdistributedandsymbolicrepresentationsforreadingcomprehension/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..86436a00ea5ac378f16eece2711ae35913f0955e
--- /dev/null
+++ b/neuralsymbolicreaderscalableintegrationofdistributedandsymbolicrepresentationsforreadingcomprehension/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e0c30ced20fd76e9ef471e45706acc68aeca9da2e74c3c1aaac4b416d9fe4730
+size 838976
diff --git a/neuralsymbolicreaderscalableintegrationofdistributedandsymbolicrepresentationsforreadingcomprehension/layout.json b/neuralsymbolicreaderscalableintegrationofdistributedandsymbolicrepresentationsforreadingcomprehension/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..834c7fa306665fddeda7cd8cf24d7015e548ff6c
--- /dev/null
+++ b/neuralsymbolicreaderscalableintegrationofdistributedandsymbolicrepresentationsforreadingcomprehension/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:130281c2c00b08967e661b19a75313f7fd0d963da120c921ccf5fe03b299398e
+size 487373
diff --git a/neuraltangentsfastandeasyinfiniteneuralnetworksinpython/ae6b02c0-165d-4d5f-9be9-4f8815897d41_content_list.json b/neuraltangentsfastandeasyinfiniteneuralnetworksinpython/ae6b02c0-165d-4d5f-9be9-4f8815897d41_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..8b63e2e445b4550839246367196a84259f7f4dc5
--- /dev/null
+++ b/neuraltangentsfastandeasyinfiniteneuralnetworksinpython/ae6b02c0-165d-4d5f-9be9-4f8815897d41_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:83dbd710239e7522e355472bf8c432f4e66993826952dbbb6eb81eee7d02850b
+size 105377
diff --git a/neuraltangentsfastandeasyinfiniteneuralnetworksinpython/ae6b02c0-165d-4d5f-9be9-4f8815897d41_model.json b/neuraltangentsfastandeasyinfiniteneuralnetworksinpython/ae6b02c0-165d-4d5f-9be9-4f8815897d41_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..b27579dce58fc4774973cfc68e00a7d414ece27b
--- /dev/null
+++ b/neuraltangentsfastandeasyinfiniteneuralnetworksinpython/ae6b02c0-165d-4d5f-9be9-4f8815897d41_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f4d7af3f207d39b2a5d8305f713a0e67decdd9c3ffe57e69df3d0067025deefd
+size 130150
diff --git a/neuraltangentsfastandeasyinfiniteneuralnetworksinpython/ae6b02c0-165d-4d5f-9be9-4f8815897d41_origin.pdf b/neuraltangentsfastandeasyinfiniteneuralnetworksinpython/ae6b02c0-165d-4d5f-9be9-4f8815897d41_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..4656c73f39d6a640accd7bbb0597b932655d9ad6
--- /dev/null
+++ b/neuraltangentsfastandeasyinfiniteneuralnetworksinpython/ae6b02c0-165d-4d5f-9be9-4f8815897d41_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:75c73406342f3972aa3809b2e68a6c973f37bce1ab75dbe64fdf2eacedb506c5
+size 4803682
diff --git a/neuraltangentsfastandeasyinfiniteneuralnetworksinpython/full.md b/neuraltangentsfastandeasyinfiniteneuralnetworksinpython/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..0543fe8d244b5638c2ff32c9d95b1bc2dc0457dc
--- /dev/null
+++ b/neuraltangentsfastandeasyinfiniteneuralnetworksinpython/full.md
@@ -0,0 +1,483 @@
+# NEURAL TANGENTS: FAST AND EASY INFINITE NEURAL NETWORKS IN PYTHON
+
+Roman Novak,\* Lechao Xiao;\* Jiri Hron\*, Jaehoon Lee, Alexander A. Alemi, Jascha Sohl-Dickstein, Samuel S. Schoenholz\*
+
+Google Brain, †University of Cambridge
+{romann, xlc}@google.com, jh2084@cam.ac.uk, {jaehlee, alemi, jaschasd, schsam}@google.com
+
+# ABSTRACT
+
+NEURAL TANGENTS is a library for working with infinite-width neural networks. It provides a high-level API for specifying complex and hierarchical neural network architectures. These networks can then be trained and evaluated either at finitewidth as usual or in their infinite-width limit. Infinite-width networks can be trained analytically using exact Bayesian inference or using gradient descent via the Neural Tangent Kernel. Additionally, NEURAL TANGENTS provides tools to study gradient descent training dynamics of wide but finite networks in either function space or weight space.
+
+The entire library runs out-of-the-box on CPU, GPU, or TPU. All computations can be automatically distributed over multiple accelerators with near-linear scaling in the number of devices. NEURAL TANGENTS is available at
+
+www.github.com/google/neural-tangents
+
+We also provide an accompanying interactive Colab notebook1.
+
+# 1 INTRODUCTION
+
+Deep neural networks (DNNs) owe their success in part to the broad availability of high-level, flexible, and efficient software libraries like Tensorflow (Abadi et al., 2015), Keras (Chollet et al., 2015), PyTorch.nn (Paszke et al., 2017), Chainer (Tokui et al., 2015; Akiba et al., 2017), JAX (Bradbury et al., 2018a), and others. These libraries enable researchers to rapidly build complex models by constructing them out of smaller primitives. The success of new machine learning approaches will similarly depend on developing sophisticated software tools to support them.
+
+# 1.1 INFINITE-WIDTH BAYESIAN NEURAL NETWORKS
+
+Recently, a new class of machine learning models has attracted significant attention, namely, deep infinitely wide neural networks. In the infinite-width limit, a large class of Bayesian neural networks become Gaussian Processes (GPs) with a specific, architecture-dependent, compositional kernel; these models are called Neural Network Gaussian Processes (NNGPs). This correspondence was first established for shallow fully-connected networks by Neal (1994) and was extended to multi-layer setting in (Lee et al., 2018; Matthews et al., 2018b). Since then, this correspondence has been expanded to a wide range of nonlinearities (Matthews et al., 2018a; Novak et al., 2019) and architectures including those with convolutional layers (Garriga-Alonso et al., 2019; Novak et al., 2019), residual connections (Garriga-Alonso et al., 2019), pooling (Novak et al., 2019), as well as graph neural networks (Du et al., 2019). The results for individual architectures have subsequently been generalized, and it was shown that a GP correspondence holds for a general class of networks that can be mapped to so-called tensor programs in (Yang, 2019). The recurrence relationship defining
+
+the NNGP kernel has additionally been extensively studied in the context of mean field theory and initialization (Cho & Saul, 2009; Daniely et al., 2016; Poole et al., 2016; Schoenholz et al., 2016; Yang & Schoenholz, 2017; Xiao et al., 2018; Li & Nguyen, 2019; Pretorius et al., 2018; Hayou et al., 2018; Karakida et al., 2018; Blumenfeld et al., 2019; Hayou et al., 2019).
+
+# 1.2 INFINITE-WIDTH NEURAL NETWORKS TRAINED BY GRADIENT DESCENT
+
+In addition to enabling a closed form description of Bayesian neural networks, the infinite-width limit has also very recently provided insights into neural networks trained by gradient descent. In the last year, several papers have shown that randomly initialized neural networks trained with gradient descent are characterized by a distribution that is related to the NNGP, and is described by the so-called Neural Tangent Kernel (NTK) (Jacot et al., 2018; Lee et al., 2019; Chizat et al., 2019), a kernel which was implicit in some earlier papers (Li & Liang, 2018; Allen-Zhu et al., 2018; Du et al., 2018a;b; Zou et al., 2019). In addition to this "function space" perspective, a dual, "weight space" view on the wide network limit was proposed in Lee et al. (2019) which showed that networks under gradient descent were well-described by the first-order Taylor series about their initial parameters.
+
+# 1.3 PROMISE AND PRACTICAL BARRIERS TO WORKING WITH INFINITE-WIDTH NETWORKS
+
+Combined, these discoveries established infinite-width networks as useful theoretical tools to understand a wide range of phenomena in deep learning. Furthermore, the practical utility of these models has been proven by achieving state-of-the-art performance on image classification benchmarks among GPs without trainable kernels (Garriga-Alonso et al., 2019; Novak et al., 2019; Arora et al., 2019a), and by their ability to match or exceed the performance of finite width networks in some situations, especially for fully- and locally-connected model families (Lee et al., 2018; Novak et al., 2019; Arora et al., 2019b).
+
+However, despite their utility, using NNGPs and NTK-GPs is arduous and can require weeks-to-months of work by seasoned practitioners. Kernels corresponding to neural networks must be derived by hand on a per-architecture basis. Overall, this process is laborious and error prone, and is reminiscent of the state of neural networks before high quality Automatic Differentiation (AD) packages proliferated.
+
+# 1.4 SUMMARY OF CONTRIBUTIONS
+
+In this paper, we introduce a new open-source software library called NEURAL TANGENTS targeting JAX (Bradbury et al., 2018a) to accelerate research on infinite limits of neural networks. The main features of NEURAL TANGENTS are:
+
+- A high-level neural network API for specifying complex, hierarchical, models. Networks specified using this API can have their infinite-width NNGP kernel and NTK evaluated analytically (§2.1, Listings 1, 2, 3, §B.2).
+- Functions to approximate infinite-width kernels by Monte Carlo sampling for networks whose kernels cannot be constructed analytically. These methods are agnostic to the neural network library used to build the network and are therefore quite versatile (§2.2, Figure 2, §B.5).
+- An API to analytically perform inference using infinite-width networks either by computing the Bayesian posterior or by computing the result of continuous gradient descent with an MSE loss. The API additionally includes tools to perform inference by numerically solving the ODEs corresponding to: continuous gradient descent, with-or-without momentum, on arbitrary loss functions, at finite or infinite time (§2.1, Figure 1, §B.4).
+- Functions to compute arbitrary-order Taylor series approximations to neural networks about a given setting of parameters to explore the weight space perspective on the infinite-width limit (§B.6, Figure 6).
+- Leveraging XLA, our library runs out-of-the-box on CPU, GPU, or TPU. Kernel computations can automatically be distributed over multiple accelerators with near-perfect scaling (§3.2, Figure 5, §B.3).
+
+We begin with three short examples (\$2) that demonstrate the ease, efficiency, and versatility of performing calculations with infinite networks using NEURAL TANGENTS. With a high level view of the library in hand, we then dive into a number of technical aspects of our library (\$3).
+
+# 1.5 BACKGROUND
+
+We briefly describe the NNGP (§1.1) and NTK (§1.2). NNGP. Neural networks are often structured as affine transformations followed by pointwise applications of nonlinearities. Let $z_{i}^{l}(x)$ describe the $i^{\text{th}}$ pre-activation following a linear transformation in $l^{\text{th}}$ layer of a neural network. At initialization, the parameters of the network are randomly distributed and so central-limit theorem style arguments can be used to show that the pre-activations become Gaussian distributed with mean zero and are therefore described entirely by their covariance matrix $\mathcal{K}(x,x') = \mathbb{E}[z_i^l (x)z_i^l (x')]$ . This describes a NNGP with the kernel, $\mathcal{K}(x,x')$ . One can use the NNGP to make Bayesian posterior predictions at a test point, $x$ , which are Gaussian distributed with with mean $\mu (x) = \mathcal{K}(x,\mathcal{X})\mathcal{K}(\mathcal{X},\mathcal{X})^{-1}\mathcal{Y}$ and variance $\sigma^2 (x) = \mathcal{K}(x,x) - \mathcal{K}(x,\mathcal{X})\mathcal{K}(\mathcal{X},\mathcal{X})^{-1}\mathcal{K}(\mathcal{X},x)$ , where $(\mathcal{X},\mathcal{Y})$ is the training set of inputs and targets respectively. NTK. When neural networks are optimized using continuous gradient descent with learning rate $\eta$ on mean squared error (MSE) loss, the function evaluated on training points evolves as $\partial_t f_t(\mathcal{X}) = -\eta J_t(\mathcal{X})J_t(\mathcal{X})^T$ $(f_{t}(\mathcal{X}) - \mathcal{Y})$ where $J_{t}(\mathcal{X})$ is the Jacobian of the output $f_{t}$ evaluated at $\mathcal{X}$ and $\Theta_t(\mathcal{X},\mathcal{X}) = J_t(\mathcal{X})J_t(\mathcal{X})^T$ is the NTK. In the infinite-width limit, the NTK remains constant $(\Theta_{t} = \Theta)$ throughout training and the time-evolution of the outputs can be solved in closed form as a Gaussian with mean $f_{t}(x) = \Theta (x,\mathcal{X})\Theta (\mathcal{X},\mathcal{X})^{-1}$ $I - \exp [-\eta \Theta (\mathcal{X},\mathcal{X})t]) \mathcal{Y}$ .
+
+# 2 EXAMPLES
+
+We begin by applying NEURAL TANGENTS to several example tasks. While these tasks are designed for pedagogy rather than research novelty, they are nonetheless emblematic of problems regularly faced in research. We emphasize that without NEURAL TANGENTS, it would be necessary to derive the kernels for each architecture by hand.
+
+# 2.1 INFERENCE WITH AN INFINITELY WIDE NEURAL NETWORK
+
+We begin by training an infinitely wide neural network with gradient descent and comparing the result to training an ensemble of wide-but-finite networks. This example is worked through in detail in the Colab notebook.3
+
+We train on a synthetic dataset with training data drawn from the process $y_{i} = \sin (x_{i}) + \epsilon_{i}$ with $x_{i}\sim \mathrm{Uniform}(-\pi ,\pi)$ and $\epsilon_{i}\sim \mathcal{N}(0,\sigma^{2})$ independently and identically distributed. To train an infinite neural network with Erf activations4 on this data using gradient descent and an MSE loss we write the following:
+
+```python
+from neural_tangents import predict, stax
+init_fn, apply_fn, kernel_fn = stax.train(
+ stax.Dense(2048, W_std=1.5, b_std=0.05), stax.Erf(),
+ stax.Dense(2048, W_std=1.5, b_std=0.05), stax.Erf(),
+ stax.Dense(1, W_std=1.5, b_std=0.05))
+y_mean, y_var = predict.gp_inference(kernel_fn, x_train, y_train, x_test, 'ntk',
+ diag_reg=1e-4, compute_cov=True)
+```
+
+The above code analytically generates the predictions that would result from performing gradient descent for an infinite amount of time. However, it is often desirable to investigate finite-time learning dynamics of deep networks. This is also supported in NEURAL TANGENTS as illustrated in the following snippet:
+
+
+Figure 1: Training dynamics for an ensemble of finite-width networks compared with an infinite network. Left: Mean and variance of the train and test MSE loss evolution throughout training. Right: Comparison between the predictions of the trained infinite network and the respective ensemble of finite-width networks. The shaded region and the dashed lines denote two standard deviations of uncertainty in the predictions for the infinite network and the ensemble respectively.
+
+
+
+```hcl
+predict_fn = predict~-predict~-predict~-predict~-predict~-predict~-predict~-predict~-predict~-predict~-predict~-predict~-predict~-predict~-predict~-predict~-predict~-predict~-predict~-predict~-predict~-predict~-predict~-predict~-predict~-predict~-predict~-predict~-predict~-predict~-predict~-predict~-predict~-predict~-predict~-predict~-predict~-predict~-predict~-predict~-predict~-predict~-predict~-predict~-predict~-predict~-predict~-predict~-predict~-predict~-predict~-Predict
+```
+
+The above specification set the hidden layer widths to 2048, which has no effect on the infinite width network inference, but the init_fn and apply_fn here correspond to ordinary finite width networks. In Figure 1 we compare the result of this exact inference with training an ensemble of one-hundred of these finite-width networks by looking at the training curves and output predictions of both models. We see excellent agreement between exact inference using the infinite-width model and the result of training an ensemble using gradient descent.
+
+# 2.2 AN INFINITELY WIDERESNET
+
+The above example considers a relatively simple network on a synthetic task. In practice we may want to consider real-world architectures, and see how close they are to their infinite-width limit. For this task we study a variant of an infinite-channel Wide Residual Network (Zagoruyko & Komodakis, 2016) (WRN-28-∞). We first define both finite and infinite models within Listing 1.
+
+We now study how quickly the kernel of the finite-channel WideResNet approaches its infinite channel limit. We explore two different axes along which convergence takes place: first, as a function of the number of channels (as measured by the widening factor, $k$ ) and second as a function of the number of finite-network Monte Carlo samples we average over. NEURAL TANGENTS makes it easy to compute MC averages of finite kernels using the following snippet:
+
+```python
+kernel_fn = nt.monte_carlo_kernel_fn(init_fn, apply_fn, lng_key, n_samples)
+sampled_kernel = kernel_fn(x, x)
+```
+
+The convergence is shown in Figure 2. We see that as both the number of samples is increased or the network is made wider, the empirical kernel approaches the kernel of the infinite network. As noted in Novak et al. (2019), for any finite widening factor the MC estimate is biased. Here, however, the bias is small relative to the variance and the distance to the empirical kernel decreases with the number of samples.
+
+# 2.3 COMPARISON OF NEURAL NETWORK ARCHITECTURES AND TRAINING SET SIZES
+
+The above examples demonstrate how one might construct a complicated architecture and perform inference using NEURAL TANGENTSNext we train a range of architectures on CIFAR-10 and compare their performance as a function of dataset size. In particular, we compare a fully-connected network,
+
+a convolutional network whose penultimate layer vectorizes the image, and the wide-residual network described above. In each case, we perform exact infinite-time inference using the analytic infinitewidth NNGP or NTK. For each architecture we perform a hyperparameter search over the depth of the network, selecting the depth that maximizes the marginal log likelihood on the training set.
+
+```python
+def WideResNetBlock(channels, strides=(1, 1), channel_mismatch=False):
+ Main = stax.serialize(stax.Relu(), stax.Conv(channels, (3, 3), strides, padding='SAME'),
+ stax.Relu(), stax.Conv(channels, (3, 3), padding='SAME'))
+ Shortcut = (stax.Identity() if not channel_mismatch else
+ stax.Conv(channels, (3, 3), strides, padding='SAME'))
+ return stax.serialize(stax.FanOut(2), staxallel(Main, Shortcut), stax.FanInSum()))
+def WideResNetGroup(n, channels, strides=(1, 1)):
+ blocks = [WideResNetBlock(channels, strides, channel_mismatch=True)]
+ for _ in range(n - 1):
+ blocks += [WideResNetBlock(channels, (1, 1))]
+ return stax.serialize(*blocks)
+def WideResNet(block_size, k, num_classes):
+ return stax.serialize(stax.Conv(16, (3, 3), padding='SAME'),
+ WideResNetGroup(block_size, int(16 * k)),
+ WideResNetGroup(block_size, int(32 * k), (2, 2)),
+ WideResNetGroup(block_size, int(64 * k), (2, 2)),
+ stax.GlobalAvgPool(), stax.Dense(num_classes))
+init_fn, apply_fn, kernel_fn = WideResNet(block_size=4, k=1, num_classes=10)
+```
+
+Listing 1: Definition of an infinitely WideResNet. This snippet simultaneously defines a finite (init_fn, apply_fn) and an infinite (kernel_fn) model. This model is used in Figures 2 and 3.
+
+
+Figure 2: Convergence of the Monte Carlo (MC) estimates of the WideResNet WRN-28- $k$ (where $k$ is the widening factor) NNGP and NTK kernels (computed with monte_carlo_kernel_fn) to their analytic values (WRN-28- $\infty$ , computed with kernel_fn), as the network gets wider by increasing the widening factor (vertical axis) and as more random networks are averaged over (horizontal axis). Experimental detail. The kernel is computed in 32-bit precision on a $100 \times 50$ batch of $8 \times 8$ -downsampled CIFAR10 (Krizhevsky, 2009) images. For sampling efficiency, for NNGP the output of the penultimate layer was used, and for NTK the output layer was assumed to be of dimension 1 (all logits are i.i.d. conditioned on a given input). The displayed distance is the relative Frobenius norm squared, i.e. $\| \mathcal{K} - \mathcal{K}_{k,n} \|_{\mathrm{F}}^2 / \| \mathcal{K} \|_{\mathrm{F}}^2$ , where $k$ is the widening factor and $n$ is the number of samples.
+
+
+
+
+Figure 3: CIFAR-10 classification with varying neural network architectures. NEURAL TANGENTS simplify experimentation with architectures. Here we use infinite time NTK inference and full Bayesian NNGP inference for CIFAR-10 for Fully Connected (FC, Listing 3), Convolutional network without pooling (CONV, Listing 2), and Wide Residual Network w/ pooling (WRESNET, Listing 1). As is common in prior work (Lee et al., 2018; Novak et al., 2019), the classification task is treated as MSE regression on zero-mean targets like $(-0.1, \dots, -0.1, 0.9, -0.1, \dots, -0.1)$ . For each training set size, the best model in the family is selected by minimizing the mean negative marginal log-likelihood (NLL, right) on the training set.
+
+
+
+
+
+The results are shown in Figure 3. We see that in each case the performance of the model increases approximately logarithmically in the size of the dataset. Moreover, we observe a clear hierarchy of performance, especially at large dataset size, in terms of architecture (FC < CONV < WRESNET w/ pooling).
+
+# 3 IMPLEMENTATION: TRANSFORMING TENSOR OPS TO KERNEL OPS
+
+Neural networks are compositions of basic tensor operations such as: dense or convolutional affine transformations, application of pointwise nonlinearities, pooling, or normalization. For most networks without weight tying between layers the kernel computation can also be written compositionally and there is a direct correspondence between tensor operations and kernel operations (see §3.1 for an example). The core logic of NEURAL TANGENTS is a set of translation rules, that sends each tensor operation acting on a finite-width layer to a corresponding transformation of the kernel for an infinite-width network. This is illustrated in Figure 4 for a simple convolutional architecture. In the associated table, we compare tensor operations (second column) with corresponding transformations of the NT and NNGP kernel tensors (third and fourth column respectively). See §D for a list of all tensor operations for which translation rules are currently implemented.
+
+One subtlety to consider when designing networks is that most infinite-width results require nonlinear transformations to be preceded by affine transformations (either dense or convolutional). This is because infinite-width results often assume that the pre-activations of nonlinear layers are approximately Gaussian. Randomness in weights and biases causes the output of infinite affine layers to satisfy this Gaussian requirement. Fortunately, Prefacing nonlinear operations with affine transformations is common practice when designing neural networks and NEURAL TANGENTS will raise an error if this requirement is not satisfied.
+
+# 3.1 A TASTE OF TENSOR-TO-Kernel OPS TRANSLATION
+
+To get some intuition behind the translation rules, we consider the case of a nonlinearity followed by a dense layer. Let $z = z(\mathcal{X},\theta)\in \mathbb{R}^{d\times n}$ be the preactivations resulting from $d$ distinct inputs at a node in some hidden layer of a neural network. Suppose $z$ has NNGP kernel and NTK given by
+
+$$
+\mathcal {K} _ {z} = \mathbb {E} _ {\theta} \left[ z _ {i} z _ {i} ^ {T} \right], \quad \Theta_ {z} = \mathbb {E} _ {\theta} \left[ \frac {\partial z _ {i}}{\partial \theta} \left(\frac {\partial z _ {i}}{\partial \theta}\right) ^ {T} \right] \tag {1}
+$$
+
+where $z_{i}\in \mathbb{R}^{d}$ is the $i^{\mathrm{th}}$ neuron and $\theta$ are the parameters in the network up until $z$ . Here $d$ is the cardinality of the network inputs $\mathcal{X}$ and $n$ is the number of neurons in the $z$ node. We
+
+
+
+
+not always necessary to track the whole $4\mathrm{x}4\mathrm{x}10\mathrm{x}10$ covariance.)
+Figure 4: An example of the translation of a convolutional neural network into a sequence of kernel operations. We demonstrate how the compositional nature of a typical NN computation on its inputs induces a corresponding compositional computation on the NNGP and NT kernels. Presented is a 2-hidden-layer 1D CNN with nonlinearity $\phi$ , performing regression on the 10-dimensional outputs $z^2$ for each of the 4 (1, 2, 3, 4) inputs $x$ from the dataset $\mathcal{X}$ . To declutter notation, unit weight and zero bias variances are assumed in all layers. Top: recursive output ( $z^2$ ) computation in the CNN (top) induces a respective recursive NNGP kernel ( $\tilde{\mathcal{K}}^2 \otimes I_{10}$ ) computation (NTK computation being similar, not shown). Bottom: explicit listing of tensor and corresponding kernel ops in each layer. See Table 1 for operation definitions. Illustration and description adapted from Figure 3 in Novak et al. (2019).
+
+| Layer | Tensor Op | NNGP Op | NTK Op |
| 0 (input) | y0= X | K0=XXT | Θ0= 0 |
| 0 (pre-activations) | z0= Conv(y0) | K0= A(K0) | Θ0= K0+ A(Θ0) |
| 1 (activations) | y1= φ(z0) | K1=T(K0) | Θ1= T(K0) ⊙ Θ0 |
| 1 (pre-activations) | z1= Conv(y1) | K1= A(K1) | Θ1= K1+ A(Θ1) |
| 2 (activations) | y2= φ(z1) | K2=T(K1) | Θ2= T(K1) ⊙ Θ1 |
| 2 (readout) | z2= Dense ∘ Flatten(y2) | K2= Tr(K2) | Θ2= K2+ Tr(Θ2) |
+
+assume $z$ is a mean zero multivariate Gaussian. We wish to compute the kernel corresponding to $h = \mathrm{Dense}(\sigma_{\omega},\sigma_b)(\phi (z))$ by computing the kernels of $y = \phi (z)$ and $h = \mathrm{Dense}(\sigma_{\omega},\sigma_b)(y)$ separately. Here,
+
+$$
+h = \operatorname {D e n s e} \left(\sigma_ {\omega}, \sigma_ {b}\right) (y) \equiv \left(1 / \sqrt {n}\right) \sigma_ {\omega} W y + \sigma_ {b} \beta , \tag {2}
+$$
+
+and the variables $W_{ij}$ and $\beta_{i}$ are i.i.d. Gaussian $\mathcal{N}(0,1)$ . We will compute kernel operations - denoted $\phi^{*}$ and $\mathrm{Dense}(\sigma_{\omega},\sigma_b)^*$ - induced by the tensor operations $\phi$ and $\mathrm{Dense}(\sigma_{\omega},\sigma_b)^5$ . Finally, we will compute the kernel operation associated with the composition $(\mathrm{Dense}(\sigma_{\omega},\sigma_b)\circ \phi)^* = \mathrm{Dense}(\sigma_{\omega},\sigma_b)^*\circ \phi^*$ .
+
+First we compute the NNGP and NT kernels for $y$ . To compute $\mathcal{K}_y$ note that from its definition,
+
+$$
+\mathcal {K} _ {y} = \mathcal {K} _ {\phi (z)} = \mathbb {E} _ {\theta} [ \phi (z) _ {i} \phi (z) _ {i} ^ {T} ] = \mathbb {E} _ {\theta} [ \phi (z _ {i}) \phi (z _ {i}) ^ {T} ] = \mathcal {T} (\mathcal {K} _ {z}). \tag {3}
+$$
+
+Since $\phi$ does not introduce any new variables $\Theta_y$ can be computed as,
+
+$$
+\Theta_ {y} = \mathbb {E} _ {\theta} \left[ \frac {\partial \phi (z _ {i})}{\partial \theta} \left(\frac {\partial \phi (z _ {i})}{\partial \theta}\right) ^ {T} \right] = \mathbb {E} _ {\theta} \left[ \operatorname {d i a g} (\dot {\phi} (z _ {i})) \frac {\partial z _ {i}}{\partial \theta} \left(\frac {\partial z _ {i}}{\partial \theta}\right) ^ {T} \operatorname {d i a g} (\dot {\phi} (z _ {i})) \right] = \dot {\mathcal {T}} (\mathcal {K} _ {z}) \odot \Theta_ {z}.
+$$
+
+Taken together these equations imply that,
+
+$$
+\left(\mathcal {K} _ {y}, \Theta_ {y}\right) = \phi^ {*} \left(\mathcal {K} _ {z}, \Theta_ {z}\right) \equiv \left(\mathcal {T} \left(\mathcal {K} _ {z}\right), \dot {\mathcal {T}} \left(\mathcal {K} _ {z}\right) \odot \Theta_ {z}\right) \tag {4}
+$$
+
+will be the translation rule for a pointwise nonlinearity. Note that Equation 4 only has an analytic expression for a small set of activation functions $\phi$ .
+
+Next we consider the case of a dense operation. Using the independence between the weights, the biases, and $h$ it follows that,
+
+$$
+\mathcal {K} _ {h} = \mathbb {E} _ {W, \beta , \theta} \left[ h _ {i} h _ {i} ^ {T} \right] = \sigma_ {\omega} ^ {2} \mathbb {E} _ {\theta} \left[ y _ {i} y _ {i} ^ {T} \right] + \sigma_ {b} ^ {2} = \sigma_ {\omega} ^ {2} \mathcal {K} _ {y} + \sigma_ {b} ^ {2}. \tag {5}
+$$
+
+Finally, the NTK of $h$ can be computed as a sum of two terms:
+
+$$
+\Theta_ {h} = \mathbb {E} _ {W, \beta , \theta} \left[ \frac {\partial h _ {i}}{\partial (W , \beta)} \left(\frac {\partial h _ {i}}{\partial (W , \beta)}\right) ^ {T} \right] + \mathbb {E} _ {W, \beta , \theta} \left[ \frac {\partial h _ {i}}{\partial \theta} \left(\frac {\partial h _ {i}}{\partial \theta}\right) ^ {T} \right] = \sigma_ {\omega} ^ {2} \mathcal {K} _ {y} + \sigma_ {b} ^ {2} + \sigma_ {\omega} ^ {2} \Theta_ {y}. \tag {6}
+$$
+
+This gives the translation rule for the dense layer in terms of $\mathcal{K}_y$ and $\Theta_y$ as,
+
+$$
+\left(\mathcal {K} _ {h}, \Theta_ {h}\right) = \operatorname {D e n s e} \left(\sigma_ {\omega}, \sigma_ {b}\right) ^ {*} \left(\mathcal {K} _ {y}, \Theta_ {y}\right) \equiv \left(\sigma_ {\omega} ^ {2} \mathcal {K} _ {y} + \sigma_ {b} ^ {2}, \sigma_ {\omega} ^ {2} \mathcal {K} _ {y} + \sigma_ {b} ^ {2} + \sigma_ {\omega} ^ {2} \Theta_ {y}\right). \tag {7}
+$$
+
+# 3.2 PERFORMANCE
+
+Our library performs a number of automatic performance optimizations without sacrificing flexibility.
+
+Leveraging block-diagonal covariance structure. A common computational challenge with GPs is inverting the training set covariance matrix. Naively, for a classification task with $C$ classes and training set $\mathcal{X}$ , NNGP and NTK covariances have the shape of $|\mathcal{X}|C\times |\mathcal{X}|C$ . For CIFAR-10, this would be $500,000\times 500,000$ . However, if a fully-connected readout layer is used (which is an extremely common design in classification architectures), the $C$ logits are i.i.d. conditioned on the input $x$ . This results in outputs that are normally distributed with a block-diagonal covariance matrix of the form $\Sigma \otimes I_C$ , where $\Sigma$ has shape $|\mathcal{X}|\times |\mathcal{X}|$ and $I_{C}$ is the $C\times C$ identity matrix. This reduces the computational complexity and storage in many common cases by an order of magnitude, which makes closed-form exact inference feasible in these cases.
+
+Automatically tracking only the smallest necessary subset of intermediary covariance entries. For most architectures, especially convolutional, the main computational burden lies in constructing the covariance matrix (as opposed to inverting it). Specifically for a convolutional network of depth $l$ , constructing the $|\mathcal{X}| \times |\mathcal{X}|$ output covariance matrix, $\Sigma$ , involves computing $l$ intermediate layer covariance matrices, $\Sigma^l$ , of size $|\mathcal{X}|d \times |\mathcal{X}|d$ (see Listing 1 for a model requiring this computation) where $d$ is the total number of pixels in the intermediate layer outputs (e.g. $d = 1024$ in the case of CIFAR-10 with SAME padding). However, as Xiao et al. (2018); Novak et al. (2019); Garriga-Alonso et al. (2019) remarked, if no pooling is used in the network the output covariance $\Sigma$ can be computed by only using the stack of $d|\mathcal{X}| \times |\mathcal{X}|$ -blocks of $\Sigma^l$ , bringing the time and memory cost from $\mathcal{O}(|\mathcal{X}|^2d^2)$ down to $\mathcal{O}(|\mathcal{X}|^2d)$ per layer (see Figure 4 and Listing 2 for models admitting this optimization). Finally, if the network has no convolutional layers, the cost further reduces to $\mathcal{O}(|\mathcal{X}|^2)$ (see Listing 3 for an example). These choices are performed automatically by NEURAL TANGENTS to achieve efficient computation and minimal memory footprint.
+
+Expressing covariance computations as 2D convolutions with optimal layout. A key insight to high performance in convolutional models is that the covariance propagation operator for convolutional layers $\mathcal{A}$ can be expressed in terms of 2D convolutions when it operates on both the full $|\mathcal{X}|d\times |\mathcal{X}|d$ covariance matrix $\Sigma$ , and on the $d$ diagonal $|\mathcal{X}|\times |\mathcal{X}|$ -blocks. This allows utilization of modern hardware accelerators, many of which target 2D convolutions as their primary machine learning application.
+
+Simultaneous NNGP and NT kernel computations. As NTK computation requires the NNGP covariance as an intermediary computation, the NNGP covariance is computed together with the NTK at no extra cost. This is especially convenient for researchers looking to investigate similarities and differences between these two infinite-width NN limits.
+
+Automatic batching and parallelism across multiple devices. In most cases as the dataset or model becomes large, it is impossible to perform the entire kernel computation at once. Additionally, in many cases it is desirable to parallelize the kernel computation across devices (CPUs, GPUs, or TPUs). NEURAL TANGENTS provides an easy way to perform both of these common tasks using a single batch decorator shown below:
+
+
+Figure 5: Performance scaling with batch size (left) and number of GPUs (right). Shows time per entry needed to compute the analytic NNGP and NTK covariance matrices (using kernel_fn) in a 21-layer ReLU network with global average pooling. Left: Increasing the batch size when computing the covariance matrix in blocks allows for a significant performance increase until a certain threshold when all cores in a single GPU are saturated. Simpler models are expected to have better scaling with batch size. Right: Time-per-sample scales linearly with the number of GPUs, demonstrating near-perfect hardware utilization.
+
+
+
+```python
+batched_kernel_fn = nt.batch(kernel_fn, batch_size)
+batched_kernel_fn(x, x) == kernel_fn(x, x) # True!
+```
+
+This code works with either analytic kernels or empirical kernels. By default, it automatically shares the computation over all available devices. We plot the performance as a function of batch size and number of accelerators when computing the theoretical NTK of a 21-layer convolutional network in Figure 5, observing near-perfect scaling with the number of accelerators.
+
+Op fusion. JAX and XLA allow end-to-end compilation of the whole kernel computation and/or inference. This enables the XLA compiler to fuse low-level ops into custom model-specific accelerator kernels, as well as eliminating overhead from op-by-op dispatch to an accelerator. In similar vein, we allow the covariance tensor to change its order of dimensions from layer to layer, with the order tracked and parsed as additional metadata under the hood. This eliminates redundant transpositions by adjusting the computation performed by each layer based on the input metadata.
+
+# 4 CONCLUSION
+
+We believe NEURAL TANGENTS will enable researchers to quickly and easily explore infinite-width networks. By democratizing this previously challenging model family, we hope that researchers will begin to use infinite neural networks, in addition to their finite counterparts, when faced with a new problem domain (especially in cases that are data-limited). In addition, we are excited to see novel uses of infinite networks as theoretical tools to gain insight and clarity into many of the hard theoretical problems in deep learning. Going forward, there are significant additions to NEURAL TANGENTS that we are exploring. There are more layers we would like to add in the future (\$D) that will enable an even larger range of infinite network topologies. Additionally, there are further performance improvements we would like to implement, to allow experimenting with larger models and datasets. We invite the community to join our efforts by contributing new layers to the library (\$B.7), or by using it for research and providing feedback!
+
+# ACKNOWLEDGMENTS
+
+We thank Yasaman Bahri for frequent discussion and useful feedback on the manuscript. We additionally appreciate both Yasaman Bahri and Greg Yang for the ongoing contributions to improve the library. We thank Sergey Ioffe for feedback on the text, as well as Ravid Ziv, and Jeffrey Pennington for discussion and feedback on early versions of the library.
+
+# REFERENCES
+
+Martín Abadi, Ashish Agarwal, Paul Barham, Eugene Brevdo, Zhifeng Chen, Craig Citro, Greg S. Corrado, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Ian Goodfellow, Andrew Harp, Geoffrey Irving, Michael Isard, Yangqing Jia, Rafal Jozefowicz, Lukasz Kaiser, Manjunath Kudlur, Josh Levenberg, Dan Mané, Rajat Monga, Sherry Moore, Derek Murray, Chris Olah, Mike Schuster, Jonathon Shlens, Benoit Steiner, Ilya Sutskever, Kunal Talwar, Paul Tucker, Vincent Vanhoucke, Vijay Vasudevan, Fernanda Viégas, Oriol Vinyals, Pete Warden, Martin Wattenberg, Martin Wicke, Yuan Yu, and Xiaojiang Zheng. TensorFlow: Large-scale machine learning on heterogeneous systems, 2015. URL http://tensorflow.org/. Software available from tensorflow.org.
+Takuya Akiba, Keisuke Fukuda, and Shuji Suzuki. ChainerMN: Scalable Distributed Deep Learning Framework. In Proceedings of Workshop on ML Systems in The Thirty-first Annual Conference on Neural Information Processing Systems (NIPS), 2017. URL http://learningsys.org/nips17/ assets/papers/paper_25.pdf.
+Zeyuan Allen-Zhu, Yanzhi Li, and Zhao Song. A convergence theory for deep learning via overparameterization. In International Conference on Machine Learning, 2018.
+Anonymous. Infinite attention: Nngp and ntk for deep attention networks. In International Conference on Machine Learning (ICML), 2020. submission under review.
+Sanjeev Arora, Simon S Du, Wei Hu, Zhiyuan Li, Ruslan Salakhutdinov, and Ruosong Wang. On exact computation with an infinitely wide neural net. In Advances In Neural Information Processing Systems, 2019a.
+Sanjeev Arora, Simon S. Du, Zhiyuan Li, Ruslan Salakhutdinov, Ruosong Wang, and Dingli Yu. Harnessing the power of infinitely wide deep nets on small-data tasks, 2019b.
+Yaniv Blumenfeld, Dar Gilboa, and Daniel Soudry. A mean field theory of quantized deep networks: The quantization-depth trade-off. arXiv preprint arXiv:1906.00771, 2019.
+James Bradbury, Roy Frostig, Peter Hawkins, Matthew James Johnson, Chris Leary, Dougal Maclaurin, and Skye Wanderman-Milne. JAX: composable transformations of Python+NumPy programs, 2018a. URL http://github.com/google/jax.
+James Bradbury, Roy Frostig, Peter Hawkins, Matthew James Johnson, Chris Leary, Dougal Maclaurin, and Skye Wanderman-Milne. Stax, a flexible neural net specification library in jax, 2018b. URL https://github.com/google/jax/blob/master/jax/experimental/stax.py.
+Lenaic Chizat, Edouard Oyallon, and Francis Bach. On lazy training in differentiable programming. arXiv preprint arXiv:1812.07956, 2019.
+Youngmin Cho and Lawrence K Saul. Kernel methods for deep learning. In Advances In Neural Information Processing Systems, 2009.
+François Chollet et al. Keras. https://keras.io, 2015.
+Amit Daniely, Roy Frostig, and Yoram Singer. Toward deeper understanding of neural networks: The power of initialization and a dual view on expressivity. In Advances In Neural Information Processing Systems, pp. 2253-2261, 2016.
+Simon S Du, Jason D Lee, Haochuan Li, Liwei Wang, and Xiyu Zhai. Gradient descent finds global minima of deep neural networks. arXiv preprint arXiv:1811.03804, 2018a.
+Simon S Du, Xiyu Zhai, Barnabas Poczos, and Aarti Singh. Gradient descent provably optimizes over-parameterized neural networks. arXiv preprint arXiv:1810.02054, 2018b.
+Simon S Du, Kangcheng Hou, Russ R Salakhutdinov, Barnabas Poczos, Ruosong Wang, and Keyulu Xu. Graph neural tangent kernel: Fusing graph neural networks with graph kernels. In H. Wallach, H. Larochelle, A. Beygelzimer, F. d'Alché-Buc, E. Fox, and R. Garnett (eds.), Advances in Neural Information Processing Systems 32, pp.
+
+5724-5734. Curran Associates, Inc., 2019. URL http://papers.nips.cc/paper/8809-graph-neural-tangent-kernel-fusing-graph-neural-networks-with-graph-kernels.pdf.
+Jacob R Gardner, Geoff Pleiss, David Bindel, Kilian Q Weinberger, and Andrew Gordon Wilson. Gpytorch: Blackbox matrix-matrix gaussian process inference withgpu acceleration. In Advances in Neural Information Processing Systems, 2018.
+Adrià Garriga-Alonso, Carl Edward Rasmussen, and Laurence Aitchison. Deep convolutional networks as shallow gaussian processes. In International Conference on Learning Representations, 2019.
+GPy. GPy: A gaussian process framework in python. http://github.com/SheffieldML/GPy, 2012.
+Soufiane Hayou, Arnaud Doucet, and Judith Rousseau. On the selection of initialization and activation function for deep neural networks. arXiv preprint arXiv:1805.08266, 2018.
+Soufiane Hayou, Arnaud Doucet, and Judith Rousseau. Mean-field behaviour of neural tangent kernel for deep neural networks, 2019.
+Arthur Jacot, Franck Gabriel, and Clément Hongler. Neural tangent kernel: Convergence and generalization in neural networks. In Advances in neural information processing systems, 2018.
+Ryo Karakida, Shotaro Akaho, and Shun-ichi Amari. Universal statistics of fisher information in deep neural networks: mean field approach. 2018.
+Alex Krizhevsky. Learning multiple layers of features from tiny images. Technical report, 2009.
+Jaehoon Lee, Yasaman Bahri, Roman Novak, Sam Schoenholz, Jeffrey Pennington, and Jascha Sohl-dickstein. Deep neural networks as gaussian processes. In International Conference on Learning Representations, 2018.
+Jaehoon Lee, Lechao Xiao, Samuel S. Schoenholz, Yasaman Bahri, Roman Novak, Jascha Sohl-Dickstein, and Jeffrey Pennington. Wide neural networks of any depth evolve as linear models under gradient descent. In Advances in neural information processing systems, 2019.
+Ping Li and Phan-Minh Nguyen. On random deep weight-tied autoencoders: Exact asymptotic analysis, phase transitions, and implications to training. In International Conference on Learning Representations, 2019. URL https://openreview.net/forum?id=HJx54i05tX.
+Yuanzhi Li and Yingyu Liang. Learning overparameterized neural networks via stochastic gradient descent on structured data. In Advances in Neural Information Processing Systems, pp. 8157-8166, 2018.
+Alexander G. de G. Matthews, Mark van der Wilk, Tom Nickson, Keisuke. Fujii, Alexis Boukouvalas, Pablo Le'on-Villagr'a, Zoubin Ghahramani, and James Hensman. GPflow: A Gaussian process library using TensorFlow. Journal of Machine Learning Research, 18(40):1-6, apr 2017. URL http://jmlr.org/papers/v18/16-537.html.
+Alexander G de G Matthews, Mark Rowland, Jiri Hron, Richard E Turner, and Zoubin Ghahramani. Gaussian process behaviour in wide deep neural networks. arXiv preprint arXiv:1804.11271, 2018a.
+Alexander G. de G. Matthews, Jiri Hron, Mark Rowland, Richard E. Turner, and Zoubin Ghahramani. Gaussian process behaviour in wide deep neural networks. In International Conference on Learning Representations, 2018b.
+Radford M. Neal. Priors for infinite networks (tech. rep. no. crg-tr-94-1). University of Toronto, 1994.
+Roman Novak, Lechao Xiao, Jaehoon Lee, Yasaman Bahri, Greg Yang, Jiri Hron, Daniel A. Abolafia, Jeffrey Pennington, and Jascha Sohl-Dickstein. Bayesian deep convolutional networks with many channels are gaussian processes. In International Conference on Learning Representations, 2019.
+
+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.
+Ben Poole, Subhaneil Lahiri, Maithra Raghu, Jascha Sohl-Dickstein, and Surya Ganguli. Exponential expressivity in deep neural networks through transient chaos. In Advances In Neural Information Processing Systems, 2016.
+Arnu Pretorius, Elan van Biljon, Steve Kroon, and Herman Kamper. Critical initialisation for deep signal propagation in noisy rectifier neural networks. In S. Bengio, H. Wallach, H. Larochelle, K. Grauman, N. Cesa-Bianchi, and R. Garnett (eds.), Advances in Neural Information Processing Systems 31, pp. 5717-5726. Curran Associates, Inc., 2018. URL http://papers.nips.cc/paper/7814-critical-initialisation-for-deep-signal-propagation-in-noisy-rectifier-neural-networks.pdf.
+Samuel S Schoenholz, Justin Gilmer, Surya Ganguli, and Jascha Sohl-Dickstein. Deep information propagation. arXiv preprint arXiv:1611.01232, 2016.
+Seiya Tokui, Kenta Oono, Shohei Hido, and Justin Clayton. Chainer: a next-generation open source framework for deep learning. In Proceedings of Workshop on Machine Learning Systems (LearningSys) in The Twenty-ninth Annual Conference on Neural Information Processing Systems (NIPS), 2015. URL http://learningsys.org/papers/LearningSys_2015_paper_33.pdf.
+Lechao Xiao, Yasaman Bahri, Jascha Sohl-Dickstein, Samuel Schoenholz, and Jeffrey Pennington. Dynamical isometry and a mean field theory of CNNs: How to train 10,000-layer vanilla convolutional neural networks. In International Conference on Machine Learning, 2018.
+Lechao Xiao, Jeffrey Pennington, and Samuel S Schoenholz. Disentangling trainability and generalization in deep learning. arXiv preprint arXiv:1912.13053, 2019.
+Ge Yang and Samuel Schoenholz. Mean field residual networks: On the edge of chaos. In Advances In Neural Information Processing Systems, 2017.
+Greg Yang. Scaling limits of wide neural networks with weight sharing: Gaussian process behavior, gradient independence, and neural tangent kernel derivation. arXiv preprint arXiv:1902.04760, 2019.
+Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. In Proceedings of the British Machine Vision Conference (BMVC), 2016.
+Difan Zou, Yuan Cao, Dongruo Zhou, and Quanquan Gu. Gradient descent optimizes overparameterized deep relu networks. Machine Learning, Oct 2019. ISSN 1573-0565. doi: 10.1007/s10994-019-05839-6. URL https://doi.org/10.1007/s10994-019-05839-6.
+
+# APPENDIX
+
+# A NEURAL TANGENTS AND PRIOR WORK
+
+Here we briefly discuss the differences between NEURAL TANGENTS and the relevant prior work.
+
+1. Prior benchmarks in the domain of infinitely wide neural networks. Various prior works have evaluated convolutional and fully-connected models on certain datasets (Lee et al., 2018; Matthews et al., 2018b;a; Novak et al., 2019; Garriga-Alonso et al., 2019; Arora et al., 2019a). While these efforts must have required implementing certain parts of our library, to our knowledge such prior efforts were either not open-sourced or not comprehensive / user-friendly / scalable enough to be used as a user-facing library. In addition, all of the works above used their own separate implementation, which further highlights a need for a more general approach.
+
+2. Code released by Lee et al. (2019). Lee et al. (2019) have released code along with their paper submission, which is a strict and minor subset of our library. More specifically, at the time of the submission, Lee et al. (2019) have released code equivalent to nt LINEARize, nt.empirical_ntk_fn, nt.predictgradient_descent_mse, nt.predictgradient_descent, and nt.predictmomentum. Every other part of the library (most notably, nt.stax) is new in this submission and was not used by Lee et al. (2019) or any other prior work. At the time of writing, NEURAL TANGENTS differs from the code released by Lee et al. (2019) by about $+9,500 / - 2,500$ lines of code.
+3. GPy (2012), GPFlow (Matthews et al., 2017), GPyTorch (Gardner et al., 2018), and other GP packages. While various packages allowing for kernel construction, optimization, and inference with Gaussian Processes exist, none of them allow easy construction of the very specific kernels corresponding to infinite neural networks (NNGP/NTK; nt.stax), nor do they provide the tools and convenience for studying wide but finite networks and their training dynamics (nt.taylor Expand, nt.predict, nt.monte_carlo_kernel_fn). On the other hand, NEURAL TANGENTS does not provide any tools for approximate inference with these kernels.
+
+# B LIBRARY DESCRIPTION
+
+NEURAL TANGENTS provides a high-level interface for specifying analytic, infinite-width, Bayesian and gradient descent trained neural networks as Gaussian Processes. This interface closely follows the `stax` API (Bradbury et al., 2018b) in JAX.
+
+# B.1 NEURAL NETWORKS WITH JAX
+
+```markdown
+statx represents each component of a network as two functions: init_fn and apply_fn. These components can be composed in serial or in parallel to produce new network components with their own init_fn and apply_fn. In this way, complicated neural network architectures can be specified hierarchically.
+
+Calling init_fn on a random seed and an input shape generates a random draw of trainable parameters for a neural network. Calling apply_fn on these parameters and a batch of inputs returns the outputs of the given finite neural network.
+
+```python
+from jax.experimental import stax
+init_fn, apply_fn = staxserial(stax.Dense(512), stax.Relu, stax.Dense(10))
+_, params = init_fn(key, (-1, 32 * 32 * 3))
+fx_train, fx_test = apply_fn.params, x_train), apply_fn.params, x_test)
+```
+
+# B.2 INFINITE NEURAL NETWORKS WITH NEURAL TANGENTS
+
+We extend stax layers to return a third function kernel_fn, which represents the covariance functions of the infinite NNGP and NTK networks of the given architecture (recall that since infinite networks are GPs, they are fully defined by their covariance functions, assuming 0 mean as is common in the literature).
+
+```python
+from neural_tangents import stax
+init_fn, apply_fn, kernel_fn = stax.serialize(stax.Dense(512), stax.Relu(), stax.Dense(10))
+```
+
+We demonstrate a specification of a more complicated architecture (WideResNet) in Listing 1.
+
+kernel_fn accepts two batches of inputs x1 and x2 and returns their NNGP covariance and NTK matrices as kernel_fn(x1, x2).nngp and kernel_fn(x1, x2).ntk respectively, which
+
+can then be used to make posterior test set predictions as the mean of a conditional multivariate normal $\mathcal{V}_{\mathrm{test}} = \mathcal{K}(\mathcal{X}_{\mathrm{test}},\mathcal{X}_{\mathrm{train}})\mathcal{K}(\mathcal{X}_{\mathrm{train}},\mathcal{X}_{\mathrm{train}})^{-1}\mathcal{Y}_{\mathrm{train}}$
+
+```python
+from jax.numpy.linalg import inv
+y_test = kernel_fn(x_test, x_train).ntk @ inv(kernel_fn(x_train, x_train).ntk) @ y_train
+```
+
+Note that the above code does not do Cholesky decomposition and is presented merely to show the mathematical expression. We provide efficient GP inference method in the predict submodule:
+
+```python
+import neural_tangents as nt
+y_test = nt.predict.gp_inference(kernel_fn, x_train, y_train, x_test, get='ntk', diag_reg=1e-4, compute_cov=False)
+```
+
+# B.3 COMPUTING INFINITE NETWORK KERNELS IN BATCHES AND IN PARALLEL
+
+Naively, the kernel_fn will compute the whole kernel in a single call on one device. However, for large datasets or complicated architectures, it is often necessary to distribute the calculation in some way. To do this, we introduce a batch decorator that takes a kernel_fn and returns a new kernel_fn with the exact same signature. The new function computes the kernel in batches and automatically parallelizes the calculation over however many devices are available, with near-perfect speedup scaling with the number of devices (Figure 5, right).
+
+```python
+import neural_tangents as nt
+kernel_fn = nt.batch(kernel_fn, batch_size=32)
+```
+
+Note that batching is often used to compute large covariance matrices that may not even fit on a GPU/TPU device, and require to be stored and used for inference using CPU RAM. This is easy to achieve by simply specifying nt.batch(..., store_on_device=False). Once the matrix is stored in RAM, inference will be performed with a CPU when nt.predict methods are called. As mentioned in §3.2, for many (notably, convolutional, and especially pooling) architectures, inference cost can be small relative to kernel construction, even when running on CPU (for example, it takes less than 3 minutes to execute jax.scipy.linalg.solve(..., sym_pos=True) on a $45,000 \times 45,000$ training covariance matrix and a $45,000 \times 10$ training target matrix).
+
+# B.4 TRAINING DYNAMICS OF INFINITE NETWORKS
+
+In addition to closed form multivariate Gaussian posterior prediction, it is also interesting to consider network predictions following continuous gradient descent. To facilitate this we provide several functions to compute predictions following gradient descent with an MSE loss, for gradient descent with arbitrary loss, or for momentum with arbitrary loss. The first case is handled analytically, while the latter two are computed by numerically integrating the differential equation. For example, the following code will compute the function evaluation on train and test points following gradient descent for some time training_time.
+
+```python
+import neural_tangents as nt
+predictor = nt.predictGradient_descent_mse(kernel_fn(x_train, x_train), y_train, fx_train, fx_test = predictor(training_time, fx_train, fx_test)
+```
+
+# B.5 INFINITE NETWORKS OF ANY ARCHITECTURE THROUGH SAMPLING
+
+Of course, there are cases where the analytic kernel cannot be computed. To support these situations, we provide utility functions to efficiently compute Monte Carlo estimates of the NNGP covariance and NTK. These functions work with neural networks constructed using any neural network library.
+
+
+Figure 6: Training a neural network and its various approximations using nt.taylorexpand. Presented is a 5-layer Erf-neural network of width 512 trained on MNIST using SGD with momentum, along with its constant (0th order), linear (1storder), and quadratic (2ndorder) Taylor expansions about the initial parameters. As training progresses (left to right), lower-order expansions deviate from the original function faster than higher-order ones.
+
+```python
+from jax import random
+from jax.experimental import stax
+import neural_tangents as nt
+init_fn, apply_fn = staxserial(stax.Dense(64), stax.BatchNorm(), stax.Sigmoid, stax.Dense(1))
+kernel_fn = nt.monte_carlo_kernel_fn(init_fn, apply_fn, key=random.PRNGKey(1), n_samples=128)
+kernel = kernel_fn(x_train, x_train)
+```
+
+We demonstrate convergence of the Monte Carlo kernel estimates to the closed-form analytic kernels in the case of a WideResNet in Figure 2.
+
+# B.6 WEIGHTS OF WIDE BUT FINITE NETWORKS
+
+While most of NEURAL TANGENTS is devoted to a function-space perspective—describing the distribution of function values on finite collections of training and testing points—we also provide tools to investigate a dual weight space perspective described in Lee et al. (2019). Convergence of dynamics to NTK dynamics coincide with networks being described by a linear approximation about their initial set of parameters. We provide decorators linearize and taylor Expand to approximate functions to linear order and to arbitrary order respectively. Both functions take an apply_fn and returns a new apply_fn that computes the series approximation.
+
+```python
+import neural_tangents as nt
+taylor_apply_fn = nt.taylor Expand.apply_fn, params, order)
+fx_train_apprx = taylor_apply_fn(new.params, x_train)
+```
+
+These act exactly like normal JAX functions and, in particular, can be plugged into gradient descent, which we demonstrate in Figure 6.
+
+# B.7 EXTENDING NEURAL TANGENTS
+
+Many neural network layers admit a sensible infinite-width limit behavior in the Bayesian and continuous gradient descent regimes as long as the multivariate central limit theorem applies to their outputs conditioned on their inputs. To add such layer to NEURAL TANGENTS, one only has to implement it as a method in nt.stax with the following signature:
+
+```txt
+@layer # an internal decorator taking care of certain boilerplate. NewLayer(layer.params: Any) -> (init_fn: function, apply_fn: function, kernel_fn: function)
+```
+
+Here init_fn and apply_fn are initialization and the forward pass methods of the finite width layer implementation (see §B.1). If the layer of interest already exists in JAX, there is no need to implement these methods and the user can simply return the respective methods from jax.experimental.stax (see nt.stax.Flatten for an example; in fact the majority of nt.stax layers call the original jax.experimental.stax layers for finite width layer methods). In this case what remains is to implement the kernel_fn method with signature
+
+```txt
+kernel_fn(input_kernel: nt.utils.Kernel) -> output_kernel: nt.utils.Kernel
+```
+
+Here both input_kernel and output_kernel are namedtuple containing the NNGP and NTK covariance matrices, as well as additional metadata useful for computing the kernel propagation operation. The specific operation to be performed should be derived by the user in the context of the particular operation that the finite width layer performs. This transformation could be as simple as an affine map on the kernel matrices, but could also be analytically intractable.
+
+Once implemented, the correctness of the implementation can be very easily tested by extending the nt-tests.stax_test with the new layer, to test the agreement with large-widths empirical NNGP and NTK kernels.
+
+# C ARCHITECTURE SPECIFICATIONS
+
+Listing 2: All-convolutional model (ConvOnly) definition used in Figure 3.
+```python
+from neural_tangents import stax
+def ConvolutionalNetwork(depth, W_std $= 1.0$ , b_std $= 0.0$ ): layers $=$ [] for_in range(depth): layers $+ =$ [stax.Conv(1,(3,3),W_std,b_std,padding $\equiv$ 'SAME'),stax.Relu()) layers $+ =$ [stax Flatten(),stax.Dense(1,W_std,b_std)] return stax^K serial(*layers)
+```
+
+Listing 3: Fully-connected (FC) model definition used in Figure 3.
+```python
+from neural_tangents import stax
+def FullyConnectedNetwork(depth, W_std $= 1$ .0,b_std $= 0$ .0): layers $=$ [stax Flatten()] for_in range(depth): layers $+ =$ [stax.Dense(1,W_std,b_std),stax.Relu()) layers $+ =$ [stax.Dense(1,W_std,b_std)] return stax^Kserial(\*layers)
+```
+
+# D IMPLEMENTED AND COMING SOON FUNCTIONALITY
+
+The following layers are currently implemented, with translation rules given in Table 1:
+
+- serial
+- parallel
+- FanOut
+FanInSum
+FanInConcat
+- Dense
+- Conv with arbitrary filter shapes, strides, dimension numbers, and padding8
+- Relu
+LeakyRelu
+Abs
+ABRelu
+Erf
+- Identity
+- Flatten
+AvgPool
+GlobalAvgPool
+SumPool
+GlobalSumPool
+- Dropout
+- LayerNorm
+GlobalSelfAttention (Anonymous, 2020)
+
+The following is in our near-term plans:
+
+Exp, Elu, Selu, Gelu
+Apache Beam support.
+
+The following layers do not have known closed-form expressions for infinite network covariances, and respective infinite networks have to be estimated empirically (via nt.monte_carlo_kernel_fn) or using other approximations (not currently implemented):
+
+- Sigmoid, Tanh, $^{10}$ Swish, $^{11}$ Softmax, LogSoftMax, Softplus, MaxPool.
+
+| Tensor Op | NNGP Op | NTK Op |
| X | K | Θ |
| Dense(σw, σb) | σ2wK + σ2b | (σ2wK + σ2b) + σ2wΘ |
| φ | T(K) | T(K) ⊙ Θ |
| Dropout(ρ) | K + (1/ρ - 1) Diag(K) | Θ + (1/ρ - 1) Diag(Θ) |
| Conv(σw, σb) | σ2wA(K) + σ2b | σ2wA(K) + σ2b + σ2wA(Θ) |
| Flatten | Tr(K) | Tr(K + Θ) |
| AvgPool(s, q, p) | AvgPool(s, q, p)(K) | AvgPool(s, q, p)(K + Θ) |
| GlobalAvgPool | GlobalAvgPool(K) | GlobalAvgPool(K + Θ) |
| SumPool(s, q, p) | SumPool(s, q, p)(K) | SumPool(s, q, p)(K + Θ) |
| GlobalSumPool | GlobalSumPool(K) | GlobalSumPool(K + Θ) |
| Attn(σQK, σOV) | Attn(σQK, σOV)(K) | 2Attn(σQK, σOV)(K)+ Attn(σQK, σOV)(Θ) |
| (Anonymous, 2020) | | |
| FanInSum(X1, ..., Xn) | ∑j=1n Kj | ∑j=1n Θj |
| FanOut(n) | [K] * n | [Θ] * n |
+
+Table 1: Translation rules (\$3) converting tensor operations into operations on NNGP and NTK kernels. Here the input tensor $\mathcal{X}$ is assumed to have shape $|\mathcal{X}|\times H\times W\times C$ (dataset size, height, width, number of channels), and the full NNGP and NT kernels $\kappa$ and $\mathcal{T}$ are considered to be of shape $(|\mathcal{X}|\times H\times W)^{\times 2}$ (in practice shapes of $|\mathcal{X}|^{\times 2}\times H\times W$ and $|\mathcal{X}|^{\times 2}$ are also possible, depending on which optimizations in §3.2 are applicable). Notation details. The Tr, GlobalAvgPool, and GlobalSumPool ops are assumed to act on all spatial axes (with sizes $H$ and $W$ in this example), producing a $|\mathcal{X}|^{\times 2}$ -kernel. Similarly, the AvgPool and SumPool ops is assumed to act on all spatial axes as well, applying the specified strides $s$ , pooling window sizes $p$ and padding strategy $p$ to the respective axes pairs in $\kappa$ and $\mathcal{T}$ (acting as 4D pooling with replicated parameters of the 2D version). $\mathcal{T}$ and $\dot{\mathcal{T}}$ are defined identically to Lee et al. (2019) as $\mathcal{T}(\Sigma) = \mathbb{E}\left[\phi(u)\phi(u)^T\right]$ , $\dot{\mathcal{T}}(\Sigma) = \mathbb{E}\left[\phi'(u)\phi'(u)^T\right]$ , $u \sim \mathcal{N}(0,\Sigma)$ . These expressions can be evaluated in closed form for many nonlinearities, and preserve the shape of the kernel. The $\mathcal{A}$ op is defined similarly to Novak et al. (2019); Xiao et al. (2018) as $[\mathcal{A}(\Sigma)]_{h,h'}^{w,w'}(x,x') = \sum_{dh,dw} [\Sigma]_{h+dh,h'+dh}^{w+dw,w'+dw}(x,x') / q^2$ , where the summation is performed over the convolutional filter receptive field with $q$ pixels (we assume unit strides and circular padding in this expression, but generalization to other settings is trivial and supported by the library). $[\Sigma]*n = [\Sigma,\dots,\Sigma]$ ( $n$ -fold replication). For LayerNorm, FanInConcat, and Attn (Anonymous, 2020) translation rules we refer the reader to our code at https://github.com/google/neural-tangents, as these ops are challenging to express concisely using current notation. See Figure 4 for an example of applying the translation rules to a specific model, and §3.1 for deriving a sample translation rule. See §D for the full list of currently implemented translations.
+
+
+
+
+
+
+Figure 7: Predictive negative log-likelihoods and condition numbers. Top. Test negative log-likelihoods for NNGP posterior and Gaussian predictive distribution for NTK at infinite training time for CIFAR-10 (test set of 2000 points). Fully Connected (FC, Listing 3) and Convolutional network without pooling (CONV, Listing 2) models are selected based on train marginal negative log-likelihoods in Figure 3. Bottom. Condition numbers for covariance matrices corresponding to NTK/NNGP as well as respective predictive covariance on the test set. Ill-conditioning of Wide Residual Network kernels due to pooling layers (Xiao et al., 2019) could be the cause of numerical issues when evaluating predictive NLL for this kernels.
+
+
\ No newline at end of file
diff --git a/neuraltangentsfastandeasyinfiniteneuralnetworksinpython/images.zip b/neuraltangentsfastandeasyinfiniteneuralnetworksinpython/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..b8d13f13408dc7dfe6ae9926bdc85c1cda53a6f7
--- /dev/null
+++ b/neuraltangentsfastandeasyinfiniteneuralnetworksinpython/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c6ffd9e85f3e64a8690c4d2d4674fa4b535b3022304cf1d868447096676f7354
+size 571928
diff --git a/neuraltangentsfastandeasyinfiniteneuralnetworksinpython/layout.json b/neuraltangentsfastandeasyinfiniteneuralnetworksinpython/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..30ca6f37c468da86f8ab959269807fb7c34d1ba5
--- /dev/null
+++ b/neuraltangentsfastandeasyinfiniteneuralnetworksinpython/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:9b827f887586cce5d1ee1db9eb5ac3438fdbda42193dd3bdd140fefc286e2b3a
+size 571871
diff --git a/onlineandstochasticoptimizationbeyondlipschitzcontinuityariemannianapproach/30723153-9ce3-4d6f-9246-b373156c157e_content_list.json b/onlineandstochasticoptimizationbeyondlipschitzcontinuityariemannianapproach/30723153-9ce3-4d6f-9246-b373156c157e_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..399fe684320c1e6f373a66f8796450f816ca571e
--- /dev/null
+++ b/onlineandstochasticoptimizationbeyondlipschitzcontinuityariemannianapproach/30723153-9ce3-4d6f-9246-b373156c157e_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:801354ed078e412cad0e74a9415f6b538f9dec0fb6c83326853f6488c557f596
+size 157209
diff --git a/onlineandstochasticoptimizationbeyondlipschitzcontinuityariemannianapproach/30723153-9ce3-4d6f-9246-b373156c157e_model.json b/onlineandstochasticoptimizationbeyondlipschitzcontinuityariemannianapproach/30723153-9ce3-4d6f-9246-b373156c157e_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..faa0521a8723e6fffc463e6902016b61ce1eac51
--- /dev/null
+++ b/onlineandstochasticoptimizationbeyondlipschitzcontinuityariemannianapproach/30723153-9ce3-4d6f-9246-b373156c157e_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:43632151ef4676f29edb79294d88a8b42a4d66fa6108dac7a37fb2968df2afcb
+size 187566
diff --git a/onlineandstochasticoptimizationbeyondlipschitzcontinuityariemannianapproach/30723153-9ce3-4d6f-9246-b373156c157e_origin.pdf b/onlineandstochasticoptimizationbeyondlipschitzcontinuityariemannianapproach/30723153-9ce3-4d6f-9246-b373156c157e_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..dcc74f1241f3599aa32c87c0ba0a1d46ac6a0f57
--- /dev/null
+++ b/onlineandstochasticoptimizationbeyondlipschitzcontinuityariemannianapproach/30723153-9ce3-4d6f-9246-b373156c157e_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:6e0acddd16f7f2ede769690ab1c1fd2da509b463555516b6e3546061a12afa24
+size 1387275
diff --git a/onlineandstochasticoptimizationbeyondlipschitzcontinuityariemannianapproach/full.md b/onlineandstochasticoptimizationbeyondlipschitzcontinuityariemannianapproach/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..f4b994659dc2e7f19d089c7e4d4b91a200f6b33e
--- /dev/null
+++ b/onlineandstochasticoptimizationbeyondlipschitzcontinuityariemannianapproach/full.md
@@ -0,0 +1,904 @@
+# ONLINE AND STOCHASTIC OPTIMIZATION BEYOND LIPSCHITZ CONTINUITY: A RIEMANNIAN APPROACH
+
+Kimon Antonakopoulos
+
+Inria, Univ. Grenoble Alpes, CNRS, Grenoble INP, LIG
+
+38000 Grenoble, France
+
+kimon.antonakopoulos@inria.fr
+
+E. Veronica Belmega
+
+ETIS UMR8051, CY University, ENSEA, CNRS, F-95000, Cergy, France
+
+belmega@ensea.fr
+
+Panayotis Mertikopoulos
+
+Inria, Univ. Grenoble Alpes, CNRS, Grenoble INP, LIG
+
+38000 Grenoble, France
+
+panayotis.mertikopoulos@imag.fr
+
+# ABSTRACT
+
+Motivated by applications to machine learning and imaging science, we study a class of online and stochastic optimization problems with loss functions that are not Lipschitz continuous; in particular, the loss functions encountered by the optimizer could exhibit gradient singularities or be singular themselves. Drawing on tools and techniques from Riemannian geometry, we examine a Riemann-Lipschitz (RL) continuity condition which is tailored to the singularity landscape of the problem's loss functions. In this way, we are able to tackle cases beyond the Lipschitz framework provided by a global norm, and we derive optimal regret bounds and last iterate convergence results through the use of regularized learning methods (such as online mirror descent). These results are subsequently validated in a class of stochastic Poisson inverse problems that arise in imaging science.
+
+# 1 INTRODUCTION
+
+The surge of recent breakthroughs in machine learning and artificial intelligence has reaffirmed the prominence of first-order methods in solving large-scale optimization problems. One of the main reasons for this is that the computation of higher-order derivatives of functions with thousands – if not millions – of variables quickly becomes prohibitive; another is that gradient calculations are typically easier to distribute and parallelize, especially in large-scale problems. In view of this, first-order methods have met with prolific success in many diverse fields, from machine learning and signal processing to wireless communications, nuclear medicine, and many others [10, 34, 37].
+
+This success is especially pronounced in the field of online optimization, i.e., when the optimizer faces a sequence of time-varying loss functions $f_{t}$ , $t = 1,2,\ldots$ , one at a time – for instance, when drawing different sample points from a large training set [11, 35]. In this general framework, first-order methods have proven extremely flexible and robust, and the attained performance guarantees are well known to be optimal [1, 11, 35]. Specifically, if the optimizer faces a sequence of $G$ -Lipschitz convex losses, the incurred min-max regret after $T$ rounds is $\Omega (GT^{1 / 2})$ , and this bound can be achieved by inexpensive first-order methods – such as online mirror descent and its variants [11, 35, 36, 41].
+
+Nevertheless, in many machine learning problems (support vector machines, Poisson inverse problems, quantum tomography, etc.), the loss landscape is not Lipschitz continuous, so the results mentioned above do not apply. Thus, a natural question that emerges is the following: Is it possible to apply online optimization tools and techniques beyond the standard Lipschitz framework? And, if so, how?
+
+Our approach and contributions. Our point of departure is the observation that Lipschitz continuity is a property of metric spaces – not normed spaces. Indeed, in convex optimization, Lipschitz continuity is typically stated in terms of a global norm (e.g., the Euclidean norm), but such a norm is de facto independent of the point in space at which it is calculated. Because of this, the standard Lipschitz framework is oblivious to the finer aspects of the problem's loss landscape – and, in particular, any singularities that may arise at the boundary of the problem's feasible region. On the other hand, in general metric spaces, this is no longer the case: the distance between two points is no longer given by a global norm, so it is much more sensitive to the geometry of the feasible region. For this reason, if the (Riemannian) distance $\mathrm{dist}(x,x^{\prime})$ between two points $x$ and $x^{\prime}$ becomes larger and larger as the points approach the boundary of the feasible region, a condition of the form $|f(x) - f(x^{\prime})| = \mathcal{O}(\mathrm{dist}(x^{\prime},x))$ may still hold even if $f$ becomes singular at the boundary.
+
+We leverage this observation by introducing the notion of Riemann-Lipschitz (RL) continuity, an extension of "vanilla" Lipschitz continuity to general spaces endowed with a Riemannian metric. We show that this metric can be chosen in a principled manner based solely on the singularity landscape of the problem's loss functions - i.e., their growth rate at infinity and/or the boundary of the feasible region. Subsequently, using a similar mechanism to choose a Riemannian regularizer, we provide an optimal $\mathcal{O}(T^{1/2})$ regret guarantee through the use of regularized learning methods - namely, "follow the regularized leader" (FTRL) and online mirror descent (OMD).
+
+Our second contribution concerns an extension of this framework to stochastic programming. First, in the context of stochastic convex optimization, we show that an online-to-batch conversion yields an $\mathcal{O}(T^{-1/2})$ value convergence rate. Second, motivated by applications to nonconvex stochastic programming (where averaging is not a priori beneficial), we also establish the convergence of the method's last iterate in a class of nonconvex problems satisfying a weak secant inequality. Finally, we supplement our theoretical analysis with numerical experiments in Poisson inverse problems.
+
+Related work. To the best of our knowledge, the first treatment of a similar question was undertaken by Bauschke et al. [3] who focused on deterministic, offline convex programs ( $f_{t} = f$ for all $t$ ) without a Lipschitz smoothness assumption (i.e., Lipschitz continuity of the gradient, as opposed to Lipschitz continuity of the objective). To tackle this issue, Bauschke et al. [3] introduced a second-order "Lipschitz-like" condition of the form $\nabla^2 f \leqslant \beta \nabla^2 h$ for some suitable Bregman function $h$ , and they showed that Bregman proximal methods achieve an $\mathcal{O}(1 / T)$ value convergence rate in offline convex problems with perfect gradient feedback.
+
+Always in the context of deterministic optimization, Bolte et al. [8] extended the results of Bauschke et al. [3] to unconstrained non-convex problems and established trajectory convergence to critical points for functions satisfying the Kurdyka–Lojasiewicz (KL) inequality. In a slightly different vein, Lu et al. [25] considered functions that are also strongly convex relative to the Bregman function defining the Lipschitz-like condition for the gradients, and they showed that mirror descent achieves a geometric convergence rate in this context. Finally, in a very recent preprint, Hanzely et al. [17] examined the rate of convergence of an accelerated variant of mirror descent under the same Lipschitz-like smoothness assumption.
+
+Importantly, all these works concern offline, deterministic optimization problems with perfect gradient feedback and regularity assumptions that cannot be exploited in an online optimization setting (such as the KL inequality). Beyond offline, deterministic optimization problems, Lu [24] established the ergodic convergence of mirror descent in stochastic non-adversarial convex problems under a "relative continuity" condition of the form $\| \nabla f(x)\| \leq G\inf_{x'}\sqrt{2D(x',x)} /\| x' - x\|$ (with $D$ denoting the divergence of an underlying "reference" Bregman function $h$ ). More recently, Hanzely and Richtarik [16] examined the performance of stochastic mirror descent under a combination of relative strong convexity and relative smoothness / Lipschitz-like conditions, and established a series of convergence rate guarantees that mirror the corresponding rates for ordinary (Euclidean) stochastic gradient descent. Except for trivial cases, these conditions are not related to Riemann-Lipschitz continuity, so there is no overlap in our results our methodology.
+
+Finally, in a very recent paper, Bécigneul and Ganea [5] established the convergence of a class of adaptive Riemannian methods in geodesically convex problems (extending in this way classical results for AdaGrad to a manifold setting). Importantly, the Riemannian methodology of [5] involves the exponential mapping of the underlying metric and focuses on geodesic convexity, so it concerns an orthogonal class of problems. The only overlap would be in the case of flat Riemannian manifolds:
+
+however, even though the manifolds we consider here are topologically simple, they are not flat. In view of this, there is no overlap with the analysis and results of [5].
+
+# 2 PROBLEM SETUP
+
+We begin by presenting the core online optimization framework that we will consider throughout the rest of our paper. This can be described by the following sequence of events:
+
+1. At each round $t = 1,2,\ldots$ , the optimizer chooses an action $X_{t}$ from a convex - but not necessarily closed or compact - subset $\mathcal{X}$ of an ambient normed space $\mathcal{V}\cong \mathbb{R}^d$ .
+2. The optimizer incurs a loss $f_{t}(X_{t})$ based on some (unknown) convex loss function $f_{t} \colon \mathcal{X} \to \mathbb{R}$ .
+3. The optimizer updates their action and the process repeats.
+
+Remark 1. For posterity, we note that if $\mathcal{X}$ is not closed, $f_{t}$ (or its derivatives) could become singular at a residual point $x\in \operatorname {bd}(\mathcal{X})\setminus \mathcal{X}$ ; in particular, we do not assume here that $f_{t}$ admits a smooth extension to the closure $\operatorname {cl}(\mathcal{X})$ of $\mathcal{X}$ (or even that it is bounded over bounded subsets of $\mathcal{X}$ ).
+
+In this broad framework, the most widely used figure of merit is the minimization of the agent's regret. Formally, the regret of a policy $X_{t} \in \mathcal{X}, t = 1,2,\ldots$ , is defined as
+
+$$
+\operatorname {R e g} _ {x} (T) = \sum_ {t = 1} ^ {T} \left[ f _ {t} \left(X _ {t}\right) - f _ {t} (x) \right], \tag {1}
+$$
+
+for all $x\in \mathcal{X}$ . We then say that the policy $X_{t}$ leads to no regret if $\operatorname{Reg}_x(T) = o(T)$ for all $x\in \mathcal{X}$ .
+
+In addition to convexity, the standard assumption in the literature for the problem's loss functions is Lipschitz continuity, i.e.,
+
+$$
+\left| f _ {t} \left(x ^ {\prime}\right) - f _ {t} (x) \right| \leq G _ {t} \| x ^ {\prime} - x \| \tag {LC}
+$$
+
+for some $G_{t} \geq 0, t = 1,2,\ldots$ , and for all $x,x^{\prime}\in \mathcal{X}$ . Under (LC), if the agent observes at each stage $t$ an element $v_{t}$ of $\partial f_t(X_t)$ , straightforward online policies based on gradient descent enjoy a bound of the form $\mathrm{Reg}_x(T) = \mathcal{O}(\bar{G}_T T^{1 / 2})$ , with $\bar{G}_T^2 = T^{-1}\sum_{t = 1}^T G_t^2$ [11, 35, 41]. In particular, if $G\equiv \lim \sup_{T\to \infty}\bar{G}_T < \infty$ (e.g., if each $f_{t}$ is $G$ -Lipschitz continuous over $\mathcal{X}$ ), we have the bound
+
+$$
+\operatorname {R e g} _ {x} (T) = \mathcal {O} \left(G T ^ {1 / 2}\right) \tag {2}
+$$
+
+which is well known to be min-max optimal in this setting [1].
+
+A note on notation. Throughout our paper, we make a clear distinction between $\mathcal{V}$ and its dual, and we use Dirac's notation $\langle v|x\rangle$ for the duality pairing between $v\in \mathcal{V}^*$ and $x\in \mathcal{V}$ (not to be confused with the notation $\langle \cdot ,\cdot \rangle$ for a scalar product on $\mathcal{V}$ ). Also, unless mentioned otherwise, all notions of boundary and interior should be interpreted in the relative (as opposed to topological) sense. We also make the blanket assumption that the subdifferential $\partial f_{t}$ of $f_{t}$ admits a continuous selection $\nabla f_t(x)\in \partial f_t(x)$ for all $x\in \operatorname {dom}\partial f_t\equiv \{x\in \mathcal{X}:\partial f_t(x)\neq \emptyset \}$ .
+
+# 3 RIEMANN-LIPSCHITZ CONTINUITY
+
+Despite its generality, (LC) may fail to hold in a wide range of problems and applications, ranging from support vector machines to Poisson inverse problems, quantum tomography, etc. [3, 8, 25]. The loss functions of these problems exhibit singularities at the boundary of the feasible region, so the standard regret analysis cited above no longer applies. Accordingly, our first step will be to introduce a family of local norms $\| \cdot \| _x$ , $x\in \mathcal{X}$ , such that a variant of (LC) holds even if the derivatives $\partial f / \partial x_{i}$ of $f$ blow up near the boundary of $\mathcal{X}$ .
+
+To achieve this, we will employ the notion of a Riemannian metric. This is simply a position-dependent scalar product on $\mathcal{V}$ , i.e., a continuous assignment of bilinear pairings $\langle \cdot, \cdot \rangle_x$ , $x \in \mathcal{X}$ , satisfying the following conditions for all $z, z' \in \mathcal{V}$ and all $x \in \mathcal{X}$ :
+
+1. Symmetry: $\langle z,z^{\prime}\rangle_{x} = \langle z^{\prime},z\rangle_{x}$
+2. Positive-definiteness: $\langle z,z\rangle_{x}\geq 0$ with equality if and only if $z = 0$
+
+More concretely, in the standard basis $\{e_i\}_{i=1}^d$ of $\mathbb{R}^d$ , we define the metric tensor of $\langle \cdot, \cdot \rangle_x$ as the matrix $g(x) \in \mathbb{R}^{d \times d}$ with components
+
+$$
+g _ {i j} (x) = \left\langle e _ {i}, e _ {j} \right\rangle_ {x} \quad i, j = 1, \dots , d. \tag {3}
+$$
+
+The norm of $z\in \mathcal{V}$ at $x\in \mathcal{X}$ is then defined as
+
+$$
+\left\| z \right\| _ {x} ^ {2} \equiv \langle z, z \rangle_ {x} ^ {2} = \sum_ {i, j = 1} ^ {d} g _ {i j} (x) z _ {i} z _ {j} = z ^ {\top} g (x) z. \tag {4}
+$$
+
+In this way, a Riemannian metric allows us to measure lengths and angles between displacement vectors at each $x \in \mathcal{X}$ ; for illustration, we provide some notable examples below:
+
+Example 1 (Euclidean geometry). The ordinary Euclidean metric on $\mathcal{X} = \mathbb{R}^d$ is $g(x) = I$ . This yields the standard expressions $\|z\|_x^2 = \sum_{i=1}^{d} z_i^2$ and $\langle z, z' \rangle_x = \sum_{i=1}^{d} z_i z_i'$ , both independent of $x$ .
+
+Example 2 (Hyperbolic geometry). The Poincaré metric on the positive orthant $\mathcal{X} = \mathbb{R}_{++}^{d}$ is
+
+$$
+g (x) = \operatorname {d i a g} \left(1 / x _ {1} ^ {2}, \dots , 1 / x _ {d} ^ {2}\right), \tag {5}
+$$
+
+leading to the local norm $\| z\| _x^2 = \sum_{i = 1}^d z_i^2 /x_i^2$ . Under (5), $\mathbb{R}_{+ + }^{d}$ can be seen as a variant of Poincare's half-space model for hyperbolic geometry [22]; this will become important later.
+
+Given a Riemannian metric on $\mathcal{X}$ , the length of a curve $\gamma \colon [0,1] \to \mathcal{X}$ is defined as $L_g[\gamma] = \int_0^1 \| \dot{\gamma}(s) \|_{\gamma(s)} ds$ , and the Riemannian distance between $x_1, x_2 \in \mathcal{X}$ is given by
+
+$$
+\operatorname {d i s t} _ {g} \left(x _ {1}, x _ {2}\right) = \inf _ {\gamma} L _ {g} [ \gamma ]. \tag {6}
+$$
+
+Under this definition, it is natural to introduce the following Riemannian variant of (LC):
+
+Definition 1. We say that $f\colon \mathcal{X}\to \mathbb{R}$ is Riemann-Lipschitz continuous relative to $g$ if
+
+$$
+\left| f \left(x ^ {\prime}\right) - f (x) \right| \leq G \operatorname {d i s t} _ {g} \left(x, x ^ {\prime}\right) \quad \text {f o r s o m e} G \geq 0 \text {a n d a l l} x, x ^ {\prime} \in \mathcal {X}. \tag {7}
+$$
+
+Albeit simple to state, (RLC) may be difficult to verify because it requires the computation of the distance function $\mathrm{dist}_g$ of $g$ - which, in turn, relies on geodesic calculations to identify the shortest possible curve between two points. Nevertheless, if $f$ is differentiable, Proposition 1 below provides an alternative characterization of Riemann-Lipschitz continuity which is easier to work with:
+
+Proposition 1. Suppose that $f\colon \mathcal{X}\to \mathbb{R}$ is differentiable. Then, (RLC) holds if and only if
+
+$$
+\left\| \operatorname {g r a d} f (x) \right\| _ {x} \leq G \quad \text {f o r a l l} x \in \mathcal {X}. \tag {RLC}
+$$
+
+Remark 2. In the above, the Riemannian gradient $\operatorname{grad} f(x)$ of $f$ at $x$ is defined as follows: First, let $\mathcal{Z} = \operatorname{span}\{x' - x : x, x' \in \mathcal{X}\}$ denote the tangent hull of $\mathcal{X}$ . Then, $\operatorname{grad} f(x) \in \mathcal{Z}$ is defined by the characteristic property
+
+$$
+f ^ {\prime} (x; z) = \left\langle \operatorname {g r a d} f (x), z \right\rangle_ {x} \quad \text {f o r a l l} z \in \mathcal {Z}. \tag {8}
+$$
+
+Existence and uniqueness of $\operatorname{grad} f(x)$ is due to the fact that $g(x)$ is positive-definite - and, hence, invertible [22]. In particular, if $\mathcal{X}$ is full-dimensional (so $\mathcal{Z} = \mathcal{V}$ ), we have:
+
+$$
+[ \operatorname {g r a d} f (x) ] _ {i} = \sum_ {j = 1} ^ {d} g (x) _ {i j} ^ {- 1} \partial_ {j} f (x). \tag {9}
+$$
+
+The proof of Proposition 1 requires the introduction of further tools from Riemannian geometry; seeing as these notions are not used anywhere else in our paper, we relegate it to the appendix. Instead, we close this section with a simple example of a singular function which is nonetheless Riemann-Lipschitz continuous:
+
+Example 3. Let $\mathcal{X} = [0,1]^d\backslash \{0\}$ (so $\mathcal{X}$ is convex but neither open nor closed) and let $f(x) = -\log (a^{\top}x)$ for some positive vector $a\in \mathbb{R}_{++}^{d}$ . If we take $g_{ij}(x) = \delta_{ij} / (x_1 + \dots +x_d)^2$ , we get
+
+$$
+\left\| \operatorname {g r a d} f (x) \right\| _ {x} ^ {2} = \frac {\sum_ {i = 1} ^ {d} a _ {i} ^ {2} \cdot \left(\sum_ {i = 1} ^ {d} x _ {i}\right) ^ {2}}{\left(a ^ {\top} x\right) ^ {2}} \leq \frac {\sum_ {i = 1} ^ {d} a _ {i} ^ {2}}{\left(\min _ {j} a _ {j}\right) ^ {2}}. \tag {10}
+$$
+
+Thus, although $f$ is not Lipschitz continuous in the standard sense, it is Riemann-Lipschitz continuous relative to $g$ ; we will revisit this example in our treatment of Poisson inverse problems in Section 6.
+
+More generally, Example 3 suggests the following rule of thumb: if $f$ exhibits a gradient singularity of the form $|\partial_i f(x)| = \mathcal{O}(\phi(x))$ at some residual point $x \in \operatorname{cl}(\mathcal{X}) \setminus \mathcal{X}$ of $\mathcal{X}$ , taking $g_{ij}(x) = \phi(x)^2\delta_{ij}$ gives $\| \operatorname{grad} f(x)\|_x^2 = \phi(x)^{-2}\sum_{i=1}^d [\partial_i f(x)]^2 = \mathcal{O}(1)$ . On that account, $f$ is Riemann-Lipschitz continuous, even though its derivative is singular; we find this heuristic particularly appealing because it provides a principled choice of Riemannian metric under which $f$ satisfies (RLC).
+
+# 4 ALGORITHMS
+
+In this section, we present the algorithms that we will study in the sequel: "follow the regularized leader" (FTRL) and online mirror descent (OMD). Both methods have been widely studied in the literature in the context of "vanilla" Lipschitz continuity; however, beyond this basic setting, treating FTRL/OMD in the Riemannian framework of the previous section is an intricate affair that requires several conceptual modifications. For this reason, we take an in-depth look into both methods below.2
+
+# 4.1 REGULARIZATION
+
+We begin with the idea of regularization through a suitable penalty function. In our Riemannian setting, we adapt this notion as follows:
+
+Definition 2. Let $g$ be a Riemannian metric on $\mathcal{X}$ and let $h\colon \mathcal{V}\to \mathbb{R}$ be a proper lower semicontinuous (l.s.c.) convex function with $\mathrm{dom}h = \mathcal{X}$ .3 We say that $h$ is a Riemannian regularizer on $\mathcal{X}$ if:
+
+1. The subdifferential of $h$ admits a continuous selection, i.e., a continuous function $\nabla h$ such that $\nabla h(x) \in \partial h(x)$ for all $x \in \mathcal{X}^{\circ} \equiv \operatorname{dom} \partial h$ .
+2. $h$ is strongly convex relative to $g$ , i.e.,
+
+$$
+h \left(x ^ {\prime}\right) \geq h (x) + \left\langle \nabla h (x) \mid x ^ {\prime} - x \right\rangle + \frac {1}{2} K \| x ^ {\prime} - x \| _ {x} ^ {2} \tag {11}
+$$
+
+for some $K > 0$ and all $x\in \mathcal{X}^{\circ}$ $x^{\prime}\in \mathcal{X}$
+
+The Bregman divergence induced by $h$ is then defined for all $p \in \mathcal{X}$ , $x \in \mathcal{X}^{\circ}$ as
+
+$$
+D (p, x) = h (p) - h (x) - \langle \nabla h (x) | p - x \rangle . \tag {12}
+$$
+
+There are two points worth noting in the above definition. First, the domain of $h$ is all of $\mathcal{X}$ , but this need not be the case for the subdifferential $\partial h$ of $h$ : by convex analysis arguments [33, Chap. 26], we have $\operatorname{ri} \mathcal{X} \subseteq \mathcal{X}^{\circ} \equiv \operatorname{dom} \partial h \subseteq \mathcal{X}$ . To connect the two, we will say that $h$ is a Riemann-Legendre regularizer when $\mathcal{X}^{\circ} = \operatorname{ri} \mathcal{X}$ and $D(p, x_{n}) \to 0$ whenever $x_{n} \to p$ .
+
+Second, strong convexity in (11) is defined relative to the underlying Riemannian metric. If the norm in (11) does not depend on $x$ , we recover the standard definition; however, the dependence of the second-order term in (11) on $g$ can change the landscape significantly. Lemma 1 and Example 5 below provide an illustration of this interplay between $g$ and $h$ :
+
+Lemma 1. A Riemannian regularizer $h$ is $K$ -strongly convex relative to $g$ if and only if
+
+$$
+D (p, x) \geq \frac {1}{2} K \| p - x \| _ {x} ^ {2}. \tag {13}
+$$
+
+The proof of Lemma 1 follows from a rearrangement of (11) so we omit it. Instead, we present below some examples of Riemannian regularizers:
+
+Example 4. Let $\mathcal{X} = [0,1]^d$ , and consider the so-called Burg entropy $h(x) = -\sum_{i=1}^{d} \log x_i$ . It is easy to see that $h(x)$ is strongly convex relative to the standard Euclidean norm $\|\cdot\|_2$ . Moreover, we have
+
+$$
+D (p, x) = \sum_ {i = 1} ^ {d} \left[ \frac {p _ {i}}{x _ {i}} - \log \frac {p _ {i}}{x _ {i}} - 1 \right] \tag {14}
+$$
+
+and, by Taylor's theorem with Lagrange remainder, we readily get
+
+$$
+D (p, x) \geq \frac {1}{2} \sum_ {i = 1} ^ {d} \frac {\left(p _ {i} - x _ {i}\right) ^ {2}}{x _ {i}} = \| p - x \| _ {x} ^ {2} \tag {15}
+$$
+
+where $\| z\| _x = \sum_{i = 1}^d z_i^2 /x_i$ denotes the so-called Shahshahani norm on $\mathcal{X}$ (i.e., $h$ is also strongly convex relative to $\| \cdot \| _x$ ). This regularizer has been used extensively in the setting of Poisson inverse problems and plays a central role in the analysis of Bauschke et al. [3], Hanzely and Richtárik [16], He et al. [18], and Lu et al. [25]. For completeness, we revisit it in Section 6.
+
+Example 5. Let $\mathcal{X}$ and $g$ be as in Example 3, and let $h(x) = (1 + r^2) / \sum_{i=1}^{d} x_i$ with $r^2 = \sum_{i=1}^{d} x_i^2$ . Then, a tedious (but otherwise straightforward) algebraic calculation gives
+
+$$
+D (p, x) \geq \sum_ {i = 1} ^ {d} \frac {\left(x _ {i} - p _ {i}\right) ^ {2}}{\left(\sum_ {j = 1} ^ {d} x _ {j}\right) ^ {2}} = \| p - x \| _ {x} ^ {2} \tag {16}
+$$
+
+i.e., $h$ is strongly convex relative to $g$ . By contrast, due to the singularity of $g$ at 0, it is easy to check that the Euclidean regularizer $h(x) = (1/2)\sum_{i=1}^{d}x_i^2$ is not strongly convex relative to $g$ .
+
+# 4.2 ALGORITHMS AND FEEDBACK STRUCTURE
+
+With these preliminaries in hand, we begin with the FTRL algorithm, which we state here as follows:
+
+$$
+X _ {t + 1} = \underset {x \in \mathcal {X}} {\arg \min } \left\{\sum_ {s = 1} ^ {t} f _ {s} (x) + \gamma^ {- 1} h (x) \right\}. \tag {FTRL}
+$$
+
+In the above, $\gamma > 0$ is a step-size parameter whose role is discussed below; as for the existence of the arg min, this is justified by the lower semicontinuity and strong convexity of $h$ together with the fact that $\operatorname{dom} h = \mathcal{X}$ (so the minimum cannot be attained in the residual set $\operatorname{cl}(\mathcal{X}) \setminus \mathcal{X}$ of $\mathcal{X}$ ).
+
+In terms of feedback, FTRL assumes that the optimizer has access to all the loss functions encountered up to a given round (except, of course, for the current one). In many cases of practical interest, this assumption is too restrictive and, instead, the optimizer only has access to a first-order oracle for each $f_{t}$ . To model this feedback structure, we assume that once $X_{t}$ has been chosen, the optimizer receives an estimate $v_{t}$ of $\nabla f_{t}(X_{t})$ satisfying the following hypotheses:
+
+a) Unbiasedness: $\mathbb{E}[v_t\mid \mathcal{F}_t] = \nabla f_t(X_t)$ (17a)
+b) Finite mean square: $\mathbb{E}[||v_t||_*^2\mid \mathcal{F}_t]\leq M_t^2.$ (17b)
+
+In the above, $\| \cdot \|_{*}$ denotes the dual norm of $\| \cdot \|_{X_t}$ , i.e., the Riemannian norm at the point $X_{t}$ where the oracle was called (we suppress here the index $X_{t}$ and write $\| \cdot \|_{*}$ instead of $\| \cdot \|_{X_{t},*}$ to lighten the notation). In particular, the oracle feedback $v_{t}$ may fail to be bounded in $L^2$ relative to any global norm on $\mathcal{V}^{*}$ ; as such, (17) is considerably weaker than the standard $L^2$ -boundedness assumption for global norms. Finally, in terms of measurability, the expectation in (17) is conditioned on the history $\mathcal{F}_t$ of $X_{t}$ up to stage $t$ ; since $v_{t}$ is generated randomly from $X_{t}$ , it is not $\mathcal{F}_t$ -measurable.
+
+To proceed, the main idea of mirror descent is to replace $f_{s}(x)$ in (FTRL) with the first-order surrogate $f_{s}(x)\gets f_{s}(X_{s}) + \langle \nabla f_{s}(X_{s})|x - X_{s}\rangle$ . In this way, substituting $v_{s}$ for the estimate of $\nabla f_{s}(X_{s})$ received at stage $s$ , we obtain the linearized FTRL scheme
+
+$$
+X _ {t + 1} = \arg \min _ {x \in \mathcal {X}} \left\{\gamma \sum_ {s = 1} ^ {t} \langle v _ {s} | x \rangle + h (x) \right\}. \tag {18}
+$$
+
+To rewrite this process in recursive form, introduce the auxiliary (dual) variable
+
+$$
+Y _ {t + 1} = Y _ {t} - \gamma v _ {t} \tag {19}
+$$
+
+so $Y_{t + 1} = -\gamma \sum_{s = 1}^{t}v_{s}$ , and hence
+
+$$
+X _ {t + 1} = \underset {x \in \mathcal {X}} {\arg \min } \{h (x) - \langle Y _ {t + 1} | x \rangle \} = \underset {x \in \mathcal {X}} {\arg \max } \{\langle Y _ {t + 1} | x \rangle - h (x) \}. \tag {20}
+$$
+
+Therefore, letting
+
+$$
+Q (y) = \arg \max _ {x \in \mathcal {X}} \{\langle y | x \rangle - h (x) \} \tag {21}
+$$
+
+denote the so-called "mirror map" of the method, we obtain the following incarnation of the online mirror descent (OMD) algorithm:
+
+$$
+\begin{array}{l} Y _ {t + 1} = Y _ {t} - \gamma v _ {t} \\ X _ {t + 1} = Q \left(Y _ {t + 1}\right). \end{array} \tag {OMD}
+$$
+
+This version of OMD is also known as "dual averaging" [26, 29, 30, 38] or "lazy mirror descent" [35]; for a "greedy" variant, see [6, 27, 28] and references therein.
+
+# 5 ANALYSIS AND RESULTS
+
+# 5.1 REGRET ANALYSIS
+
+We begin by stating our main results for the regret minimization properties of FTRL and OMD. Throughout this section, we make the following blanket assumptions:
+
+1. Both algorithms are initialized at the "prox-center" $x_{c} = \arg \min h$ of $\mathcal{X}$ and are run with (constant) step-size $\alpha / T^{1/2}$ for some $\alpha > 0$ chosen by the optimizer.
+2. The $t$ -th stage loss function $f_{t}\colon \mathcal{X}\to \mathbb{R}$ is convex and satisfies (RLC) with constant $G_{t}$ .
+3. The optimizer's aggregate loss $\sum_{t=1}^{T} f_t$ attains its minimum value at some $x^* \in \mathcal{X}$ .
+
+The purpose of the last assumption is to avoid cases where the infimum of a loss function is not attained within the problem's feasible region (such as $e^{-x}$ over $\mathbb{R}_+$ ). We then have:
+
+Theorem 1. Let $\operatorname{Reg}(T) \equiv \operatorname{Reg}_{x^*}(T)$ , $\bar{G}_T^2 = T^{-1} \sum_{t=1}^T G_t^2$ , and $\bar{M}_T^2 = T^{-1} \sum_{t=1}^T M_t^2$ . Then:
+
+a) The FTRL algorithm enjoys the regret bound
+
+$$
+\operatorname {R e g} (T) \leq \left[ \frac {D \left(x ^ {*} , x _ {c}\right)}{\alpha} + \frac {2 \alpha \bar {G} _ {T} ^ {2}}{K} \right] \sqrt {T}. \tag {22a}
+$$
+
+b) The OMD algorithm with noisy feedback of the form (17) enjoys the mean regret bound
+
+$$
+\mathbb {E} [ \operatorname {R e g} (T) ] \leq \left[ \frac {D \left(x ^ {*} , x _ {c}\right)}{\alpha} + \frac {\alpha \bar {M} _ {T} ^ {2}}{2 K} \right] \sqrt {T}. \tag {22b}
+$$
+
+In particular, if $\sup_t G_t < \infty$ , $\sup_t M_t < \infty$ , both algorithms guarantee $\mathcal{O}(\sqrt{T})$ regret.
+
+Remark 3. We emphasize here that the $\mathcal{O}(\sqrt{T})$ regret bound above is achieved even if $\mathcal{X}$ is unbounded or if the "Bregman depth" $H\equiv \sup_{x\in \mathcal{X}}D(x,x_c) = \sup h - \inf h$ of $\mathcal{X}$ is infinite.4 Of course, if $H < \infty$ and $G$ (or $M$ ) is known to the optimizer, (22) can be optimized further by tuning $\alpha$ . When these constants are unknown, achieving an optimized constant by means of an adaptive step-size policy is an important question, but one which lies beyond the scope of this paper.
+
+The main idea behind the proof of Theorem 1 is to relate the Riemannian structure of $\mathcal{X}$ to the Bregman regularization framework underlying (FTRL) and (OMD). A first such link is provided by the Bregman divergence (12); however, because of the primal-dual interplay between $X_{t} \in \mathcal{X}$ and $Y_{t} \in \mathcal{V}^{*}$ , the Bregman divergence is not sufficiently adapted. To overcome this difficulty, we employ the Fenchel coupling between a target point $p \in \mathcal{X}$ and $y \in \mathcal{V}^{*}$ , defined here as
+
+$$
+\Phi (p, y) = h (p) + h ^ {*} (y) - \langle y | p \rangle \quad \text {f o r a l l} p \in \mathcal {X}, y \in \mathcal {V} ^ {*}, \tag {23}
+$$
+
+with $h^{*}(y) = \max_{x\in \mathcal{X}}\{\langle y|x\rangle -h(x)\}$ denoting the convex conjugate of $h$ . As we show in the appendix, the Fenchel coupling (which is non-negative by virtue of Young's inequality) enjoys the key property
+
+$$
+\Phi (p, y - \gamma v) \leq \Phi (p, y) - \left\langle \gamma v \right| Q (y) - p \rangle + \frac {\gamma^ {2}}{2 K} \| v \| _ {Q (y), *} ^ {2}. \tag {24}
+$$
+
+It is precisely this primal-dual inequality which allows us to go beyond the standard Lipschitz framework: compared to (primal-primal) inequalities of a similar form for global norms [2, 21, 27, 30, 40], the distinguishing feature of (24) is the advent of the Riemannian norm $\| v\|_{x,*}$ . Thanks to the intricate connection between $g$ and $h$ , the second-order term in (24) can be controlled even when the received gradient is unbounded relative to any global norm, i.e., even if the objective is singular.
+
+The main obstacle to achieve this is that the underlying Riemannian metric $g$ , the Fenchel coupling $\Phi$ and the Bregman divergence $D$ (all state-dependent notions of distance) need not be compatible with one another. That this is indeed the case is owed to Lemma 1: tethering the Riemannian norm in (13) to the second argument of the Bregman divergence instead of the first (or any other point in-between) plays a crucial role in deriving (24). Any other relation between $g$ and $h$ along these lines is not amenable to analyzing (FTRL) or (OMD) in this framework.
+
+# 5.2 APPLICATIONS TO STOCHASTIC OPTIMIZATION
+
+The second part of our analysis concerns stochastic optimization problems of the form
+
+$$
+\begin{array}{l} \text {m i n i m i z e} \quad f (x) = \mathbb {E} [ F (x; \omega) ] \\ \text {b i n a t i o n} \quad x ^ {\prime} \end{array} \tag {Opt}
+$$
+
+$$
+\begin{array}{l l} \text {s u b j e c t t o} & x \in \mathcal {X} \end{array}
+$$
+
+with the expectation taken over some model sample space $\Omega$ . Our first result here is as follows:
+
+Theorem 2. Assume that $f$ is convex and Riemann-Lipschitz continuous in mean square, i.e., $\sup_x\mathbb{E}[\| \nabla F(x;\omega)\|_{x,*}^2 ]\leq M^2$ for some $M > 0$ . If (OMD) is run for $T$ iterations with a constant step-size of the form $\alpha /\sqrt{T}$ and stochastic gradients $v_{t} = \nabla F(X_{t};\omega_{t})$ generated by an i.i.d. sequence $\omega_{t}\in \Omega$ , we have
+
+$$
+\mathbb {E} [ f (\bar {X} _ {T}) ] \leq \min f + \left[ \frac {D _ {c}}{\alpha} + \frac {\alpha M ^ {2}}{2 K} \right] \frac {1}{\sqrt {T}} \tag {25}
+$$
+
+where $\bar{X}_T = (1 / T)\sum_{t = 1}^{T}X_t$ is the "ergodic average" of $X_{t}$ and $D_{c} = \inf_{x^{*}\in \arg \min_{f}}D(x^{*},x_{c}) < \infty$ denotes the Bregman distance of the prox-center $x_{c}$ of $\mathcal{X}$ to arg min $f$ .
+
+The key novelty in Theorem 2 is that the optimal $\mathcal{O}(T^{-1/2})$ convergence rate of OMD is maintained even if the stochastic gradients of $F$ become singular at residual points $x \in \operatorname{cl}(\mathcal{X}) \setminus \mathcal{X}$ . As with the regret guarantee of Theorem 1, this is achieved by the intricate three-way relation between the landscape of $f$ , the underlying Riemannian metric $g$ (which is tailored to the singularity profile of the latter), and the Riemannian regularizer $h$ . The proof of Theorem 2 likewise relies on an online-to-batch conversion of the regret guarantees of (OMD) for the sequence of stochastic gradients $\nabla F(\cdot; \omega_t)$ of $f$ ; the details can be found in the appendix.
+
+To go beyond the ergodic guarantees of Theorem 2, we also analyze below the convergence of the "last iterate" of OMD, i.e., the actual sequence of generated points $X_{t}$ . This is of particular interest for non-convex problems where ergodic convergence results are of limited value (because Jensen's inequality no longer applies). To obtain global convergence results in this setting, we focus on a class of functions which satisfy a weak secant inequality of the form
+
+$$
+\inf \left\{\langle \nabla f (x) | x - x ^ {*} \rangle : x ^ {*} \in \arg \min f, x \in \mathcal {K} \right\} > 0 \tag {SI}
+$$
+
+for every closed subset $\mathcal{K}$ of $\mathcal{X}$ that is separated by neighborhoods from $\arg \min f$ . Variants of this condition have been widely studied in the literature and include non-convex functions with complicated ridge structures [9, 13, 19, 20, 23, 31, 39, 40]. In this very general setting, we have:
+
+Theorem 3. Assume $f$ satisfies (SI) and is Riemann-Lipschitz continuous in $L^2$ . Suppose further that $\arg \min f$ is bounded and (OMD) is run with a sequence of stochastic gradients $v_t = \nabla F(X_t; \omega_t)$ , a Riemann-Legendre regularizer $h$ , and a variable step-size $\gamma_t$ such that $\sum_{t=1}^{\infty} \gamma_t = \infty$ , $\sum_{t=1}^{\infty} \gamma_t^2 < \infty$ . Then, with probability 1, $X_t$ converges to some (possibly random) $x^* \in \arg \min f$ .
+
+
+Figure 1: Reconstruction of the Lena test image from a sample contaminated with Poisson noise. Left to right: (a) the contaminated sample; (b) CMP reconstruction; (c) RMD reconstruction; and (d) Poisson likelihood loss at each iteration. The RMD process provides a sharper definition of image features relative to the CMP algorithm (which is the second-best).
+
+
+
+
+
+
+
+The proof for Theorem 3 hinges on combining (quasi-)supermartingale convergence results with the basic inequality (24); we detail the proof in the paper's appendix. Seeing as (SI) holds trivially for (pseudo-)convex functions, we only note here that Theorem 3 complements Theorem 2 in an important way: the convergence of $X_{t}$ implies that of $\bar{X}_{t}$ , so the convergence of $\mathbb{E}[f(\bar{X}_t)]$ to $\min f$ follows immediately from Theorem 3; however, the rate of convergence (25) doesn't. In practice, the ergodic average converges to interior minimizers faster than the last iterate but lags behind when tracking boundary points and/or in non-convex landscapes; we explore this issue in Section 6 below.
+
+# 6 NUMERICAL EXPERIMENTS IN POISSON INVERSE PROBLEMS
+
+For the purposes of validation, we proceed with an application of our algorithmic results to a broad class of Poisson inverse problems that arise in tomography problems. Referring the reader to the appendix for the details, the objective of interest here is the Poisson likelihood loss (generalized Kullback-Leibler divergence):
+
+$$
+f (x) = \sum_ {j = 1} ^ {m} \left[ u _ {j} \log \frac {u _ {j}}{(H x) _ {j}} + (H x) _ {j} - u _ {j} \right] \tag {26}
+$$
+
+where $u \in \mathbb{R}_+^m$ is a vector of Poisson data observations (e.g., pixel intensities) and $H \in \mathbb{R}^{m \times d}$ is an ill-conditioned matrix representing the data-gathering protocol. Since the generalized KL objective of (26) exhibits an $\mathcal{O}(1 / x)$ singularity at the boundary of the orthant, we consider the Poincaré metric $g(x) = \mathrm{diag}(1 / x_1, \ldots, 1 / x_d)$ under which the KL divergence is Riemann-Lipschitz continuous (cf. Example 2). Going back to Example 3, a suitable Riemannian regularizer for this metric is $h(x) = \sum_{i=1}^{m} 1 / x_i^2$ , which is 1-strongly convex relative to $g$ . We then run the induced mirror descent algorithm with an online-to-batch conversion mechanism as described in Section 5.2. For reference purposes, we call the resulting process Riemannian mirror descent (RMD).
+
+Subsequently, we ran RMD on a Poisson denoising problem for a $384 \times 384$ test image contaminated with Poisson noise (so $d \approx 10^5$ in this case). For benchmarking, we also ran a fast variant of the widely used Lucy-Richardson (LR) algorithm [7], and the recent composite mirror prox (CMP) method of [18]; all methods were run with stochastic gradients and the same minibatch size. Because of the "dark area" gradient singularities when $[Hx]_j \to 0$ , Euclidean stochastic gradient methods oscillate without converging, so they are not reported. As we see in Fig. 1, the RMD process provides the sharpest reconstruction of the original. In particular, after an initial warm-up phase, the last iterate of Riemannian mirror descent consistently outperforms the LR algorithm by 7 orders of magnitude, and CMP by 3. We also note that the Poisson likelihood loss decreases faster under the last iterate of RMD relative to the different algorithmic variants that we tested, exactly because of the hysteresis effect that is inherent to ergodic averaging.
+
+Overall, we note that the introduction of an additional degree of freedom (the choice of Bregman function and that of the local Riemannian norm), makes RMD a particularly flexible and powerful paradigm for loss models with singularities. We find these results particularly encouraging for further investigations on the interplay between Riemannian geometry and Bregman-proximal methods.
+
+# 7 CONCLUDING REMARKS
+
+Owing to its connections with machine learning (support vector machines, Poisson inverse problems, quantum tomography, etc.), venturing beyond Lipschitz continuity is a fruitful research direction that has recently generated considerable interest in the literature. Depending on the type of continuity or smoothness encountered (Lipschitz continuity of the objective or Lipschitz continuity of the objective's gradients), the results can be significantly different, and it is not a priori clear which surrogate smoothness/continuity condition would be the most appropriate for any given problem. The present paper provides a complementary, Riemannian-geometric viewpoint which we feel can be fairly promising for the design of efficient optimization algorithms in this context. The precise characterization of the interplay between the different continuity conditions considered in the literature is an important open issue which we leave for future work.
+
+# ACKNOWLEDGMENTS
+
+The authors gratefully acknowledge financial support from the French National Research Agency (ANR) under grants ORACLESS (ANR-16-CE33-0004-01) and ELIOT (ANR-18-CE40-0030), as well as the FAPESP 2018/12579-7 project. This work also benefited from financial support by MIAI Grenoble Alpes (Multidisciplinary Institute in Artificial Intelligence).
+
+# REFERENCES
+
+[1] Abernethy, Jacob, Peter L. Bartlett, Alexander Rakhlin, Ambuj Tewari. 2008. Optimal strategies and minimax lower bounds for online convex games. $\text{COLT '08: Proceedings of the 21st Annual Conference on Learning Theory}$ .
+[2] Balandat, Maximilian, Walid Krichene, Claire Tomlin, Alexandre Bayen. 2016. Minimizing regret on reflexive Banach spaces and Nash equilibria in continuous zero-sum games. NIPS '16: Proceedings of the 30th International Conference on Neural Information Processing Systems.
+[3] Bauschke, Heinz H., Jérôme Bolte, Marc Teboulle. 2017. A descent lemma beyond Lipschitz gradient continuity: First-order methods revisited and applications. Mathematics of Operations Research 42(2) 330-348.
+[4] Bauschke, Heinz H., Patrick L. Combettes. 2017. Convex Analysis and Monotone Operator Theory in Hilbert Spaces. 2nd ed. Springer, New York, NY, USA.
+[5] Bécigneul, Gary, Octavian-Eugen Ganea. 2019. Riemannian adaptive optimization methods. *ICLR '19: Proceedings of the 2019 International Conference on Learning Representations*.
+[6] Beck, Amir, Marc Teboulle. 2003. Mirror descent and nonlinear projected subgradient methods for convex optimization. Operations Research Letters 31(3) 167-175.
+[7] Bertero, Mario, Patrizia Boccacci, Gabriele Desiderà, Giuseppe Vicidomini. 2009. Image deblurring with Poisson data: from cells to galaxies. Inverse Problems 25(12) 123006.
+[8] Bolte, Jérôme, Shoham Sabach, Marc Teboulle, Yakov Vaisbound. 2018. First order methods beyond convexity and Lipschitz gradient continuity with applications to quadratic inverse problems. SIAM Journal on Optimization 28(3) 2131-2151.
+[9] Bottou, Léon. 1998. Online learning and stochastic approximations. On-line learning in neural networks 17(9) 142.
+[10] Bubeck, Sébastien. 2015. Convex optimization: Algorithms and complexity. Foundations and Trends in Machine Learning 8(3-4) 231–358.
+[11] Bubeck, Sébastien, Nicolò Cesa-Bianchi. 2012. Regret analysis of stochastic and nonstochastic multi-armed bandit problems. Foundations and Trends in Machine Learning 5(1) 1–122.
+[12] Chen, Gong, Marc Teboulle. 1993. Convergence analysis of a proximal-like minimization algorithm using Bregman functions. SIAM Journal on Optimization 3(3) 538-543.
+[13] Facchinei, Francisco, Jong-Shi Pang. 2003. Finite-Dimensional Variational Inequalities and Complementarity Problems. Springer Series in Operations Research, Springer.
+[14] Ferreira, Orion P. 2006. Proximal subgradient and a characterization of Lipschitz function on Riemannian manifolds. Journal of Mathematical Analysis and Applications 313 587-597.
+[15] Hall, P., C. C. Heyde. 1980. Martingale Limit Theory and Its Application. Probability and Mathematical Statistics, Academic Press, New York.
+[16] Hanzely, Filip, Peter Richtárik. 2018. Fastest rates for stochastic mirror descent methods. https://arxiv.org/abs/1803.07374.
+
+[17] Hanzely, Filip, Peter Richtárik, Lin Xiao. 2018. Accelerated Bregman proximal gradient methods for relatively smooth convex optimization. https://arxiv.org/abs/1808.03045.
+[18] He, Niao, Zaid Harchaoui, Yichen Wang, Le Song. 2016. Fast and simple optimization for Poisson likelihood models. https://arxiv.org/abs/1608.01264.
+[19] Jiang, Houyuan, Huifu Xu. 2008. Stochastic approximation approaches to the stochastic variational inequality problem. IEEE Trans. Autom. Control 53(6) 1462-1475.
+[20] Karimi, Hamed, Julie Nutini, Mark Schmidt. 2016. Linear convergence of gradient and proximal-gradient methods under the Polyak-Łojasiewicz condition. https://arxiv.org/abs/1608.04636.
+[21] Krichene, Walid. 2016. Continuous and discrete dynamics for online learning and convex optimization. Ph.D. thesis, Department of Electrical Engineering and Computer Sciences, University of California, Berkeley.
+[22] Lee, John M. 1997. Riemannian Manifolds: an Introduction to Curvature. No. 176 in Graduate Texts in Mathematics, Springer.
+[23] Ljung, Lennart. 1978. Strong convergence of a stochastic approximation algorithm. Annals of Statistics 6(3) 680-696.
+[24] Lu, Haihao. 2017. "Relative-continuity" for non-Lipschitz non-smooth convex optimization using stochastic (or deterministic) mirror descent. https://arxiv.org/abs/1710.04718.
+[25] Lu, Haihao, Robert M. Freund, Yurii Nesterov. 2018. Relatively-smooth convex optimization by first-order methods and applications. SIAM Journal on Optimization 28(1) 333-354.
+[26] Mertikopoulos, Panayotis, Zhengyuan Zhou. 2019. Learning in games with continuous action sets and unknown payoff functions. Mathematical Programming 173(1-2) 465-507.
+[27] Nemirovski, Arkadi Semen, Anatoli Juditsky, Guanghui Lan, Alexander Shapiro. 2009. Robust stochastic approximation approach to stochastic programming. SIAM Journal on Optimization 19(4) 1574-1609.
+[28] Nemirovski, Arkadi Semen, David Berkovich Yudin. 1983. Problem Complexity and Method Efficiency in Optimization. Wiley, New York, NY.
+[29] Nesterov, Yurii. 2007. Dual extrapolation and its applications to solving variational inequalities and related problems. Mathematical Programming 109(2) 319-344.
+[30] Nesterov, Yurii. 2009. Primal-dual subgradient methods for convex problems. Mathematical Programming 120(1) 221-259.
+[31] Nevel'son, M. B., Rafail Z. Khasminskii. 1976. Stochastic Approximation and Recursive Estimation. American Mathematical Society, Providence, RI.
+[32] Robbins, Herbert, David Sigmund. 1971. A convergence theorem for nonnegative almost supermartingales and some applications. J. S. Rustagi, ed., Optimizing Methods in Statistics. Academic Press, New York, NY, 233-257.
+[33] Rockafellar, Ralph Tyrrell. 1970. Convex Analysis. Princeton University Press, Princeton, NJ.
+[34] Scutari, Gesualdo, Francisco Facchinei, Daniel Pérez Palomar, Jong-Shi Pang. 2010. Convex optimization, game theory, and variational inequality theory in multiuser communication systems. IEEE Signal Process. Mag. 27(3) 35-49.
+[35] Shalev-Shwartz, Shai. 2011. Online learning and online convex optimization. Foundations and Trends in Machine Learning 4(2) 107-194.
+[36] Shalev-Shwartz, Shai, Yoram Singer. 2007. Convex repeated games and Fenchel duality. Advances in Neural Information Processing Systems 19. MIT Press, 1265-1272.
+[37] Sra, Suvrit, Sebastian Nowozin, Stephen J. Wright. 2012. Optimization for Machine Learning. MIT Press, Cambridge, MA, USA.
+[38] Xiao, Lin. 2010. Dual averaging methods for regularized stochastic learning and online optimization. Journal of Machine Learning Research 11 2543-2596.
+[39] Zhang, Hui, Wotao Yin. 2013. Gradient methods for convex minimization: Better rates under weaker conditions. https://arxiv.org/abs/1303.4645.
+[40] Zhou, Zhengyuan, Panayotis Mertikopoulos, Nicholas Bambos, Stephen Boyd, Peter W. Glynn. 2017. Stochastic mirror descent for variationally coherent optimization problems. NIPS '17: Proceedings of the 31st International Conference on Neural Information Processing Systems.
+[41] Zinkevich, Martin. 2003. Online convex programming and generalized infinitesimal gradient ascent. ICML '03: Proceedings of the 20th International Conference on Machine Learning. 928-936.
+
+# A RIEMANN-LIPSCHITZ CONTINUITY
+
+In this appendix, our main goal is to prove Proposition 1, i.e., the equivalence between (7) and (RLC) when $f$ is differentiable.
+
+To do so, we first need to introduce the notion of a geodesic, i.e., a length-minimizing curve that attains the infimum $\inf_{\gamma} L[\gamma]$ over all piecewise smooth curves joining two points $x_1, x_2 \in \mathcal{U}$ . That such a curve exists and is unique in our setting is a basic fact of Riemannian geometry [22]. Moreover, given a tangent vector $z \in \mathcal{Z}$ , this leads to the definition of the exponential mapping $\exp: \mathcal{U} \times \mathcal{Z} \to \mathcal{U}$ so that
+
+$$
+(x, z) \mapsto \exp_ {x} (z) = \gamma_ {z} (1), \tag {A.1}
+$$
+
+where $\gamma_z$ denotes the unique geodesic emanating from $x$ with initial velocity vector $\dot{\gamma}_z = z$ . We then have $\exp_x(tz) = \gamma_z(t)$ for all $t$ and, moreover, for sufficiently small $r > 0$ , the restriction of $\exp_x$ to a ball of radius $r$ in $\mathcal{Z}$ is a diffeomorphism onto its image in $\mathcal{U}$ . The largest positive number $i_x$ such that the above holds for all $r < i_x$ is then known as the injectivity radius of $\mathcal{U}$ at $x$ [22].
+
+Our proof of the equivalence between (7) and (RLC) follows a simplified version of the approach of Ferreira [14] who, to our knowledge, was the first to discuss the concept of proximal subgradients in Riemannian manifolds. To that end, fix some $x \in \mathcal{U}$ , let $z = \operatorname{grad} f(x)$ and consider the ray emanating from $x$
+
+$$
+\gamma (t) = \exp_ {x} \left(t z / \| z \| _ {x}\right). \tag {A.2}
+$$
+
+Since $\gamma$ is a geodesic, we readily obtain $\mathrm{dist}_g(x,\gamma (t)) = t$ for all sufficiently small $t$ . Also, by construction, we have $\exp_x^{-1}\gamma (t) = tz / \| z\| _x$ . Hence, with $f$ convex, it follows that, for some constant $\alpha >0$ and for sufficiently small positive $\delta < i_{x}$ , we have
+
+$$
+f (\gamma (t)) - f (x) \geq \langle z, \exp_ {x} ^ {- 1} (\gamma (t)) \rangle \tag {A.3}
+$$
+
+$$
+- \alpha \operatorname {d i s t} _ {g} (x, \gamma (t)) ^ {2}, \tag {A.4}
+$$
+
+where we used the local topological equivalence of the Riemannian topology and the standard topology of $\mathbb{R}^d$ , and the fact that $\exp_z(t)$ is a diffeomorphism for sufficiently small $\delta > 0$ - and hence, for all $\delta < i_x$ . Thus, if $f$ is also Riemann-Lipschitz continuous in the sense of (7), we will also have
+
+$$
+G t \geq f (\gamma (t)) - f (x) \geq \langle z, t z / \| z \| _ {x} \rangle_ {x} - \alpha t ^ {2}. \tag {A.5}
+$$
+
+Thus, by isolating the leftmost and rightmost hand sides, dividing by $t$ , and taking the limit $t \to 0$ , we get
+
+$$
+\| \operatorname {g r a d} f (x) \| _ {x} = \| z \| _ {x} \leq G, \tag {A.6}
+$$
+
+as was to be shown.
+
+To establish the converse, assume that (RLC) holds, fix $x,x^{\prime}\in \mathcal{X}$ pick $K > G$ and a sufficiently small $\delta >0$ , and consider the Riemannian distance majorant $w(x) = \mathrm{dist}_g(x,x')$ if $\mathrm{dist}_g(x,x') < \delta$ , and $w(x) = K\mathrm{dist}_g(x,x') + \varepsilon^2 /(\delta -\varepsilon)$ when $\delta < \mathrm{dist}_g(x,x') < 2\delta$ , with $\varepsilon = \mathrm{dist}_g(x,x') - \delta$ .
+
+A simple calculation then shows that $\| \mathrm{grad}w(x)\| _x\geq K > G$ . It is also straightforward to show that the minimum of $f + w$ is attained at $x^{\prime}$ , so
+
+$$
+\begin{array}{l} f \left(x ^ {\prime}\right) = f \left(x ^ {\prime}\right) + w \left(x ^ {\prime}\right) \\ \leq f (x) + w (x) \\ \leq f (x) + K \operatorname {d i s t} _ {g} \left(x, x ^ {\prime}\right). \tag {A.7} \\ \end{array}
+$$
+
+Then, by interchanging $x$ and $x'$ above, we obtain $|f(x) - f(x')| \leq K \mathrm{dist}_g(x, x')$ . Since $K > G$ has been chosen arbitrarily, (7) follows.
+
+# B PROPERTIES OF MIRROR MAPPINGS AND THE FENCHEL COUPLING
+
+We begin by recalling and clarifying some of the notational conventions used in the paper. First, let $\mathcal{V} \cong \mathbb{R}^d$ be a finite-dimensional real space; then, its dual space will be denoted by $\mathcal{V} \equiv \mathcal{V}^*$ , and we write $\langle y|x\rangle$ for the duality pairing between $y \in \mathcal{V}$ and $x \in \mathcal{V}$ . Also, if $\|\cdot\|$ is a norm on $\mathcal{V}$ , the dual norm on $\mathcal{V}$ is defined as $\|y\|_* \equiv \sup \{\langle y|x\rangle : \|x\| \leq 1\}$ .
+
+Given an extended-real-valued convex function $f \colon \mathcal{X} \to \mathbb{R} \cup \{\infty\}$ , we will write $\operatorname{dom} f \equiv \{x \in \mathcal{V} : f(x) < \infty\}$ for its effective domain. The subdifferential of $f$ at $x \in \operatorname{dom} f$ is then defined as $\partial f(x) \equiv \{y \in \mathcal{V} : f(x') - f(x) + \langle y|x' - x \rangle \geq 0 \text{ for all } x' \in \mathcal{V}\}$ and the domain of subdifferentiability of $f$ is $\operatorname{dom} \partial f \equiv \{x \in \operatorname{dom} f : \partial f \neq \emptyset\}$ . Finally, assuming it exists, the directional derivative of $f$ at $x$ along $z \in \mathcal{V}$ is defined as $f'(x;z) \equiv d/dt|_{t=0}f(x+tz)$ . We will then say that $f$ is differentiable at $x \in \operatorname{dom} f$ if there exists $\nabla f(x) \in \mathcal{V}$ such that $\langle \nabla f(x)|z\rangle = f'(x;z)$ for all vectors of the form $z = x' - x, x' \in \operatorname{dom} f$ .
+
+With these notational conventions at hand, we proceed to prove some auxiliary results and estimates that are used throughout the analysis of Section 5. To recall the basic setup, we assume throughout what follows that $h$ is a Riemannian regularizer in the sense of Definition 2. The convex conjugate $h^* \colon \mathcal{Y} \to \mathbb{R}$ of $h$ is then defined as
+
+$$
+h ^ {*} (y) = \sup _ {x \in \mathcal {X}} \{\langle y | x \rangle - h (x) \}. \tag {B.1}
+$$
+
+Since $h$ is $K$ -strongly convex relative to $g$ , it is also strongly convex relative to the Euclidean norm (recall here that $g(x) \geqslant \mu I$ ). As a result, the supremum in (B.1) is always attained, and $h^*(y)$ is finite for all $y \in \mathcal{Y}$ [4]. Moreover, by standard results in convex analysis [33, Chap. 26], $h^*$ is differentiable on $\mathcal{Y}$ and its gradient satisfies the identity
+
+$$
+\nabla h ^ {*} (y) = \underset {x \in \mathcal {X}} {\arg \max } \left\{\langle y | x \rangle - h (x) \right\}. \tag {B.2}
+$$
+
+Thus, recalling the definition of the mirror map $Q\colon \mathcal{V}\to \mathcal{X}$ (cf., Section 4):
+
+$$
+Q (y) = \underset {x \in \mathcal {X}} {\arg \max } \{\langle y | x \rangle - h (x) \}, \tag {B.3}
+$$
+
+we readily get
+
+$$
+Q (y) = \nabla h ^ {*} (y). \tag {B.4}
+$$
+
+Together with the prox-mapping induced by $h$ , all these notions are related as follows:
+
+Lemma B.1. Let $h$ be a Riemannian regularizer on $\mathcal{X}$ . Then, for all $x \in \operatorname{dom} \partial h$ and all $y, v \in \mathcal{V}$ , we have:
+
+$$
+a) x = Q (y) \quad \Longleftrightarrow y \in \partial h (x). \tag {B.5a}
+$$
+
+$$
+b) x ^ {+} = Q (\nabla h (x) + v) \Longleftrightarrow \nabla h (x) + v \in \partial h \left(x ^ {+}\right) \tag {B.5b}
+$$
+
+Finally, if $x = Q(y)$ and $p \in \mathcal{X}$ , we have
+
+$$
+\langle \nabla h (x) | x - p \rangle \leq \langle y | x - p \rangle . \tag {B.6}
+$$
+
+Remark. Note that (B.5b) directly implies that $\partial h(x^{+})\neq \emptyset$ , i.e., $x^{+}\in \mathrm{dom}\partial h$ for all $v\in \mathcal{V}$ . An immediate consequence of this is that the update rule $x^{+} = Q(\nabla h(x) + v)$ is well-posed, i.e., it can be iterated in perpetuity.
+
+Proof of Lemma B.1. To prove (B.5a), note that $x$ solves (B.2) if and only if $y - \partial h(x) \ni 0$ , i.e., if and only if $y \in \partial h(x)$ . Eq. (B.5b) is then obtained in the same manner.
+
+For the inequality (B.6), it suffices to show it holds for all $p \in \mathcal{X}^{\circ} \equiv \operatorname{dom} \partial h$ (by continuity). To do so, let
+
+$$
+\phi (t) = h (x + t (p - x)) - [ h (x) + \langle y | x + t (p - x) \rangle ]. \tag {B.7}
+$$
+
+Since $h$ is strongly convex relative to $g$ and $y \in \partial h(x)$ by (B.5a), it follows that $\phi(t) \geq 0$ with equality if and only if $t = 0$ . Moreover, note that $\psi(t) = \langle \nabla h(x + t(p - x)) - y|p - x\rangle$ is a continuous selection of subgradients of $\phi$ . Given that $\phi$ and $\psi$ are both continuous on [0, 1], it follows that $\phi$ is continuously differentiable and $\phi' = \psi$ on [0, 1]. Thus, with $\phi$ convex and $\phi(t) \geq 0 = \phi(0)$ for all $t \in [0, 1]$ , we conclude that $\phi'(0) = \langle \nabla h(x) - y|p - x\rangle \geq 0$ , from which our claim follows.
+
+As we mentioned earlier, much of our analysis revolves around a "primal-dual" divergence between a target point $p \in \mathcal{X}$ and a dual vector $y \in \mathcal{Y}$ , called the Fenchel coupling. Following [26], this is defined as follows for all $p \in \mathcal{X}, y \in \mathcal{Y}$ :
+
+$$
+\Phi (p, y) = h (p) + h ^ {*} (y) - \langle y | p \rangle . \tag {B.8}
+$$
+
+The following lemma illustrates some basic properties of the Fenchel coupling:
+
+Lemma B.2. Let $h$ be a Riemannian regularizer on $\mathcal{X}$ with convexity modulus $K$ . Then, for all $p \in \mathcal{X}$ and all $y \in \mathcal{Y}$ , we have:
+
+1. $\Phi (p,y) = D(p,Q(y))$ if $Q(y)\in \mathcal{X}^{\circ}$ (but not necessarily otherwise).
+2. If $x = Q(y)$ , then $\Phi(p, y) \geq \frac{K}{2} \|x - p\|_x^2$
+
+Proof. For our first claim, let $x = Q(y)$ . Then, by definition we have:
+
+$$
+\Phi (p, y) = h (p) - \langle y | Q (y) \rangle - h (Q (y)) - \langle y | p \rangle = h (p) - h (x) - \langle y | p - x \rangle . \tag {B.9}
+$$
+
+Since $y \in \partial h(x)$ , we have $h'(x; p - x) = \langle y | p - x \rangle$ whenever $x \in \mathcal{X}^\circ$ , thus proving our first claim. For our second claim, working in the previous spirit we get that:
+
+$$
+\Phi (p, y) = h (p) - h (x) - \langle y | p - x \rangle \tag {B.10}
+$$
+
+Thus, we obtain the result by recalling the strong convexity assumption for $h$ with respect to the Riemannian norm $\| \cdot \|_x$ .
+
+We continue with some basic relations connecting the Fenchel coupling relative to a target point before and after a gradient step. The basic ingredient for this is a primal-dual analogue of the so-called "three-point identity" for Bregman functions [12]:
+
+Lemma B.3. Let $h$ be a regularizer on $\mathcal{X}$ . Fix some $p \in \mathcal{X}$ and let $y, y^+ \in \mathcal{Y}$ . Then, letting $x = Q(y)$ , we have
+
+$$
+\Phi (p, y ^ {+}) = \Phi (p, y) + \Phi (x, y ^ {+}) + \langle y ^ {+} - y | x - p \rangle . \tag {B.11}
+$$
+
+Proof. By definition, we get:
+
+$$
+\Phi (p, y ^ {+}) = h (p) + h ^ {*} \left(y ^ {+}\right) - \langle y ^ {+} | p \rangle \tag {B.12}
+$$
+
+$$
+\Phi (p, y) = h (p) + h ^ {*} (y) - \langle y | p \rangle .
+$$
+
+Then, by subtracting the above we get:
+
+$$
+\begin{array}{l} \Phi (p, y ^ {+}) - \Phi (p, y) = h (p) + h ^ {*} (y ^ {+}) - \langle y ^ {+} | p \rangle - h (p) - h ^ {*} (y) + \langle y | p \rangle \\ = h ^ {*} (y ^ {+}) - h ^ {*} (y) - \langle y ^ {+} - y | p \rangle \\ = h ^ {*} (y ^ {+}) - \langle y | Q (y) \rangle + h (Q (y)) - \langle y ^ {+} - y | p \rangle \\ = h ^ {*} \left(y ^ {+}\right) - \langle y | x \rangle + h (x) - \langle y ^ {+} - y | p \rangle \\ = h ^ {*} \left(y ^ {+}\right) + \langle y ^ {+} - y | x \rangle - \langle y ^ {+} | x \rangle + h (x) - \langle y ^ {+} - y | p \rangle \\ = \Phi (x, y ^ {+}) + \langle y ^ {+} - y | x - p \rangle \tag {B.13} \\ \end{array}
+$$
+
+and our proof is complete.
+
+With all this at hand, we have the following key estimate:
+
+Proposition B.1. Let $h$ be a Riemannian regularizer on $\mathcal{X}$ with convexity modulus $K$ , fix some $p \in \mathcal{X}$ , let $x = Q(y)$ for some $y \in \mathcal{Y}$ . Then, for all $v \in \mathcal{V}$ , we have:
+
+$$
+\Phi (p, y + v) \leq \Phi (p, y) + \langle v | x - p \rangle + \frac {1}{2 K} \| v \| _ {x, *} ^ {2} \tag {B.14}
+$$
+
+Proof. By the three-point identity (B.11), we get
+
+$$
+\Phi (p, y) = \Phi (p, y + v) + \Phi (Q (y + v), y) + \langle y - (y + v) | Q (y + v) - p \rangle \tag {B.15}
+$$
+
+and hence, after rearranging:
+
+$$
+\begin{array}{l} \Phi (p, y + v) = \Phi (p, y) - \Phi (Q (y + v), y) + \langle v | Q (y + v) - p \rangle \\ = \Phi (p, y) - \Phi (Q (y + v), y) + \langle v | x - p \rangle + \langle v | Q (y + v) - x \rangle \tag {B.16} \\ \end{array}
+$$
+
+By Young's inequality [33], we also have
+
+$$
+\langle v | Q (y + v) - x \rangle \leq \frac {K}{2} \| Q (y + v) - x \| _ {x} ^ {2} + \frac {1}{2 K} \| v \| _ {x, *} ^ {2} \tag {B.17}
+$$
+
+Our claim then follows by the fact that $\Phi(Q(y + v), y) \geq \frac{K}{2} \|Q(y + v) - x\|_x^2$ (cf. Lemmas 1 and B.2).
+
+# C ANALYSIS OF FTRL
+
+Our goal here is to prove the regret bound (22a) of Theorem 1. The starting point of our analysis is the following basic bound:
+
+Lemma C.1 (35, Lemma 2.3). The sequence of actions generated by (FTRL) satisfies
+
+$$
+\operatorname {R e g} _ {x} (T) \leq h (x) - h \left(X _ {1}\right) + \sum_ {t = 1} ^ {T} \left[ f _ {t} \left(X _ {t}\right) - f _ {t} \left(X _ {t + 1}\right) \right]. \tag {C.1}
+$$
+
+Importantly, the above bound does not require any Lipschitz continuity or strong convexity assumptions, so it applies to our setting "as is". The importance of Riemann-Lipschitz continuity lies in the following:
+
+Lemma C.2. If $f$ is convex and Riemann-Lipschitz continuous with constant $G$ , then:
+
+$$
+f (x) - f \left(x ^ {\prime}\right) \leq G \| x ^ {\prime} - x \| _ {x} \quad \text {f o r a l l} x, x ^ {\prime} \in \mathcal {X} ^ {\circ}. \tag {C.2}
+$$
+
+Proof. By the convexity of $f$ , we have:
+
+$$
+\begin{array}{l} f (x) - f \left(x ^ {\prime}\right) \leq \langle \nabla f (x) | x - x ^ {\prime} \rangle = \langle \operatorname {g r a d} f (x), x - x ^ {\prime} \rangle_ {x} \\ \leq \left\| \operatorname {g r a d} f (x) \right\| _ {x} \| x - x ^ {\prime} \| _ {x} \\ \leq G \| x - x ^ {\prime} \| _ {x} \tag {C.3} \\ \end{array}
+$$
+
+where the first line follows from the definition of the Riemannian gradient of $f$ , the second one from the Cauchy-Schwartz inequality, and the last from Proposition 1.
+
+With these preliminary results at hand, we obtain the following basic bound for FTRL:
+
+Proposition C.1. Suppose that (FTRL) is run against a sequence of loss convex loss functions with assumptions as in Section 5. Then, for all $x \in \mathcal{X}$ , we have:
+
+$$
+\operatorname {R e g} _ {x} (T) \leq \frac {D \left(x , x _ {c}\right)}{\gamma} + \frac {2 \gamma}{K} \sum_ {t = 1} ^ {T} G _ {t} ^ {2} \tag {C.4}
+$$
+
+Proof. Our proof is patterned after Shalev-Shwartz [35], but with an important difference regarding the use of Riemannian norms and Riemann-Lipschitz continuity. To begin, let
+
+$$
+F _ {t} (x) = \sum_ {s = 1} ^ {t - 1} f _ {s} (x) + \frac {h (x)}{\gamma} \tag {C.5}
+$$
+
+denote the "cumulative" loss faced by the optimizer up to roun $t - 1$ , including the regularization penalty. By the definition of the FTRL policy, $X_{t} \in \arg \min F_{t}(x)$ , so $\langle \nabla F_t(X_t)|x - X_t\rangle \geq 0$ and, likewise, $\langle \nabla F_{t + 1}(X_{t + 1})|x - X_{t + 1}\rangle \geq 0$ for all $x \in \mathcal{X}$ . Furthermore, since $h$ is $K$ -strongly convex relative to $g$ , $F_{t}$ and $F_{t + 1}$ will be $(K / \gamma)$ -strongly convex relative to $g$ .
+
+Putting all this together, we obtain:
+
+$$
+F _ {t} \left(X _ {t + 1}\right) \geq F _ {t} \left(X _ {t}\right) + \frac {K}{2 \gamma} \left\| X _ {t + 1} - X _ {t} \right\| _ {X _ {t + 1}} ^ {2} \tag {C.6a}
+$$
+
+$$
+F _ {t + 1} \left(X _ {t}\right) \geq F _ {t + 1} \left(X _ {t + 1}\right) + \frac {K}{2 \gamma} \left\| X _ {t} - X _ {t + 1} \right\| _ {X _ {t}} ^ {2} \tag {C.6b}
+$$
+
+and hence, after summing the above inequalities:
+
+$$
+\begin{array}{l} f _ {t} \left(X _ {t}\right) - f _ {t} \left(X _ {t + 1}\right) \geq \frac {K}{2 \gamma} \left\| X _ {t + 1} - X _ {t} \right\| _ {X _ {t + 1}} ^ {2} + \frac {K}{2 \gamma} \left\| X _ {t} - X _ {t + 1} \right\| _ {X _ {t}} ^ {2} \\ \geq \frac {K}{2 \gamma} \| X _ {t + 1} - X _ {t} \| _ {X _ {t}} ^ {2}. \tag {C.7} \\ \end{array}
+$$
+
+On the other hand, Lemma C.2 gives
+
+$$
+f _ {t} \left(X _ {t}\right) - f _ {t} \left(X _ {t + 1}\right) \leq G _ {t} \| X _ {t} - X _ {t + 1} \| _ {X _ {t}} \tag {C.8}
+$$
+
+so, combining the last two inequalities, we get:
+
+$$
+\frac {K}{2 \gamma} \| X _ {t + 1} - X _ {t} \| _ {X _ {t}} \leq G _ {t}. \tag {C.9}
+$$
+
+Therefore, plugging this back into (C.8) yields
+
+$$
+f _ {t} \left(X _ {t}\right) - f _ {t} \left(X _ {t + 1}\right) \leq \frac {2 \gamma G _ {t} ^ {2}}{K}, \tag {C.10}
+$$
+
+and our result obtains from Lemma C.1.
+
+The proof of (22a) then follows by applying Proposition C.1 with a step-size of the prescribed form.
+
+# D ERGODIC ANALYSIS OF OMD
+
+This appendix is devoted to the proof of our main regret bound for (OMD). We begin by recalling the recursive definition of the (lazy) OMD method:
+
+$$
+Y _ {t + 1} = Y _ {t} - \gamma v _ {t} \tag {OMD}
+$$
+
+$$
+X _ {t + 1} = Q \left(Y _ {t + 1}\right)
+$$
+
+with $Q$ defined as in Appendix B and oracle feedback subject to the hypotheses (17). We may then write the oracle feedback received by the optimizer at time $t$ as $v_{t} = \nabla f_{t}(X_{t}) + U_{t + 1}$ ; hence, by the unbiasedness assumption (17a), it follows that $\mathbb{E}[U_{t + 1}|\mathcal{F}_t] = 0$ , i.e., $U_{t}$ is a martingale difference sequence (MDS) relative to $\mathcal{F}_t$ .
+
+Now, applying Proposition B.1 to (OMD), we get:
+
+$$
+\begin{array}{l} \Phi (x ^ {*}, Y _ {t + 1}) \leq \Phi (x ^ {*}, Y _ {t}) - \gamma \langle v _ {t} | X _ {t} - x ^ {*} \rangle + \frac {\gamma^ {2}}{2 K} \| v _ {t} \| _ {X _ {t, *}} ^ {2} \\ = \Phi \left(x ^ {*}, Y _ {t}\right) + \gamma \left\langle \nabla f _ {t} \left(X _ {t}\right) \mid x ^ {*} - X _ {t} \right\rangle - \gamma \left\langle U _ {t + 1} \mid X _ {t} - x ^ {*} \right\rangle + \frac {\gamma^ {2}}{2 K} \| v _ {t} \| _ {X _ {t}, *} ^ {2}. \tag {D.1} \\ \end{array}
+$$
+
+Hence, after rearranging and telescoping, we obtain
+
+$$
+\operatorname {R e g} (T) \leq \sum_ {t = 1} ^ {T} \left\langle \nabla f _ {t} \left(X _ {t}\right) \mid X _ {t} - x ^ {*} \right\rangle \leq \frac {D \left(x ^ {*} , x _ {c}\right)}{\gamma} + \sum_ {t = 1} ^ {T} \xi_ {t + 1} + \frac {\gamma}{2 K} \sum_ {t = 1} ^ {T} \| v _ {t} \| _ {X _ {t}, *} ^ {2} \tag {D.2}
+$$
+
+where, in the last line, we used the definition of the Riemannian dual norm $||\cdot ||_{*}\equiv ||\cdot ||_{x^{*},*}$ , and we set $\xi_{t + 1} = \langle U_{t + 1}|x^{*} - X_{t}\rangle$ . Our result then follows by taking expectations on both sides.
+
+# E LAST-ITERATE ANALYSIS OF OMD
+
+In this last section, we will present the convergence analysis for the last iterate of (OMD) to $\arg \min f$ .
+
+We begin by recalling two important results from probability theory. The first is a version of the law of large numbers for martingale difference sequences that are bounded in $L^2$ [15]:
+
+Theorem E.1. Let $Y_{t} = \sum_{i=1}^{t} \zeta_{i}$ be a martingale and $\beta_{t}$ a non-decreasing positive sequence such that $\lim_{t \to \infty} \beta_{t} = \infty$ . Then,
+
+$$
+\lim _ {t \rightarrow \infty} Y _ {t} / \beta_ {t} = 0 \text {a l m o s t s u r e l y} \tag {E.1}
+$$
+
+on the set $\sum_{t=1}^{\infty} \beta_t^{-2} \mathbb{E}[\zeta_t^2 \mid \mathcal{F}_{t-1}] < \infty$ .
+
+The second is a convergence result for quasi-supern Martingales due to Robbins and Sigmund [32]:
+
+Lemma E.1. Let $(\mathcal{F}_t)_{t\in \mathbb{N}}$ be a non-decreasing sequence of $\sigma-$ algebras. Let $(\alpha_{t})_{t\in \mathbb{N}}$ , $(\theta_t)_{t\in \mathbb{N}}$ nonnegative $\mathcal{F}_t$ -measurable random variables, $(\eta_t)_{t\in \mathbb{N}}$ is an $\mathcal{F}_t$ -measurable non-negative summable random variable and the following inequality holds:
+
+$$
+\mathbb {E} \left[ \alpha_ {t + 1} \mid \mathcal {F} _ {t} \right] \leq \alpha_ {t} - \theta_ {t} + \eta_ {t} \text {a l m o s t s u r e l y} \tag {E.2}
+$$
+
+Then, $(\alpha_{t})_{t\in \mathbb{N}}$ converges almost surely towards a $[0,\infty)$ -valued random variable.
+
+An application of this lemma leads us to the following result which is of independent interest:
+
+Proposition E.1. Let $X_{t}$ be the sequence of iterates generated by (OMD) run with a step-size sequence $\gamma_{t}$ such that $\sum_{t=1}^{\infty} \gamma_{t}^{2} < \infty$ and a stochastic oracle as in the statement of Theorems 2 and 3. Then, for all $x^{*} \in \arg \min f$ , $\Phi(x^{*}, Y_{t})$ converges with probability 1.
+
+Proof. Let $x^{*} \in \arg \min f$ . Recalling our main estimation:
+
+$$
+\Phi \left(x ^ {*}, Y _ {t + 1}\right) \leq \Phi \left(x ^ {*}, Y _ {t}\right) - \gamma_ {t} \left\langle v _ {t} \mid X _ {t} - x ^ {*} \right\rangle_ {x} + \frac {\gamma_ {t} ^ {2}}{2 K} \| v _ {t} \| _ {X _ {t}, *} ^ {2} \tag {E.3}
+$$
+
+and taking conditional expectations on both sides, we get due to $\mathcal{F}_t-$ measurability arguments:
+
+$$
+\mathbb {E} \left[ \Phi \left(x ^ {*}, Y _ {t + 1}\right) \mid \mathcal {F} _ {t} \right] \leq \Phi \left(x ^ {*}, Y _ {t}\right) - \gamma_ {t} \left\langle v _ {t} \mid X _ {t} - x ^ {*} \right\rangle_ {x} + \frac {\gamma_ {t} ^ {2}}{2 K} \mathbb {E} \left[ \| v _ {t} \| _ {X _ {t}, *} ^ {2} \mid \mathcal {F} _ {t} \right]. \tag {E.4}
+$$
+
+Since, $(2K)^{-1}\sum_{t = 1}^{\infty}\gamma_t^2\mathbb{E}[||v_t||_{X_t,*}^2 |\mathcal{F}_t]\leq M(2K)^{-1}\sum_{t = 1}^{\infty}\gamma_t^2 < \infty$ Thus, by applying the above we get the result.
+
+Having this at hand, we can establish the following proposition:
+
+Proposition E.2. Let $X_{t}$ be the sequence of iterates generated by (OMD) with assumptions as in Theorem 3. Then, for all $x^{*} \in \arg \min f$ , the sequence $\| X_{t} - x^{*}\|_{X_{t}}$ is bounded with probability 1.
+
+Proof. Recalling our main estimation and taking condition expectations on both sides, we get:
+
+$$
+\mathbb {E} \left[ \Phi \left(x ^ {*}, Y _ {t + 1}\right) \mid \mathcal {F} _ {t} \right] \leq \Phi \left(x ^ {*}, Y _ {t}\right) - \gamma_ {t} \left\langle v _ {t} \mid X _ {t} - x ^ {*} \right\rangle_ {x} + \frac {\gamma_ {t} ^ {2}}{2 K} \mathbb {E} \left[ \| v _ {t} \| _ {X _ {t}, *} ^ {2} \mid \mathcal {F} _ {t} \right] \tag {E.5}
+$$
+
+Hence, by the above corollary, we have that the sequence $\Phi(x^{*}, Y_{t})$ converges with probability 1 for all $x^{*} \in \arg \min f$ . Thus, it is also bounded with probability 1 for all $x^{*}$ . We then get
+
+$$
+\left\| X _ {t} - x ^ {*} \right\| _ {X _ {t}} ^ {2} \leq \frac {2}{K} \Phi \left(x ^ {*}, Y _ {t}\right) \tag {E.6}
+$$
+
+which concludes our proof.
+
+We continue by showing that $X_{t}$ possesses a subsequence that converges to $\arg \min f$ :
+
+Proposition E.3. Let $X_{t}$ be the sequence of iterates generated by (OMD) with assumptions as in Theorem 3. Then, with probability 1, there exists a (possibly random) subsequence of $X_{t}$ which converges to $\arg \min f$ .
+
+Proof. Assume to the contrary that, with positive probability, the sequence $X_{t}$ generated by (OMD) admits no limit points in arg min $f$ . Conditioning on this event, there exists a (nonempty) closed set $\mathcal{C} \subset \mathcal{X}$ which is separated by neighborhoods from arg min $f$ and is such that $X_{t} \in \mathcal{C}$ for all sufficiently large $t$ . Then, by relabeling $X_{t}$ if necessary, we can assume without loss of generality that $X_{t} \in \mathcal{C}$ for all $t \in \mathbb{N}$ . Thus, by Proposition B.1, we get:
+
+$$
+\begin{array}{l} \Phi (x ^ {*}, Y _ {t + 1}) \leq \Phi (x ^ {*}, Y _ {t}) - \gamma_ {t} \langle v _ {t} | X _ {t} - x ^ {*} \rangle + \frac {\gamma_ {t} ^ {2}}{2 K} \| v _ {t} \| _ {X _ {t, *}} ^ {2} \\ = \Phi (x ^ {*}, Y _ {t}) - \gamma_ {t} \langle \nabla f (X _ {t}) | X _ {t} - x ^ {*} \rangle - \gamma_ {t} \langle U _ {t + 1} | X _ {t} - x ^ {*} \rangle + \frac {\gamma_ {t} ^ {2}}{2 K} \| v _ {t} \| _ {X _ {t, *}} ^ {2} \\ \leq \Phi \left(x ^ {*}, Y _ {t}\right) - \gamma_ {t} \delta (\mathcal {C}) + \gamma_ {t} \xi_ {t + 1} + \frac {\gamma_ {t} ^ {2}}{2 K} \| v _ {t} \| _ {X _ {t, *}} ^ {2} \tag {E.7} \\ \end{array}
+$$
+
+where in the last line we set $\delta (\mathcal{C}) = \inf \{\langle \nabla f(x)|x - x^{*}\rangle :x^{*}\in \arg \min f,x\in \mathcal{C}\} >0$ (by (SI)), $U_{t + 1} = v_t - \nabla f(X_t),\xi_{t + 1} = -\langle U_{t + 1}|X_t - x^*\rangle$ and $\beta_{t} = \sum_{i = 1}^{t}\gamma_{i}$ . Thus, by telescoping and factorizing we get:
+
+$$
+\Phi \left(x ^ {*}, Y _ {t + 1}\right) \leq \Phi \left(x ^ {*}, Y _ {1}\right) - \beta_ {t} \left[ \delta (\mathcal {C}) - \frac {\sum_ {s = 1} ^ {t} \gamma_ {s} \xi_ {s + 1}}{\beta_ {t}} - \frac {\sum_ {s = 1} ^ {t} \gamma_ {s} ^ {2} \| v _ {s} \| _ {X _ {s , *}} ^ {2}}{2 K \beta_ {t}} \right] \tag {E.8}
+$$
+
+By the unbiasedness assumption for $U_{t}$ , we have $\mathbb{E}[\xi_{t + 1} \mid \mathcal{F}_t] = \langle \mathbb{E}[U_{t + 1} \mid \mathcal{F}_t] | X_t - x^* \rangle = 0$ . Moreover, for all $x^* \in \arg \min f$ , we have
+
+$$
+\sum_ {t = 1} ^ {\infty} \gamma_ {t} ^ {2} \mathbb {E} [ \xi_ {t + 1} \mid \mathcal {F} _ {t} ] \leq \sum_ {t = 1} ^ {\infty} \gamma_ {t} ^ {2} \| X _ {t} - x ^ {*} \| _ {X _ {t}} ^ {2} \mathbb {E} [ U _ {t + 1} \mid \mathcal {F} _ {t} ] \leq \sum_ {t = 1} ^ {\infty} \gamma_ {t} ^ {2} \Phi (x ^ {*}, Y _ {t}) \mathbb {E} [ U _ {t + 1} \mid \mathcal {F} _ {t} ] < \infty \tag {E.9}
+$$
+
+where the last (strict) inequality is obtained due to the finite mean square property, the boundness of $\Phi(x^{*}, Y_{t})$ and the fact that $\sum_{t=1}^{\infty} \gamma_{t}^{2} < \infty$ . Thus, we can apply the law of large numbers for $L^{2}$ -martingales stated above and conclude that $\beta_{t}^{-1} \sum_{s=1}^{t} \gamma_{s} \xi_{s+1}$ converges to 0 almost surely. On the other hand, for the term $S_{t+1} = \sum_{s=1}^{t} \gamma_{s}^{2} \|v_{s}\|_{X_{t,*}}^{2}$ , since $v_{s+1}$ is $\mathcal{F}_{s}$ -measurable for all $s = 1, 2, \ldots, t-1$ we have:
+
+$$
+\mathbb {E} \left[ S _ {t + 1} \mid \mathcal {F} _ {t} \right] = \mathbb {E} \left[ \sum_ {i = 1} ^ {t - 1} \gamma_ {t} ^ {2} \| v _ {i} \| _ {X _ {t}, *} ^ {2} + \gamma_ {t} ^ {2} \| v _ {t} \| _ {X _ {t}, *} ^ {2} \Bigg | \mathcal {F} _ {t} \right] = S _ {t} + \gamma_ {t} ^ {2} \mathbb {E} \left[ \| v _ {t} \| _ {X _ {t}, *} ^ {2} \mid \mathcal {F} _ {t} \right] \geq S _ {t} \tag {E.10}
+$$
+
+so $S_{t}$ is a submartingale with respect to $\mathcal{F}_t$ . Furthermore, by the law of total expectation, we also get:
+
+$$
+\mathbb {E} \left[ S _ {t + 1} \right] = \mathbb {E} \left[ \mathbb {E} \left[ S _ {t + 1} \mid \mathcal {F} _ {t} \right] \right] \leq \sigma^ {2} \sum_ {i = 1} ^ {t} \gamma_ {i} ^ {2} \leq \sigma^ {2} \sum_ {t = 1} ^ {\infty} \gamma_ {t} ^ {2} < \infty , \tag {E.11}
+$$
+
+implying that $S_{t}$ is bounded in $L^{1}$ . Thus, due to Doob's submartingale convergence theorem [15], we conclude that $S_{t}$ converges to some (almost surely finite) random variable $S_{\infty}$ so $\lim_{t\to \infty}\frac{S_{t + 1}}{\beta_t} = 0$ with probability 1.
+
+Now, by letting $t \to \infty$ in (E.8), we get $\Phi(x^{*}, Y_{t}) \to -\infty$ , a contradiction. Going back to our original assumption, this shows that there exists a subsequence of $X_{t}$ which converges to $\arg \min f$ with probability 1, as claimed.
+
+With all this at hand, we proceed to the proof of our last-iterate convergence result:
+
+Proof of Theorem 3. By the boundedness (and hence compactness) of arg min $f$ , Proposition E.3 implies that, with probability 1, there exists some $x^{*} \in \arg \min f$ such that $X_{t_k} \to x^*$ for some (possibly random) subsequence $X_{t_k}$ of $X_{t}$ . By the Riemann-Legendre property of $h$ , it follows that $\Phi(x^{*}, Y_{t_k}) = D(x^{*}, X_{t_k}) \to 0$ as $k \to \infty$ , implying in turn that $\lim_{t \to \infty} D(x^{*}, X_{t}) = 0$ (by Proposition E.1). Since $D(x^{*}, X_{t}) \geq K \|X_{t} - x^{*}\|_{X_{t}}^{2} \geq \mu \|X_{t} - x^{*}\|^{2}$ , we conclude that $X_{t} \to x^{*}$ , and our proof is complete.
+
+# F APPLICATIONS TO POISSON INVERSE PROBLEMS AND NUMERICAL EXPERIMENTS
+
+# F.1 DETAILED STATEMENT OF THE PROBLEM
+
+The class of Poisson inverse problems that we consider stem from linear systems of the form
+
+$$
+u = H x + z \tag {F.1}
+$$
+
+where
+
+- $x \in \mathbb{R}_+^d$ is the object under study (a signal, image, ...).
+- $u \in \mathbb{R}_{++}^{m}$ is the observed data (usually $m \ll d$ ).
+- The kernel matrix $H \in \mathbb{R}_+^{m \times d}$ is a representation of the data-gathering protocol and is typically highly ill-conditioned (e.g., a Toeplitz matrix in the case of image deconvolution problems).
+- $z \in \mathbb{R}^m$ is the noise affecting the measurements.
+
+When data points are obtained by means of a counting process, measurements can be modeled as Poisson random variables of the form $u_{j} \sim \mathrm{Pois}(Hx)_{j}$ . Then, up to an additive constant, the log-likelihood of $x \in \mathbb{R}^d$ given an observation $u \in \mathbb{R}_{++}^{m}$ will be
+
+$$
+L (x; u) = - \sum_ {j = 1} ^ {m} \left[ u _ {j} \log \frac {u _ {j}}{(H x) _ {j}} + (H x) _ {j} - u _ {j} \right]. \tag {F.2}
+$$
+
+Hence, obtaining a maximum likelihood estimate for $x$ leads to the archetypal Poisson inverse problem
+
+$$
+\text {m i n i m i z e} \quad f (x) \equiv D _ {\mathrm {K L}} (u, H x),
+$$
+
+$$
+\begin{array}{l} \text {s u b j e c t t o} \quad x \in \mathbb {R} _ {+} ^ {d}, \end{array} \tag {PIP}
+$$
+
+where $D_{\mathrm{KL}}(p,q) = \sum_{j = 1}^{m}[p_j\log (p_j / q_j) + q_j - p_j]$ denotes the generalized KL divergence on $\mathbb{R}_+^m$ . For an extensive review of Poisson inverse problems, we refer the reader to Bertero et al. [7].
+
+In many cases of practical interest, measurements arrive in distinct batches over time - e.g., as sequential optical sections in microscopy and tomography. Moreover, due to the large numbers of pixels/voxels involved (a typical range of values for $m$ is between $10^{6}$ and $10^{7}$ ), gradients of $f$ are very costly to compute; as such, optimization methods that rely on accurate gradient data are difficult to apply in this setting. Accordingly, a natural workaround to this obstacle is to exploit the online nature of the measurement process, model (PIP) as an online optimization problem, and then to use an online-to-batch conversion to get a candidate solution [35].
+
+On the downside, this online optimization analysis crucially requires the loss functions faced by the optimizer to be Lipschitz continuous. However, this assumption does not hold for (PIP): if $f_{j}(x) = -u_{j}\log (u_{j} / (Hx)_{j})$ denotes the singular part of the KL divergence for the $j$ -th sample, we readily get
+
+$$
+\frac {\partial f _ {j}}{\partial x _ {i}} = \frac {u _ {j} H _ {j i}}{(H x) _ {j}}. \tag {F.3}
+$$
+
+This shows that the gradient of $f_{j}$ exhibits an $\mathcal{O}(1 / x)$ singularity at the boundary of $\mathbb{R}_+^d$ , so $f$ cannot be Lipschitz under any global norm on $\mathbb{R}^d$ .
+
+As suggested by Example 3, this singularity can be lifted by considering the local norm
+
+$$
+\| z \| _ {x} ^ {2} = \left(x _ {1} + \dots + x _ {d}\right) ^ {2} \sum_ {i = 1} ^ {d} z _ {i} ^ {2} \quad \text {f o r a l l} v \in \mathbb {R} ^ {d}. \tag {F.4}
+$$
+
+In this case, we have
+
+$$
+\left\| \nabla f _ {j} (x) \right\| _ {x} ^ {2} = \sum_ {i = 1} ^ {d} u _ {j} ^ {2} \frac {H _ {j i} ^ {2} x _ {i} ^ {2}}{(H x) _ {j} ^ {2}} = \frac {u _ {j} ^ {2} \sum_ {i = 1} ^ {d} H _ {j i} ^ {2} x _ {i} ^ {2}}{\left[ \sum_ {i = 1} ^ {d} H _ {j i} x _ {i} \right] ^ {2}} = \mathcal {O} \left(u _ {j} ^ {2}\right), \tag {F.5}
+$$
+
+so $\| \nabla f_j \|_x$ is bounded under this modified norm. This is the principal motivation for considering the Riemannian mirror descent method defined with respect to this metric and the regularizer presented in Example 5.
+
+# F.2 DETAILS ON THE EXPERIMENTS
+
+In the rest of this appendix, we discuss in more detail the algorithms tested in Section 6. The algorithms we considered are
+
+1. The accelerated Lucy-Richardson algorithm, as presented in [7] and corresponding to OMD with the entropic regularizer $h(x) = \sum_{i} x_{i} \log x_{i}$ .
+2. The composite mirror prox (CMP) of He et al. [18], corresponding to OMD with an extra gradient step and the log-barrier (Burg) regularizer $h(x) = -\sum_{i}\log x_{i}$ of Example 4.
+3. The Riemannian mirror descent (RMD) algorithm detailed in Section 6, corresponding to the Poincaré-like regularizer of Example 5.
+
+All algorithms were run with stochastic gradients drawn with the same minibatch size ( $n = 256$ ) and a step-size of the form $\gamma_t \propto 1 / \sqrt{t}$ (corresponding to the stochastic variant of each algorithm). For comparison purposes, we harvested each algorithm's last generated sample ("last iterate") as well as the corresponding ergodic average (defined here as $\bar{X}_T = \sum_{t=1}^{T} \gamma_t X_t / \sum_{t=1}^{T} \gamma_t$ ). Overall, the algorithms' last generated sample provided consistently better results than the ergodic average. The ground truth and the evolution of the Poisson likelihood loss are all reported in Fig. 1.
+
+Remark. We should note here that the method of He et al. [18] can be seen as an "extra-gradient" version of the NoLips algorithm of Bauschke et al. [3] and the "relative stochastic gradient descent" scheme of Hanzely and Richtárik [16] (the difference between the last two being the step-size policy). In our experiments, Burg mirror descent with and without an extra-gradient step behaved similarly, with the extra-gradient version (CMP) performing slightly better. To minimize clutter, and because we are already comparing RMD to CMP above, we do not report this extra set of numerical experiments.
\ No newline at end of file
diff --git a/onlineandstochasticoptimizationbeyondlipschitzcontinuityariemannianapproach/images.zip b/onlineandstochasticoptimizationbeyondlipschitzcontinuityariemannianapproach/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..755c8f6b8fbdfa3ff18026bc5cf688ae3ff194d0
--- /dev/null
+++ b/onlineandstochasticoptimizationbeyondlipschitzcontinuityariemannianapproach/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:7b3c50242e6099ca7711bdfb5a12d215e995a59516d2245c665524fe8bfdaed1
+size 649474
diff --git a/onlineandstochasticoptimizationbeyondlipschitzcontinuityariemannianapproach/layout.json b/onlineandstochasticoptimizationbeyondlipschitzcontinuityariemannianapproach/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..035d37623d896afe4fc412791602eb9c7384f632
--- /dev/null
+++ b/onlineandstochasticoptimizationbeyondlipschitzcontinuityariemannianapproach/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:9cc1d763374d567c14c7526217d6de07d84da556b2e6b7a7cf54ba3fa6691bc7
+size 1130792
diff --git a/onrobustnessofneuralordinarydifferentialequations/6369f50d-ae66-4ed4-b766-46c84a6f3fb5_content_list.json b/onrobustnessofneuralordinarydifferentialequations/6369f50d-ae66-4ed4-b766-46c84a6f3fb5_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..ab5b1486f4e3e30df175ce61f61364db7f6676d5
--- /dev/null
+++ b/onrobustnessofneuralordinarydifferentialequations/6369f50d-ae66-4ed4-b766-46c84a6f3fb5_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:060f2eeb6734303ac3aae19b53498a6f4a615df5e0d26df6e20b2ab9a3f32595
+size 87067
diff --git a/onrobustnessofneuralordinarydifferentialequations/6369f50d-ae66-4ed4-b766-46c84a6f3fb5_model.json b/onrobustnessofneuralordinarydifferentialequations/6369f50d-ae66-4ed4-b766-46c84a6f3fb5_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..f0a14fb8fca6eba808c230f7a8d3d8a2da29aa61
--- /dev/null
+++ b/onrobustnessofneuralordinarydifferentialequations/6369f50d-ae66-4ed4-b766-46c84a6f3fb5_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:da9fbe83a8495cb146f500f6f3faf3c9f4dea88db860b9c4a0dfe73bcc2f950d
+size 101811
diff --git a/onrobustnessofneuralordinarydifferentialequations/6369f50d-ae66-4ed4-b766-46c84a6f3fb5_origin.pdf b/onrobustnessofneuralordinarydifferentialequations/6369f50d-ae66-4ed4-b766-46c84a6f3fb5_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..1710ce9d7fd6b564a13b563682c6c2e6ff83c17e
--- /dev/null
+++ b/onrobustnessofneuralordinarydifferentialequations/6369f50d-ae66-4ed4-b766-46c84a6f3fb5_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:03ed9aba35f795d88f4935d3467d582ada0a59be1e6e2044add5c7f42332d528
+size 1259992
diff --git a/onrobustnessofneuralordinarydifferentialequations/full.md b/onrobustnessofneuralordinarydifferentialequations/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..6da9a27e7574aabd58193530522bf1535bdfb992
--- /dev/null
+++ b/onrobustnessofneuralordinarydifferentialequations/full.md
@@ -0,0 +1,302 @@
+# ON ROBUSTNESS OF NEURAL ORDINARY DIFFERENTIAL EQUATIONS
+
+Hanshu YAN*, Jiawei DU*, Vincent Y. F. TAN & Jiashi FENG
+
+Department of Electrical and Computer Engineering
+
+National University of Singapore
+
+{hanshu.yan,dujiawei}@u.nus.edu,{vtan,elefjia}@nus.edu.sg
+
+# ABSTRACT
+
+Neural ordinary differential equations (ODEs) have been attracting increasing attention in various research domains recently. There have been some works studying optimization issues and approximation capabilities of neural ODEs, but their robustness is still yet unclear. In this work, we fill this important gap by exploring robustness properties of neural ODEs both empirically and theoretically. We first present an empirical study on the robustness of the neural ODE-based networks (ODENets) by exposing them to inputs with various types of perturbations and subsequently investigating the changes of the corresponding outputs. In contrast to conventional convolutional neural networks (CNNs), we find that the ODENets are more robust against both random Gaussian perturbations and adversarial attack examples. We then provide an insightful understanding of this phenomenon by exploiting a certain desirable property of the flow of a continuous-time ODE, namely that integral curves are non-intersecting. Our work suggests that, due to their intrinsic robustness, it is promising to use neural ODEs as a basic block for building robust deep network models. To further enhance the robustness of vanilla neural ODEs, we propose the time-invariant steady neural ODE (TisODE), which regularizes the flow on perturbed data via the time-invariant property and the imposition of a steady-state constraint. We show that the TisODE method outperforms vanilla neural ODEs and also can work in conjunction with other state-of-the-art architectural methods to build more robust deep networks.
+
+# 1 INTRODUCTION
+
+Neural ordinary differential equations (Chen et al., 2018) form a family of models that approximate nonlinear mappings by using continuous-time ODEs. Due to their desirable properties, such as invertibility and parameter efficiency, neural ODEs have attracted increasing attention recently (Dupont et al., 2019; Liu et al., 2019). For example, Grathwohl et al. (2018) proposed a neural ODE-based generative model—the FFJORD—to solve inverse problems; Quaglino et al. (2019) used a higher-order approximation of the states in a neural ODE, and proposed the SNet to accelerate computation. Along with the wider deployment of neural ODEs, robustness issues come to the fore. However, the robustness of neural ODEs is still yet unclear. In particular, it is unclear how robust neural ODEs are in comparison to the widely-used CNNs. Robustness properties of CNNs have been studied extensively. In this work, we present the first systematic study on exploring the robustness properties of neural ODEs.
+
+To do so, we consider the task of image classification. We expect that results would be similar for other machine learning tasks such as regression. Neural ODEs are dimension-preserving mappings, but a classification model transforms a high-dimensional input—such as an image—into an output whose dimension is equal to the number of classes. Thus, we consider the neural ODE-based classification network (ODENet) whose architecture is shown in Figure 1. An ODENet consists of three components: the feature extractor (FE) consists of convolutional layers which maps an input datum to a multi-channel feature map, a neural ODE that serves as the nonlinear representation mapping (RM), and the fully-connected classifier (FCC) that generates a prediction vector based on the output of the RM.
+
+The robustness of a classification model can be evaluated through the lens of its performance on perturbed images. To comprehensively investigate the robustness of neural ODEs, we perturb original images with commonly-used perturbations, namely, random Gaussian noise (Szegedy et al., 2013) and harmful adversarial examples (Goodfellow et al., 2014; Madry et al., 2017). We conduct experiments in two common settings—training the model only on authentic non-perturbed images and training the model on authentic images as well as the Gaussian perturbed ones. We observe that ODENets are more robust compared to CNN models against all types of perturbations in both settings. We then provide an insightful understanding of such intriguing robustness of neural ODEs by exploiting a certain property of the flow (Dupont et al., 2019), namely that integral curves that start at distinct initial states are non-intersecting. The flow of a continuous-time ODE is defined as the family of solutions/paths traversed by the state, starting from different initial points, and an integral curve is a specific solution for a given initial point. The non-intersecting property indicates that
+
+an integral curve starting from some point is constrained by the integral curves starting from that point's neighborhood. Thus, in an ODENet, if a correctly classified datum is slightly perturbed, the integral curve associated to its perturbed version would not change too much from the original one. Consequently, the perturbed datum could still be correctly classified. Thus, there exists intrinsic robustness regularization in ODENets, which is absent from CNNs.
+
+Motivated by this property of the neural ODE flow, we attempt to explore a more robust neural ODE architecture by introducing stronger regularization on the flow. We thus propose a Time-Invariant Steady neural ODE (TisODE). The TisODE removes the time dependence of the dynamics in an ODE and imposes a steady-state constraint on the integral curves. Removing the time dependence of the derivative results in the time-invariant property of the ODE. To wit, given a solution $\mathbf{z}_1(t)$ , another solution $\widetilde{\mathbf{z}}_1(t)$ , with an initial state $\widetilde{\mathbf{z}}_1(0) = \mathbf{z}_1(T')$ for some $T' > 0$ , can be regarded as the $-T'$ -shift version of $\mathbf{z}_1(t)$ . Such a time-invariant property would make bounding the difference between output states convenient. To elaborate, let the output of a neural ODE correspond to states at time $T > 0$ . By the time-invariant property, the difference between outputs, $\| \widetilde{\mathbf{z}}_1(T) - \mathbf{z}_1(T) \|$ , equals to $\| \mathbf{z}_1(T + T') - \mathbf{z}_1(T) \|$ . To control this distance, a steady-state regularization term is introduced to the overall objective to constrain the change of a state after time exceeds $T$ . With the time-invariant property and the steady-state term, we show that TisODE even is more robust. We do so by evaluating the robustness of TisODE-based classifiers against various types of perturbations and observe that such models are more robust than vanilla ODE-based models.
+
+In addition, some other effective architectural solutions have also been recently proposed to improve the robustness of CNNs. For example, Xie et al. (2017) randomlyizes or pads zeros into test images to destroy the specific structure of adversarial perturbations. Besides, the model proposed by Xie et al. (2019) contains feature denoising filters to remove the feature-level patterns of adversarial examples. We conduct experiments to show that our proposed TisODE can work seamlessly and in conjunction with these methods to further boost the robustness of deep models. Thus, the proposed TisODE can be used as a generally applicable and effective component for improving the robustness of deep models.
+
+In summary, our contributions are as follows. Firstly, we are the first to provide a systematic empirical study on the robustness of neural ODEs and find that the neural ODE-based models are more robust compared to conventional CNN models. This finding inspires new applications of neural ODEs in improving robustness of deep models, a problem that concerns many deep learning theorists and practitioners alike. Secondly, we propose the TisODE method, which is simple yet effective in significantly boosting the robustness of neural ODEs. Moreover, the proposed TisODE can also be used in conjunction with other state-of-the-art robust architectures. Thus, TisODE can serve as a drop-in module to improve the robustness of deep models effectively.
+
+
+Figure 1: The architecture of an ODENet. The neural ODE block serves as a dimension-preserving nonlinear mapping.
+
+# 2 PRELIMINARIES ON NEURAL ODE
+
+It has been shown that a residual block (He et al., 2016) can be interpreted as the discrete approximation of an ODE by setting the discretization step to be one. When the discretization step approaches zero, it yields a family of neural networks, which are called neural ODEs (Chen et al., 2018). Formally, in a neural ODE, the relation between input and output is characterized by the following set of equations:
+
+$$
+\frac {\mathrm {d} \mathbf {z} (t)}{\mathrm {d} t} = f _ {\theta} (\mathbf {z} (t), t), \quad \mathbf {z} (0) = \mathbf {z} _ {\text {i n}}, \quad \mathbf {z} _ {\text {o u t}} = \mathbf {z} (T), \tag {1}
+$$
+
+where $f_{\theta} : \mathbb{R}^{d} \times [0, \infty) \to \mathbb{R}^{d}$ denotes the trainable layers that are parameterized by weights $\theta$ and $\mathbf{z} : [0, \infty) \to \mathbb{R}^{d}$ represents the $d$ -dimensional state of the neural ODE. We assume that $f_{\theta}$ is continuous in $t$ and globally Lipschitz continuous in $\mathbf{z}$ . In this case, the input $\mathbf{z}_{\mathrm{in}}$ of the neural ODE corresponds to the state at $t = 0$ , and the output $\mathbf{z}_{\mathrm{out}}$ is associated to the state at some $T \in (0, \infty)$ . Because $f_{\theta}$ governs how the state changes with respect to time $t$ , we also use $f_{\theta}$ to denote the dynamics of the neural ODE.
+
+Given input $\mathbf{z}_{\mathrm{in}}$ , the output $\mathbf{z}_{\mathrm{out}}$ can be computed by solving the ODE in (1). If $T$ is fixed, the output $\mathbf{z}_{\mathrm{out}}$ only depends on the input $\mathbf{z}_{\mathrm{in}}$ and the dynamics $f_{\theta}$ , which also corresponds to the weighted layers in the neural ODE. Therefore, the neural ODE can be represented as the $d$ -dimensional function $\phi_T(\cdot ,\cdot)$ of the input $\mathbf{z}_{\mathrm{in}}$ and the dynamics $f_{\theta}$ , i.e.,
+
+$$
+\mathbf {z} _ {\mathrm {o u t}} = \mathbf {z} (T) = \mathbf {z} (0) + \int_ {0} ^ {T} f _ {\theta} (\mathbf {z} (t), t) \mathrm {d} t = \phi_ {T} (\mathbf {z} _ {\mathrm {i n}}, f _ {\theta}).
+$$
+
+The terminal time $T$ of the output state $\mathbf{z}(T)$ is set to be 1 in practice. Several methods have been proposed for training neural ODEs, such as the adjoint sensitivity method (Chen et al., 2018), SNet (Quaglino et al., 2019), and the auto-differentiation technique (Paszke et al., 2017). In this work, we use the most straightforward technique, i.e., updating the weights $\theta$ with the auto-differentiation technique in the PyTorch framework.
+
+# 3 AN EMPIRICAL STUDY ON THE ROBUSTNESS OF ODENETS
+
+Robustness of deep models has gained increased attention, as it is imperative that deep models employed in critical applications, such as healthcare, are robust. The robustness of a model is measured by the sensitivity of the prediction with respect to small perturbations on the inputs. In this study, we consider three commonly-used perturbation schemes, namely random Gaussian perturbations, FGSM (Goodfellow et al., 2014) adversarial examples, and PGD (Madry et al., 2017) adversarial examples. These perturbation schemes reflect noise and adversarial robustness properties of the investigated models respectively. We evaluate the robustness via the classification accuracies on perturbed images, in which the original non-perturbed versions of these images are all correctly classified.
+
+For a fair comparison with conventional CNN models, we made sure that the number of parameters of an ODENet is close to that of its counterpart CNN model. Specifically, the ODENet shares the same network architecture with the CNN model for the FE and FCC parts. The only difference is that, for the RM part, the input of the ODE-based RM is concatenated with one more channel which represents the time $t$ , while the RM in a CNN model has a skip connection and serves as a residual block. During the training phase, all the hyperparameters are kept the same, including training epochs, learning rate schedules, and weight decay coefficients. Each model is trained three times with different random seeds, and we report the average performance (classification accuracy) together with the standard deviation.
+
+# 3.1 EXPERIMENTAL SETTINGS
+
+Dataset: We conduct experiments to compare the robustness of ODENets with CNN models on three datasets, i.e., the MNIST (LeCun et al., 1998), the SVHN (Netzer et al., 2011), and a subset of the ImageNet dataset (Deng et al., 2009). We call the subset ImgNet10 since it is collected from 10 synsets of ImageNet: dog, bird, car, fish, monkey, turtle, lizard, bridge, cow, and crab. We selected 3,000 training images and 300 test images from each synset and resized all images to $128 \times 128$ .
+
+Architectures: On the MNIST dataset, both the ODENet and the CNN model consists of four convolutional layers and one fully-connected layer. The total number of parameters of the two models is around 140k. On the SVHN dataset, the networks are similar to those for the MNIST; we only changed the input channels of the first convolutional layer to three. On the ImgNet10 dataset, there are nine convolutional layers and one fully-connected layer for both the ODENet and the CNN model. The numbers of parameters is approximately 280k. In practice, the neural ODE can be solved with different numerical solvers such as the Euler method and the Runge-Kutta methods (Chen et al., 2018). Here, we use the easily-implemented Euler method in the experiments. To balance the computation and the continuity of the flow, we solve the ODE initial value problem in equation (1) by the Euler method with step size 0.1. Our implementation builds on the open-source neural ODE codes. Details on the network architectures are included in the Appendix.
+
+Training: The experiments are conducted using two settings on each dataset—training models only with original non-perturbed images and training models on original images together with their perturbed versions. In both settings, we added a weight decay term into the training objective to regularize the norm of the weights, since this can help control the model's representation capacity and improve the robustness of a neural network (Sokolic et al., 2017). In the second setting, images perturbed with random Gaussian noise are used to fine-tune the models, because augmenting the dataset with small perturbations can possibly improve the robustness of models and synthesizing Gaussian noise does not incur excessive computation time.
+
+# 3.2 ROBUSTNESS OF ODENETS TRAINED ONLY ON NON-PERTURBED IMAGES
+
+The first question we are interested in is how robust ODENets are against perturbations if the model is only trained on original non-perturbed images. We train CNNs and ODEnets to perform classification on three datasets and set the weight decay parameters for all models to be 0.0005. We make sure that both the well-trained ODENets and CNN models have satisfactory performances on original non-perturbed images, i.e., around $99.5\%$ for MNIST, $95.0\%$ for the SVHN, and $80.0\%$ for ImgNet10.
+
+Since Gaussian noise is ubiquitous in modeling image degradation, we first evaluated the robustness of the models in the presence of zero-mean random Gaussian perturbations. It has also been shown that a deep model is vulnerable to harmful adversarial examples, such as the FGSM (Goodfellow et al., 2014). We are also interested in how robust ODENets are in the presence of adversarial examples. The standard deviation $\sigma$ of Gaussian noise and the $l_{\infty}$ -norm $\epsilon$ of the FGSM attack for each dataset are shown in Table 1.
+
+Table 1: Robustness comparison of different models. We report their mean classification accuracies $(\%)$ and standard deviations (mean $\pm$ std) on perturbed images from the MNIST, the SVHN, and the ImgNet10 datasets. Two types of perturbations are used—zero-mean Gaussian noise and FGSM adversarial attack. The results show that ODENets are much more robust in comparison to CNN models.
+
+ | Gaussian noise | Adversarial attack |
| MNIST | σ = 50 | σ = 75 | σ = 100 | FGSM-0.15 | FGSM-0.3 | FGSM-0.5 |
| CNN | 98.1±0.7 | 85.8±4.3 | 56.4±5.6 | 63.4±2.3 | 24.0±8.9 | 8.3±3.2 |
| ODENet | 98.7±0.6 | 90.6±5.4 | 73.2±8.6 | 83.5±0.9 | 42.1±2.4 | 14.3±2.1 |
| SVHN | σ = 15 | σ = 25 | σ = 35 | FGSM-3/255 | FGSM-5/255 | FGSM-8/255 |
| CNN | 90.0±1.2 | 76.3±2.7 | 60.9±3.9 | 29.2±2.9 | 13.7±1.9 | 5.4±1.5 |
| ODENet | 95.7±0.7 | 88.1±1.5 | 78.2±2.1 | 58.2±2.3 | 43.0±1.3 | 30.9±1.4 |
| ImgNet10 | σ = 10 | σ = 15 | σ = 25 | FGSM-5/255 | FGSM-8/255 | FGSM-16/255 |
| CNN | 80.1±1.8 | 63.3±2.0 | 40.8±2.7 | 28.5±0.5 | 18.1±0.7 | 9.4±1.2 |
| ODENet | 81.9±2.0 | 67.5±2.0 | 48.7±2.6 | 36.2±1.0 | 27.2±1.1 | 14.4±1.7 |
+
+From the results in Table 1, we observe that the ODENets demonstrate superior robustness compared to CNNs for all types of perturbations. On the MNIST dataset, in the presence of Gaussian
+
+perturbations with a large $\sigma$ of 100, the ODENet produces much higher accuracy on perturbed images compared to the CNN model (73.2% vs. 56.4%). For the FGSM-0.3 adversarial examples, the accuracy of ONEnet is around twice as high as that of the CNN model. On the SVHN dataset, ODENets significantly outperform CNN models, e.g., for the FGSM-5/255 examples, the accuracy of the ODENet is 43.0%, which is much higher than that of the CNN model (13.7%). On the ImgNet10, for both cases of $\sigma = 25$ and FGSM-8/255, ODENet outperforms CNNs by a large margin of around 9%.
+
+# 3.3 ROBUSTNESS OF ODENETS TRAINED ON ORIGINAL IMAGES TOGETHER WITH GAUSSIAN PERTURBATIONS
+
+Training a model on original images together with their perturbed versions can improve the robustness of the model. As mentioned previously, Gaussian noise is commonly assumed to be present in real-world images. Synthesizing Gaussian noise is also fast and easy. Thus, we add random Gaussian noise into the original images to generate their perturbed versions. ODE nets and CNN models are both trained on original images together with their perturbed versions. The standard deviation of the added Gaussian noise is randomly chosen from $\{50, 75, 100\}$ on the MNIST dataset, $\{15, 25, 35\}$ on the SVHN dataset, and $\{10, 15, 25\}$ on the ImgNet10. All other hyperparameters are kept the same as above.
+
+Table 2: Robustness comparison of different models. We report their mean classification accuracies $(\%)$ and standard deviations (mean $\pm$ std) on perturbed images from the MNIST, the SVHN, and the ImgNet10 datasets. Three types of perturbations are used—zero-mean Gaussian noise, FGSM adversarial attack, and PGD adversarial attack. The results show that ODENets are more robust compared to CNN models.
+
+ | Gaussian noise | Adversarial attack |
| MNIST | σ = 100 | FGSM-0.3 | FGSM-0.5 | PGD-0.2 | PGD-0.3 |
| CNN | 98.7±0.1 | 54.2±1.1 | 15.8±1.3 | 32.9±3.7 | 0.0±0.0 |
| ODENet | 99.4±0.1 | 71.5±1.1 | 19.9±1.2 | 64.7±1.8 | 13.0±0.2 |
| SVHN | σ = 35 | FGSM-5/255 | FGSM-8/255 | PGD-3/255 | PGD-5/255 |
| CNN | 90.6±0.2 | 25.3±0.6 | 12.3±0.7 | 32.4±0.4 | 14.0±0.5 |
| ODENet | 95.1±0.1 | 49.4±1.0 | 34.7±0.5 | 50.9±1.3 | 27.2±1.4 |
| ImgNet10 | σ = 25 | FGSM-5/255 | FGSM-8/255 | PGD-3/255 | PGD-5/255 |
| CNN | 92.6±0.6 | 40.9±1.8 | 26.7±1.7 | 28.6±1.5 | 11.2±1.2 |
| ODENet | 92.6±0.5 | 42.0±0.4 | 29.0±1.0 | 29.8±0.4 | 12.3±0.6 |
+
+The robustness of the models is evaluated under Gaussian perturbations, FGSM adversarial examples, and PGD (Madry et al., 2017) adversarial examples. The latter is a stronger attacker compared to the FGSM. The $l_{\infty}$ -norm $\epsilon$ of the PGD attack for each dataset is shown in Table 2. Based on the results, we observe that ODENets consistently outperform CNN models on both two datasets. On the MNIST dataset, the ODENet outperforms the CNN against all types of perturbations. In particular, for the PGD-0.2 adversarial examples, the accuracy of the ODENet (64.7%) is much higher than that of the CNN (32.9%). Besides, for the PGD-0.3 attack, the CNN is completely misled by the adversarial examples, but the ODENet can still classify perturbed images with an accuracy of 13.0%. On the SVHN dataset, ODENets also show superior robustness in comparison to CNN models. For all the adversarial examples, ODENets outperform CNN models by a margin of at least 10 percentage points. On the ImgNet10 dataset, the ODENet also performs better than CNN models against all forms of adversarial examples.
+
+# 3.4 INSIGHTS ON THE ROBUSTNESS OF ODENETS
+
+From the results in Sections 3.2 and 3.3, we find ODENets are more robust compared to CNN models. Here, we attempt to provide an intuitive understanding of the robustness of the neural ODE. In an ODENet, given some datum, the FE extracts an informative feature map from the datum. The neural ODE, serving as the RM, takes as input the feature map and performs a nonlinear mapping. In practice, we use the weight decay technique during training which regularizes the norm of weights
+
+in the FE part, so that the change of feature map in terms of a small perturbation on the input can be controlled. We aim to show that, in the neural ODE, a small change on the feature map will not lead to a large deviation from the original output associated with the feature map.
+
+Theorem 1 (ODE integral curves do not intersect (Coddington & Levinson, 1955; Younes, 2010; Dupont et al., 2019)). Let $\mathbf{z}_1(t)$ and $\mathbf{z}_2(t)$ be two solutions of the ODE in (1) with different initial conditions, i.e. $\mathbf{z}_1(0) \neq \mathbf{z}_2(0)$ . In (1), $f_{\theta}$ is continuous in $t$ and globally Lipschitz continuous in $\mathbf{z}$ . Then, it holds that $\mathbf{z}_1(t) \neq \mathbf{z}_2(t)$ for all $t \in [0,\infty)$ .
+
+To illustrate this theorem, considering a simple 1-dimensional system in which the state is a scalar. As shown in Figure 2, equation (1) has a solution $z_{1}(t)$ starting from $A_{1} = (0,z_{1}(0))$ , where $z_{1}(0)$ is the feature of some datum. Equation (1) also has another two solutions $z_{2}(t)$ and $z_{3}(t)$ , whose starting points $A_{2} = (0,z_{2}(0))$ and $A_{3} = (0,z_{3}(0))$ , both of which are close to $A_{1}$ . Suppose $A_{1}$ is between $A_{2}$ and $A_{3}$ . By Theorem 1, we know that the integral curve $z_{1}(t)$ is always sandwiched between the integral curves $z_{2}(t)$ and $z_{3}(t)$ .
+
+
+Figure 2: No integral curves intersect. The integral curve starting from $\widetilde{A_1}$ is always sandwiched between two integral curves starting from $A_{1}$ and $A_{3}$ .
+
+Now, let $\epsilon < \min \{|z_2(0) - z_1(0)|, |z_3(0) - z_1(0)|\}$ . Consider a solution $\widetilde{z}_1(t)$ of equation (1). The integral curve $\widetilde{z}_1(t)$ starts from a point $\widetilde{A}_1 = (0, \widetilde{z}_1(0))$ . The point $\widetilde{A}_1$ is in the $\epsilon$ -neighborhood of $A_1$ with $|\widetilde{z}_1(0) - z_1(0)| < \epsilon$ . By Theorem 1, we know that $|\widetilde{z}_1(T) - z_1(T)| \leq |z_3(T) -$
+
+$z_{2}(T)|$ . In other words, if any perturbation smaller than $\epsilon$ is added to the scalar $z_{1}(0)$ in $A_{1}$ , the deviation from the original output $z_{1}(T)$ is bounded by the distance between $z_{2}(T)$ and $z_{3}(T)$ . In contrast, in a CNN model, there is no such bound on the deviation from the original output. Thus, we opine that due to this non-intersecting property, ODENets are intrinsically robust.
+
+# 4 TISODE: BOOSTING THE ROBUSTNESS OF NEURAL ODES
+
+In the previous section, we presented an empirical study on the robustness of ODENets and observed that ODENets are more robust compared to CNN models. In this section, we explore how to boost the robustness of the vanilla neural ODE model further. This motivates the proposal of time-invariant steady neural ODEs (TisODEs).
+
+# 4.1 TIME-INVARIANT STEADY NEURAL ODES
+
+
+Figure 3: An illustration of the time-invariant property of ODEs. We can see that the curve $\widetilde{\mathbf{z}}_1(t)$ is exactly the horizontal translation of $\mathbf{z}_1(t)$ on the interval $[T',\infty)$ .
+
+From the discussion in Section 3.4, the key to improving the robustness of neural ODEs is to control the difference between neighboring integral curves. By Grownall's inequality (Howard, 1998) (see Theorem 2 in the Appendix), we know that the difference between two terminal states is bounded by the difference between initial states multiplied by the exponential of the dynamics' Lipschitz constant. However, it is very difficult to bound the Lipschitz constant of the dynamics directly. Alternatively, we propose to achieve the goal of controlling the output deviation by following two steps: (i) removing the time dependence of the dynamics and (ii) imposing a certain steady-state constraint.
+
+In the neural ODE characterized by equation (1), the dynamics $f_{\theta}(\mathbf{z}(t), t)$ depends on both the state $\mathbf{z}(t)$ at time $t$ and the time $t$ itself. In contrast, if the neural ODE is modified to be time-invariant, the time dependence of the
+
+dynamics is removed. Consequently, the dynamics depends only on the state $\mathbf{z}$ . So, we can rewrite
+
+the dynamics function as $f_{\theta}(\mathbf{z})$ , and the neural ODE is characterized as
+
+$$
+\left\{ \begin{array}{l} \frac {\mathrm {d} \mathbf {z} (t)}{\mathrm {d} t} = f _ {\theta} (\mathbf {z} (t)); \\ \mathbf {z} (0) = \mathbf {z} _ {\text {i n}}; \\ \mathbf {z} _ {\text {o u t}} = \mathbf {z} (T). \end{array} \right. \tag {2}
+$$
+
+Let $\mathbf{z}_1(t)$ be a solution of (2) on $[0,\infty)$ and $\epsilon > 0$ be a small positive value. We define the set $\mathbb{M}_1 = \{(\mathbf{z}_1(t),t)|t\in [0,T],\| \mathbf{z}_1(t) - \mathbf{z}_1(0)\| \leq \epsilon \}$ . This set contains all points on the curve of $\mathbf{z}_1(t)$ during $[0,T]$ that are also inside the $\epsilon$ -neighborhood of $\mathbf{z}_1(0)$ . For some element $(\mathbf{z}_1(T'),T')\in \mathbb{M}_1$ , let $\widetilde{\mathbf{z}}_1(t)$ be the solution of (2) which starts from $\widetilde{\mathbf{z}}_1(0) = \mathbf{z}_1(T')$ . Then we have
+
+$$
+\widetilde {\mathbf {z}} _ {1} (t) = \mathbf {z} _ {1} \left(t + T ^ {\prime}\right) \tag {3}
+$$
+
+for all $t$ in $[0,\infty)$ . The property shown in equation (3) is known as the time-invariant property. It indicates that the integral curve $\widetilde{\mathbf{z}}_1(t)$ is the $-T^{\prime}$ shift of $\mathbf{z}_1(t)$ (Figure 3).
+
+We can regard $\widetilde{\mathbf{z}}_1(0)$ as a slightly perturbed version of $\mathbf{z}_1(0)$ , and we are interested in how large the difference between $\widetilde{\mathbf{z}}_1(T)$ and $\mathbf{z}_1(T)$ is. In a robust model, the difference should be small. By equation (3), we have $\| \widetilde{\mathbf{z}}_1(T) - \mathbf{z}_1(T)\| = \| \mathbf{z}_1(T + T') - \mathbf{z}_1(T)\|$ . Since $T' \in [0,T]$ , the difference between $\mathbf{z}_1(T)$ and $\widetilde{\mathbf{z}}_1(T)$ can be bounded as follows,
+
+$$
+\| \widetilde {\mathbf {z}} _ {1} (T) - \mathbf {z} _ {1} (T) \| = \left\| \int_ {T} ^ {T + T ^ {\prime}} f _ {\theta} \left(\mathbf {z} _ {1} (t)\right) \mathrm {d} t \right\| \leq \left\| \int_ {T} ^ {T + T ^ {\prime}} \left| f _ {\theta} \left(\mathbf {z} _ {1} (t)\right) \right| \mathrm {d} t \right\| \leq \left\| \int_ {T} ^ {2 T} \left| f _ {\theta} \left(\mathbf {z} _ {1} (t)\right) \right| \mathrm {d} t \right\|, \tag {4}
+$$
+
+where all norms are $\ell_2$ norms and $|f_{\theta}|$ denotes the element-wise absolute operation of a vector-valued function $f_{\theta}$ . That is to say, the difference between $\widetilde{\mathbf{z}}_1(T)$ and $\mathbf{z}_1(T)$ can be bounded by only using the information of the curve $\mathbf{z}_1(t)$ . For any $t' \in [0, T]$ and element $(\mathbf{z}_1(t'), t') \in \mathbb{M}_1$ , consider the integral curve that starts from $\mathbf{z}_1(t')$ . The difference between the output state of this curve and $\mathbf{z}_1(T)$ satisfies inequality (4).
+
+Therefore, we propose to add an additional term $L_{\mathrm{ss}}$ to the loss function when training the time-invariant neural ODE:
+
+$$
+L _ {\mathrm {s s}} = \sum_ {i = 1} ^ {N} \left\| \int_ {T} ^ {2 T} | f _ {\theta} (\mathbf {z} _ {i} (t)) | \mathrm {d} t \right\|, \tag {5}
+$$
+
+where $N$ is the number of samples in the training set and $\mathbf{z}_i(t)$ is the solution whose initial state equals to the feature of the $i^{\mathrm{th}}$ sample. The regularization term $L_{\mathrm{ss}}$ is termed as the steady-state loss. This terminology "steady state" is borrowed from the dynamical systems literature. In a stable dynamical system, the states stabilize around a fixed point, known as the steady-state, as time tends to infinity. If we can ensure that $L_{\mathrm{ss}}$ is small, for each sample, the outputs of all the points in $\mathbb{M}_i$ will stabilize around $\mathbf{z}_i(T)$ . Consequently, the model is robust. This modification of the neural ODE is dubbed Time-invariant steady neural ODE.
+
+# 4.2 EVALUATING ROBUSTNESS OF TISODE-BASED CLASSIFIERS
+
+Here, we conduct experiments to evaluate the robustness of our proposed TisODE, and compare TisODE-based models with the vanilla ODENets. We train all models with original non-perturbed images together with their Gaussian perturbed versions. The regularization parameter for the steady-state loss $L_{\mathrm{ss}}$ is set to be 0.1. All other hyperparameters are exactly the same as those in Section 3.3.
+
+From the results in Table 3, we can see that our proposed TisODE-based models are clearly more robust compared to vanilla ODENets. On the MNIST dataset, when combating FGSM-0.3 attacks, the TisODE-based models outperform vanilla ODENets by more than 4 percentage points. For the FGSM-0.5 adversarial examples, the accuracy of the TisODE-based model is 6 percentage points better. On the SVHN dataset, the TisODE-based models perform better in terms of all forms of adversarial examples. On the ImgNet10 dataset, the TisODE-based models also outperform vanilla ODE-based models on all types of perturbations. In the presence of FGSM and PGD-5/255 examples, the accuracies are enhanced by more than 2 percentage points.
+
+Table 3: Classification accuracy (mean ± std in %) on perturbed images from MNIST, SVHN and ImgNet10. To evaluate the robustness of classifiers, we use three types of perturbations, namely zero-mean Gaussian noise with standard deviation $\sigma$ , FGSM attack and PGD attack. From the results, the proposed TisODE effectively improve the robustness of the vanilla neural ODE.
+
+ | Gaussian noise | Adversarial attack |
| MNIST | σ = 100 | FGSM-0.3 | FGSM-0.5 | PGD-0.2 | PGD-0.3 |
| CNN | 98.7±0.1 | 54.2±1.1 | 15.8±1.3 | 32.9±3.7 | 0.0±0.0 |
| ODENet | 99.4±0.1 | 71.5±1.1 | 19.9±1.2 | 64.7±1.8 | 13.0±0.2 |
| TisODE | 99.6±0.0 | 75.7±1.4 | 26.5±3.8 | 67.4±1.5 | 13.2±1.0 |
| SVHN | σ = 35 | FGSM-5/255 | FGSM-8/255 | PGD-3/255 | PGD-5/255 |
| CNN | 90.6±0.2 | 25.3±0.6 | 12.3±0.7 | 32.4±0.4 | 14.0±0.5 |
| ODENet | 95.1±0.1 | 49.4±1.0 | 34.7±0.5 | 50.9±1.3 | 27.2±1.4 |
| TisODE | 94.9±0.1 | 51.6±1.2 | 38.2±1.9 | 52.0±0.9 | 28.2±0.3 |
| ImgNet10 | σ = 25 | FGSM-5/255 | FGSM-8/255 | PGD-3/255 | PGD-5/255 |
| CNN | 92.6±0.6 | 40.9±1.8 | 26.7±1.7 | 28.6±1.5 | 11.2±1.2 |
| ODENet | 92.6±0.5 | 42.0±0.4 | 29.0±1.0 | 29.8±0.4 | 12.3±0.6 |
| TisODE | 92.8±0.4 | 44.3±0.7 | 31.4±1.1 | 31.1±1.2 | 14.5±1.1 |
+
+# 4.3 TISODE - A GENEALLY APPLICABLE DROP-IN TECHNIQUE FOR IMPROVING THE ROBUSTNESS OF DEEP NETWORKS
+
+In view of the excellent robustness of the TisODE, we claim that the proposed TisODE can be used as a general drop-in module for improving the robustness of deep networks. We support this claim by showing the TisODE can work in conjunction with other state-of-the-art techniques and further boost the models' robustness. These techniques include the feature denoising (FDn) method (Xie et al., 2019) and the input randomization (IR) method (Xie et al., 2017). We conduct experiments on the MNIST and SVHN datasets. All models are trained with original non-perturbed images together with their Gaussian perturbed versions. We show that models using the FDn/IRd technique becomes much more robust when equipped with the TisODE. In the FDn experiments, the dot-product non-local denoising layer (Xie et al., 2019) is added to the head of the fully-connected classifier.
+
+Table 4: Classification accuracy (mean ± std in %) on perturbed images from MNIST and SVHN. We evaluate against three types of perturbations, namely zero-mean Gaussian noise with standard deviation $\sigma$ , FGSM attack and PGD attack. From the results, upon the CNNs modified with FDn and IRd, using TisODE can further improve the robustness.
+
+ | Gaussian noise | Adversarial attack |
| MNIST | σ = 100 | FGSM-0.3 | FGSM-0.5 | PGD-0.2 | PGD-0.3 |
| CNN | 98.7±0.1 | 54.2±1.1 | 15.8±1.3 | 32.9±3.7 | 0.0±0.0 |
| CNN-FDn | 99.0±0.1 | 74.0±4.1 | 32.6±5.3 | 58.9±4.0 | 8.2±2.6 |
| TisODE-FDn | 99.4±0.0 | 80.6±2.3 | 40.4±5.7 | 72.6±2.4 | 28.2±3.6 |
| CNN-IRd | 95.3±0.9 | 78.1±2.2 | 36.7±2.1 | 79.6±1.9 | 55.5±2.9 |
| TisODE-IRd | 97.6±0.1 | 86.8±2.3 | 49.1±0.2 | 88.8±0.9 | 66.0±0.9 |
| SVHN | σ = 35 | FGSM-5/255 | FGSM-8/255 | PGD-3/255 | PGD-5/255 |
| CNN | 90.6±0.2 | 25.3±0.6 | 12.3±0.7 | 32.4±0.4 | 14.0±0.5 |
| CNN-FDn | 92.4±0.1 | 43.8±1.4 | 31.5±3.0 | 40.0±2.6 | 19.6±3.4 |
| TisODE-FDn | 95.2±0.1 | 57.8±1.7 | 48.2±2.0 | 53.4±2.9 | 32.3±1.0 |
| CNN-IRd | 84.9±1.2 | 65.8±0.4 | 54.7±1.2 | 74.0±0.5 | 64.5±0.8 |
| TisODE-IRd | 91.7±0.5 | 74.4±1.2 | 61.9±1.8 | 81.6±0.8 | 71.0±0.5 |
+
+From Table 4, we observe that both FDn and IRd can effectively improve the adversarial robustness of vanilla CNN models (CNN-FDn, CNN-IRd). Furthermore, combining our proposed TisODE with FDn or IRd (TisODE-FDn, TisODE-IRd), the adversarial robustness of the resultant model is significantly enhanced. For example, on the MNIST dataset, the additional use of our TisODE increases the accuracies on the PGD-0.3 examples by at least 10 percentage points for both FDn $(8.2\%$ to $28.2\%)$ and IRd $(55.5\%$ to $66.0\%)$ . However, on both MNIST and SVHN datasets, the IRd technique improves the robustness against adversarial examples, but its performance is worse
+
+on random Gaussian noise. With the help of the TisODE, the degradation in the robustness against random Gaussian noise can be effectively ameliorated.
+
+# 5 RELATED WORKS
+
+In this section, we briefly review related works on the neural ODE and works concerning improving the robustness of deep neural networks.
+
+Neural ODE: The neural ODE (Chen et al., 2018) method models the input and output as two states of a continuous-time dynamical system by approximating the dynamics of this system with trainable layers. Before the proposal of neural ODE, the idea of modeling nonlinear mappings using continuous-time dynamical systems was proposed in Weinan (2017). Lu et al. (2017) also showed that several popular network architectures could be interpreted as the discretization of a continuous-time ODE. For example, the ResNet (He et al., 2016) and PolyNet (Zhang et al., 2017) are associated with the Euler scheme and the FractalNet (Larsson et al., 2016) is related to the Runge-Kutta scheme. In contrast to these discretization models, neural ODEs are endowed with an intrinsic invertibility property, which yields a family of invertible models for solving inverse problems (Ardizzone et al., 2018), such as the FFJORD (Grathwohl et al., 2018).
+
+Recently, many researchers have conducted studies on neural ODEs from the perspectives of optimization techniques, approximation capabilities, and generalization. Concerning the optimization of neural ODEs, the auto-differentiation techniques can effectively train ODENets, but the training procedure is computationally and memory inefficient. To address this problem, Chen et al. (2018) proposed to compute gradients using the adjoint sensitivity method (Pontryagin, 2018), in which there is no need to store any intermediate quantities of the forward pass. Also in Quaglino et al. (2019), the authors proposed the SNet which accelerates the neural ODEs by expressing their dynamics as truncated series of Legendre polynomials. Concerning the approximation capability, Dupont et al. (2019) pointed out the limitations in approximation capabilities of neural ODEs because of the preserving of input topology. The authors proposed an augmented neural ODE which increases the dimension of states by concatenating zeros so that complex mappings can be learned with simple flow. The most relevant work to ours concerns strategies to improve the generalization of neural ODEs. In Liu et al. (2019), the authors proposed the neural stochastic differential equation (SDE) by injecting random noise to the dynamics function and showed that the generalization and robustness of vanilla neural ODEs could be improved. However, our improvement on the neural ODEs is explored from a different perspective by introducing constraints on the flow. We empirically found that our proposal and the neural SDE can work in tandem to further boost the robustness of neural ODEs.
+
+Robust Improvement: A straightforward way of improving the robustness of a model is to smooth the loss surface by controlling the spectral norm of the Jacobian matrix of the loss function (Sokolic et al., 2017). In terms of adversarial examples (Carlini & Wagner, 2017; Chen et al., 2017), researchers have proposed adversarial training strategies (Madry et al., 2017; Elsayed et al., 2018; Tramér et al., 2017) in which the model is fine-tuned with adversarial examples generated in real-time. However, generating adversarial examples is not computationally efficient, and there exists a trade-off between the adversarial robustness and the performance on original non-perturbed images (Yan et al., 2018; Tsipras et al., 2018). In Wang et al. (2018a), the authors model the ResNet as a transport equation, in which the adversarial vulnerability can be interpreted as the irregularity of the decision boundary. Consequently, a diffusion term is introduced to enhance the robustness of the neural nets. Besides, there are also some works that propose novel architectural defense mechanisms against adversarial examples. For example, Xie et al. (2017) utilized random resizing and random padding to destroy the specific structure of adversarial perturbations; Wang et al. (2018b) and Wang et al. (2018c) improved the robustness of neural networks by replacing the output layers with novel interpolating functions; In Xie et al. (2019), the authors designed a feature denoising filter that can remove the perturbation's pattern from feature maps. In this work, we explore the intrinsic robustness of a specific novel architecture (neural ODE), and show that the proposed TisODE can improve the robustness of deep networks and can also work in tandem with these state-of-the-art methods Xie et al. (2017; 2019) to achieve further improvements.
+
+# 6 CONCLUSION
+
+In this paper, we first empirically study the robustness of neural ODEs. Our studies reveal that neural ODE-based models are superior in terms of robustness compared to CNN models. We then explore how to further boost the robustness of vanilla neural ODEs and propose the TisODE. Finally, we show that the proposed TisODE outperforms the vanilla neural ODE and also can work in conjunction with other state-of-the-art techniques to further improve the robustness of deep networks. Thus, the TisODE method is an effective drop-in module for building robust deep models.
+
+# ACKNOWLEDGEMENT
+
+This work is funded by a Singapore National Research Foundation (NRF) Fellowship (R-263-000-D02-281).
+
+Jiashi Feng was partially supported by NUS IDS R-263-000-C67-646, ECRA R-263-000-C87-133, MOE Tier-II R-263-000-D17-112 and AI.SG R-263-000-D97-490
+
+# REFERENCES
+
+Lynton Ardizzone, Jakob Kruse, Sebastian Wirkert, Daniel Rahner, Eric W Pellegrini, Ralf S Klessen, Lena Maier-Hein, Carsten Rother, and Ullrich Kothe. Analyzing inverse problems with invertible neural networks. arXiv preprint arXiv:1808.04730, 2018.
+Nicholas Carlini and David Wagner. Towards evaluating the robustness of neural networks. In 2017 IEEE Symposium on Security and Privacy (SP), pp. 39-57. IEEE, 2017.
+Pin-Yu Chen, Huan Zhang, Yash Sharma, Jinfeng Yi, and Cho-Jui Hsieh. Zoo: Zeroth order optimization based black-box attacks to deep neural networks without training substitute models. In Proceedings of the 10th ACM Workshop on Artificial Intelligence and Security, pp. 15-26. ACM, 2017.
+Tian Qi Chen, Yulia Rubanova, Jesse Bettencourt, and David K Duvenaud. Neural ordinary differential equations. In Advances in neural information processing systems, pp. 6571-6583, 2018.
+Earl A Coddington and Norman Levinson. Theory of ordinary differential equations. Tata McGraw-Hill Education, 1955.
+Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In 2009 IEEE conference on computer vision and pattern recognition, pp. 248-255. IEEE, 2009.
+Emilien Dupont, Arnaud Doucet, and Yee Whye Teh. Augmented neural odes. arXiv preprint arXiv:1904.01681, 2019.
+Gamaleldin F Elsayed, Shreya Shankar, Brian Cheung, Nicolas Papernot, Alex Kurakin, Ian Goodfellow, and Jascha Sohl-Dickstein. Adversarial examples that fool both human and computer vision. arXiv preprint arXiv:1802.08195, 10, 2018.
+Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. arXiv preprint arXiv:1412.6572, 2014.
+Will Grathwohl, Ricky TQ Chen, Jesse Betterncourt, Ilya Sutskever, and David Duvenaud. Ffjord: Free-form continuous dynamics for scalable reversible generative models. arXiv preprint arXiv:1810.01367, 2018.
+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.
+Ralph Howard. The Gronwall inequality. lecture notes, 1998.
+Gustav Larsson, Michael Maire, and Gregory Shakhnarovich. Fractalnet: Ultra-deep neural networks without residuals. arXiv preprint arXiv:1605.07648, 2016.
+Yann LeCun, Léon Bottou, Yoshua Bengio, Patrick Haffner, et al. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278-2324, 1998.
+Xuanqing Liu, Si Si, Qin Cao, Sanjiv Kumar, and Cho-Jui Hsieh. Neural sde: Stabilizing neural oed networks with stochastic noise. arXiv preprint arXiv:1906.02355, 2019.
+Yiping Lu, Aoxiao Zhong, Quanzheng Li, and Bin Dong. Beyond finite layer neural networks: Bridging deep architectures and numerical differential equations. arXiv preprint arXiv:1710.10121, 2017.
+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.
+Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew Y Ng. Reading digits in natural images with unsupervised feature learning. 2011.
+
+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. 2017.
+Lev Semenovich Pontryagin. Mathematical theory of optimal processes. Routledge, 2018.
+Alessio Quaglino, Marco Gallieri, Jonathan Masci, and Jan Koutnik. Accelerating neural odes with spectral elements. arXiv preprint arXiv:1906.07038, 2019.
+Jure Sokolic, Raja Giryes, Guillermo Sapiro, and Miguel RD Rodrigues. Robust large margin deep neural networks. IEEE Transactions on Signal Processing, 65(16):4265-4280, 2017.
+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.
+Florian Tramér, Alexey Kurakin, Nicolas Papernot, Ian Goodfellow, Dan Boneh, and Patrick McDaniel. Ensemble adversarial training: Attacks and defenses. arXiv preprint arXiv:1705.07204, 2017.
+Dimitris Tsipras, Shibani Santurkar, Logan Engstrom, Alexander Turner, and Aleksander Madry. Robustness may be at odds with accuracy. arXiv preprint arXiv:1805.12152, 2018.
+B. Wang, B. Yuan, Z. Shi, and S. Osher. ResNets Ensemble via the Feynman-Kac Formalism to Improve Natural and Robust Accuracies. arXiv e-prints, art. arXiv:1811.10745, Nov 2018a.
+Bao Wang, Alex T Lin, Zuoqiang Shi, Wei Zhu, Penghang Yin, Andrea L Bertozzi, and Stanley J Osher. Adversarial defense via data dependent activation function and total variation minimization. arXiv preprint arXiv:1809.08516, 2018b.
+Bao Wang, Xiyang Luo, Zhen Li, Wei Zhu, Zuoqiang Shi, and Stanley Osher. Deep neural nets with interpolating function as output activation. In Advances in Neural Information Processing Systems, pp. 743-753, 2018c.
+E Weinan. A proposal on machine learning via dynamical systems. Communications in Mathematics and Statistics, 5(1):1-11, 2017.
+Cihang Xie, Jianyu Wang, Zhishuai Zhang, Zhou Ren, and Alan Yuille. Mitigating adversarial effects through randomization. arXiv preprint arXiv:1711.01991, 2017.
+Cihang Xie, Yuxin Wu, Laurens van der Maaten, Alan L Yuille, and Kaiming He. Feature denoising for improving adversarial robustness. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 501-509, 2019.
+Ziang Yan, Yiwen Guo, and Changshui Zhang. Deep defense: Training dnns with improved adversarial robustness. In Advances in Neural Information Processing Systems, pp. 419-428, 2018.
+Laurent Younes. *Shapes and diffeomorphisms*, volume 171. Springer, 2010.
+Xingcheng Zhang, Zhizhong Li, Chen Change Loy, and Dahua Lin. Polynet: A pursuit of structural diversity in very deep networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 718-726, 2017.
+
+# 7 APPENDIX
+
+7.1 NETWORKS USED ON THE MNIST, THE SVHN, AND THE IMGNET10 DATASETS
+
+Table 5: The architectures of the ODENets on different datasets.
+
+| MNIST | Repetition | Layer |
| FE | ×1 ×1 | Conv(1, 64, 3, 1) + GroupNorm + ReLU Conv(64, 64, 4, 2) + GroupNorm + ReLU |
| RM | ×2 | Conv(64, 64, 3, 1) + GroupNorm + ReLU |
| FCC | ×1 | AdaptiveAvgPool2d + Linear(64,10) |
|
| SVHN | Repetition | Layer |
| FE | ×1 ×1 | Conv(3, 64, 3, 1) + GroupNorm + ReLU Conv(64, 64, 4, 2) + GroupNorm + ReLU |
| RM | ×2 | Conv(64, 64, 3, 1) + GroupNorm + ReLU |
| FCC | ×1 | AdaptiveAvgPool2d + Linear(64,10) |
|
| ImgNet10 | Repetition | Layer |
| FE | ×1 ×1 ×1 ×1 | Conv(3, 32, 5, 2) + GroupNorm MaxPooling(2) BaiscBlock(32, 64, 2) MaxPooling(2) |
| RM | ×3 | BaiscBlock(64, 64, 1) |
| FCC | ×1 | AdaptiveAvgPool2d + Linear(64,10) |
+
+In Table 5, the four arguments of the Conv layer represent the input channel, output channel, kernel size, and the stride. The two arguments of the Linear layer represents the input dimension and the output dimension of this fully-connected layer. In the network on the ImgNet10, the BasicBlock refers to the standard architecture in (He et al., 2016), the three arguments of the BasicBlock represent the input channel, output channel and the stride of the Conv layers inside the block. Note that we replace the BatchNorm layers in BasicBlocks as the GroupNorm to guarantee that the dynamics of each datum is independent of other data in the same mini-batch.
+
+# 7.2 THE CONSTRUCTION OF IMGNET10 DATASET
+
+Table 6: The corresponding indexes to each class in the original ImageNet dataset
+
+| Class | Indexing |
| dog | n02090721, | n02091032, | n02088094 |
| bird | n01532829, | n01558993, | n01534433 |
| car | n02814533, | n03930630, | n03100240 |
| fish | n01484850, | n01491361, | n01494475 |
| monkey | n02483708, | n02484975, | n02486261 |
| turtle | n01664065, | n01665541, | n01667114 |
| lizard | n01677366, | n01682714, | n01685808 |
| bridge | n03933933, | n04366367, | n04311004 |
| cow | n02403003, | n02408429, | n02410509 |
| crab | n01980166, | n01978455, | n01981276 |
+
+# 7.3 GRONWALL'S INEQUALITY
+
+We formally state the Gronwall's Inequality here, following the version in (Howard, 1998).
+
+Theorem 2. Let $U \subset \mathbb{R}^d$ be an open set. Let $f: U \times [0, T] \to \mathbb{R}^d$ be a continuous function and let $\mathbf{z}_1, \mathbf{z}_2: [0, T] \to U$ satisfy the initial value problems:
+
+$$
+\frac {\mathrm {d} \mathbf {z} _ {1} (t)}{\mathrm {d} t} = f (\mathbf {z} _ {1} (t), t), \quad \mathbf {z} _ {1} (t) = \mathbf {x} _ {1}
+$$
+
+$$
+\frac {\mathrm {d} \mathbf {z} _ {2} (t)}{\mathrm {d} t} = f (\mathbf {z} _ {2} (t), t), \quad \mathbf {z} _ {2} (t) = \mathbf {x} _ {2}
+$$
+
+Assume there is a constant $C \geq 0$ such that, for all $t \in [0,T]$ ,
+
+$$
+\left\| f \left(\mathbf {z} _ {2} (t), t\right) - f \left(\mathbf {z} _ {1} (t), t\right)\right) \| \leq C \| \mathbf {z} _ {2} (t) - \mathbf {z} _ {1} (t) \|
+$$
+
+Then, for any $t \in [0,T]$ ,
+
+$$
+\left\| \mathbf {z} _ {1} (t) - \mathbf {z} _ {2} (t) \right\| \leq \left\| \mathbf {x} _ {2} - \mathbf {x} _ {1} \right\| \cdot e ^ {C t}.
+$$
+
+# 7.4 MORE EXPERIMENTAL RESULTS
+
+# 7.4.1 COMPARISON IN THE SETTING OF ADVERSARIAL TRAINING
+
+We implement the adversarial training of the models on the MNIST dataset, and the adversarial examples for training are generated in real-time via the FGSM method (epsilon=0.3) during each epoch (Madry et al., 2017). The results of the adversarially trained models are shown in Table 7. We can observe that the neural ODE-based models are consistently more robust than CNN models. The proposed TisODE also outperforms the vanilla neural ODE.
+
+Table 7: Classification accuracy (%) on perturbed images from MNIST. To evaluate the robustness of classifiers, we use three types of perturbations, namely zero-mean Gaussian noise with standard deviation $\sigma$ , FGSM attack and PGD attack.
+
+ | Gaussian noise | Adversarial attack |
| MNIST | σ = 100 | FGSM-0.3 | FGSM-0.5 | PGD-0.3 |
| CNN | 58.0 | 98.4 | 21.1 | 5.3 |
| ODENet | 84.2 | 99.1 | 36.0 | 12.3 |
| TisODE | 87.9 | 99.1 | 66.5 | 78.9 |
+
+# 7.4.2 EXPERIMENTS ON THE CIFAR10 DATASET
+
+We conduct experiments on CIFAR10 to compare the robustness of CNN and neural ODE-based models. We train all the models only with original non-perturbed images and evaluate the robustness of models against random Gaussian noise and FGSM adversarial attacks. The results are shown in Table 8. We can observe that the ONENet is more robust than the CNN model in terms of both the random noise and the FGSM attack. Besides, our proposal, TisODE, can improve the robustness of the vanilla neural ODE.
+
+Table 8: Classification accuracy (\%) on perturbed images from CIFAR10. To evaluate the robustness of classifiers, we use two types of perturbations, namely zero-mean Gaussian noise with standard deviation $\sigma$ and FGSM attack.
+
+ | Gaussian noise | Adversarial attack |
| CIFAR10 | σ = 15 | σ = 20 | FGSM-8/255 | FGSM-10/255 |
| CNN | 70.2 | 57.6 | 24.3 | 18.4 |
| ODENet | 72.6 | 60.6 | 31.2 | 26.0 |
| TisODE | 74.3 | 62.0 | 33.6 | 26.8 |
+
+Here, we control the number of parameters to be the same for all kinds of models. We use a small network, which consists of five convolutional layers and one linear layer.
+
+Table 9: The architecture of the ODENet on CIFAR10.
+
+ | Repetition | Layer |
| FE | ×1 | Conv(3, 16, 3, 1) + GroupNorm + ReLU |
| ×1 | Conv(16, 32, 3, 2) + GroupNorm + ReLU |
| ×1 | Conv(32, 64, 3, 2) + GroupNorm + ReLU |
| RM | ×2 | Conv(64, 64, 3, 1) + GroupNorm + ReLU |
| FCC | ×1 | AdaptiveAvgPool2d + Linear(64,10) |
+
+# 7.4.3 AN EXTENSION ON THE COMPARISON BETWEEN CNNS AND ODENETS
+
+Here, we compare CNN and neural ODE-based models by controlling both the number of parameters and the number of function evaluations. We conduct experiments on the MNIST dataset, and all the models are trained only with original non-perturbed images.
+
+For the neural ODE-based models, the time range is set from 0 to 1. We use the Euler method, and the step size is set to be 0.05. Thus the number of evaluations is $1 / 0.05 = 20$ . For the CNN models (specifically ResNet), we repeatedly concatenate the residual block for 20 times, and these 20 blocks share the same weights. Our experiments show that, in this condition, the neural ODE-based models still outperform the CNN models (FGSM-0.15: $87.5\%$ vs. $81.9\%$ , FGSM-0.3: $53.4\%$ vs. $49.7\%$ , PGD-0.2: $11.8\%$ vs. $4.8\%$ ).
\ No newline at end of file
diff --git a/onrobustnessofneuralordinarydifferentialequations/images.zip b/onrobustnessofneuralordinarydifferentialequations/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..9110fd072d4816abffcf96639c99c0f5aa785d2c
--- /dev/null
+++ b/onrobustnessofneuralordinarydifferentialequations/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:da59f25b1d37d979490d932ae2daed962301b7caafcced668c9117a63ada9c8b
+size 605936
diff --git a/onrobustnessofneuralordinarydifferentialequations/layout.json b/onrobustnessofneuralordinarydifferentialequations/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..55fa2d2a631df74c14ae10fae4181402ebc675e1
--- /dev/null
+++ b/onrobustnessofneuralordinarydifferentialequations/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f528b4bbfdd7e2e85f6b71e50f733b86137e2eb77516ef19c131312ee354cd4a
+size 447927
diff --git a/pcdartspartialchannelconnectionsformemoryefficientarchitecturesearch/8ef817aa-5e58-4b29-85df-2ad3bfd9d1f9_content_list.json b/pcdartspartialchannelconnectionsformemoryefficientarchitecturesearch/8ef817aa-5e58-4b29-85df-2ad3bfd9d1f9_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..da053a50920a046dc045f06180f4f66fa16be59d
--- /dev/null
+++ b/pcdartspartialchannelconnectionsformemoryefficientarchitecturesearch/8ef817aa-5e58-4b29-85df-2ad3bfd9d1f9_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:cc64890e0524ed7b71a130445ce806d58f10fa9e41ef23c98dc62d969e9ccc7d
+size 78133
diff --git a/pcdartspartialchannelconnectionsformemoryefficientarchitecturesearch/8ef817aa-5e58-4b29-85df-2ad3bfd9d1f9_model.json b/pcdartspartialchannelconnectionsformemoryefficientarchitecturesearch/8ef817aa-5e58-4b29-85df-2ad3bfd9d1f9_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..9cb487aa2341d0d0c69496cd8746ae55ddae37a9
--- /dev/null
+++ b/pcdartspartialchannelconnectionsformemoryefficientarchitecturesearch/8ef817aa-5e58-4b29-85df-2ad3bfd9d1f9_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0cfc0be61d0a372b10a582308ceed85f4b7c6c839ea73b528ac01944fc328c8e
+size 95894
diff --git a/pcdartspartialchannelconnectionsformemoryefficientarchitecturesearch/8ef817aa-5e58-4b29-85df-2ad3bfd9d1f9_origin.pdf b/pcdartspartialchannelconnectionsformemoryefficientarchitecturesearch/8ef817aa-5e58-4b29-85df-2ad3bfd9d1f9_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..5832777198c56b9e90f4c9469e71d1742f941945
--- /dev/null
+++ b/pcdartspartialchannelconnectionsformemoryefficientarchitecturesearch/8ef817aa-5e58-4b29-85df-2ad3bfd9d1f9_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:bb389f0df3c6183539af3863860c33c7b223368b6035507d00f1fdd88f03fedc
+size 1854504
diff --git a/pcdartspartialchannelconnectionsformemoryefficientarchitecturesearch/full.md b/pcdartspartialchannelconnectionsformemoryefficientarchitecturesearch/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..488a30ab22f9b3ab7b453075acd5e73b8d0141d8
--- /dev/null
+++ b/pcdartspartialchannelconnectionsformemoryefficientarchitecturesearch/full.md
@@ -0,0 +1,249 @@
+# PC-DARTS: PARTIAL CHANNEL CONNECTIONS FOR MEMORY-EFFICIENT ARCHITECTURE SEARCH
+
+Yuhui Xu $^{1*}$ Lingxi Xie $^{2}$ Xiaopeng Zhang $^{2}$ Xin Chen $^{3}$ Guo-Jun Qi $^{4}$ Qi Tian $^{2(\boxtimes)}$ Hongkai Xiong $^{1}$
+
+$^{1}$ Shanghai Jiao Tong University $^{2}$ Huawei Noah's Ark Lab
+
+$^{3}$ Tongji University $^{4}$ Futurewei Technologies
+
+yuhuixu@sjtu.edu.cn {198808xc, zxphistory}@gmail.com 1410452@tongji.edu.cn
+
+guojunq@gmail.com tian.qil@huawei.com xionghongkai@sjtu.edu.cn
+
+# ABSTRACT
+
+Differentiable architecture search (DARTS) provided a fast solution in finding effective network architectures, but suffered from large memory and computing overheads in jointly training a super-network and searching for an optimal architecture. In this paper, we present a novel approach, namely, Partially-Connected DARTS, by sampling a small part of super-network to reduce the redundancy in exploring the network space, thereby performing a more efficient search without comprising the performance. In particular, we perform operation search in a subset of channels while bypassing the held out part in a shortcut. This strategy may suffer from an undesired inconsistency on selecting the edges of super-net caused by sampling different channels. We alleviate it using edge normalization, which adds a new set of edge-level parameters to reduce uncertainty in search. Thanks to the reduced memory cost, PC-DARTS can be trained with a larger batch size and, consequently, enjoys both faster speed and higher training stability. Experimental results demonstrate the effectiveness of the proposed method. Specifically, we achieve an error rate of $2.57\%$ on CIFAR10 with merely 0.1 GPU-days for architecture search, and a state-of-the-art top-1 error rate of $24.2\%$ on ImageNet (under the mobile setting) using 3.8 GPU-days for search. Our code has been made available at https://github.com/yuhuiu1993/PC-DARTS.
+
+# 1 INTRODUCTION
+
+Neural architecture search (NAS) emerged as an important branch of automatic machine learning (AutoML), and has been attracting increasing attentions from both academia and industry. The key methodology of NAS is to build a large space of network architectures, develop an efficient algorithm to explore the space, and discover the optimal structure under a combination of training data and constraints (e.g., network size and latency). Different from early approaches that often incur large computation overheads (Zoph & Le, 2017; Zoph et al., 2018; Real et al., 2019), recent one-shot approaches (Pham et al., 2018; Liu et al., 2019) have reduced the search costs by orders of magnitudes, which advances its applications to many real-world problems. In particular, DARTS (Liu et al., 2019) converts the operation selection into weighting a fixed set of operations. This makes the entire framework differentiable to architecture hyper-parameters and thus the network search can be efficiently accomplished in an end-to-end fashion. Despite its sophisticated design, DARTS is still subject to a large yet redundant space of network architectures and thus suffers from heavy memory and computation overheads. This prevents the search process from using larger batch sizes for either speedup or higher stability. Prior work (Chen et al., 2019) proposed to reduce the search space, which leads to an approximation that may sacrifice the optimality of the discovered architecture.
+
+In this paper, we present a simple yet effective approach named Partially-Connected DARTS (PC-DARTS) to reduce the burdens of memory and computation. The core idea is intuitive: instead of sending all channels into the block of operation selection, we randomly sample a subset of them in each step, while bypassing the rest directly in a shortcut. We assume the computation on this subset is a surrogate approximating that on all the channels. Besides the tremendous reduction in memory and computation costs, channel sampling brings another benefit - operation search is regularized and less likely to fall into local optima. However, PC-DARTS incurs a side effect, where the selection of channel connectivity would become unstable as different subsets of channels are sampled across iterations. Thus, we introduce edge normalization to stabilize the search for network connectivity by explicitly learning an extra set of edge-selection hyper-parameters. By sharing these hyper-parameters throughout the training process, the sought network architecture is insensitive to the sampled channels across iterations and thus is more stable.
+
+Benefiting from the partial connection strategy, we are able to greatly increase the batch size. Specifically, as only $1 / K$ of channels are randomly sampled for an operation selection, it reduces the memory burden by almost $K$ times. This allows us to use a $K$ times larger batch size during search, which not only accelerates the network search but also stabilizes the process particularly for large-scale datasets. Experiments on benchmark datasets demonstrate the effectiveness of PC-DARTS. Specifically, we achieve an error rate of $2.57\%$ in less than 0.1 GPU-days (around 1.5 hours) on a single Tesla V100 GPU, surpassing the result of $2.76\%$ reported by DARTS that required 1.0 GPU-day. Furthermore, PC-DARTS allows a direct search on ImageNet (while DARTS failed due to low stability), and sets the state-of-the-art record with a top-1 error of $24.2\%$ (under the mobile setting) in only 3.8 GPU-days (11.5 hours on eight Tesla V100 GPUs).
+
+# 2 RELATED WORK
+
+Thanks to the rapid development of deep learning, significant gain in performance has been brought to a wide range of computer vision problems, most of which owed to manually designed network architectures (Krizhevsky et al., 2012; Simonyan & Zisserman, 2015; He et al., 2016; Huang et al., 2017). Recently, a new research field named neural architecture search (NAS) has been attracting increasing attentions. The goal is to find automatic ways of designing neural architectures to replace conventional handcrafted ones. According to the heuristics to explore the large architecture space, existing NAS approaches can be roughly divided into three categories, namely, evolution-based approaches, reinforcement-learning-based approaches and one-shot approaches.
+
+The first type of architecture search methods (Liu et al., 2018b; Xie & Yuille, 2017; Real et al., 2017; Elsken et al., 2019; Real et al., 2019; Miikkulainen et al., 2019) adopted evolutionary algorithms, which assumed the possibility of applying genetic operations to force a single architecture or a family evolve towards better performance. Among them, Liu et al. (Liu et al., 2018b) introduced a hierarchical representation for describing a network architecture, and Xie et al. (Xie & Yuille, 2017) decomposed each architecture into a representation of 'genes'. Real et al. (Real et al., 2019) proposed aging evolution which improved upon standard tournament selection, and surpassed the best manually designed architecture since then. Another line of heuristics turns to reinforcement learning (RL) (Zoph & Le, 2017; Baker et al., 2017; Zoph et al., 2018; Zhong et al., 2018; Liu et al., 2018a), which trained a meta-controller to guide the search process. Zoph et al. (Zoph & Le, 2017) first proposed using a controller-based recurrent neural network to generate hyper-parameters of neural networks. To reduce the computation cost, researchers started to search for blocks or cells (Zhong et al., 2018; Zoph et al., 2018) instead of the entire network, and consequently, managed to reduce the overall computational costs by a factor of 7. Other kinds of approximation, such as greedy search (Liu et al., 2018a), were also applied to further accelerate search. Nevertheless, the computation costs of these approaches, based on either evolution or RL, are still beyond acceptance.
+
+In order to accomplish architecture search within a short period of time, researchers considered to reduce the costs of evaluating each searched candidate. Early efforts include sharing weights between searched and newly generated networks (Cai et al., 2018), and later these methods were generalized into a more elegant framework named one-shot architecture search (Brock et al., 2018; Cai et al., 2019; Liu et al., 2019; Pham et al., 2018; Xie et al., 2019), in which an over-parameterized network or super-network covering all candidate operations was trained only once, from which exponentially many sub-networks can be sampled. As typical examples, SMASH (Brock et al.,
+
+
+Figure 1: Illustration of the proposed approach (best viewed in color), partially-connected DARTS (PC-DARTS). As an example, we investigate how information is propagated to node $\#3$ , i.e., $j = 3$ . There are two sets of hyper-parameters during search, namely, $\{\alpha_{i,j}^o\}$ and $\{\beta_{i,j}\}$ , where $0 \leqslant i < j$ and $o \in \mathcal{O}$ . To determine $\{\alpha_{i,j}^o\}$ , we only sample a subset, $1 / K$ , of channels and connect them to the next stage, so that the memory consumption is reduced by $K$ times. To minimize the uncertainty incurred by sampling, we add $\{\beta_{i,j}\}$ as extra edge-level parameters.
+
+2018) trained the over-parameterized network by a HyperNet (Ha et al., 2017), and ENAS (Pham et al., 2018) shared parameters among child models to avoid retraining each candidate from scratch.
+
+This paper is based on DARTS (Liu et al., 2018b), which introduced a differentiable framework for architecture search, and thus combine the search and evaluation stages into one. A super-network is optimized during the search stage, after which the strongest sub-network is preserved and then retrained. Despite its simplicity, researchers detected some of its drawbacks, such as instability (Li & Talwalkar, 2019; Sciuto et al., 2019), which led to a few improved approaches beyond DARTS (Cai et al., 2019; Chen et al., 2019; Mei et al., 2020). In particular, ProxylessNAS (Cai et al., 2019) was the first method that searched directly on ImageNet, and P-DARTS (Chen et al., 2019) designed a progressive search stage to bridge the depth gap between the super-network and the sub-network.
+
+# 3 THE PROPOSED APPROACH
+
+# 3.1 PRELIMINARIES: DIFFERENTIABLE ARCHITECTURE SEARCH (DARTS)
+
+We first review the baseline DARTS (Liu et al., 2019), and define the notations for the discussion later. Mathematically, DARTS decomposes the searched network into a number $(L)$ of cells. Each cell is represented as a directed acyclic graph (DAG) with $N$ nodes, where each node defines a network layer. There is a pre-defined space of operations denoted by $\mathcal{O}$ , in which each element, $o(\cdot)$ , is a fixed operation (e.g., identity connection, and $3 \times 3$ convolution) performed at a network layer. Within a cell, the goal is to choose one operation from $\mathcal{O}$ to connect each pair of nodes. Let a pair of nodes be $(i,j)$ , where $0 \leqslant i < j \leqslant N - 1$ , the core idea of DARTS is to formulate the information propagated from $i$ to $j$ as a weighted sum over $|\mathcal{O}|$ operations, namely, $f_{i,j}(\mathbf{x}_i) = \sum_{o \in \mathcal{O}} \frac{\exp\left\{\alpha_{i,j}^o\right\}}{\sum_{o' \in \mathcal{O}} \exp\left\{\alpha_{i,j}^{o'}\right\}} \cdot o(\mathbf{x}_i)$ , where $\mathbf{x}_i$ is the output of the $i$ -th node, and $\alpha_{i,j}^o$ is a hyper-parameter for weighting operation $o(\mathbf{x}_i)$ . The output of a node is the sum of all input flows, i.e., $\mathbf{x}_j = \sum_{i < j} f_{i,j}(\mathbf{x}_i)$ , and the output of the entire cell is formed by concatenating the output of nodes $\mathbf{x}_2 - \mathbf{x}_{N-1}$ , i.e., $\text{concat}(\mathbf{x}_2, \mathbf{x}_3, \ldots, \mathbf{x}_{N-1})$ . Note that the first two nodes, $\mathbf{x}_0$ and $\mathbf{x}_1$ , are input nodes to a cell, which are fixed during architecture search.
+
+This design makes the entire framework differentiable to both layer weights and hyper-parameters $\alpha_{i,j}^{o}$ , so that it is possible to perform architecture search in an end-to-end fashion. After the search process is finished, on each edge $(i,j)$ , the operation $o$ with the largest $\alpha_{i,j}^{o}$ value is preserved, and each node $j$ is connected to two precedents $i < j$ with the largest $\alpha_{i,j}^{o}$ preserved.
+
+# 3.2 PARTIAL CHANNEL CONNECTIONS
+
+A drawback of DARTS lies in memory inefficiency. In the main part of the searched architecture, $|\mathcal{O}|$ operations and the corresponding outputs need to be stored at each node (i.e., each network layer), leading to $|\mathcal{O}| \times$ memory to use. To fit into a GPU, one must reduce the batch size during search, which inevitably slows down search speed, and may deteriorate search stability and accuracy.
+
+An alternative solution to memory efficiency is the partial channel connection as depicted in Figure 1. Take the connection from $\mathbf{x}_i$ to $\mathbf{x}_j$ for example. This involves defining a channel sampling mask $\mathbf{S}_{i,j}$ , which assigns 1 to selected channels and 0 to masked ones. The selected channels are sent into mixed computation of $|\mathcal{O}|$ operations, while the masked ones bypass these operations, i.e., they are directly copied to the output,
+
+$$
+f _ {i, j} ^ {\mathrm {P C}} \left(\mathbf {x} _ {i}; \mathbf {S} _ {i, j}\right) = \sum_ {o \in \mathcal {O}} \frac {\exp \left\{\alpha_ {i , j} ^ {o} \right\}}{\sum_ {o ^ {\prime} \in \mathcal {O}} \exp \left\{\alpha_ {i , j} ^ {o ^ {\prime}} \right\}} \cdot o \left(\mathbf {S} _ {i, j} * \mathbf {x} _ {i}\right) + (1 - \mathbf {S} _ {i, j}) * \mathbf {x} _ {i}. \tag {1}
+$$
+
+where, $\mathbf{S}_{i,j}*\mathbf{x}_i$ and $(1 - \mathbf{S}_{i,j})*\mathbf{x}_i$ denote the selected and masked channels, respectively. In practice, we set the proportion of selected channels to $1 / K$ by regarding $K$ as a hyper-parameter. By varying $K$ , we could trade off between architecture search accuracy (smaller $K$ ) and efficiency (larger $K$ ) to strike a balance (See Section 4.4.1 for more details).
+
+A direct benefit brought by the partial channel connection is that the memory overhead of computing $f_{i,j}^{\mathrm{PC}}(\mathbf{x}_i; \mathbf{S}_{i,j})$ is reduced by $K$ times. This allows us to use a larger batch size for architecture search. There are twofold benefits. First, the computing cost could be reduced by $K$ times during the architecture search. Moreover, the larger batch size implies the possibility of sampling more training data during each iteration. This is particularly important for the stability of architecture search. In most cases, the advantage of one operation over another is not significant, unless more training data are involved in a mini-batch to reduce the uncertainty in updating the parameters of network weights and architectures.
+
+# 3.3 EDGE NORMALIZATION
+
+Let us look into the impact of sampling channels on neural architecture search. There are both positive and negative effects. On the upside, by feeding a small subset of channels for operation mixture while bypassing the remainder, we make it less biased in selecting operations. In other words, for edge $(i,j)$ , given an input $\mathbf{x}_i$ , the difference from using two sets of hyper-parameters $\{\alpha_{i,j}^o\}$ and $\{\alpha_{i,j}'\}$ is largely reduced, because only a small part $(1 / K)$ of input channels would go through the operation mixture while the remaining channels are left intact. This regularizes the preference of a weight-free operation (e.g., skip-connect, max-pooling, etc.) over a weight-equipped one (e.g., various kinds of convolution) in $\mathcal{O}$ . In the early stage, the search algorithm often prefers weight-free operations, because they do not have weights to train and thus produce more consistent outputs, i.e., $o(\mathbf{x}_i)$ . In contrast, the weight-equipped ones, before their weights are well optimized, would propagate inconsistent information across iterations. Consequently, weight-free operations often accumulate larger weights (namely $\alpha_{i,j}^o$ ) at the beginning, and this makes it difficult for the weight-equipped operations to beat them even after they have been well trained thereafter. This phenomenon is especially significant when the proxy dataset (on which architecture search is performed) is difficult, and this could prevent DARTS from performing satisfactory architecture search on ImageNet. In experiments, we will show that PC-DARTS, with partial channel connections, produces more stable and superior performance on ImageNet.
+
+On the downside, in a cell, each output node $\mathbf{x}_j$ needs to pick up two input nodes from its precedents $\{\mathbf{x}_0,\mathbf{x}_1,\ldots ,\mathbf{x}_{j - 1}\}$ , which are weighted by $\max_{o}\alpha_{0,j}^{o},\max_{o}\alpha_{1,j}^{o},\ldots ,\max_{o}\alpha_{j - 1,j}^{o}$ , respectively, following the original DARTS. However, these architecture parameters are optimized by randomly sampled channels across iterations, and thus the optimal connectivity determined by them could be unstable as the sampled channels change over time. This could cause undesired fluctuation in
+
+the resultant network architecture. To mitigate this problem, we introduce edge normalization that weighs on each edge $(i,j)$ explicitly, denoted by $\beta_{i,j}$ , so that the computation of $\mathbf{x}_j$ becomes:
+
+$$
+\mathbf {x} _ {j} ^ {\mathrm {P C}} = \sum_ {i < j} \frac {\exp \left\{\beta_ {i , j} \right\}}{\sum_ {i ^ {\prime} < j} \exp \left\{\beta_ {i ^ {\prime} , j} \right\}} \cdot f _ {i, j} (\mathbf {x} _ {i}). \tag {2}
+$$
+
+Specifically, after the architecture search is done, the connectivity of edge $(i,j)$ is determined by both $\{\alpha_{i,j}^{o}\}$ and $\beta_{i,j}$ , for which we multiply the normalized coefficients together, i.e., multiplying $\frac{\exp\{\beta_{i,j}\}}{\sum_{i' < j} \exp\{\beta_{i',j}\}}$ by $\frac{\exp\{\alpha_{i,j}^{o}\}}{\sum_{o' \in \mathcal{O}} \exp\{\alpha_{i,j}^{o'}\}}$ . Then the edges are selected by finding the large edge weights as in DARTS. Since $\beta_{i,j}$ are shared through the training process, the learned network architecture is insensitive to the sampled channels across iterations, making the architecture search more stable. In Section 4.4.2, we will show that edge normalization is also effective over the original DARTS. Finally, the extra computation overhead required for edge normalization is negligible.
+
+# 3.4 DISCUSSIONS AND RELATIONSHIP TO PRIOR WORK
+
+First of all, there are two major contributions of our approach, namely, channel sampling and edge normalization. Channel sampling, as the key technique in this work, has not been studied in NAS for reducing computational overhead (other regularization methods like Dropout (Srivastava et al., 2014) and DropPath (Larsson et al., 2017) cannot achieve the same efficiency, in both time and memory, as channel sampling). It accelerates and regularizes search and, with the help of edge normalization, improves search stability. Note that both search speed and stability are very important for a search algorithm. Combining channel sampling and edge normalization, we obtain the best accuracy on ImageNet (based on the DARTS search space), and the direct search cost on ImageNet (3.8 GPU-days) is the lowest known. Moreover, these two components are easily transplanted to other search algorithms to improve search accuracy and speed, e.g., edge normalization boosts the accuracy and speed of the original DARTS methods.
+
+Other researchers also tried to alleviate the large memory consumption of DARTS. Among prior efforts, ProxylessNAS (Cai et al., 2019) binarized the multinomial distribution $\alpha_{i,j}^{o}$ and samples two paths at each time, which significantly reduced memory cost and enabled direct search on ImageNet. PARSEC (Casale et al., 2019) also proposed a sampling-based optimization method to learn a probability distribution. Our solution, by preserving all operations for architecture search, achieves a higher accuracy in particular on challenging datasets like ImageNet ( $+0.7\%$ over ProxylessNAS and $+1.8\%$ over PARSEC). Another practical method towards memory efficiency is Progressive-DARTS (Chen et al., 2019), which eliminated a subset of operators in order to provide sufficient memory for deeper architecture search. In comparison, our approach preserves all operators and instead performs sub-sampling on the channel dimension. This strategy works better in particular on large-scale datasets like ImageNet.
+
+# 4 EXPERIMENTS
+
+# 4.1 DATASETS AND IMPLEMENTATION DETAILS
+
+We perform experiments on CIFAR10 and ImageNet, two most popular datasets for evaluating neural architecture search. CIFAR10 (Krizhevsky & Hinton, 2009) consists of 60K images, all of which are of a spatial resolution of $32 \times 32$ . These images are equally distributed over 10 classes, with 50K training and 10K testing images. ImageNet (Deng et al., 2009) contains 1,000 object categories, and 1.3M training images and 50K validation images, all of which are high-resolution and roughly equally distributed over all classes. Following the conventions (Zoph et al., 2018; Liu et al., 2019), we apply the mobile setting where the input image size is fixed to be $224 \times 224$ and the number of multi-add operations does not exceed 600M in the testing stage.
+
+Following DARTS (Liu et al., 2019) as well as conventional architecture search approaches, we use an individual stage for architecture search, and after the optimal architecture is obtained, we conduct another training process from scratch. In the search stage, the goal is to determine the best sets of hyper-parameters, namely $\{\alpha_{i,j}^o\}$ and $\{\beta_{i,j}\}$ for each edge $(i,j)$ . To this end, the trainning set is partitioned into two parts, with the first part used for optimizing network parameters, e.g.,
+
+Table 1: Comparison with state-of-the-art network architectures on CIFAR10.
+
+| Architecture | Test Err. (%) | Params (M) | Search Cost (GPU-days) | Search Method |
| DenseNet-BC (Huang et al., 2017) | 3.46 | 25.6 | - | manual |
| NASNet-A + cutout (Zoph et al., 2018) | 2.65 | 3.3 | 1800 | RL |
| AmoebaNet-B + cutout (Real et al., 2019) | 2.55±0.05 | 2.8 | 3150 | evolution |
| Hirearchical Evolution (Liu et al., 2018b) | 3.75±0.12 | 15.7 | 300 | evolution |
| PNAS (Liu et al., 2018a) | 3.41±0.09 | 3.2 | 225 | SMBO |
| ENAS + cutout (Pham et al., 2018) | 2.89 | 4.6 | 0.5 | RL |
| NAONet-WS (Luo et al., 2018) | 3.53 | 3.1 | 0.4 | NAO |
| DARTS (1st order) + cutout (Liu et al., 2019) | 3.00±0.14 | 3.3 | 0.4 | gradient-based |
| DARTS (2nd order) + cutout (Liu et al., 2019) | 2.76±0.09 | 3.3 | 1 | gradient-based |
| SNAS (moderate) + cutout (Xie et al., 2019) | 2.85±0.02 | 2.8 | 1.5 | gradient-based |
| ProxylessNAS + cutout (Cai et al., 2019) | 2.08 | - | 4.0 | gradient-based |
| P-DARTS + cutout (Chen et al., 2019) | 2.50 | 3.4 | 0.3 | gradient-based |
| BayesNAS + cutout (Zhou et al., 2019) | 2.81±0.04 | 3.4 | 0.2 | gradient-based |
| PC-DARTS + cutout | 2.57±0.07‡ | 3.6 | 0.1† | gradient-based |
+
+† Recorded on a single GTX 1080Ti. It can be shortened into 0.06 GPU-days if Tesla V100 is used.
+$\ddagger$ We ran PC-DARTS 5 times and used standalone validation to pick the best from the 5 runs. This process was done by using $45\mathrm{K}$ out of $50\mathrm{K}$ training images for training, and the remaining $5\mathrm{K}$ images for validation. The best one in validation was used for testing, which reported a test error of $2.57\%$ .
+
+convolutional weights, and the second part used for optimizing hyper-parameters. The entire search stage is accomplished in an end-to-end manner. For fair comparison, the operation space $\mathcal{O}$ remains the same as the convention, which contains 8 choices, i.e., $3 \times 3$ and $5 \times 5$ separable convolution, $3 \times 3$ and $5 \times 5$ dilated separable convolution, $3 \times 3$ max-pooling, $3 \times 3$ average-pooling, skip-connect (a.k.a., identity), and zero (a.k.a., none).
+
+We propose an alternative and more efficient implementation for partial channel connections. For edge $(i,j)$ , we do not perform channel sampling at each time of computing $o(\mathbf{x}_i)$ , but instead choose the first $1 / K$ channels of $\mathbf{x}_i$ for operation mixture directly. To compensate, after $\mathbf{x}_j$ is obtained, we shuffle its channels before using it for further computations. This is the same implementation used in ShuffleNet (Zhang et al., 2018), which is more GPU-friendly and thus runs faster.
+
+# 4.2 RESULTS ON CIFAR10
+
+In the search scenario, the over-parameterized network is constructed by stacking 8 cells (6 normal cells and 2 reduction cells), and each cell consists of $N = 6$ nodes. We train the network for 50 epochs, with the initial number of channels being 16. The 50K training set of CIFAR10 is split into two subsets with equal size, with one subset used for training network weights and the other used for architecture hyper-parameters.
+
+We set $K = 4$ for CIFAR10, i.e., only $1/4$ features are sampled on each edge, so that the batch size during search is increased from 64 to 256. Besides, following (Chen et al., 2019), we freeze the hyper-parameters, $\{\alpha_{i,j}^o\}$ and $\{\beta_{i,j}\}$ , and only allow the network parameters to be tuned in the first 15 epochs. This process, called warm-up, is to alleviate the drawback of the parameterized operations. The total memory cost is less than 12GB so that we can train it on most modern GPUs. The network weights are optimized by momentum SGD, with an initial learning rate of 0.1 (annealed down to zero following a cosine schedule without restart), a momentum of 0.9, and a weight decay of $3 \times 10^{-4}$ . We use an Adam optimizer (Kingma & Ba, 2015) for $\{\alpha_{i,j}^o\}$ and $\{\beta_{i,j}\}$ , with a fixed learning rate of $6 \times 10^{-4}$ , a momentum of (0.5, 0.999) and a weight decay of $10^{-3}$ . Owing to the increased batch size, the entire search process only requires 3 hours on a GTX 1080Ti GPU, or 1.5 hours on a Tesla V100 GPU, which is almost $4 \times$ faster than the original first-order DARTS.
+
+The evaluation stage simply follows that of DARTS. The network is composed of 20 cells (18 normal cells and 2 reduction cells), and each type of cells share the same architecture. The initial number of channels is 36. The entire 50K training set is used, and the network is trained from scratch for
+
+
+(a) the normal cell found on CIFAR10
+
+
+(c) the normal cell found on ImageNet
+
+
+(b) the reduction cell found on CIFAR10
+
+
+(d) the reduction cell on ImageNet
+Figure 2: Cells found on CIFAR10 and ImageNet. Searching on ImageNet makes the normal cell more complex (deeper), although the reduction cell is very similar to that found on CIFAR10.
+
+600 epochs using a batch size of 128. We use the SGD optimizer with an initial learning rate of 0.025 (annealed down to zero following a cosine schedule without restart), a momentum of 0.9, a weight decay of $3 \times 10^{-4}$ and a norm gradient clipping at 5. Drop-path with a rate of 0.3 as well as cutout (DeVries & Taylor, 2017) is also used for regularization. We visualize the searched normal and reduction cells in the left-hand side of Figure 2.
+
+Results and comparison to recent approaches are summarized in Table 1. In merely 0.1 GPU-days, PC-DARTS achieve an error rate of $2.57\%$ , with both search time and accuracy surpassing the baseline, DARTS, significantly. To the best of our knowledge, our approach is the fastest one that achieves an error rate of less than $3\%$ . Our number ranks among the top of recent architecture search results. ProxylessNAS used a different protocol to achieve an error rate of $2.08\%$ , and also reported a much longer time for architecture search. P-DARTS (Chen et al., 2019) slightly outperforms our approach by searching over a deeper architecture, which we can integrate our approach into P-DARTS to accelerate it as well as improve its performance (consistent accuracy gain is obtained).
+
+# 4.3 RESULTS ON IMAGENET
+
+We slightly modify the network architecture used on CIFAR10 to fit ImageNet. The overparameterized network starts with three convolution layers of stride 2 to reduce the input image resolution from $224 \times 224$ to $28 \times 28$ . 8 cells (6 normal cells and 2 reduction cells) are stacked beyond this point, and each cell consists of $N = 6$ nodes. To reduce search time, we randomly sample two subsets from the 1.3M training set of ImageNet, with $10\%$ and $2.5\%$ images, respectively. The former one is used for training network weights and the latter for updating hyper-parameters.
+
+ImageNet is much more difficult than CIFAR10. To preserve more information, we use a subsampling rate of $1/2$ , which doubles that used in CIFAR10. Still, a total of 50 epochs are trained and architecture hyper-parameters are frozen during the first 35 epochs. For network weights, we use a momentum SGD with an initial learning rate of 0.5 (annealed down to zero following a cosine schedule without restart), a momentum of 0.9, and a weight decay of $3 \times 10^{-5}$ . For hyper-parameters, we use the Adam optimizer (Kingma & Ba, 2015) with a fixed learning rate of $6 \times 10^{-3}$ , a momentum (0.5, 0.999) and a weight decay of $10^{-3}$ . We use eight Tesla V100 GPUs for search, and the total batch size is 1,024. The entire search process takes around 11.5 hours. We visualize the searched normal and reduction cells in the right-hand side of Figure 2.
+
+The evaluation stage follows that of DARTS, which also starts with three convolution layers with a stride of 2 that reduce the input image resolution from $224 \times 224$ to $28 \times 28$ . 14 cells (12 normal cells and 2 reduction cells) are stacked beyond this point, with the initial channel number being 48. The network is trained from scratch for 250 epochs using a batch size of 1,024. We use the SGD
+
+Table 2: Comparison with state-of-the-art architectures on ImageNet (mobile setting).
+
+| Architecture | Test Err. (%) | Params (M) | ×+ (M) | Search Cost (GPU-days) | Search Method |
| top-1 | top-5 |
| Inception-v1 (Szegedy et al., 2015) | 30.2 | 10.1 | 6.6 | 1448 | - | manual |
| MobileNet (Howard et al., 2017) | 29.4 | 10.5 | 4.2 | 569 | - | manual |
| ShuffleNet 2× (v1) (Zhang et al., 2018) | 26.4 | 10.2 | ~5 | 524 | - | manual |
| ShuffleNet 2× (v2) (Ma et al., 2018) | 25.1 | - | ~5 | 591 | - | manual |
| NASNet-A (Zoph et al., 2018) | 26.0 | 8.4 | 5.3 | 564 | 1800 | RL |
| AmoebaNet-C (Real et al., 2019) | 24.3 | 7.6 | 6.4 | 570 | 3150 | evolution |
| PNAS (Liu et al., 2018a) | 25.8 | 8.1 | 5.1 | 588 | 225 | SMBO |
| MnasNet-92 (Tan et al., 2019) | 25.2 | 8.0 | 4.4 | 388 | - | RL |
| DARTS (2nd order) (Liu et al., 2019) | 26.7 | 8.7 | 4.7 | 574 | 4.0 | gradient-based |
| SNAS (mild) (Xie et al., 2019) | 27.3 | 9.2 | 4.3 | 522 | 1.5 | gradient-based |
| ProxylessNAS (GPU)‡ (Cai et al., 2019) | 24.9 | 7.5 | 7.1 | 465 | 8.3 | gradient-based |
| P-DARTS (CIFAR10) (Chen et al., 2019) | 24.4 | 7.4 | 4.9 | 557 | 0.3 | gradient-based |
| P-DARTS (CIFAR100) (Chen et al., 2019) | 24.7 | 7.5 | 5.1 | 577 | 0.3 | gradient-based |
| BayesNAS (Zhou et al., 2019) | 26.5 | 8.9 | 3.9 | - | 0.2 | gradient-based |
| PC-DARTS (CIFAR10) | 25.1 | 7.8 | 5.3 | 586 | 0.1 | gradient-based |
| PC-DARTS (ImageNet)‡ | 24.2 | 7.3 | 5.3 | 597 | 3.8 | gradient-based |
+
+† This architecture was searched on ImageNet directly, otherwise it was searched on CIFAR10 or CIFAR100.
+
+optimizer with a momentum of 0.9, an initial learning rate of 0.5 (decayed down to zero linearly), and a weight decay of $3 \times 10^{-5}$ . Additional enhancements are adopted including label smoothing and an auxiliary loss tower during training. Learning rate warm-up is applied for the first 5 epochs.
+
+Results are summarized in Table 2. Note that the architectures searched on CIFAR10 and ImageNet itself are both evaluated. For the former, it reports a top-1/5 error of $25.1\% /7.8\%$ , which significantly outperforms $26.7\% /8.7\%$ reported by DARTS. This is impressive given that our search time is much shorter. For the latter, we achieve a top-1/5 error of $24.2\% /7.3\%$ , which is the best known performance to date. In comparison, ProxylessNAS (Cai et al., 2019), another approach that directly searched on ImageNet, used almost doubled time to produce $24.9\% /7.5\%$ , which verifies that our strategy of reducing memory consumption is more efficient yet effective.
+
+
+Figure 3: Search cost and accuracy comparison between our approach with different sampling rates, namely, $1/1$ , $1/2$ , $1/4$ and $1/8$ , among which $1/4$ makes a nice tradeoff between accuracy and efficiency.
+
+| CIFAR10 |
| PC | EN | Test Error | Search Cost |
| X | X | 3.00±0.14% | 0.4 GPU-days |
| X | ✓ | 2.82±0.05% | 0.4 GPU-days |
| ✓ | X | 2.67±0.11% | 0.1 GPU-days |
| ✓ | ✓ | 2.57±0.07% | 0.1 GPU-days |
| ImageNet (ILSVRC2012) |
| PC | EN | Test Error | Search Cost |
| X | X | 26.8±0.1% | 7.7 GPU-days |
| X | ✓ | 26.3±0.1% | 7.7 GPU-days |
| ✓ | X | 26.2±0.1% | 3.8 GPU-days |
| ✓ | ✓ | 25.8±0.1% | 3.8 GPU-days |
+
+Table 3: Ablation study on CIFAR10 and ImageNet. PC and EN denote partial channel connections and edge normalization, respectively. All architectures on ImageNet are re-trained by 100 epochs (the $25.8\%$ error corresponds to the best entry, $24.2\%$ , reported in Table 2 (250 epochs).
+
+# 4.4 ABLATION STUDY
+
+# 4.4.1 EFFECTIVENESS OF CHANNEL PROPORTION $1 / K$
+
+We first evaluate $K$ , the hyper-parameter that controls the sampling rate of channels. Note that a tradeoff exists: increasing the sampling rate (i.e., using a smaller $K$ ) allows more accurate infor
+
+Table 4: Experiments on stability of DARTS and PC-DARTS. Left: Evaluations of searched architectures in five independent search runs. Middle: architectures searched with different numbers of epochs. Right: runs on architectures searched with different numbers of nodes.
+
+| Methods | Runs | Epochs | Nodes |
| #1 | #2 | #3 | #4 | #5 | 50 | 75 | 100 | 125 | 5 | 6 | 7 |
| DARTS-v1(%) | 2.89 | 3.15 | 2.99 | 3.07 | 3.27 | 2.98 | 2.87 | 3.32 | 3.08 | 3.03 | 2.98 | 2.89 |
| DARTS-v2(%) | 3.11 | 2.68 | 2.77 | 3.14 | 3.06 | 2.76 | 2.93 | 3.51 | 3.18 | 2.82 | 2.76 | 3.02 |
| PC-DARTS(%) | 2.72 | 2.67 | 2.57 | 2.75 | 2.64 | 2.57 | 2.67 | 2.69 | 2.75 | 2.63 | 2.57 | 2.64 |
+
+mation to be propagated, while sampling a smaller portion of channels casts heavier regularization and may alleviate over-fitting. To study its impacts, we evaluate the performance produced by four sampling rates, namely $1/1$ , $1/2$ , $1/4$ and $1/8$ , on CIFAR10, and plot the results into a diagram of search time and accuracy in Figure 3. One can observe that a sampling rate of $1/4$ yields superior performance over $1/2$ and $1/1$ in terms of both time and accuracy. Using $1/8$ , while being able to further reduce search time, causes a dramatic accuracy drop.
+
+These experiments not only justify the tradeoff between accuracy and efficiency of architecture search, but also reveal the redundancy of super-network optimization in the context of NAS. More essentially, this reflects the gap between search and evaluation, i.e., a better optimized super-network does not guarantee a better searched architecture – in other words, differentiable NAS approaches are easily to over-fit on the super-network. From this viewpoint, channel sampling plays the role of regularization, which shrinks the gap between search and evaluation.
+
+# 4.4.2 CONTRIBUTIONS OF DIFFERENT COMPONENTS OF PC-DARTS
+
+Next, we evaluate the contributions made by two components of PC-DARTS, namely, partial channel connections and edge normalization. The results are summarized in Table 3. It is clear that edge normalization brings the effect of regularization even when the channels are fully-connected. Being a component with very few extra costs, it can be freely applied to a wide range of approaches involving edge selection. In addition, edge normalization cooperates well with partial channel connections to provide further improvement. Without edge normalization, our approach can suffer low stability in both the number of network parameters and accuracy. On CIFAR10, we run search without edge normalization for several times, and the testing error ranges from $2.54\%$ to $3.01\%$ . On the other hand, with edge normalization, the maximal difference among five runs does not exceed $0.15\%$ . Therefore, we justify our motivation in designing edge normalization (see Section 3.3), i.e., it can be a standalone method for stabilizing architecture search, yet it works particularly well under partial channel connection, since the latter introduces randomness and stabilization indeed helps.
+
+# 4.4.3 STABILITY OF OUR APPROACH
+
+In this part, we demonstrate the stability of our approach from three different perspectives. Results are summarized in Table 4, with detailed analysis below.
+
+First, we evaluate the stability of different approaches by conducting 5 independent search runs. We re-implement DARTS-v1 and DARTS-v2 with the proposed code, as well as that of our approach, and perform five individual search processes with the same hyper-parameters but different random seeds (0, 1, 2, 3, 4). The architectures found by DARTS in different runs, either v1 or v2, suffer much higher standard deviations than that of our approach (DARTS-v1: $\pm 0.15\%$ , DARTS-v2: $\pm 0.21\%$ , PC-DARTS: $\pm 0.07\%$ ).
+
+Second, we study how the search algorithm is robust to hyper-parameters, e.g., the length of the search stage. We try different numbers of epochs, from 50 to 125, and observe how it impacts the performance of searched architectures. Again, we find that both DARTS-v1 and DARTS-v2 are less robust to this change.
+
+Third, we go one step further by enlarging the search space, allowing a larger number of nodes to appear in each cell – the original DARTS-based space has 6 nodes, and here we allow 5, 6 and 7 nodes. From 5 to 6 nodes, the performance of all three algorithms goes up, while from 6 to 7 nodes, DARTS-v2 suffers a significant accuracy drop, while PC-DARTS mostly preserves its performance.
+
+Table 5: Detection results, in terms of average precisions, on the MS-COCO dataset (test-dev 2015).
+
+| Network | Input Size | Backbone | ×+ | AP | \( AP_{50} \) | \( AP_{75} \) | \( AP_S \) | \( AP_M \) | \( AP_L \) |
| SSD300 (Liu et al., 2016) | 300×300 | VGG-16 | 35.2B | 23.2 | 41.2 | 23.4 | 5.3 | 23.2 | 39.6 |
| SSD512 (Liu et al., 2016) | 512×512 | VGG-16 | 99.5B | 26.8 | 46.5 | 27.8 | 9.0 | 28.9 | 41.9 |
| YOLOV2 (Redmon & Farhadi, 2017) | 416×416 | Darknet-19 | 17.5B | 21.6 | 44.0 | 19.2 | 5.0 | 22.4 | 35.5 |
| Pelee (Wang et al., 2018) | 304×304 | PeleeNet | 1.3B | 22.4 | 38.3 | 22.9 | - | - | - |
| SSDLiteV1 (Howard et al., 2017) | 320×320 | MobileNetV1 | 1.3B | 22.2 | - | - | - | - | - |
| SSDLiteV2 (Sandler et al., 2018) | 320×320 | MobileNetV2 | 0.8B | 22.1 | - | - | - | - | - |
| SSDLiteV3 (Tan et al., 2019) | 320×320 | MnasNet-A1 | 0.8B | 23.0 | - | - | 3.8 | 21.7 | 42.0 |
| PC-DARTS with SSD | 320×320 | PC-DARTS‡ | 1.2B | 28.9 | 46.9 | 30.0 | 7.9 | 32.0 | 48.3 |
+
+† The backbone architecture of PC-DARTS was searched on ImageNet (with a 24.2% top-1 error).
+
+As a side note, all these algorithms fail to gain accuracy in enlarged search spaces, because CIFAR10 is relatively simple and the performance of searched architectures seems to saturate.
+
+With all the above experiments, we can conclude that PC-DARTS is indeed more robust than DARTS in different scenarios of evaluation. This largely owes to the regularization mechanism introduced by PC-DARTS, which (i) forces it to adjust to dynamic architectures, and (ii) avoids the large pruning gap after search, brought by the none operator.
+
+# 4.5 TRANSFERRING TO OBJECT DETECTION
+
+To further validate the performance of the architecture found by PC-DARTS, we use it as the backbone for object detection. We plug the architecture found on ImageNet, as shown in Figure 2, into a popular object detection framework named Single-Shot Detectors (SSD) (Liu et al., 2016). We train the entire model on the MS-COCO (Lin et al., 2014) trainval dataset, which is obtained by a standard pipeline that excludes 5K images from the val set, merges the rest data into the 80K train set and evaluates it on the test-dev 2015 set.
+
+Results are summarized in Table 5. Results for SSD, YOLO and MobileNets are from (Tan et al., 2019). With the backbone searched by PC-DARTS, we need only 1.2B FLOPs to achieve an AP of $28.9\%$ , which is $5.7\%$ higher than SSD300 (but with $29\times$ fewer FLOPs), or $2.1\%$ higher than SSD512 (but with $83\times$ fewer FLOPs). Compared to the 'Lite' versions of SSD, our result enjoys significant advantages in AP, surpassing the most powerful one (SSDLiteV3) by an AP of $6.9\%$ . All these results suggest that the advantages obtained by PC-DARTS on image classification can transfer well to object detection, a more challenging task, and we believe these architectures would benefit even more application scenarios.
+
+# 5 CONCLUSIONS
+
+In this paper, we proposed a simple and effective approach named partially-connected differentiable architecture search (PC-DARTS). The core idea is to randomly sample a proportion of channels for operation search, so that the framework is more memory efficient and, consequently, a larger batch size can be used for higher stability. Additional contribution to search stability is made by edge normalization, a light-weighted module that requires merely no extra computation. Our approach can accomplish a complete search within 0.1 GPU-days on CIFAR10, or 3.8 GPU-days on ImageNet, and report state-of-the-art classification accuracy in particular on ImageNet.
+
+This research delivers two important messages that are important for future research. First, differentiable architecture search seems to suffer even more significant instability compared to conventional neural network training, and so it can largely benefit from both (i) regularization and (ii) a larger batch size. This work shows an efficient way to incorporate these two factors in a single pipeline, yet we believe there exist other (possibly more essential) solutions for this purpose. Second, going one step further, our work reveals the redundancy of super-network optimization in NAS, and experiments reveal a gap between improving super-network optimization and finding a better architecture, and regularization plays an efficient role in shrinking the gap. We believe these insights can inspire researchers in this field, and we will also follow this path towards designing stabilized yet efficient algorithms for differentiable architecture search.
+
+# REFERENCES
+
+Bowen Baker, Otkrist Gupta, Nikhil Naik, and Ramesh Raskar. Designing neural network architectures using reinforcement learning. In ICLR, 2017.
+Andrew Brock, Theodore Lim, James M Ritchie, and Nick Weston. SMASH: one-shot model architecture search through hypernetworks. In ICLR, 2018.
+Han Cai, Tianyao Chen, Weinan Zhang, Yong Yu, and Jun Wang. Efficient architecture search by network transformation. In AAAI, 2018.
+Han Cai, Ligeng Zhu, and Song Han. ProxylessNAS: Direct neural architecture search on target task and hardware. In ICLR, 2019.
+Francesco Paolo Casale, Jonathan Gordon, and Nicolo Fusi. Probabilistic neural architecture search. arXiv preprint arXiv:1902.05116, 2019.
+Xin Chen, Lingxi Xie, Jun Wu, and Qi Tian. Progressive differentiable architecture search: Bridging the depth gap between search and evaluation. In ICCV, 2019.
+Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. ImageNet: A large-scale hierarchical image database. In CVPR, 2009.
+Terrance DeVries and Graham W Taylor. Improved regularization of convolutional neural networks with cutout. arXiv preprint arXiv:1708.04552, 2017.
+Thomas Elsken, Jan Hendrik Metzen, and Frank Hutter. Efficient multi-objective neural architecture search via lamarckian evolution. In ICLR, 2019.
+David Ha, Andrew Dai, and Quoc V Le. Hypernetworks. In ICLR, 2017.
+Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016.
+Andrew G Howard, Menglong Zhu, Bo Chen, Dmitry Kalenichenko, Weijun Wang, Tobias Weyand, Marco Andreetto, and Hartwig Adam. MobileNets: Efficient convolutional neural networks for mobile vision applications. arXiv preprint arXiv:1704.04861, 2017.
+Gao Huang, Zhuang Liu, Laurens Van Der Maaten, and Kilian Q Weinberger. Densely connected convolutional networks. In CVPR, 2017.
+Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In ICLR, 2015.
+Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. Technical report, Citeseer, 2009.
+Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. ImageNet classification with deep convolutional neural networks. In NIPS, 2012.
+Gustav Larsson, Michael Maire, and Gregory Shakhnarovich. FractalNet: Ultra-deep neural networks without residuals. In ICLR, 2017.
+Liam Li and Ameet Talwalkar. Random search and reproducibility for neural architecture search. In UAI, 2019.
+Tsung-Yi Lin, Michael Maire, Serge J. Belongie, Lubomir D. Bourdev, Ross B. Girshick, James Hays, Pietro Perona, Deva Ramanan, Piotr Dólár, and C. Lawrence Zitnick. Microsoft COCO: Common objects in context. In ECCV, 2014.
+Chenxi Liu, Barret Zoph, Maxim Neumann, Jonathon Shlens, Wei Hua, Li-Jia Li, Li Fei-Fei, Alan Yuille, Jonathan Huang, and Kevin Murphy. Progressive neural architecture search. In ECCV, 2018a.
+Hanxiao Liu, Karen Simonyan, Oriol Vinyals, Chrisantha Fernando, and Koray Kavukcuoglu. Hierarchical representations for efficient architecture search. In ICLR, 2018b.
+
+Hanxiao Liu, Karen Simonyan, and Yiming Yang. DARTS: Differentiable architecture search. In ICLR, 2019.
+Weiwei Liu, Dragomir Anguelov, Dumitru Erhan, Christian Szegedy, Scott E. Reed, Cheng-Yang Fu, and Alexander C. Berg. Ssd: Single shot multibox detector. In ECCV, 2016.
+Renqian Luo, Fei Tian, Tao Qin, Enhong Chen, and Tie-Yan Liu. Neural architecture optimization. In NeurIPS, 2018.
+Ningning Ma, Xiangyu Zhang, Hai-Tao Zheng, and Jian Sun. ShuffleNet V2: Practical guidelines for efficient cnn architecture design. In ECCV, 2018.
+Jieru Mei, Xiaochen Lian, Xiaojie Jin, Linjie Yang, Yingwei Li, Alan Yuille, and Jianchao Yang. AtomNAS: Fine-grained end-to-end neural architecture search. In ICLR, 2020.
+Risto Miikkulainen, Jason Liang, Elliot Meyerson, Aditya Rawal, Daniel Fink, Olivier Francon, Bala Raju, Hormoz Shahrzad, Arshak Navruzyan, Nigel Duffy, et al. Evolving deep neural networks. In Artificial Intelligence in the Age of Neural Networks and Brain Computing, pp. 293-312. Elsevier, 2019.
+Hieu Pham, Melody Y Guan, Barret Zoph, Quoc V Le, and Jeff Dean. Efficient neural architecture search via parameter sharing. In ICML, 2018.
+Esteban Real, Sherry Moore, Andrew Selle, Saurabh Saxena, Yutaka Leon Suematsu, Jie Tan, Quoc V Le, and Alexey Kurakin. Large-scale evolution of image classifiers. In ICML, 2017.
+Esteban Real, Alok Aggarwal, Yanping Huang, and Quoc V Le. Regularized evolution for image classifier architecture search. In AAAI, 2019.
+Joseph Redmon and Ali Farhadi. Yolo9000: Better, faster, stronger. CVPR, 2017.
+Mark Sandler, Andrew G. Howard, Menglong Zhu, Andrey Zhmoginov, and Liang-Chieh Chen. *Mobilenetv2: Inverted residuals and linear bottlenecks*. CVPR, 2018.
+Christian Sciuto, Kaicheng Yu, Martin Jaggi, Claudiu Musat, and Mathieu Salzmann. Evaluating the search phase of neural architecture search. ArXiv, abs/1902.08142, 2019.
+Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. In ICLR, 2015.
+Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: A simple way to prevent neural networks from overfitting. JMLR, 15(1):1929-1958, 2014.
+Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott Reed, Dragomir Anguelov, Dumitru Erhan, Vincent Vanhoucke, and Andrew Rabinovich. Going deeper with convolutions. In CVPR, 2015.
+Mingxing Tan, Bo Chen, Ruoming Pang, Vijay Vasudevan, and Quoc V Le. MnasNet: Platform-aware neural architecture search for mobile. CVPR, 2019.
+Robert J. Wang, Xiang Li, Shuang Ao, and Charles X. Ling. Pelee: A real-time object detection system on mobile devices. In NeurIPS, 2018.
+Lingxi Xie and Alan Yuille. Genetic CNN. In ICCV, 2017.
+Sirui Xie, Hehui Zheng, Chunxiao Liu, and Liang Lin. SNAS: Stochastic neural architecture search. In ICLR, 2019.
+Xiangyu Zhang, Xinyu Zhou, Mengxiao Lin, and Jian Sun. ShuffleNet: An extremely efficient convolutional neural network for mobile devices. In CVPR, 2018.
+Zhao Zhong, Junjie Yan, Wei Wu, Jing Shao, and Cheng-Lin Liu. Practical block-wise neural network architecture generation. In CVPR, 2018.
+
+Hongpeng Zhou, Minghao Yang, Jun Wang, and Wei Pan. BayesNAS: A Bayesian approach for neural architecture search. In ICML, 2019.
+Barret Zoph and Quoc V Le. Neural architecture search with reinforcement learning. In ICLR, 2017.
+Barret Zoph, Vijay Vasudevan, Jonathon Shlens, and Quoc V Le. Learning transferable architectures for scalable image recognition. In CVPR, 2018.
\ No newline at end of file
diff --git a/pcdartspartialchannelconnectionsformemoryefficientarchitecturesearch/images.zip b/pcdartspartialchannelconnectionsformemoryefficientarchitecturesearch/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..9552d92258a6a85a6035e3688042bbc0b7522b59
--- /dev/null
+++ b/pcdartspartialchannelconnectionsformemoryefficientarchitecturesearch/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:8730e6789c7c93efa35ee4a1b9b0a397956a7e6171069cadf1d684ee2494d7d2
+size 507395
diff --git a/pcdartspartialchannelconnectionsformemoryefficientarchitecturesearch/layout.json b/pcdartspartialchannelconnectionsformemoryefficientarchitecturesearch/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..caae950a9eec5180975e5b0587e8790c6e65472c
--- /dev/null
+++ b/pcdartspartialchannelconnectionsformemoryefficientarchitecturesearch/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a46103d4677232f98bf9a00dbb488ea56f9f45ae59e29606ccf3ec448b58fdc1
+size 440076
diff --git a/programguidedagent/4d59cc78-6a10-4529-8b08-f526c3189c9d_content_list.json b/programguidedagent/4d59cc78-6a10-4529-8b08-f526c3189c9d_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..f1cc65b387a1546259f57367e037702e68fc23a3
--- /dev/null
+++ b/programguidedagent/4d59cc78-6a10-4529-8b08-f526c3189c9d_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:4cc36673279b48573a1f0ff60a35f77c4c492a463e26ea7c5ed46af0224c2585
+size 136525
diff --git a/programguidedagent/4d59cc78-6a10-4529-8b08-f526c3189c9d_model.json b/programguidedagent/4d59cc78-6a10-4529-8b08-f526c3189c9d_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..3dcea2bbfa6923e3455976f56006d0b9c664d4ed
--- /dev/null
+++ b/programguidedagent/4d59cc78-6a10-4529-8b08-f526c3189c9d_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:22981708e61063a162ee0f0898cd26aa135cd3299b793d49830e623f8a014570
+size 169112
diff --git a/programguidedagent/4d59cc78-6a10-4529-8b08-f526c3189c9d_origin.pdf b/programguidedagent/4d59cc78-6a10-4529-8b08-f526c3189c9d_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..ddb643927392c3afaf8d80c7c668491b27feef6c
--- /dev/null
+++ b/programguidedagent/4d59cc78-6a10-4529-8b08-f526c3189c9d_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c2a6fe37338ea0343adf6c79ac27d0100decdcedb4f01abb944360ecfe164547
+size 1447125
diff --git a/programguidedagent/full.md b/programguidedagent/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..17a4283652622a6d66f814390134063f1cc2ea61
--- /dev/null
+++ b/programguidedagent/full.md
@@ -0,0 +1,553 @@
+# PROGRAM GUIDED AGENT
+
+Shao-Hua Sun, Te-Lin Wu, Joseph J. Lim
+
+University of Southern California
+
+{shaohuas,telinwu,limjj}@usc.edu
+
+# ABSTRACT
+
+Developing agents that can learn to follow natural language instructions has been an emerging research direction. While being accessible and flexible, natural language instructions can sometimes be ambiguous even to humans. To address this, we propose to utilize programs, structured in a formal language, as a precise and expressive way to specify tasks. We then devise a modular framework that learns to perform a task specified by a program – as different circumstances give rise to diverse ways to accomplish the task, our framework can perceive which circumstance it is currently under, and instruct a multitask policy accordingly to fulfill each subtask of the overall task. Experimental results on a 2D Minecraft environment not only demonstrate that the proposed framework learns to reliably accomplish program instructions and achieves zero-shot generalization to more complex instructions but also verify the efficiency of the proposed modulation mechanism for learning the multitask policy. We also conduct an analysis comparing various models which learn from programs and natural language instructions in an end-to-end fashion.
+
+# 1 INTRODUCTION
+
+Humans are capable of leveraging instructions to accomplish complex tasks. A comprehensive instruction usually comprises a set of descriptions detailing a variety of situations and the corresponding subtasks that are required to be fulfilled. To accomplish a task, we can leverage instructions to estimate the progress, recognize the current state, and perform corresponding actions. For example, to make a gourmet dish, we can follow recipes and procedurally create the desired dish by recognizing what ingredients and tools are missing, what alternatives are available, and what corresponding preparations are required. With sufficient practice, we can improve our ability to perceive (e.g. knowing when food is well-cooked) as well as master cooking skills (e.g. cutting food into same-sized pieces), and eventually accomplish difficult recipes.
+
+Can machines likewise learn to follow and exploit comprehensive instructions like humans? Utilizing expert demonstrations to instruct agents has been widely studied in (Finn et al., 2017; Yu et al., 2018b; Xu et al., 2018; Pathak et al., 2018; Stadie et al., 2017; Duan et al., 2017; Wang et al., 2017b). However, demonstrations could be expensive to obtain and are less flexible (e.g. altering subtask orders in demonstrations is nontrivial). On the other hand, natural language instructions are flexible and expressive (Malmaud et al., 2014; Jermsurawong & Habash, 2015; Kiddon et al., 2015; Misra et al., 2018; Fried et al., 2018; Kaplan et al., 2017; Bahdanau et al., 2019). Yet, language has the caveat of being ambiguous even to humans, due to its lacking of structure as well as unclear coreferences and entities. Andreas et al. (2017a); Oh et al. (2017) investigate a hierarchical approach, where the instructions consist of a set of symbolically represented subtasks. Nonetheless, those instructions are not a function of states (i.e. describe a variety of circumstances and the corresponding desired subtasks), which substantially limits their expressiveness.
+
+We propose to utilize programs, written in a formal language, as a structured, expressive, and unambiguous representation to specify tasks. Specifically, we consider programs, which are composed of control flows (e.g. if/else and loops), environmental conditions, as well as corresponding subtasks, as shown in Figure 1. Not only do programs have expressiveness by describing diverse situations (e.g. a river exists) and the corresponding subtasks which are required to be executed (e.g. mining wood), but they are also unambiguous due to their explicit scoping. To study the effectiveness of using programs as task specifications, we introduce a new problem, where we aim to develop a framework
+
+
+Program
+
+
+Figure 1: An illustration of the proposed problem. We are interested in learning to fulfill tasks specified by written programs. A program consists of control flows (e.g. if, while), branching conditions (e.g. is_there[River]), and subtasks (e.g. mine(Wood)).
+Figure 2: The domain-specific language (DSL) for constructing programs. Each program is composed of domain dependent perception, subtasks, and control flows.
+
+Program $p\coloneqq \mathrm{def}\operatorname {run}():s$
+
+Statement $s\coloneqq$ while $(c):(s)\mid b\mid \mathrm{loop}(i):(s)$
+
+if(c) : (s) elseif(c) : (s) else : (s)
+
+Item $t\coloneqq$ Gold | Wood | Iron
+
+Terrain $u\coloneqq$ Bridge | River | Merchant | Wall | Flat
+
+Operators $o\coloneqq >\geq = < < \leq$
+
+Numbers $i\coloneqq$ A positive integer or zero
+
+Perception $h\coloneqq$ agent[t] | env[t] | is_there[t] | is_there[u]
+
+Behavior $b\coloneqq \mathrm{min}(t)$ | goto(i,i)
+
+| place(t, i, i) | build_bridge() | sell(t)
+
+Conditions $c\coloneqq h[t]o i|h[u]o i$
+
+which learns to comprehend a task specified by a program as well as perceive and interact with the environment to accomplish the task.
+
+To address this problem, we propose a modular framework, program guided agent, which exploits the structural nature of programs to decompose and execute them as well as learn to ground program tokens with the environment. Specifically, our framework consists of three modules: (1) a program interpreter that leverages a grammar provided by the programming language to parse and execute a program, (2) a perception module that learns to respond to conditional queries (e.g. is_there[River]) produced by the interpreter, and (3) a policy that learns to fulfill a variety of subtasks (e.g. mine(Wood)) extracted from the program by the interpreter. To effectively instruct the policy with symbolically represented subtasks, we introduce a learned modulation mechanism that leverages a subtask to modulate the encoded state features instead of concatenating them. Our framework (shown in Figure 3) utilizes a rule-based program interpreter to deal with programs as well as learning perception module and policy when it is necessary to perceive or interact with the environment. With this modularity, our framework can generalize to more complex program-specified tasks without additional learning.
+
+To evaluate the proposed framework, we consider a Minecraft-inspired 2D gridworld environment, where an agent can navigate itself across different terrains and interact with objects, similar to Andreas et al. (2017a); Sohn et al. (2018). A corresponding domain-specific language (DSL) defines the rules of constructing programs for instructing an agent to accomplish certain tasks. Our proposed framework demonstrates superior generalization ability – learning from simpler tasks while generalizing to complex tasks. We also conduct extensive analysis on various end-to-end learning models which learns from not only program instructions but also natural language descriptions. Furthermore, our proposed learned policy modulation mechanism yields a better learning efficiency compared to other commonly used methods that simply concatenate a state and goal.
+
+# 2 RELATED WORK
+
+Learning from language instructions. Prior works have investigated leveraging natural languages to specify tasks on a wide range of applications, including navigation (Misra et al., 2018; Tellex et al., 2011; Fried et al., 2018; Vogel & Jurafsky, 2010; Shimizu & Haas, 2009; Branavan et al., 2009; Misra et al., 2017; Tellex et al., 2011), spatial reasoning for goal reaching (Janner et al., 2018), game playing (Kaplan et al., 2017; Fried et al., 2017; Co-Reyes et al., 2019), and grounding visual concepts (Kaplan et al., 2017; Bahdanau et al., 2019; Andreas et al., 2017b). However, natural language descriptions can often be ambiguous even to humans. Moreover, it is not clear how end-to-end learning agents trained with simpler instructions can generalize well to much more complex ones. In contrast, we propose to utilize a precise and structured representation, programs, to specify tasks.
+
+Learning from demonstrations. When a task cannot be easily described in languages (e.g. object texture or geometry), expert demonstrations offer an alternative way to provide instructions. Prior works have explored learning from video demonstrations (Finn et al., 2017; Yu et al., 2018b; Xu et al., 2018; Pathak et al., 2018; Stadie et al., 2017; Aytar et al., 2018) or expert trajectories (Duan et al., 2017; Wang et al., 2017b). However, demonstrations can be expensive to obtain and are less expressive about diverging behaviors of a complex task, which are better captured by control flow in programs. Moreover, editing demonstrations such as rearranging the order of subtasks is often difficult.
+
+Program induction and synthesis. To learn acquire programmatic skills such as digit addition and string transformations and achieve better generalization, program induction methods (Xu et al., 2018; Devlin et al., 2017a; Neelakantan et al., 2015; Graves et al., 2014; Kaiser & Sutskever, 2016; Reed & De Freitas, 2016; Cai et al., 2017; Xiao et al., 2018) aim to implicitly induce the underlying programs to mimic the behaviors demonstrated in task specifications (e.g. input/output pairs, demonstrations). On the other hand, program synthesis methods (Bošnjak et al., 2017; Parisotto et al., 2017; Devlin et al., 2017b; Chen et al., 2019; Shin et al., 2018; Bunel et al., 2018; Liu et al., 2019; Sun et al., 2018; Lin et al., 2018; Liao et al., 2019) explicitly synthesize the underlying programs and execute the programs to perform the tasks. Instead of trying to infer programs from task specifications, we are interested in explicitly executing programs. Also, our framework can potentially be leveraged to obtain program execution results for evaluating program synthesis frameworks when no program executor is available (e.g. programs describe real-world activities instead of behaviors in simulation).
+
+Symbolic planning and programmable agent. Classical symbolic planning concerns the problem of achieving a goal state from an initial state through a series of symbolically represented executions (Ghallab et al.; Konidaris et al., 2018). Our work shares a similar spirit but assume a task (i.e. a program) is given, where the agent is required to learn to ground symbolic concepts (Mao et al., 2019; Han et al., 2019) and follow the control flow. Executing programs with reinforcement learning has been studied in programmable hierarchies of abstract machines (Parr & Russell, 1998; Andre & Russell, 2001; 2002), which provide partial descriptions and subroutines of the desired task. Denil et al. (2017); Lázaro-Gredilla et al. (2018) train agents to execute declarative programs by grounding these well-structured languages in their learning environments. In contrast, our modular framework consists of modules for perceiving the environment and interacting with it by following an imperative program which specifies the task. An extended discussion on the related work can be found in Section C.
+
+# 3 PROBLEM FORMULATION
+
+We are interested in learning to comprehend and execute an instruction specified by a program to fulfill the desired task. In this section, we formally describe our definition of programs, the family of Markov Decision Processes (MDPs), and the problem formulation.
+
+Program. The programs considered in this work are defined based on a Domain Specific Language (DSL) as shown in Figure 2. The DSL is composed of perception primitives, action primitives, and control flow. A perception primitive indicates circumstances in the environment (e.g. is_there (River), and agent [Gold] $< 3$ ) that can be perceived by an agent, while an action primitive defines a subtask that describes a certain behavior (e.g. mine (Gold), and goto (1, 1)). Control flow includes if/else statements, loops, and Boolean/logical operators to compose more sophisticated conditions. A program $p$ is a deterministic function that outputs a desired behavior (i.e. subtask) given a history of states $o_{t} = p(H_{j})$ , where $H_{j} = \{s_{1}, \dots, s_{t}\}$ is a state history with $s \in S$ denoting a state of the environment, and $o \in \mathcal{O}$ denotes an instructed behavior (subtask). We denote a program as $p \sim \mathcal{P}$ , an infinite program set containing all executable programs given a DSL. Note that a discussion on the DSL design principle can be found in Section B.
+
+MDPs. We consider a family of finite-horizon discounted MDPs in a shared environment, specified by a tuple $(\mathcal{S},\mathcal{A},\mathcal{P},\mathcal{T},\mathcal{R},\rho,\gamma)$ , where $\mathcal{S}$ denotes a set of states, $\mathcal{A}$ denotes a set of low-level actions an agent can take, $\mathcal{P}$ denotes a set of programs specifying instructions, $\mathcal{T}: \mathcal{S} \times \mathcal{A} \times \mathcal{S} \to \mathbb{R}$ denotes a transition probability distribution, $\mathcal{R}$ denotes a task-specific reward function, $\rho$ denotes an initial state distribution, and $\gamma$ denotes a discount factor. For a fixed sequence $\{(s_0,a_0),\dots,(s_t,a_t)\}$ of states and actions obtained from a rollout of a given policy $\pi$ , the performance of the policy is evaluated based on a discounted return $\sum_{t=0}^{T} \gamma^t r_t$ , where $T$ is the horizon of the episode.
+
+
+Figure 3: Program Guided Agent. The proposed modular framework comprehends and fulfills a desired task specified by a program. The program interpreter executes the program by altering between querying the perception module with a query $q$ when an environment condition is encountered (e.g. env[Gold] > 0, is_there[River]) and instructing a policy when it needs to fulfill a goal/subtask $g$ (e.g. mine(Gold), build_bridge)). The perception module produces a response $h$ to answer the query, determining which paths in the program should be chosen. The policy takes a sequence of low-level actions $a$ (e.g. moveUp, moveLeft, Pickup) interacting with the environment to accomplish the given subtask (e.g. mine(Gold)).
+
+Problem Formulation. We consider developing a framework which can comprehend and fulfill an instruction specified by a program. Specifically, we consider a sampled MDP with a program describing the desired task. Addressing this task requires the ability to keep track of which parts of the program are finished and which parts are not, perceiving the environment and deciding which paths in the program to take, and performing actions interacting with the environment to fulfill subtasks.
+
+# 4 APPROACH
+
+Accomplishing an instructed task described by a program requires (1) executing the program control flow and conditions, (2) recognizing the situations to infer which path in the program should be chosen, and (3) executing a series of actions interacting with the environment to fulfill the subtasks. Based on this intuition, we design a modular framework with three modules:
+
+- Program interpreter (Section 4.1) reads a program and executes it by querying a perception module with environment conditions (e.g. env[Gold] > 0) and instructing the policy with subtasks (e.g. mine [Gold]).
+- Perception module (Section 4.2) responds to perception queries (e.g. env [Gold] > 0) by examining the observation and predicting responses (e.g. true).
+- Policy (action module) (Section 4.3) performs low-level actions (e.g. moveUp, moveLeft, pickUp) to fulfill the symbolically represented subtasks (e.g. mine (Gold)) provided by the program interpreter.
+
+Our key insight is to only learn a module when its input or output is associated with the environment (i.e. a function approximator is needed) – the perception module learns to ground the queries to its observation and answer them; the policy learns to ground the symbolically represented subtasks and interact with the environment in a trial-and-error way (Section 4.4). On the other hand, we do not learn the program interpreter; instead, we utilize a rule-based parser to execute programs An overview of the proposed framework is illustrated in Figure 3.
+
+# 4.1 PROGRAM INTERPRETER
+
+To execute a program instruction, we group program tokens into three main categories: (1) subtasks indicate what the agent should perform (e.g. mine (Gold)), (2) perceptions the essential information extracted from the environment (e.g. env [Gold] > 0), and (3) control flows determine which paths in a program should be taken according to the perceived information (i.e. perceptions). Then, we devise a program interpreter, which can execute and keep track of the progress by leveraging the
+
+structure of programs. Specifically, it consists of a program line parser and a program executor. The parser first transforms the program into a program tree by representing each line of a program as a tree node. Each node is either a leaf node (subtask) or a non-leaf node (perception or control flow) that has various subroutines as children nodes. The executor then performs a pre-order traversal on the program tree to execute the program, utilizing the parsed contents to alternate between querying the perception module when an environment condition is encountered and instructing the policy when it reaches to a leaf node (subtask). The details and the algorithm are summarized in section A. Note that the program interpreter is a rule-based algorithm instead of a learning module.
+
+# 4.2 PERCEPTION MODULE
+
+Determining which paths should be chosen when executing a program requires grounding a symbolically represented query (e.g. is_there[River] can be represented as a sequence of symbols) and perceiving the environment. To this end, we employ a perception module $\Phi$ that learns to map a query and current observation to a response: $h = \Phi(q,s)$ , where $q$ denotes a query, and $h$ denotes the corresponding perception output (e.g. true/false). Note that we focus on Boolean perception outputs in this paper, but a more generic perception type can be used (e.g. object attributes such as color, shape, and size).
+
+# 4.3 POLICY
+
+When program execution reaches a subtask/leaf node (e.g. mine (Gold)), the agent is required to take a sequence of low-level actions (e.g. moveUp, moveLeft, Pickup) to interact with the environment to fulfill it. To enable the execution, we employ a multitask policy $\pi$ (i.e. action module) which is instructed by a symbolic goal (e.g. mine (Gold)) provided by the program interpreter indicating the details of the corresponding subtask. To learn to perform different subtasks, we train the policy using actor-critic reinforcement learning, which takes a goal vector $g$ and an environment state $s$ and outputs a probabilistic distribution $a$ for low-level actions $a \sim \pi(s_t, g_t | \theta)$ . The value estimator used for our policy optimization is also goal-conditioned: $V_{\pi}(s_t, g_t) = \mathbb{E}[\sum_t \gamma^t R_t | s_0 = s, \pi, g_t]$ .
+
+While the most common way to feed a state and goal to a policy parameterized by a neural network is to concatenate them in a raw space or a latent space, we find this less effective when the policy has to learn a diverse set of tasks. Therefore, we propose a modulation mechanism to effectively learn the policy. Specifically, we employ a goal network to encode the goal and compute affine transform parameters $\gamma$ and $\beta$ , which are used to modulate state features $e_s$ to $\hat{e}_s = \gamma \cdot e_s + \beta$ . Then, the modulated features $\hat{e}_s$ are used to predict action $a$ and value $V$ . With the modulation mechanism, the goal network learns to activate state features related to the current goal and deactivate others. An illustration is shown in Figure 4 (a). A more detailed discussion of the related works that utilize similar learned modulation mechanisms can be found in Section D.
+
+# 4.4 LEARNING
+
+To follow a program by perceiving the environment and taking actions to interact with it, we employ two learning modules: a perception module and a policy. In this section, we discuss how each module is trained, their training objectives, and optimization methods. More training details and the architectures can be found in section E.4.1.
+
+# 4.4.1 PERCEPTION MODULE
+
+We formulate training the perception module as a supervised learning task. Given tuples of (query $q$ , state $s$ , ground truth perception $h_{gt}$ ), we train a neural network $\Phi$ to predict the perception output $h$ by optimizing the binary cross-entropy loss: $\mathcal{L}_{CE} = -h_{gt}\log(h) - (1 - h_{gt})\log(1 - h)$ . A query such as is_there[River] is represented as a sequence of symbols. Note that when perception describes more than a Boolean, training the perception module can be done by optimizing other losses such as categorical cross-entropy loss. We train the perception module only on the queries appearing in the training programs with randomly sampled states, requiring it to generalize to novel queries to perform well in executing testing programs.
+
+
+
+
+(a) Illustration
+
+
+
+
+(b) Training curves
+Figure 4: Learning a multitask policy via learned modulation. (a) A multitask policy takes both a state $s$ and a goal specification $g$ as inputs and produces an action distribution $a \sim \pi(s, g)$ . Instead of simply concatenating the state and goal in a raw space or a latent space, we propose to modulate state features $e_s$ using the goal. Specifically, the goal network learns to predict affine transform parameters $\gamma$ and $\beta$ to modulate the state features $\hat{e}_s = \gamma \cdot e_s + \beta$ . Then, the final layers use the modulated features to predict actions. (b) We experiment different ways of feeding a state and goal for learning a multitask policy. The training curves demonstrate that all modulation variants, including modulating state feature maps of convolutional layers (Modulation conv), modulating state feature vectors of fully-connected layers (Modulation fc), or both (Modulation conv fc), are more efficient than concatenating the state and the goal in a raw space (Concat raw) or a latent space (Concat).
+
+# 4.4.2 POLICY
+
+We train the policy using Advantage Actor-Critic (A2C) (Mnih et al., 2016; Dhariwal et al., 2017), which is commonly used for gridworld environments with discrete action spaces. A2C computes policy gradients $A_{t}\nabla_{\theta}\log \pi_{\theta}(a_{t}|s_{t},g_{t})$ , where $A_{t} = R_{t} - V(s_{t},g_{t})$ is the advantage function based on empirical return $R_{t}$ starting from $s_t$ and learned value estimator $V(s_{t},g_{t})$ conditioning on the goal vector $g_{t}$ . We denote the learning rate as $\alpha$ , and the policy update rule is as follows:
+
+$$
+\theta \leftarrow \theta + \alpha \left(A _ {t} \nabla_ {\theta} \log \pi_ {\theta} \left(a _ {t} \mid s _ {t}, g _ {t}\right) + \beta \nabla_ {\theta} H _ {\pi_ {\theta}}\right), \tag {1}
+$$
+
+where $H_{\pi_\theta}$ denotes the policy entropy, where maximizing it improves overall exploration, and $\beta$ determines the strength of the entropy regularization term.
+
+# 5 EXPERIMENTS
+
+Our experiments aim to answer the following questions: (1) Can our proposed framework learn to perform tasks specified by programs? (2) Can our modular framework generalize better to more complex tasks compared to end-to-end learning models? (3) How well can a variety of end-to-end learning models (e.g. LSTM, Tree-RNN, Transformer) learn from programs and natural language instructions? (4) Is the proposed learned modulation more efficient to learn a multitask (multi-goal) policy than simply concatenating a state and goal?
+
+# 5.1 EXPERIMENTAL SETUPS
+
+# 5.1.1 ENVIRONMENT
+
+To evaluate the proposed framework in an environment where an agent can perceive diverse scenarios and interact with the environment to perform various subtasks, we construct a discrete Minecraft-inspired gridworld environment, similar to Andreas et al. (2017a); Sohn et al. (2018). As illustrated in Figure 1, the agent can navigate through a grid world and interact with resources (e.g. Wood, Iron, Gold) and obstacles (e.g. River, Wall), build tools (e.g. Bridge), and sell resources to a merchant visualized as an alpaca. The environment gives a sparse task completion reward of $+1$ when an instruction (i.e. an entire program or natural language instruction) is successfully executed. More details can be found in Section E.1.
+
+Table 1: Task completion rate. For each method, we iterate over all the programs in a testing set by randomly sampling ten initial environment states and running three models trained using different random seeds for this method. The averaged task completion rates and their standard deviations are reported. Note that all the end-to-end learning models learning from natural language descriptions and programs suffer from a significant performance drop when evaluated on the more complex testing set.
+
+| Instruction
+Method | Natural language descriptions | Programs |
| Seq-LSTM | Transformer | Seq-LSTM | Tree-RNN | Transformer | Ours (concat) | Ours | |
| Dataset | test | 54.9±1.8% | 52.5±2.6% | 56.7±1.9% | 50.1±1.2% | 49.4±1.6% | 88.6±0.8% | 94.0±0.5% | |
| test-complex | 32.4±4.9% | 38.2±2.6% | 38.8±1.2% | 42.2±2.4% | 40.9±1.5% | 85.2±0.8% | 91.8±0.2% | |
| Generalization gap | 40.9% | 27.2% | 31.6% | 15.8% | 17.2% | 3.8% | 2.3% | |
+
+# 5.1.2 TASK INSTRUCTIONS
+
+**Programs.** We sample 4,500 programs using our DSL and split them into 4,000 training programs (train) and 500 testing programs (test). To examine the framework's ability to generalize to more complex instructions, we generate 500 programs which are twice longer and contains more condition branches on average to construct a harder testing set (test-complex).
+
+Natural language instructions. To obtain the natural language counterparts of those instructions, we asked annotators to construct natural language translations of all the programs. The data collection details, as well as sample programs and their corresponding natural language translations, can be found in Section E.3, and figure 10 respectively. We include a brief discussion on how annotated natural language instructions can be ambiguously interpreted as several valid programs.
+
+# 5.2 TRAINING
+
+During training, we randomly sample programs from the training set as well as randomly sample an environment state to execute the program interpreter. The program interpreter produces a goal to instruct the policy when encountering a subtask in the program. The policy takes actions $a \sim \pi(s, g)$ and receive reward $+1$ only when the entire program is completed. While we do not explicitly introduce a curriculum like Andreas et al. (2017a), this setup naturally induces a curriculum where the policy first learns to solve simpler programs and gain a better understanding of subtasks by obtaining the task completion, which eventually allows the policy to complete more complex programs. Note that the perception module is pre-trained beforehand in a supervised manner. More training details can be found in section E.7.
+
+# 5.3 END-TO-END LEARNING MODELS
+
+In contrast to the proposed modular framework, we experiment with a variety of end-to-end learning models. Considering programs and natural language instructions as sequences of tokens, we investigate two types of state-of-the-art sequence encoders: LSTM (Hochreiter & Schmidhuber, 1997) (Seq-LSTM), and Transformers (Vaswani et al., 2017; Devlin et al., 2018) (Transformer). To leverage the explicit structure of programs, we also investigate encoding programs using a generalization of RNNs for tree-structured input (Tai et al., 2015; Alon et al., 2019) (Tree-RNN). All the models are trained using A2C. The details of these architectures can be found in Section E.4.2.
+
+# 5.4 RESULTS
+
+# 5.4.1 TASK COMPLETION
+
+We train the proposed framework and the end-to-end learning models on training programs and evaluate their performances using the percentage of completed instructions on test and test-complex sets (shown in Table 1). Our proposed framework achieves a satisfactory test performance and only suffers a negligible drop (i.e. generalization gap) when it is evaluated on test-complex set. This can be attributed to the modular design, which explicitly utilizes the structure and grammar of programs, allowing the two learning modules (i.e. perception and policy) to focus on their local jobs. A more detailed failure analysis can be found in Section E.6.
+
+
+Figure 5: Analysis on end-to-end learning models: (a) Models learning from programs generalize better to longer instructions. Transformer is more robust to longer instructions (Upper). Tree-RNN exploiting the program structure generalizes the best, but performs worst for shorter programs (Lower). (b) Seq-LSTM learning from both instructions performs worse as the diversity increases. Transformer learns better from natural language when the instructions are less diverse (Upper). Transformer and Tree-RNN learning from programs are more consistent as the diversity increases, yet perform worse on less diverse instructions (Lower).
+
+On the other hand, all the end-to-end learning models suffer a significant performance drop between test and test-complex sets, while it is less significant for the models learning from programs, potentially indicating that models learning from instructions with explicit structures can generalize to complex instructions better. Among them, Seq-LSTM achieves the best results on test set, but performs the worst on the test-complex set. Transformer has smaller generalization gaps, which could be attributed to their multi-head attention mechanism, capturing the instruction semantics better. By leveraging the explicit structure of programs, Tree-RNN achieves the best generalization performance.
+
+# 5.4.2 ANALYSIS
+
+An analysis on the end-to-end learning models with respect to varying instruction length and complexity is shown in Figure 5, where all the instructions from test and test-complex sets are considered.
+
+Instruction length. As shown in Figure 5 (a), both Seq-LSTM and Transformer suffer from a performance drop as the instruction length increases. Seq-LSTM performs better when instructions are shorter, but suffers from generalizing to longer instructions. On the other hand, Transformer may learn on a more semantic level, which leads to similar overall performances across two types of instructions. Tree-RNN leverages the structure of programs and achieves a better performance.
+
+Instruction diversity. We define the diversity of a program based on the number of control flows it contains (i.e. number of branches). Figure 5 (b) shows a clear trend of performance drop of all the models. Transformer is more robust to diverse instructions which could be attributed to its better ability to learn the semantics. While Seq-LSTM learning from programs are consistently better across different levels of diversities, Tree-RNN demonstrates the most consistent performances.
+
+# 5.5 POLICY MODULATION
+
+We investigate if learning a multitask policy with the learned modulation mechanism is more effective. We compare against the two most commonly used methods: concatenating a state and goal in a raw space (Concat raw) or a latent space (Concat). An illustration is shown in Figure 4 (a). Since our state contains an environment map, which is encoded by a CNN and MLP, we experiment modulating convoluted feature maps (Modulation conv) or feature vectors (Modulation fc) or both (Modulation conv fc). Figure 4 (b) demonstrate that the proposed policy modulation mechanism is more sample efficient. Table 1 shows that the multitask policy learning using modulation achieves better performance on task completion.
+
+# 6 CONCLUSION
+
+We propose to utilize programs, structured in a formal language, as an expressive and precise way to specify tasks instead of commonly used natural language instructions. We introduce the problem of developing a framework that can comprehend a program as well as perceive and interact with the environment to accomplish the desired task. To address this problem, we devise a modular framework, program guided agent, which executes programs with a program interpreter by altering between querying a perception module when a branching condition is encountered and instructing a policy to fulfill subtasks. We employ a policy modulation mechanism to improve the efficiency of learning the multitask policy. The experimental results on a 2D Minecraft environment demonstrate that the proposed framework learns to reliably fulfill program instructions and generalize well to more complex instructions without additional training. We also investigate the performance of various models that learn from programs and natural language descriptions in an end-to-end fashion.
+
+# ACKNOWLEDGMENTS
+
+The authors are grateful for the fruitful discussion with Jiayuan Mao, Yuan-Hong Liao, Youngwoon Lee, Karl Pertsch, and Ayush Jain. The authors would like to thank Sriram Somasundaram for contributing to building the environment and Aleksei Petrenko for the A2C implementation.
+
+# REFERENCES
+
+Martín Abadi, Paul Barham, Jianmin Chen, Zhifeng Chen, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Geoffrey Irving, Michael Isard, et al. Tensorflow: A system for large-scale machine learning. In USEnIX Symposium on Operating Systems Design and Implementation, 2016.
+Amjad Almahairi, Sai Rajeswar, Alessandro Sordoni, Philip Bachman, and Aaron Courville. Augmented cyclegan: Learning many-to-many mappings from unpaired data. In International Conference on Machine Learning, 2018.
+Uri Alon, Omer Levy, and Eran Yahav. code2seq: Generating sequences from structured representations of code. International Conference on Learning Representations, 2019.
+David Andre and Stuart J Russell. Programmable reinforcement learning agents. In Advances in Neural Information Processing Systems, 2001.
+David Andre and Stuart J Russell. State abstraction for programmable reinforcement learning agents. In National Conference on Artificial Intelligence, 2002.
+Jacob Andreas, Dan Klein, and Sergey Levine. Modular multitask reinforcement learning with policy sketches. In International Conference on Machine Learning, 2017a.
+Jacob Andreas, Dan Klein, and Sergey Levine. Learning with latent language. In North American Chapter of the Association for Computational Linguistics, 2017b.
+Yusuf Aytar, Tobias Pfaff, David Budden, Thomas Paine, Ziyu Wang, and Nando de Freitas. Playing hard exploration games by watching youtube. In Advances in Neural Information Processing Systems. 2018.
+Pierre-Luc Bacon, Jean Harb, and Doina Precup. The option-critic architecture. In Association for the Advancement of Artificial Intelligence, 2017.
+Dzmitry Bahdanau, Felix Hill, Jan Leike, Edward Hughes, Pushmeet Kohli, and Edward Grefenstette. Learning to understand goal specifications by modelling reward. In International Conference on Learning Representations, 2019.
+Bram Bakker, Jürgen Schmidhuber, et al. Hierarchical reinforcement learning based on subgoal discovery and subpolicy specialization. In Intelligent Autonomous Systems, 2004.
+Matko Bošnjak, Tim Rocktäschel, Jason Naradowsky, and Sebastian Riedel. Programming with a differentiable forth interpreter. In International Conference on Machine Learning, 2017.
+Satchuthananthavale RK Branavan, Harr Chen, Luke S Zettlemoyer, and Regina Barzilay. Reinforcement learning for mapping instructions to actions. In Association for Computational Linguistics, 2009.
+SRK Branavan, Nate Kushner, Tao Lei, and Regina Barzilay. Learning high-level planning from text. In Association for Computational Linguistics, 2012.
+Rudy R Bunel, Matthew Hausknecht, Jacob Devlin, Rishabh Singh, and Pushmeet Kohli. Leveraging grammar and reinforcement learning for neural program synthesis. In International Conference on Learning Representations, 2018.
+Jonathon Cai, Richard Shin, and Dawn Song. Making neural programming architectures generalize via recursion. In International Conference on Learning Representations, 2017.
+Xinyun Chen, Chang Liu, and Dawn Song. Execution-guided neural program synthesis. In International Conference on Learning Representations, 2019.
+John D Co-Reyes, Abhishek Gupta, Suvansh Sanjeev, Nick Altieri, John DeNero, Pieter Abbeel, and Sergey Levine. Guiding policies with language via meta-learning. International Conference on Learning Representations, 2019.
+
+Misha Denil, Sergio Gómez Colmenarejo, Serkan Cabi, David Saxton, and Nando de Freitas. Programmable agents. arXiv preprint arXiv:1706.06383, 2017.
+Aditya Desai, Sumit Gulwani, Vineet Hingorani, Nidhi Jain, Amey Karkare, Mark Marron, Subhajit Roy, et al. Program synthesis using natural language. In International Conference on Software Engineering, 2016.
+Jacob Devlin, Rudy R Bunel, Rishabh Singh, Matthew Hausknecht, and Pushmeet Kohli. Neural program meta-induction. In Advances in Neural Information Processing Systems, 2017a.
+Jacob Devlin, Jonathan Uesato, Surya Bhupatiraju, Rishabh Singh, Abdel-rahman Mohamed, and Pushmeet Kohli. Robustfill: Neural program learning under noisy i/o. In International Conference on Machine Learning, 2017b.
+Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. In North American Chapter of the Association for Computational Linguistics, 2018.
+Prafulla Dhariwal, Christopher Hesse, Oleg Klimov, Alex Nichol, Matthias Plappert, Alec Radford, John Schulman, Szymon Sidor, Yuhuai Wu, and Peter Zhokhov. Openai baselines, 2017.
+Bhuwan Dhingra, Hanxiao Liu, Zhilin Yang, William W Cohen, and Ruslan Salakhutdinov. Gated-attention readers for text comprehension. In Association for Computational Linguistics, 2017.
+Nat Dilokthanakul, Christos Kaplanis, Nick Pawlowski, and Murray Shanahan. Feature control as intrinsic motivation for hierarchical reinforcement learning. arXiv preprint arXiv:1705.06769, 2017.
+Yan Duan, Marcin Andrychowicz, Bradly Stadie, OpenAI Jonathan Ho, Jonas Schneider, Ilya Sutskever, Pieter Abbeel, and Wojciech Zaremba. One-shot imitation learning. In Advances in Neural Information Processing Systems, 2017.
+Vincent Dumoulin, Jonathon Shlens, and Manjunath Kudlur. A learned representation for artistic style. In International Conference on Learning Representations, 2017.
+Chelsea Finn, Tianhe Yu, Tianhao Zhang, Pieter Abbeel, and Sergey Levine. One-shot visual imitation learning via meta-learning. In Conference on Robot Learning, 2017.
+Kevin Frans, Jonathan Ho, Xi Chen, Pieter Abbeel, and John Schulman. Meta learning shared hierarchies. In International Conference on Learning Representations, 2018.
+Daniel Fried, Jacob Andreas, and Dan Klein. Unified pragmatic models for generating and following instructions. In North American Chapter of the Association for Computational Linguistics, 2017.
+Daniel Fried, Ronghang Hu, Volkan Cirik, Anna Rohrbach, Jacob Andreas, Louis-Philippe Morency, Taylor Berg-Kirkpatrick, Kate Saenko, Dan Klein, and Trevor Darrell. Speaker-follower models for vision-and-language navigation. In Neural Information Processing Systems, 2018.
+Malik Ghallab, Dana Nau, and Paolo Traverso. Automated Planning: theory and practice. Elsevier.
+Alex Graves, Greg Wayne, and Ivo Danihelka. Neural tuning machines. arXiv preprint arXiv:1410.5401, 2014.
+Chi Han, Jiayuan Mao, Chuang Gan, Josh Tenenbaum, and Jiajun Wu. Visual concept-metaconcept learning. In Neural Information Processing Systems. 2019.
+Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural Computation, 1997.
+Jie Hu, Li Shen, and Gang Sun. Squeeze-and-excitation networks. In IEEE Conference on Computer Vision and Pattern Recognition, 2018.
+Minyoung Huh, Shao-Hua Sun, and Ning Zhang. Feedback adversarial learning: Spatial feedback for improving generative adversarial networks. In IEEE Conference on Computer Vision and Pattern Recognition, 2019.
+
+Michael Janner, Karthik Narasimhan, and Regina Barzilay. Representation learning for grounded spatial reasoning. Association for Computational Linguistics, 2018.
+Jermsak Jermsurawong and Nizar Habash. Predicting the structure of cooking recipes. In Empirical Methods in Natural Language Processing, 2015.
+Łukasz Kaiser and Ilya Sutskever. Neural gpus learn algorithms. In International Conference on Learning Representations, 2016.
+Russell Kaplan, Christopher Sauer, and Alexander Sosa. Beating atari with natural language guided reinforcement learning. arXiv preprint arXiv:1704.05539, 2017.
+Tero Karras, Samuli Laine, and Timo Aila. A style-based generator architecture for generative adversarial networks. In IEEE Conference on Computer Vision and Pattern Recognition, 2019.
+Chloe Kiddon, Ganesa Thandavam Ponnuraj, Luke Zettlemoyer, and Yejin Choi. Mise en place: Unsupervised interpretation of instructional recipes. In Empirical Methods in Natural Language Processing, 2015.
+George Konidaris, Leslie Pack Kaelbling, and Tomas Lozano-Perez. From skills to symbols: Learning symbolic representations for abstract high-level planning. Journal of Artificial Intelligence Research, 2018.
+Tejas D Kulkarni, Karthik Narasimhan, Ardavan Saeedi, and Josh Tenenbaum. Hierarchical deep reinforcement learning: Integrating temporal abstraction and intrinsic motivation. In Advances in Neural Information Processing Systems, 2016.
+Miguel Lázaro-Gredilla, Dianhuan Lin, J Swaroop Guntupalli, and Dileep George. Beyond imitation: Zero-shot task transfer on robots by learning concepts as cognitive programs. arXiv preprint arXiv:1812.02788, 2018.
+Yoonho Lee and Seungjin Choi. Gradient-based meta-learning with learned layerwise metric and subspace. In International Conference on Machine Learning, 2018.
+Youngwoon Lee, Shao-Hua Sun, Sriram Somasundaram, Edward Hu, and Joseph J. Lim. Composing complex skills by learning transition policies. In International Conference on Learning Representations, 2019.
+Yuan-Hong Liao, Xavier Puig, Marko Boben, Antonio Torralba, and Sanja Fidler. Synthesizing environment-aware activities via activity sketches. In IEEE Conference on Computer Vision and Pattern Recognition, 2019.
+Xi Victoria Lin, Chenglong Wang, Luke Zettlemoyer, and Michael D Ernst. Nl2bash: A corpus and semantic parser for natural language interface to the linux operating system. In International Conference on Language Resources and Evaluation, 2018.
+Yunchao Liu, Jiajun Wu, Zheng Wu, Daniel Ritchie, William T. Freeman, and Joshua B. Tenenbaum. Learning to describe scenes with programs. In International Conference on Learning Representations, 2019.
+Jonathan Malmaud, Earl Wagner, Nancy Chang, and Kevin Murphy. Cooking with semantics. In Workshop on Semantic Parsing at Association for Computational Linguistics, 2014.
+Jiayuan Mao, Honghua Dong, and Joseph J. Lim. Universal agent for disentangling environments and tasks. In International Conference on Learning Representations, 2018.
+Jiayuan Mao, Chuang Gan, Pushmeet Kohli, Joshua B Tenenbaum, and Jiajun Wu. The neurosymbolic concept learner: Interpreting scenes, words, and sentences from natural supervision. In International Conference on Learning Representations, 2019.
+Dipendra Misra, John Langford, and Yoav Artzi. Mapping instructions and visual observations to actions with reinforcement learning. In Empirical Methods in Natural Language Processing, 2017.
+
+Dipendra Misra, Andrew Bennett, Valts Blukis, Eyvind Niklasson, Max Shatkhin, and Yoav Artzi. Mapping instructions to actions in 3d environments with visual goal prediction. In Empirical Methods in Natural Language Processing, 2018.
+Volodymyr Mnih, Adria Puigdomenech Badia, Mehdi Mirza, Alex Graves, Timothy Lillicrap, Tim Harley, David Silver, and Koray Kavukcuoglu. Asynchronous methods for deep reinforcement learning. In International Conference on Machine Learning, 2016.
+Katharina Mulling, Jens Kober, Oliver Kroemer, and Jan Peters. Learning to select and generalize striking movements in robot table tennis. International Journal of Robotics Research, 2013.
+Ofir Nachum, Shixiang Shane Gu, Honglak Lee, and Sergey Levine. Data-efficient hierarchical reinforcement learning. In Neural Information Processing Systems, 2018.
+Arvind Neelakantan, Quoc V Le, and Ilya Sutskever. Neural programmer: Inducing latent programs with gradient descent. In International Conference on Learning Representations, 2015.
+Junhyuk Oh, Satinder Singh, Honglak Lee, and Pushmeet Kohli. Zero-shot task generalization with multi-task deep reinforcement learning. In International Conference on Machine Learning, 2017.
+Boris N. Oreshkin, Pau Rodriguez, and Alexandre Lacoste. Tadam: Task dependent adaptive metric for improved few-shot learning. In Neural Information Processing Systems, 2018.
+Emilio Parisotto, Abdel-rahman Mohamed, Rishabh Singh, Lihong Li, Dengyong Zhou, and Pushmeet Kohli. Neuro-symbolic program synthesis. In International Conference on Learning Representations, 2017.
+Taesung Park, Ming-Yu Liu, Ting-Chun Wang, and Jun-Yan Zhu. Semantic image synthesis with spatially-adaptive normalization. In IEEE Conference on Computer Vision and Pattern Recognition, 2019.
+Ronald Parr and Stuart J Russell. Reinforcement learning with hierarchies of machines. In Advances in Neural Information Processing Systems, 1998.
+Deepak Pathak, Parsa Mahmoudieh, Guanghao Luo, Pulkit Agrawal, Dian Chen, Yide Shentu, Evan Shelhamer, Jitendra Malik, Alexei A Efros, and Trevor Darrell. Zero-shot visual imitation. In International Conference on Learning Representations, 2018.
+Jeffrey Pennington, Richard Socher, and Christopher D. Manning. Glove: Global vectors for word representation. In Empirical Methods in Natural Language Processing, 2014.
+Ethan Perez, Harm De Vries, Florian Strub, Vincent Dumoulin, and Aaron Courville. Learning visual reasoning without strong priors. 2017.
+Ethan Perez, Florian Strub, Harm de Vries, Vincent Dumoulin, and Aaron Courville. FiLM: Visual Reasoning with a General Conditioning Layer. In Association for the Advancement of Artificial Intelligence, 2018.
+Mohammad Raza, Sumit Gulwani, and Natasha Milic-Frayling. *Compositional program synthesis from natural language and examples*. In *International Joint Conference on Artificial Intelligence*, 2015.
+Scott Reed and Nando De Freitas. Neural programmer-interpreters. In International Conference on Learning Representations, 2016.
+Nobuyuki Shimizu and Andrew Haas. Learning to follow navigational route instructions. In International Joint Conference on Artificial Intelligence, 2009.
+Richard Shin, Illia Polosukhin, and Dawn Song. Improving neural program synthesis with inferred execution traces. In Neural Information Processing Systems. 2018.
+Sungryull Sohn, Junhyuk Oh, and Honglak Lee. Hierarchical reinforcement learning for zero-shot generalization with subtask dependencies. In Advances in Neural Information Processing Systems, 2018.
+
+Bradly C. Stadie, Pieter Abbeel, and Ilya Sutskever. Third person imitation learning. In International Conference on Learning Representations, 2017.
+Shao-Hua Sun, Hyeonwoo Noh, Sriram Somasundaram, and Joseph Lim. Neural program synthesis from diverse demonstration videos. In International Conference on Machine Learning, 2018.
+Kai Sheng Tai, Richard Socher, and Christopher D Manning. Improved semantic representations from tree-structured long short-term memory networks. Association for Computational Linguistics, 2015.
+Stefanie Tellex, Thomas Kollar, Steven Dickerson, Matthew R Walter, Ashis Gopal Banerjee, Seth J Teller, and Nicholas Roy. Understanding natural language commands for robotic navigation and mobile manipulation. In Association for the Advancement of Artificial Intelligence, 2011.
+Richard Socher Tianmin Shu, Caiming Xiong. Hierarchical and interpretable skill acquisition in multi-task reinforcement learning. International Conference on Learning Representations, 2018.
+Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in Neural Information Processing Systems, 2017.
+Alexander Sasha Vezhnevets, Simon Osindero, Tom Schaul, Nicolas Heess, Max Jaderberg, David Silver, and Koray Kavukcuoglu. Feudal networks for hierarchical reinforcement learning. arXiv preprint arXiv:1703.01161, 2017.
+Adam Vogel and Daniel Jurafsky. Learning to follow navigational directions. In Association for Computational Linguistics, 2010.
+Risto Vuorio, Shao-Hua Sun, Hexiang Hu, and Joseph J. Lim. Toward multimodal model-agnostic meta-learning. In Meta-Learning Workshop at Neural Information Processing Systems, 2018.
+Risto Vuorio, Shao-Hua Sun, Hexiang Hu, and Joseph J Lim. Multimodal model-agnostic meta-learning via task-aware modulation. In Neural Information Processing Systems, 2019.
+Sida I Wang, Samuel Ginn, Percy Liang, and Christopher D Manning. Naturalizing a programming language via interactive learning. In Association for Computational Linguistics, 2017a.
+Ziyu Wang, Josh S Merel, Scott E Reed, Nando de Freitas, Gregory Wayne, and Nicolas Heess. Robust imitation of diverse behaviors. In Advances in Neural Information Processing Systems, 2017b.
+Da Xiao, Jo-Yu Liao, and Xingyuan Yuan. Improving the universality and learnability of neural programmer-interpreters with combinator abstraction. In International Conference on Learning Representations, 2018.
+Saining Xie, Sainan Liu, Zeyu Chen, and Zhuowen Tu. Attentional shapecontextnet for point cloud recognition. In IEEE Conference on Computer Vision and Pattern Recognition, 2018.
+Danfei Xu, Suraj Nair, Yuke Zhu, Julian Gao, Animesh Garg, Li Fei-Fei, and Silvio Savarese. Neural task programming: Learning to generalize across hierarchical tasks. In International Conference on Robotics and Automation, 2018.
+Pengcheng Yin and Graham Neubig. Tranx: A transition-based neural abstract syntax parser for semantic parsing and code generation. In Empirical Methods in Natural Language Processing, 2018.
+Tao Yu, Rui Zhang, Kai Yang, Michihiro Yasunaga, Dongxu Wang, Zifan Li, James Ma, Irene Li, Qingning Yao, Shanelle Roman, et al. Spider: A large-scale human-labeled dataset for complex and cross-domain semantic parsing and text-to-sql task. In Empirical Methods in Natural Language Processing, 2018a.
+Tianhe Yu, Chelsea Finn, Annie Xie, Sudeep Dasari, Tianhao Zhang, Pieter Abbeel, and Sergey Levine. One-shot imitation from observing humans via domain-adaptive meta-learning. In Robotics: Science and Systems, 2018b.
+
+# A PROGRAM EXECUTION
+
+We describe our program interpreter in Section 4.1 and provide more details in this section. The program instruction considered in this work contains the following three components: (1) subtasks, (2) perceptions, and (3) control flows. Accordingly, our Program Interpreter is designed to consist of (1) a parser to parse each line of the program following the grammar defined by our DSL in figure 2, and (2) a program executor which executes the program conditioning on the parsed contents. The interpreter transforms the program into a tree-like object by exploiting its structure (i.e. scopes) and then utilizes the parsed contents to traverse it to execute the program.
+
+A program tree is built by representing each line of a program as a tree node. Each tree node is a data structure containing members: (1) node.line, the original line in the program, (2) node.isLeaf(), if the current node is a leaf node (i.e. subtask), and (3) node.children, all the subroutines of the current node (i.e. the processes under the scope of the current line of program). The interpreter will parse according to the original line contained in the node, and decide whether to call the policy if it is a leaf node (subtask) or produce a query to call the perception module, deciding which child node (subroutine) to go into.
+
+The subroutines of a node should correspond to proper scoping of the program. For example, in Figure 1 in the main paper, the line if is_there[River] has subroutines mine(Wood), build_bridge(), if agent[Iron]<3, and place(Iron,1,1), but not mine(Iron), which should be if agent[Iron]<3's subroutine.
+
+Once the program tree is built, the program executor will perform a pre-order traversal to initiate the execution. Algorithm 1 summarizes the details of the program execution utilizing the transformed program tree.
+
+Algorithm 1 Program Execution
+Require: $P$ : program to be executed
+Require: $s$ : environmental state
+Require: $\pi$ : agent policy parameterized by $\theta ,\Phi$ : perception module
+Require: node: has member node.line as the original program line and children nodes node(children
+1: procedure EXECUTE(node)
+2: if node.isLeaf() then
+3: subtask $=$ parse_subtask(node.line)
+4: $\pi (\mathrm{subtask},\theta)$ Calls the agent policy to execute the subtask
+5: else
+6: control_flow, perception_query $=$ parse_ctrl_percept(node.line)
+7: $h = \Phi$ (perception_query, s) Calls the perception module with a query and state
+8: control_flow h e.g.if, while, loop, calls the subroutines depending on h
+9: for child in node.children do
+10: EXECUTE(child)
+11: end for
+12: end if
+13: end procedure
+
+# B DSL DESIGN PRINCIPLE
+
+Since different domains require different DSLs, we aim to design our DSL by following a design principle that would potentially allow us to easily adapt our DSL to different domain. Specifically, we develop a DSL design principle that considers a general setting where an agent can perceive and interact with the environment to fulfill some tasks. Accordingly, our DSL consists of control flows, perceptions, and actions. While control flows are domain independent, perceptions and actions can be designed based on the domain of interest, which would require certain expertise and domain knowledge. We aim to design our DSL that is (1) intuitive: the actions and perceptions are intuitively align with human common sense, (2) modular: actions are reasonably distinct and can be used to compose more complex behaviors, and (3) hierarchical: a proper level of abstraction that enables describing long-horizon tasks.
+
+# C EXTENDED RELATED WORK
+
+We present an extended discussion of the related work in this section.
+
+Multitask reinforcement learning. To achieve multi-task reinforcement learning, previous works devised hierarchical approaches where an RL agent is trained to achieve a series of subtasks to accomplish the task. In Andreas et al. (2017a), a sequence of policy sketches is predefined to guide an agent towards the desired goal by leveraging modularized neural network policies. Oh et al. (2017) propose to learn a controller to predict to either proceed, revert, or stay at a current subgoal, which is sampled from a list of simple symbolic instructions. In this paper, hierarchical tasks are described by programs with increased diversity through branching conditions, and therefore our framework is required to determine which branches in a program should be executed. On the other hand, the framework proposed by Sohn et al. (2018) requires a subtask graph describing a set of subtasks and their dependencies and aims to find the optimal subtask to execute. This is different from our problem formulation where the agent is asked to follow a given program/procedure.
+
+Hierarchical reinforcement learning. Our work is also closely related to hierarchical reinforcement learning, where a meta-controller learns to predict which sub-policy to take at each time step (Kulkarni et al., 2016; Bacon et al., 2017; Dilokthanakul et al., 2017; Frans et al., 2018; Vezhnevets et al., 2017; Lee et al., 2019; Bakker et al., 2004; Nachum et al., 2018; Mao et al., 2018). Previous works also investigated in explicitly specifying sub-policy with symbolic representations for meta-controller to utilize, or an explicit selection process of lower-level motor skills (Mülling et al., 2013; Tianmin Shu, 2018).
+
+Programmable agents. We would like to emphasize that our work differs from programmable agents (Denil et al., 2017) in motivation, problem formulations, proposed methods, and contributions. First, Denil et al. (2017) concern declarative programs which specify what to be computed (e.g. a target object in a reaching task). However, the programs considered in our work are imperative, which how this is to be computed (i.e. a procedure). Also, Denil et al. (2017) consider only one-liner programs that contain only AND, OR, and object attributes. On the other hand, we consider programs that are much longer and describe more complex procedures. While Denil et al. (2017) aim to generalize to novel combinations of object attributes, our work is mainly interested in generalizing to more complex tasks (i.e. programs) by leveraging the structure of programs.
+
+Programs vs. natural language instructions. In this work, we advocate utilizing programs as a task representation and propose a modular framework that can leverage the structure of programs to address this problem. Yet, natural language instructions enjoy better accessibility and are more intuitive to users who do not have experience in programming languages. While addressing the accessibility of programs or converting a natural language instruction to a more structural form is beyond the scope of this work, we look forward to future research that leverages the strengths of both programs and natural language instructions by bridging the gap between these two representations, such as synthesizing programs from natural language (Lin et al., 2018; Desai et al., 2016; Raza et al., 2015), semantic parsing that bridges unstructured languages and structural formal languages (Yu et al., 2018a; Yin & Neubig, 2018), and naturalizing program (Wang et al., 2017a).
+
+# D DISCUSSIONS ON LEARNED MODULATION MECHANISMS
+
+To fuse the information from an input domain (e.g. an image) with another condition domain (e.g. a language query, image such as segmentation map, noise, etc.), a wide range of works have demonstrated the effectiveness of predicting affine transforms based on the condition to scale and bias the input in visual question answering (Perez et al., 2018; 2017), image synthesis (Almahairi et al., 2018; Karras et al., 2019; Park et al., 2019; Huh et al., 2019), style transfer (Dumoulin et al., 2017), recognition (Hu et al., 2018; Xie et al., 2018), reading comprehension (Dhingra et al., 2017), few-shot learning (Oreshkin et al., 2018; Lee & Choi, 2018), etc. Many of those works present an extensive ablation study to compare the learned modulation against traditional ways to merge the information from the input and condition domains.
+
+Recently, a few works have employed a similar learned modulation technique to reinforcement learning frameworks on learning to follow language instruction (Bahdanau et al., 2019) and meta-reinforcement learning (Vuorio et al., 2018; 2019). However, there has not been a comprehensive
+
+ablation study that suggests fusing the information from the input domain (e.g. a state) and the condition domain (e.g. a goal or a task embedding) for the reinforcement learning setting. In this work, we conduct an ablation study in our 2D Minecraft environment where an agent is required to fulfill a navigational task specified by a program and show the effectiveness of learning to modulate input features with symbolically represented goal as well as present a number of modulation variations (i.e. modulating the fully-connected layers or the convolutional layers or both). We look forward to future research that verifies if this learned modulation mechanism is effective in dealing with more complex domains such as robot manipulation or locomotion.
+
+# E ADDITIONAL EXPERIMENTAL DETAILS
+
+# E.1 ENVIRONMENT DETAILS
+
+In the following paragraphs, we provide some details of the environment used in this work.
+
+Objects in the environment. The major environmental resources that the agent can interact with are: wood, gold, and iron. There is a certain probability that the environment will contain a river, which the agent cannot go across unless a bridge is built (or pre-built). The environment is surrounded by brick walls, which draws the boundaries of the world.
+
+Agent action space. The agent's actions are (1) crafting actions: including mining (collecting resources), placing, building a bridge, and selling an item; and (2) motor actions: including moving to four directions (up, down, left, right). The crafting actions are only allowed on the current grid cell the agent is standing on, e.g. the subtask mine (gold) requires the agent to navigate to a specific location containing a gold with motor actions, and then perform the crafting action mine at the current location. To build a bridge, the agent should consume one of the wood it possesses. To sell an item, the agent needs to travel to a merchant. With certain probabilities, there can be 2 to 4 merchants at different locations.
+
+Initialization. During training, when each training program is sampled, a valid environment will be randomly initialized, where validity refers to the property that the agent will be able to successfully follow the program with sufficiently provided environmental resources. At test time, we pre-sample 20 valid initialization of the environment with 20 different random seeds to ensure the validity of the two test sets.
+
+Agent observation space (state representations). The state used in our reinforcement learning policy consists of an environment map $s_{\mathrm{map}}$ and an inventory status of the agent $s_{\mathrm{inv}}$ . $s_{\mathrm{map}}$ is of size $10 \times 10 \times 9$ , where each channel-wise slice of size $10 \times 10 \times 1$ represents the binary existence of certain objects at a specific location, e.g. if (3,4,2) is 1, it means there is a gold at location (3,4) (environment objects in channel dimension are zero-indexed). The objects represented by the channels are ordered as follows: wood, iron, gold, agent, wall, goal (2-D representation of intended goal coordinates), river, bridge, and merchant. The agent inventory status $s_{\mathrm{inv}}$ is augmented with the agent location, resulting in a 1-d integer vector of size 5. The ordered entry of such vector is as follows: agent's wood counts, agent's iron counts, agent's gold counts, agent's location coordinate x, and then y.
+
+Goal representations. For our proposed framework, we represent the goal of the subtask as an 1-D vector of size 10, produced by the program interpreter. The first five entries of the goal vector is a one-hot representation of the subtask: goto, place, mine, sell, build_bridge. The 6th to 8th entries are one-hot representation of the resources: wood, iron, and gold. The last two entries are the intended goal locations. For example, place (iron, 3, 5) will be represented as $[0, 1, 0, 0, 0, 0, 1, 0, 3, 5]$ . For end-to-end learning models, such goal representation is produced by the input encoder as a continuous latent vector representation.
+
+Exemplar environment maps. We show several exemplary rendered environment maps in Figure 6. As can be seen, the essential resources such as wood, gold, iron are represented as block objects, where the merchant is depicted by an alpaca. The agent is shown as a female human character. River grids, with bridge blocks built on it is shown as the blue grid cells, where the bridge which should be transformed by wood is of wooden texture. The Boundaries can be seen in the surroundings represented as brick wall grids.
+
+
+(a)
+
+
+(b)
+Figure 6: Exemplar rendered environment map. The agent, objects, and stuff are represented as blocks with their corresponding textures. Specifically, the agent is represented as a female character. gold is represented as a golden block, wood is shown as a tree, and iron is represented as a sliver block. River is shown as a blue grid with water texture while bridge is presented as wooden grid. merchant is shown as an alpaca, which is supposed to transport the sold objects. Notice that there are 2 merchants in (a) and (b), while (c) and (d) contains 3 and 4 of them, respectively. The boundaries of the map are shown as brick walls.
+
+
+(c)
+
+
+(d)
+
+# E.2 GROUND TRUTH PERCEPTIONS FOR END-TO-END LEARNING BASELINES
+
+Since we train our perception module using ground truth information, we provide the ground truth perception information to all our baselines yet failed to elaborate this in the original paper. Specifically, at every time step, we feed the ground truth perception (i.e. the answer to the queries such as env[Gold] $>0$ and is_there[River]) to the baseline models. The ground truth perception is represented as a vector that has a dimension of the number of all possible queries, and each element corresponds to a binary answer to a query. Therefore, the baseline models can learn to utilize this ground truth information to infer the desired subtasks. During testing time, the baseline models can still access to all this ground truth perception information, even though it is usually not possible in practice. On the contrary, during testing time, our perception module predicts the answer to given queries and the performance of the whole framework depends on the predicted answers.
+
+# E.3 TASK INSTRUCTIONS DETAILS
+
+**Programs.** We generate the program sets by sampling program tokens with normal distributions, and constructing them according to the DSL grammar we define. The training set is composed of on average 32 tokens and 4.6 lines; the more complex test set, i.e. test-complex, contains on average 65 tokens and 9.8 lines. We include the plotted statistics of various essential properties for the three datasets in Figure 11, Figure 12, and Figure 13, respectively. Note that the maximum indent of a program is the maximum depth of its scope or the height of its transformed program tree. The number of recurring procedures includes both while and loop.
+
+Natural language instructions. For each of the three program sets, we chunked them into several subsets of programs and assign them to annotators for their corresponding natural language translations. The annotators were instructed to read the provided DSL to understand the details of program syntax as well as some exemplary translations before they are allowed to start the task. The annotators were encouraged to give diverse and colloquial translations to avoid constantly giving dull line-by-line translations. The collected (translated) natural language instructions were then cleansed with spell checks and grammatical errors fixes. On average, the annotators used 27, 28, and 61 words to describe the instructions for the train, test, and test-complex sets respectively. The total vocabulary size of the natural language instructions is of 448.
+
+Qualitative results on natural language analysis. We show several example data points from our testing sets in Figure 10. The leftmost column displays natural language instructions, the middle column shows our sampled ground truth programs, while the rightmost column illustrates how language can be ambiguous and lead to possible alternative interpreted programs.
+
+# E.4 NETWORK ARCHITECTURES
+
+The proposed framework and the end-to-end learning baselines are implemented in TensorFlow (Abadi et al., 2016).
+
+# E.4.1 OUR FRAMEWORK
+
+Perception module. The perception module takes a query $q$ and a state $s$ as input and outputs a response $h$ . A query has a size of $6 \times 186$ , since the longest query has a length of 6 and 186 is the dimension of one-hot program tokens. Shorter queries are zero-padded to this size.
+
+The state map $s_{\mathrm{map}}$ is encoded by a CNN with four layers with channel size of 32, 64, 96, and 128. Each convolutional layer has kernel size 3 and stride 2 and is followed by ReLU nonlinearity. The final feature map is flattened to a feature vector, denoted as $f_{m}$ .
+
+The state inventory $s_{\mathrm{inv}}$ is encoded by a two-layer MLP with a channel size of 32 for both layers. Each fully-connected layer is followed by ReLU nonlinearity. The resulting feature vector is denoted as $f_{i}$ .
+
+Each token in the query is first encoded by a two-layer MLP with a channel size of 32 for both layers. Each fully-connected layer is followed by ReLU nonlinearity. Then, all the query token features are concatenated along the feature dimension to a single vector. This vector is then encoded by another two-layer MLP with a channel size of 32 for both layers. Each fully-connected layer is followed by ReLU nonlinearity. The resulting feature vector is denoted as $f_{q}$ .
+
+All encoded features $(f_{m}, f_{i},$ and $f_{q})$ are then concatenated along the feature dimensions to a single vector. This vector is processed by a three-layer MLP with a channel size of 128, 64, and 32. Each fully-connected layer is followed by ReLU nonlinearity. Finally, a linear fully-connected layer produces an output with a size of 1, which should have a higher value if the response of the query is true and lower otherwise.
+
+Policy. The policy takes a goal $g$ and a state $s$ as input and outputs an action distribution $a$ , where the state is encoded by two types of modules: (1) a four-layer CNN encoder to encode the state map $s_{\mathrm{map}}$ , and (2) a two-layer MLP to encode the agent inventory status $s_{\mathrm{inv}}$ .
+
+The goal $g$ is encoded by a two-layer MLP with a channel size of 64 for both layers. Each fully-connected layer is followed by ReLU nonlinearity. The resulting feature vector is denoted as $f_{g}$ . Given the encoded goal vector, we employ four linear fully-connected layers to predict modulation parameters $\{\gamma_{i},\beta_{i}\}_{1,\dots ,4}$ for the state CNN encoder, where $\gamma_{1}$ and $\beta_{1}$ have size 32, $\gamma_{2}$ and $\beta_{2}$ have size 64, $\gamma_{3}$ and $\beta_{3}$ have size 96, and $\gamma_{4}$ and $\beta_{4}$ have size 128. Note that these modulation parameters are predicted for modulating convolutional features (i.e. modulation conv). For modulation fc, a linear fully-connected layer is used to produce $\gamma^{fc}$ and $\beta^{fc}$ with size 64.
+
+A state map $s_{\mathrm{map}}$ is encoded by four-layer CNN with channel size of 32, 64, 96, and 128. Each convolutional layer has kernel size 3, strides 2, and is followed by ReLU nonlinearity. After each convolutional layer, the produced feature maps $e$ are modulated to $\gamma \cdot e + \beta$ , where $\gamma$ and $\beta$ are broadcast along spatial dimensions. The final feature map is flattened to a feature vector and denoted as $f_m^\pi$ .
+
+A state inventory $s_{\mathrm{inv}}$ is encoded by a two-layer MLP with channel size of 64 for both layers. Each fully-connected layer is followed by ReLU nonlinearity. The resulting feature vector is denoted as $f_i^\pi$ .
+
+The two encoded features $(f_m^\pi$ and $f_i^\pi)$ are then concatenated along the feature dimension. Two fully-connected layers are used to process the feature with a channel size of 64 for both layers. Each layer is followed by ReLU nonlinearity. The final encoded feature $u$ is then modulated to $\gamma^{fc} \cdot u + \beta^{fc}$ if modulation $fc$ is used.
+
+Finally, the modulated features $\hat{u}$ are used to produce an action distribution $a$ and a predicted value $V$ using two separated MLPs. Each MLP has two fully-connected layers with a channel size of 64 for both layers. A linear layer then outputs a vector with a size of 8 (the number of low-level actions). Another linear layer outputs a vector with a size of 1 as the predicted value.
+
+# E.4.2 END-TO-END LEARNING MODELS
+
+In addition to the input encoder, the end-to-end learning models can utilize a mechanism to remember what subtasks from the instructions have been accomplished. The agent can then explicitly memorize where it stands in the instruction while completing the task. We augment such memorization mechanism utilizing the memory of another LSTM network, taking as inputs the encoded states
+
+throughout the execution trajectory. After agent taking each action, the last hidden state encoding the trajectory up to the current step is used to compute attention scores to pool the outputs of the input encoders. For Tree-RNN encoder, we simply concatenate the hidden representation from memorization LSTM with the root representation of Tree-RNN before feeding them to subsequent layers. The agent policy network then learns to perform task conditioning on this attention-pooled latent instruction vector.
+
+We provide details of our various end-to-end learning models in Table 2. Program token embedding is jointly trained with learning the whole module, while GloVe Pennington et al. (2014) (50-D version) is used for word embedding when instructions are natural languages.
+
+| Model | Parameters | Details |
| Seq-LSTM | 0.62M | LSTM size of 128, both program and word embeddings are of dimension 50. Attention LSTM size of 128. Attention weights of size [256 × 128], with bias of size [128]. Word embeddings utilize pre-trained GloVe. |
| Tree-RNN | 0.51M | Program embeddings are of dimension 128. Attention LSTM size of 128. Composition module (to aggregate all the children representation of a node) is of size [128 × 128], and output projection weights of size [128 × 128], with bias of size [128]. The program embeddings are average pooled across the same program line, so that each line will be mapped to a fixed dimension representation. The composition layer is applied when combining pooled embedding from all the children of a node. |
| Transformer | 2.63M | Number of hidden layers: 2, with 8 attention heads, and intermediate size of 256. Hidden size is 128. No dropout is applied. |
+
+Table 2: Architectural details for end-to-end learning models
+
+# E.5 RAW RGB INPUT
+
+To verify if our framework can be extended to using high-dimensional raw state inputs (i.e. RGB image) as inputs where a hand-crafted policy or perception module might not be easy to obtain, we performed an additional experiment where the perception module and the policy are trained on raw RGB inputs instead of the symbolic state representation. The results suggest that our framework can utilize RGB inputs while maintaining similar performance (93.2% on the test set) and generalization ability (91.4% on the test-complex set).
+
+# E.6 FAILURE ANALYSIS
+
+To gain a better understanding of how our proposed framework and the end-to-end learning models work or fail, we conduct detailed failure analysis on the execution traces of our model. The analysis is organized as follows:
+
+- We first present an analysis of our framework on the subtasks that appear to be the first failed subtask, which immediately leads to failing the whole task. This analysis sheds some light on which subtasks most commonly cause the failure of task execution. (Section E.6.1)
+- We show an analysis of how many time steps each successfully executed subtask takes on average for our framework, through which we explain which subtasks we find to be harder than others. (Section E.6.2)
+- We show additional visualizations on the completion rates of different end-to-end learning models plotted with metrics not shown in the main paper, where we aim to deliver a more complete view of how these models perform. (Section E.6.3)
+
+# E.6.1 FIRST FAILURE RATE OF SUBTASKS
+
+As the first step of failure analysis, we want to get an idea of which subtasks cause the failure of the model in executions more often. To make this possible, we define "first failed subtask" as the first subtask that ends as a failure in an unsuccessful execution of a program. Based on this definition, we
+
+
+Figure 7: First failure rate of subtasks. Every colored grid shows the first failure rate of each subtask. From top-left to bottom-right, each block of grids show the results for subtask category goto, place, build_bridge, mine, and sell. Warmer colors indicate higher first failure rate; while colder colors indicate lower first failure rate. White grids indicate subtasks that either never occurs as first failed task in any execution or do not exist in the executions that lead to this figure.
+
+
+Figure 8: Average time cost of subtasks. The setup of this plot is similar to that of Figure 7. Warmer colors indicate higher average subtask time cost; while colder colors indicate lower average subtask time cost. White grids indicate subtasks that do not exist in the executions that lead to this figure.
+
+further define "first failure rate" as the percentage that an occurrence of a specific subtask turns out to be the first failed subtask of the execution that includes it.
+
+We collect the first failure rate of all subtasks for the result we obtain from running our full model over the more complex test set, i.e. test-complex. The results are plotted in a visually interpretable format in Figure 7. As seen in the figure, subtasks in goto and place categories are more likely to be the first failed subtask than subtasks in build_bridge, mine, and sell categories. Within the goto and place subtask categories, subtasks requiring the agent to navigate to grid cells nearby the border of the world has a higher first failure rate than ones nearby the center of the world. This shows that these tasks mentioned above are more prone to failure than other subtasks.
+
+# E.6.2 AVERAGE TIME COST OF SUBTASKS
+
+Continuing from the previous analysis, we show the average time cost of all successful subtask executions in Figure 8. As can be seen in the figure, subtasks in build_bridge, mine, and sell categories take relatively smaller number of time steps to complete. In goto and place categories, the closer to border the subtask requires the agent to reach, the more time consuming it gets for the agent to complete the subtask. This corresponds to the finding in the analysis of first failure rates that subtasks with destinations close to the border are more likely to fail. In other words, the closer to border the agent has to reach, the more likely it is to fail the subtask.
+
+# E.6.3 ADDITIONAL ANALYSIS ON END-TO-END LEARNING MODELS COMPLETION RATES
+
+To conclude failure analysis, we focus on the variation of completion rates of program executions with respect to different conditioning variables. As shown in Figure 9, plots showing the trends of completion rates while evaluating with different independent variables show that execution failure is
+
+
+Figure 9: Additional analysis on completion rates. The results of executing program instructions on both datasets are used to produce the six plots above. In each plot, each color corresponds to a different model that we propose. For the two rightmost plots, there is a very small number of outliers that extends out of the right boundary of the plot that we omit for visual interpretability reasons. Please note that the use of colors in this figure is not the same as that in Figure 5 of the main paper.
+
+more common in cases when the program consists of larger number of lines, more loops and while statements, and larger number of subtasks. Note that this subtask count is only a summation of the occurrence counts of each subtask in a program, which does not accurately reflect the number of executions each subtask is being invoked (i.e. it does not reflect the repetitive counts when there is a loop).
+
+Meanwhile, the effect of the number of if and else statements and the maximum indent values of programs on completion rates seem to vary across different models. For Seq-LSTM model, having a larger number of if and else statements or having a larger max indent value results in more failures; while for Transformer and Tree-RNN models, having larger values above results instead in fewer failures. This is probably since Transformer and Tree-RNN models are designed in a way that deals with hierarchical structures with jumps in instruction executions better (this point is also mentioned in the main paper). Despite this difference in effects, the overall change in performance when the number of if and else statements and the maximum indent value change is much less significant than that in the previous case.
+
+During our analysis, we also designed an algorithm to calculate an estimate to the number of branches a program has. Here, the number of branches is defined by the number of distinct sets of lines that a program can be executed. For a program without control flows (no if, else-if, else, loop, and while statements), the number of branches is always 1. For if, else-if, and else statements, the exact number of branches these statements incur can be calculated easily. In cases of the loop and while statements, we treat loops as being executed only once and while statements as if statements when we calculate the number of branches. The result shown in the analysis does not reveal a clear trend. We attribute this result to two possibilities – either the metric we create is not accurate enough, or it is not a very suitable metric to be inspected.
+
+# E.7 HYPERPARAMETERS
+
+We use the following hyperparameters to train A2C agents for our model and all the end-to-end learning models: learning rate: $1 \times 10^{-3}$ , number of environment: 64, number of workers: 64, and number of update roll-out steps: 5.
+
+# E.8 COMPUTATIONAL RESOURCES
+
+We train all our models on a single Nvidia Titan-X GPU, in a 40 core Ubuntu 16.04 Linux server.
+
+| # | Language Instructions | Ground Truth Program | Alternative Interpretation |
| (a) | If there is a river, build a bridge. Repeat the followings 3 times: mine a gold, and if environment has no more than 8 gold, mine iron, and then sell an iron. | def run():
+if is_there[River]:
+build_bridge()
+loop(3):
+mine(Gold)
+if env[Gold] <= 8:
+mine(Gold)
+sell(Iron) | def run():
+if is_there[River]:
+build_bridge()
+loop(3):
+mine(Gold)
+if env[Gold] <= 8:
+mine(Gold)
+sell(Iron) |
| (b) | Place an iron on (7,2) and repeat 4 times, if agent has no more than 9 iron then sell a gold. | def run():
+place(Iron, 7, 2)
+loop(4):
+if agent[Iron] <= 9:
+sell(Gold) | def run():
+loop(5):
+place(Iron, 7, 2)
+if agent[Iron] <= 9:
+sell(Gold) |
| (c) | Mine wood first. If agent has more than 3 iron, mine wood. If there is gold in the environment, place iron at (3,7). | def run():
+mine(Wood)
+if agent[Iron] >= 4:
+mine(Wood)
+if is_there[Gold]:
+place(Iron, 3, 7) | def run():
+mine(Wood)
+if agent[Iron] >= 4:
+mine(Wood)
+if is_there[Gold]:
+place(Iron, 3, 7) |
+
+
+Figure 10: Exemplar data and languages ambiguity. The goal of the examples above is to show that natural language instructions while being flexible enough to capture the high-level semantics of the task, can be ambiguous in different ways and thus might lead to impaired performance. In example (a), the modifier "repeat the following 3 times" has an unclear scope, resulting in two possible interpretations shown in program format on the right side; in example (b), "repeat 4 times" can be used to modify either the previous part of the description or the latter part of it, resulting in ambiguity; in example (c), the last sentence starting with "If" has unclear scope. In all of the above cases, a model that learns to execute instructions presented in natural language format might fail to execute the instructions successfully because of the ambiguity of the language instructions.
+
+
+
+
+
+
+Figure 11: Program set statistics for training set (train).
+
+
+
+
+
+
+
+
+Figure 12: Program set statistics for same complexity testing set (test).
+
+
+
+
+
+
+
+
+
+
+
+
+Figure 13: Program set statistics for more complex testing set (test-complex).
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/programguidedagent/images.zip b/programguidedagent/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..2d2f50c196c36f1b2023d3a0f1fe75ce6738978c
--- /dev/null
+++ b/programguidedagent/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:93aa57a9cefe023bbcac8907a74519c37180ee7825fd6d201c0c58572ccafd4b
+size 743491
diff --git a/programguidedagent/layout.json b/programguidedagent/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..a1f6d8d97d49fa0c58e1ec580ffb64930b32839b
--- /dev/null
+++ b/programguidedagent/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:482902a134b66611cf593952b60a5affbbd9258d0d529660e6290d11b7656043
+size 674449
diff --git a/progressivelearninganddisentanglementofhierarchicalrepresentations/ebdac50e-7edc-4a6d-9afe-8914a88e43a3_content_list.json b/progressivelearninganddisentanglementofhierarchicalrepresentations/ebdac50e-7edc-4a6d-9afe-8914a88e43a3_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..cf1534a98b2e16547343ca68e9e024ab9a8dc2fe
--- /dev/null
+++ b/progressivelearninganddisentanglementofhierarchicalrepresentations/ebdac50e-7edc-4a6d-9afe-8914a88e43a3_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:464bfbbfc60822a7111ea23ee35da9a2a2c15ad2338b0805dadd8e9418016b88
+size 77114
diff --git a/progressivelearninganddisentanglementofhierarchicalrepresentations/ebdac50e-7edc-4a6d-9afe-8914a88e43a3_model.json b/progressivelearninganddisentanglementofhierarchicalrepresentations/ebdac50e-7edc-4a6d-9afe-8914a88e43a3_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..5a3a2915e2f5dac69ff4499917694c684721c4be
--- /dev/null
+++ b/progressivelearninganddisentanglementofhierarchicalrepresentations/ebdac50e-7edc-4a6d-9afe-8914a88e43a3_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ddbbba33a68f63830325d2dce53a0505efe94b5333864b2f7374afe26c9ff6fd
+size 89392
diff --git a/progressivelearninganddisentanglementofhierarchicalrepresentations/ebdac50e-7edc-4a6d-9afe-8914a88e43a3_origin.pdf b/progressivelearninganddisentanglementofhierarchicalrepresentations/ebdac50e-7edc-4a6d-9afe-8914a88e43a3_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..08a177fe464e32c6da5b40441864a2553835d791
--- /dev/null
+++ b/progressivelearninganddisentanglementofhierarchicalrepresentations/ebdac50e-7edc-4a6d-9afe-8914a88e43a3_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:4301a44e0eedfa281a5b93531fdaa35abf5fc65fb77bdfcf2e3b2b3a9ab3ae4c
+size 7422135
diff --git a/progressivelearninganddisentanglementofhierarchicalrepresentations/full.md b/progressivelearninganddisentanglementofhierarchicalrepresentations/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..f75fbc38bde2344ec65c729bc88c9edd632eddd6
--- /dev/null
+++ b/progressivelearninganddisentanglementofhierarchicalrepresentations/full.md
@@ -0,0 +1,294 @@
+# PROGRESSIVE LEARNING AND DISENTANGLEMENT OF HIERARCHICAL REPRESENTATIONS
+
+Zhiyuan Li, Jaideep Vitthal Murkute, Prashnna Kumar Gyawali & Linwei Wang
+
+Golisano College of Computing and Information Sciences
+
+Rochester Institute of Technology
+
+Rochester, NY 14623, USA
+
+{z17904, jvm6526, pkg2182, Linwei.Wang}@rit.edu
+
+# ABSTRACT
+
+Learning rich representation from data is an important task for deep generative models such as variational auto-encoder (VAE). However, by extracting high-level abstractions in the bottom-up inference process, the goal of preserving all factors of variations for top-down generation is compromised. Motivated by the concept of "starting small", we present a strategy to progressively learn independent hierarchical representations from high- to low-levels of abstractions. The model starts with learning the most abstract representation, and then progressively grow the network architecture to introduce new representations at different levels of abstraction. We quantitatively demonstrate the ability of the presented model to improve disentanglement in comparison to existing works on two benchmark data sets using three disentanglement metrics, including a new metric we proposed to complement the previously-presented metric of mutual information gap. We further present both qualitative and quantitative evidence on how the progression of learning improves disentangling of hierarchical representations. By drawing on the respective advantage of hierarchical representation learning and progressive learning, this is to our knowledge the first attempt to improve disentanglement by progressively growing the capacity of VAE to learn hierarchical representations1.
+
+# 1 INTRODUCTION
+
+Variational auto-encoder (VAE), a popular deep generative model (DGM), has shown great promise in learning interpretable and semantically meaningful representations of data (Higgins et al. (2017); Chen et al. (2018); Kim & Mnih (2018); Gyawali et al. (2019)). However, VAE has not been able to fully utilize the depth of neural networks like its supervised counterparts, for which a fundamental cause lies in the inherent conflict between the bottom-up inference and top-down generation process (Zhao et al. (2017); Li et al. (2016)): while the bottom-up abstraction is able to extract high-level representations helpful for discriminative tasks, the goal of generation requires the preservation of all generative factors that are likely at different abstraction levels. This issue was addressed in recent works by allowing VAEs to generate from details added at different depths of the network, using either memory modules between top-down generation layers (Li et al. (2016)), or hierarchical latent representations extracted at different depths via a variational ladder autoencoder (VLAE, Zhao et al. (2017)).
+
+However, it is difficult to learn to extract and disentangle all generative factors at once, especially at different abstraction levels. Inspired by human cognition system, Elman (1993) suggested the importance of "starting small" in two aspects of the learning process of neural networks: incremental input in which a network is trained with data and tasks of increasing complexity, and incremental memory in which the network capacity undergoes developmental changes given fixed external data and tasks — both pointing to an incremental learning strategy for simplifying a complex final task. Indeed, the former concept of incremental input has underpinned the success of curriculum learning (Bengio et al. (2015)). In the context of DGMs, various stacked versions of generative adversarial networks (GANs) have been proposed to decompose the final task of high-resolution image generation into progressive sub-tasks of generating small to large images (Denton et al. (2015); Zhang
+
+et al. (2018)). The latter aspect of "starting small" with incremental growth of network capacity is less explored, although recent works have demonstrated the advantage of progressively growing the depth of GANs for generating high-resolution images (Karras et al. (2018); Wang et al. (2018)). These works, so far, have focused on progressive learning as a strategy to improve image generation.
+
+We are motivated to investigate the possibility to use progressive learning strategies to improve learning and disentangling of hierarchical representations. At a high level, the idea of progressively or sequentially learning latent representations has been previously considered in VAE. In Gregor et al. (2015), the network learned to sequentially refine generated images through recurrent networks. In Lezama (2019), a teacher-student training strategy was used to progressively increase the number of latent dimensions in VAE to improve the generation of images while preserving the disentangling ability of the teacher model. However, these works primarily focus on progressively growing the capacity of VAE to generate, rather than to extract and disentangle hierarchical representations.
+
+In comparison, in this work, we focus on 1) progressively growing the capacity of the network to extract hierarchical representations, and 2) these hierarchical representations are extracted and used in generation from different abstraction levels. We present a simple progressive training strategy that grows the hierarchical latent representations from different depths of the inference and generation model, learning from high- to low-levels of abstractions as the capacity of the model architecture grows. Because it can be viewed as a progressive strategy to train the VLAe presented in Zhao et al. (2017), we term the presented model pro-VLAe. We quantitatively demonstrate the ability of pro-VLAe to improve disentanglement on two benchmark data sets using three disentanglement metrics, including a new metric we proposed to complement the metric of mutual information gap (MIG) previously presented in Chen et al. (2018). These quantitative studies include comprehensive comparisons to $\beta$ -VAE (Higgins et al. (2017)), VLAe (Zhao et al. (2017)), and the teacher-student strategy as presented in (Lezama (2019)) at different values of the hyperparameter $\beta$ . We further present both qualitative and quantitative evidence that pro-VLAe is able to first learn the most abstract representations and then progressively disentangle existing factors or learn new factors at lower levels of abstraction, improving disentangling of hierarchical representations in the process.
+
+# 2 RELATED WORKS
+
+A hierarchy of feature maps can be naturally formed in stacked discriminative models (Zeiler & Fergus (2014)). Similarly, in DGM, many works have proposed stacked-VAEs as a common way to learn a hierarchy of latent variables and thereby improve image generation (Sønderby et al. (2016); Bachman (2016); Kingma et al. (2016)). However, this stacked hierarchy is not only difficult to train as the depths increases (Sønderby et al. (2016); Bachman (2016)), but also has an unclear benefit for learning either hierarchical or disentangled representations: as shown in Zhao et al. (2017), when fully optimized, it is equivalent to a model with a single layer of latent variables. Alternatively, instead of a hierarchy of latent variables, independent hierarchical representations at different abstraction levels can be extracted and used in generation from different depths of the network (Rezende et al. (2014); Zhao et al. (2017)). A similar idea was presented in Li et al. (2016) to generate lost details from memory and attention modules at different depths of the top-down generation process. The presented work aligns with existing works (Rezende et al. (2014); Zhao et al. (2017)) in learning independent hierarchical representation from different levels of abstraction, and we look to facilitate this learning by progressively learning the representations from high- to low-levels.
+
+Progressive learning has been successful for high-quality image generation, mostly in the setting of GANs. Following the seminar work of Elman (1993), these progressive strategies can be loosely grouped into two categories. Mostly, in line with incremental input, several works have proposed to divide the final task of image generation into progressive tasks of generating low-resolution to high-resolution images with multi-scale supervision (Denton et al. (2015); Zhang et al. (2018)). Alternatively, in line with incremental memory, a small number of works have demonstrated the ability to simply grow the architecture of GANs from a shallow network with limited capacity for generating low-resolution images, to a deep network capable of generating super-resolution images (Karras et al. (2018); Wang et al. (2018)). This approach was also shown to be time-efficient since the early-stage small networks require less time to converge comparing to training a full network from the beginning. This latter group of works provided compelling evidence for the benefit of progressively growing the capacity of a network to generate images, although its extension for growing the capacity of a network to learn hierarchical representations has not been explored.
+
+Limited work has considered incremental learning of representations in VAE. In Gregor et al. (2015), recurrent networks with attention mechanisms were used to sequentially refines the details in generated images. It however focused on the generation performance of VAE without considering the learned representations. In Lezama (2019), a teacher-student strategy was used to progressively grow the dimension of the latent representations in VAE. Its fundamental motivation was that, given a teacher model that has learned to effectively disentangle major factors of variations, progressively learning additional nuisance variables will improve generation without compromising the disentangling ability of the teacher – the latter accomplished via a newly-proposed Jacobian supervision. The capacity of this model to grow, thus, is by design limited to the extraction of nuisance variables. In comparison, we are interested in a more significant growth of the VAE capacity to progressively learn and improve disentangling of important factors of variations which, as we will later demonstrate, is not what the model in Lezama (2019) is intended for. In addition, neither of these works considered learning different levels of abstractions at different depths of the network, and the presented pro-VLAE provides a simpler training strategy to achieve progressive representation learning.
+
+Learning disentangled representation is a primary motivation of our work, and an important topic in VAE. Existing works mainly tackle this by promoting the independence among the learned latent factors in VAE (Higgins et al. (2017); Kim & Mnih (2018); Chen et al. (2018)). The presented progressive learning strategy provides a novel approach to improve disentangling that is different to these existing methods and a possibility to augment them in the future.
+
+# 3 METHODS
+
+# 3.1 MODEL: VAE WITH HIERARCHICAL REPRESENTATIONS
+
+We assume a generative model $p(\pmb{x}, \pmb{z}) = p(\pmb{x} | \pmb{z}) p(\pmb{z})$ for observed $\pmb{x}$ and its latent variable $\pmb{z}$ . To learn hierarchical representations of $\pmb{x}$ , we decompose $\pmb{z}$ into $\{z_1, z_2, \dots, z_L\}$ with $z_l (l = 1, 2, 3, \dots, L)$ from different abstraction levels that are loosely guided by the depth of neural network as in Zhao et al. (2017). We define the hierarchical generative model $p_\theta$ as:
+
+$$
+p (\boldsymbol {x}, \boldsymbol {z}) = p (\boldsymbol {x} | \boldsymbol {z} _ {1}, \boldsymbol {z} _ {2}, \dots , \boldsymbol {z} _ {L}) \prod_ {l = 1} ^ {L} p (\boldsymbol {z} _ {l}). \tag {1}
+$$
+
+Note that there is no hierarchical dependence among the latent variables as in common hierarchical latent variable models. Rather, similar to that in Rezende et al. (2014) and Zhao et al. (2017), $z_{l}$ 's are independent and each represents generative factors at an abstraction level not captured in other levels. We then define an inference model $q_{\phi}$ to approximate the posterior as:
+
+$$
+q \left(\boldsymbol {z} _ {1}, \boldsymbol {z} _ {2}, \dots , \boldsymbol {z} _ {L} | \boldsymbol {x}\right) = \prod_ {l = 1} ^ {L} q \left(\boldsymbol {z} _ {l} \mid \boldsymbol {h} _ {l} (\boldsymbol {x})\right), \tag {2}
+$$
+
+where $h_{l}(\pmb{x})$ represents a particular level of bottom-up abstraction of $\pmb{x}$ . We parameterize $p_{\theta}$ and $q_{\phi}$ with an encoding-decoding structure and, as in Zhao et al. (2017), we approximate the abstraction level with the network depth. The full model is illustrated in Fig. 1(c), with a final goal to maximize a modified evidence lower bound (ELBO) of the marginal likelihood of data $\pmb{x}$ :
+
+$$
+\log p (\boldsymbol {x}) \geq \mathcal {L} = \mathbb {E} _ {q (\boldsymbol {z} | \boldsymbol {x})} [ \log p (\boldsymbol {x} | \boldsymbol {z}) ] - \beta K L (q (\boldsymbol {z} | \boldsymbol {x}) | | p (\boldsymbol {z})) , \tag {3}
+$$
+
+where $KL$ denotes the Kullback-Leibler divergence, prior $p(z)$ is set to isotropic Gaussian $\mathcal{N}(0,I)$ according to standard practice, and $\beta$ is a hyperparameter introduced in Higgins et al. (2017) to promote disentangling, defaulting to the standard ELBO objective when $\beta = 1$ .
+
+# 3.2 PROGRESSIVE LEARNING OF HIERARCHICAL REPRESENTATION
+
+We present a progressive learning strategy, as illustrated in Fig. 1, to achieve the final goal in equation (3) by learning the latent variables $\mathbf{z}_l$ progressively from the highest $(l = L)$ to the lowest $l = 1$ level of abstractions. We start by learning the most abstraction representations at layer $L$ as show in Fig. 1(a). In this case, our model degenerates to a vanilla VAE with latent variables $\mathbf{z}_L$ at the deepest layer. We keep the dimension of $\mathbf{z}_L$ small to start small in terms of the capacity to learn latent representations, where we define the inference model at progressive step $s = 0$ as:
+
+$$
+\boldsymbol {z} _ {L} \sim \mathcal {N} \left(\mu_ {L} \left(\boldsymbol {h} _ {L}\right), \sigma_ {L} \left(\boldsymbol {h} _ {L}\right)\right), \boldsymbol {h} _ {l} = f _ {l} ^ {e} \left(\boldsymbol {h} _ {l - 1}\right), \text {f o r} l = 1, 2, \dots , L, \text {a n d} \boldsymbol {h} _ {0} \equiv \boldsymbol {x}, \tag {4}
+$$
+
+
+Figure 1: Progressive learning of hierarchical representations. White blocks and solid lines are VAE models at the current progression. $\alpha$ is a fade-in coefficient for blending in the new network component. Gray circles and dash line represents (optional) constraining of the future latent variables.
+
+and the generative model as:
+
+$$
+\boldsymbol {g} _ {L} = f _ {L} ^ {d} \left(\boldsymbol {z} _ {L}\right), \boldsymbol {g} _ {l} = f _ {l} ^ {d} \left(\boldsymbol {g} _ {l + 1}\right), \boldsymbol {x} = D (\boldsymbol {x}; f _ {0} ^ {d} \left(\boldsymbol {g} _ {0}\right)), \tag {5}
+$$
+
+where $f_{l}^{e}, \mu_{L}$ , and $\sigma_{L}$ are parts of the encoder architecture, $f_{l}^{d}$ are parts of the decoder architecture, and $D$ is the distribution of $x$ parametrized by $f_{0}^{d}(g_{0})$ , which can be either Bernoulli or Gaussian depending on the data. Next, as shown in Fig. 1, we progressively grow the model to learn $z_{L-1}, \dots, z_{2}, z_{1}$ from high to low abstraction levels. At each progressive step $s = 1, 2, \dots, L-1$ , we move down one abstraction level, and grow the inference model by introducing new latent code:
+
+$$
+\mathbf {z} _ {l} \sim \mathcal {N} \left(\mu_ {l} \left(\mathbf {h} _ {l}\right), \sigma_ {l} \left(\mathbf {h} _ {l}\right)\right), l = L - s. \tag {6}
+$$
+
+Simultaneously, we grow the decoder such that it can generate with the new latent code as:
+
+$$
+\boldsymbol {g} _ {l} = f _ {l} ^ {d} ([ m _ {l} (\boldsymbol {z} _ {l}); \boldsymbol {g} _ {l + 1} ]), l = L - s, \tag {7}
+$$
+
+where $m_l$ includes transposed convolution layers outputting a feature map in the same shape as $g_{l+1}$ , and $[\cdot; \cdot]$ denotes a concatenation operation. The training objective at progressive step $s$ is then:
+
+$$
+\mathcal {L} _ {p r o} = \mathbb {E} _ {q \left(\boldsymbol {z} _ {L}, \boldsymbol {z} _ {L - 1}, \dots , \boldsymbol {z} _ {L - s} \mid \boldsymbol {x}\right)} [ \log p (\boldsymbol {x} | \boldsymbol {z} _ {L}, \boldsymbol {z} _ {L - 1}, \dots , \boldsymbol {z} _ {L - s}) ] - \beta \sum_ {L - s} ^ {L} K L (q (\boldsymbol {z} _ {l} | \boldsymbol {x}) | | p (\boldsymbol {z} _ {l})), \tag {8}
+$$
+
+By replacing the full objective in equation (3) with a sequence of the objectives in equation (8) as the training progresses, we incrementally learn to extract and generate with hierarchical latent representations $z_{l}$ 's from high to low levels of abstractions. Once trained, the full model as shown in Fig. 1(c) will be used for inference and generation, and progressive processes are no longer needed.
+
+# 3.3 IMPLEMENTATION STRATEGIES
+
+Two important strategies are utilized to implement the proposed progressive representation learning. First, directly adding new components to a trained network often introduces a sudden shock to the gradient: in VAEs, this often leads to the explosion of the variance in the latent distributions. To avoid this shock, we adopt the popular method of "fade-in" (Karras et al. (2018)) to smoothly blend the new and existing network components. In specific, we introduce a "fade-in" coefficient $\alpha$ to equations (6) and (7) when growing new components in the encoder and the decoder:
+
+$$
+\boldsymbol {z} _ {l} \sim \mathcal {N} \left(\mu_ {l} \left(\alpha \boldsymbol {h} _ {l}\right), \sigma_ {l} \left(\alpha \boldsymbol {h} _ {l}\right)\right), \boldsymbol {g} _ {l} = f _ {l} ^ {d} \left(\left[ \alpha m _ {l} \left(\boldsymbol {z} _ {l}\right); \boldsymbol {g} _ {l + 1} \right]\right), \tag {9}
+$$
+
+where $\alpha$ increases from 0 to 1 within a certain number of iterations (5000 in our experiments) since the addition of the new network components $\mu_l, \sigma_l$ , and $m_l$ .
+
+Second, we further stabilize the training by weakly constraining the distribution of $z_{l}$ 's before they are added to the network. This can be achieved by applying a KL penalty, modulated by a small coefficient $\gamma$ , to all latent variables that have not been used in the generation at progressive step $s$ :
+
+$$
+\mathcal {L} _ {\text {p r e - t r a i n e d}} = \gamma \sum_ {l = 1} ^ {L - s - 1} \left[ - K L (q (\boldsymbol {z} _ {l} | \boldsymbol {x}) \| p (\boldsymbol {z} _ {l})) \right], \tag {10}
+$$
+
+where $\gamma$ is set to 0.5 in our experiments. The final training objective at step $s$ then becomes:
+
+$$
+\mathcal {L} = \mathcal {L} _ {p r o} + \mathcal {L} _ {p r e - t r a i n e d} \tag {11}
+$$
+
+Note that the latent variables at the hierarchy lower than $L - s$ are neither meaningfully inferred nor used in generation at progressive step $s$ , and $\mathcal{L}_{pre-trained}$ merely intends to regularize the distribution of these latent variables before they are added to the network. In the experiments below, we use both "fade-in" and $\mathcal{L}_{pre-trained}$ when implementing the progressive training strategy.
+
+# 3.4 DISENTANGLEMENT METRIC
+
+Various quantitative metrics for measuring disentanglement have been proposed (Higgins et al. (2017); Kim & Mnih (2018); Chen et al. (2018)). For instance, the recently proposed MIG metrics (Chen et al. (2018)) measures the gap of mutual information between the top two latent dimensions that have the highest mutual information with a given generative factor. A low MIG score, therefore, suggests an undesired outcome that the same factor is split into multiple dimensions. However, if different generative factors are entangled into the same latent dimension, the MIG score will not be affected.
+
+Therefore, we propose a new disentanglement metric to supplement MIG by recognizing the entanglement of multiple generative factors into the same latent dimension. We define MIG-sup as:
+
+$$
+\frac {1}{J} \sum_ {1} ^ {J} \left(I _ {\text {n o r m}} \left(\boldsymbol {z} _ {j}; v _ {k ^ {(j)}}\right) - \max _ {k \neq k ^ {(j)}} I _ {\text {n o r m}} \left(\boldsymbol {z} _ {j}; v _ {k}\right)\right), \tag {12}
+$$
+
+where $\mathbf{z}$ is the latent variables and $v$ is the ground truth factors, $k^{(j)} = \mathrm{argmax}_k I_{\mathrm{norm}}(\mathbf{z}_j;v_k)$ , $J$ is the number of meaningful latent dimensions, and $I_{\mathrm{norm}}(\mathbf{z}_j;v_k)$ is normalized mutual information $I(z_{j};v_{k}) / H(v_{k})$ . Considering MIG and MIG-sup together will provide a more complete measure of disentanglement, accounting for both the splitting of one factor into multiple dimensions and the encoding of multiple factors into the same dimension. In an ideal disentanglement, both MIG and MIG-sup should be 1, recognizing a one-to-one relationship between a generative factor and a latent dimension. This would have a similar effect to the metric that was proposed in Eastwood & Williams (2018), although MIG-based metrics do not rely on training extra classifiers or regressors and are unbiased for hyperparameter settings. The factor metric (Kim & Mnih (2018)) also has similar properties with MIG-sup, although MIG-sup is stricter on penalizing any amount of other minor factors in the same dimension.
+
+# 4 EXPERIMENT
+
+We tested the presented pro-VLAE on four benchmark data sets: dSprites (Matthey et al. (2017)), 3DShapes (Burgess & Kim (2018)), MNIST (LeCun et al. (1998)), and CelebA (Liu et al. (2015)), where the first two include ground-truth generative factors that allow us to carry out comprehensive quantitative comparisons of disentangling metrics with existing models. In the following, we first quantitatively compare the disentangling ability of pro-VLAE in comparison to three existing models using three disentanglement metrics. We then analyze pro-VLAE from the aspects of how it learns progressively, its ability to disentangle, and its ability to learn abstractions at different levels.
+
+Comparisons in quantitative disentanglement metrics: For quantitative comparisons, we considered the factor metric in Kim & Mnih (2018), the MIG in Chen et al. (2018), and the MIG-sup presented in this work. We compared pro-VLAE (changing $\beta$ ) with beta-VAE (Higgins et al. (2017)), VLAE (Zhao et al. (2017)) as a hierarchical baseline without progressive training, and the teacher-student model (Lezama (2019)) as the most related progressive VAE without hierarchical representations. All models were considered at different values of $\beta$ except the teacher-student model: the comparison of $\beta$ -VAE, VLAE, and the presented pro-VLAE thus also provides an ablation study on the effect of learning hierarchical representations and doing so in a progressive manner.
+
+For fair comparisons, we strictly required all models to have the same number of latent variables and the same number of training iterations. For instance, if a hierarchical model has three layers that each has three latent dimensions, a non-hierarchical model will have nine latent dimensions; if a progressive method has three progressive steps with 15 epochs of training each, a non-progressive method will be trained for 45 epochs. Three to five experiments were conducted for each model at each $\beta$ value, and the average of the top three is used for reporting the quantitative results in Fig. 2.
+
+
+
+
+
+
+
+
+Figure 2: Quantitative comparison of disentanglement metrics. Each point is annotated by the $\beta$ value and averaged over top three best random seeds for the given $\beta$ on the give model. Left to right: reconstruction errors vs. disentanglement metrics of factor, MIG, and MIG-sup, a higher value indicating a better disentanglement in each metric.
+
+
+
+
+
+
+Figure 3: MIG vs. MIG-sup following a similar presentation in Fig. 2. A better disentanglement should have higher MIG and higher MIG-sup, locating at the top-right quadrant of the plot.
+
+
+
+As shown, for MIG and MIG-sup, VLAE generally outperformed $\beta$ -VAE at most $\beta$ values, while pro-VLAE showed a clear margin of improvement over both methods. With the factor metric, pro-VLAE was still among the top performers, although with a smaller margin and a larger overlap with VLAE on 3DShapes, and with $\beta$ -VAE ( $\beta = 10$ ) on dSprites. The teacher-student strategy with Jacobian supervision in general had a low to moderate disentangling score, especially on 3DShapes. This is consistent with the original motivation of the method for progressively learning nuisance variables after the teacher learns to disentangle effectively, rather than progressively disentangling hierarchical factors of variations as intended by pro-VLAE. Note that pro-VLAE in general performed better with a smaller value of $\beta$ ( $\beta < 20$ ), suggesting that progressive learning already had an effect of promoting disentangling and a high value of $\beta$ may over-promote disentangling at the expense of reconstruction quality.
+
+Fig. 3 shows MIG vs. MIG-sup scores among the tested models. As shown, results from pro-VLAE were well separated from the other three models at the right top quadrant of the plots, obtaining simultaneously high MIG and MIG-sup scores as a clear evidence for improved disentangling ability.
+
+Fig. 4 provides images generated by traversing each latent dimension using the best pro-VLAE $(\beta = 8)$ , the best VLAE $(\beta = 10)$ , and the teacher-student model on 3DShapes data. As shown, pro-VLAE learned to disentangle the object, wall, and floor color in the deepest layer; the following hierarchy of representations then disentangled objective scale, orientation, and shape, while the lowest-level of abstractions ran out of meaningful generative factors to learn. In comparison, the VLAE distributed six generative factors over the nine latent dimensions, where color was split across
+
+
+Figure 4: Traversing each latent dimension in pro-VLAE $(\beta = 8)$ , VLAE $(\beta = 10)$ , and teacher-student model. The hierarchy of the latent variables is noted by brackets on the side.
+
+
+Figure 5: Progressive learning of hierarchical representations. At each progression and for each $z_{l}$ , the row of images are generated by randomly sampling from its prior distributions while fixing the other latent variables (this is NOT traversing). The green bar at each row tracks the mutual information $I(\pmb{x};\pmb{z}_l)$ , while the total mutual information $I(\pmb{x};\pmb{z})$ is labeled on top.
+
+
+
+the hierarchy and sometimes entangled with the object scale (in $z_{2}$ ). The teacher-student model was much less disentangled, which we will delve into further in the following section.
+
+Information flow during progressive learning: To further understand what happened during progressive learning, we use mutual information $I(\pmb{x}, \pmb{z}_l)$ as a surrogate to track the amount of information learned in each hierarchy of latent variables $\pmb{z}_l$ during the progressive learning. We adopted the approach in Chen et al. (2018) to empirically estimate the mutual information by stratified sampling.
+
+Fig. 5 shows an example from 3DShapes. At progressive step 0, pro-VAE was only learning the deepest latent variables in $z_{3}$ , discovering most of the generative factors including color, objective shape, and orientation entangled within $z_{3}$ . At progressive step 1, interestingly, the model was able to "drag" out shape and rotation factors from $z_{3}$ and disentangle them into $z_{2}$ along with a new scale factor. Thus $I(\pmb{x};z3)$ decreased from 10.59 to 6.94 while $I(\pmb{x};z2)$ increased from 0.02 to 5.98 in this progression, while the total mutual information $I(\pmb{x};z)$ increased from 10.61 to 12.84, suggesting the overall learning of more detailed information. Since 3DShapes only has 6 factors, the lowest-level representation $z_{1}$ had nothing to learn in progressive step 2, and the allocation of mutual information remained nearly unchanged. Note that the sum of $I(\pmb{x},\pmb{z}_l)$ 's does not equal to $I(\pmb{x},\pmb{z})$ and $I_{over} = \sum_{1}^{L}I(\pmb{x},\pmb{z}_{l}) - I(\pmb{x},\pmb{z})$ suggests the amount of information that is entangled.
+
+In comparison, the teacher-student model was less effective in progressively dragging entangled representations to newly added latent dimensions, as suggested by the slowing changing of $I(\pmb{x},\pmb{z}_l)$ 's
+
+
+Figure 6: Visualization of hierarchical features learnt for MNIST data. Each sub-figure is generated by randomly sampling from the prior distribution of $z_{l}$ at one abstraction level while fixing the others. The original latent code is inferred from a image with digit "0". From left to right: $z_{3}$ encodes the highest abstraction: digit identity; $z_{2}$ encodes stroke width; and $z_{1}$ encodes other digit styles.
+
+
+Figure 7: Visualization of hierarchical features learnt for CelebA data. Each subfigure is generated by traversing along a selected latent dimension in each row within each hierarchy of $z_{l}$ 's. From left to right: latent variables $z_{4}$ to $z_{1}$ progressively learn major (e.g., gender in $z_{4}$ and smile in $z_{3}$ ) to minor representations (e.g. wavy-hair in $z_{2}$ and eye-shadow in $z_{1}$ ) in a disentangled manner.
+
+
+
+
+
+during progression and the larger value of $I_{over}$ . This suggests that, since the teacher-student model was motivated for progressively learning nuisance variables, the extent to which its capacity can grow for learning new representations is limited by two fundamental causes: 1) because it increases the dimension of the same latent vectors at the same depth, the growth of the network capacity is limited in comparison to pro-VLAE, and 2) the Jacobian supervision further restricts the student model to maintain the same disentangling ability of the teacher model.
+
+Disentangling hierarchical representations: We also qualitatively examined pro-VLAE on data with both relatively simple (MNIST) and complex (CelebA) factors of variations, all done in unsupervised training. On MNIST (Figure 6), while the deepest latent representations encoded the highest-level features in terms of digit identity, the representations learned at shallower levels encoded changes in writing styles. In Figure 7, we show the latent representation progressively learned in CelebA from the highest to lowest levels of abstractions, along with disentangling within each level demonstrated by traversing one selected dimension at a time. These dimensions are selected as examples associated with clear semantic meanings. As shown, while the deepest latent representation $z_{4}$ learned to disentangle high-level features such as gender and race, the shallowest representation $z_{1}$ learned to disentangle low-level features such as eye-shadow. Moreover, the number of distinct representations learned decreased from deep to shallow layers. While demonstrating disentangling by traversing each individual latent dimension or by hierarchically-learned representations has been separately reported in previous works (Higgins et al. (2017); Zhao et al. (2017)), to our knowledge this is the first time the ability of a model to disentangle individual latent factors in a hierarchical manner has been demonstrated. This provides evidence that the presented progressive strategy of learning can improve the disentangling of first the most abstract representations followed by progressively lower levels of abstractions.
+
+# 5 CONCLUSION
+
+In this work, we present a progressive strategy for learning and disentangling hierarchical representations. Starting from a simple VAE, the model first learns the most abstract representation. Next, the model learns independent representations from high- to low-levels of abstraction by progressively growing the capacity of the VAE deep to shallow. Experiments on several benchmark data sets demonstrated the advantages of the presented method. An immediate future work is to include stronger guidance for allocating information across the hierarchy of abstraction levels, either through external multi-scale image supervision or internal information-theoretic regularization strategies.
+
+# REFERENCES
+
+Philip Bachman. An architecture for deep, hierarchical generative models. In Advances in Neural Information Processing Systems, pp. 4826-4834, 2016.
+Yoshua Bengio, Jerome Louradour, Ronan Collobert, and Jason Weston. Curriculum learning. In International Conferences on Machine Learning, 2015.
+Chris Burgess and Hyunjik Kim. 3d shapes dataset. https://github.com/deepmind/3dshapes-dataset/, 2018.
+Tian Qi Chen, Xuechen Li, Roger B Grosse, and David K Duvenaud. Isolating sources of disentanglement in variational autoencoders. In Advances in Neural Information Processing Systems, pp. 2610-2620, 2018.
+Emily L Denton, Soumith Chintala, Arthur Szlam, and Rob Fergus. Deep generative image models using a laplacian pyramid of adversarial networks. In Advances in Neural Information Processing Systems, pp. 1486-1494, 2015.
+Cian Eastwood and Christopher KI Williams. A framework for the quantitative evaluation of disentangled representations. In International Conference on Learning Representations, 2018.
+Jeffrey L Elman. Learning and development in neural networks: The importance of starting small. Cognition, 48(1):71-99, 1993.
+Karol Gregor, Ivo Danihelka, Alex Graves, Danilo Jimenez Rezende, and Daan Wierstra. Draw: A recurrent neural network for image generation. In International Conference on Machine Learning, 2015.
+Prashnna Kumar Gyawali, Zhiyuan Li, Cameron Knight, Sandesh Ghimire, B Milan Horacek, John Sapp, and Linwei Wang. Improving disentangled representation learning with the beta bernoulli process. In IEEE International Conference on Data Mining, 2019.
+Irina Higgins, Loic Matthew, 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.
+Tero Karras, Timo Aila, Samuli Laine, and Jaakko Lehtinen. Progressive growing of gans for improved quality, stability, and variation. In International Conference on Learning Representations, 2018.
+Hyunjik Kim and Andriy Mnih. Disentangling by factorising. In International Conference on Machine Learning, 2018.
+Durk P Kingma, Tim Salimans, Rafal Jozefowicz, Xi Chen, Ilya Sutskever, and Max Welling. Improved variational inference with inverse autoregressive flow. In Advances in neural information processing systems, pp. 4743-4751, 2016.
+Yann LeCun, Léon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278-2324, 1998.
+
+Jose Lezama. Overcoming the disentanglement vs reconstruction trade-off via jacobian supervision. In International Conference on Learning Representations, 2019.
+Chongxuan Li, Jun Zhu, and Bo Zhang. Learning to generate with memory. In International Conference on Machine Learning, pp. 1177-1186, 2016.
+Ziwei Liu, Ping Luo, Xiaogang Wang, and Xiaou Tang. Deep learning face attributes in the wild. In Proceedings of the IEEE International Conference on Computer Vision, pp. 3730-3738, 2015.
+Loic Matthew, Irina Higgins, Demis Hassabis, and Alexander Lerchner. dsprites: Disentanglement testing sprites dataset. https://github.com/deepmind/dSprites-dataset/, 2017.
+Danilo Jimenez Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic backpropagation and approximate inference in deep generative models. In International Conference on Machine Learning, 2014.
+Casper Kaae Sønderby, Tapani Raiko, Lars Maaløe, Søren Kaae Sønderby, and Ole Winther. Ladder variational autoencoders. In Advances in neural information processing systems, pp. 3738-3746, 2016.
+Yifan Wang, Federico Perazzi, Brian McWilliams, Alexander Sorkine-Hornung, Olga Sorkine-Hornung, and Christopher Schroers. A fully progressive approach to single-image superresolution. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Workshops, pp. 864-873, 2018.
+Matthew D Zeiler and Rob Fergus. Visualizing and understanding convolutional networks. In European Conference on Computer Vision, pp. 818-833. Springer, 2014.
+Han Zhang, Tao Xu, Hongsheng Li, Shaoting Zhang, Xiaogang Wang, Xiaolei Huang, and Dimitris N Metaxas. Stackgan++: Realistic image synthesis with stacked generative adversarial networks. IEEE Transactions on Pattern Analysis and Machine Intelligence, 41(8):1947-1962, 2018.
+Shengjia Zhao, Jiaming Song, and Stefano Ermon. Learning hierarchical features from deep generative models. In International Conference on Machine Learning, pp. 4091-4099, 2017.
+
+# APPENDIX
+
+# A EXAMPLES OF PERFORMANCE OF DIFFERENT METRICS
+
+
+MIG: 0.1295, MIG-sup:0.4225, factor: 0.6653
+
+
+Figure 8: An example of one factor being encoded in multiple dimensions. Each row is a traverse for one dimension (dimension order adjusted for better visualization). Notice that both dim1 and dim2 are encoding floor-color, both dim3 and dim4 are encoding wall-color, and both dim5 and dim6 are encoding object color. Therefore, the MIG is very low since it penalizes splitting one factor to multiple dimensions. On the other hand, the MIG-sup and factor-metric is not too bad since one dimension mainly encodes one factor, even though there are some entanglement of color-vs-shape and color-vs-scale.
+MIG: 0.9524, MIG-sup:0.9488, factor: 0.9975
+Figure 9: An example of one dimension containing multiple factors. Each row is a traverse for one dimension (dimension order adjusted for better visualization). Notice that both models achieve high and similar MIG because all 6 factors are encoded and no splitting to multiple dimensions. However, the right-hand side model has much lower MIG-sup and factor-metric than the left-hand side model. Because both scale and shape are encoded in dim5, while dim6 has no factor. Both MIG-sup and factor-metric penalize encoding multiple factors in one dimension. Besides, our MIG-sup is lower and drops more than factor-metric because MIG-sup is stricter in this case.
+
+
+MIG: 0.9131, MIG-sup: 0.7548, factor: 0.8313
+
+# B A CLOSER COMPARISON WITH VLAE
+
+# B.1 TWO DIMENSIONAL TRaversing ON MNIST DATASET
+
+
+Figure 10: MNIST traversing results following the same generation strategy and network hierarchy as those presented in Figure 5 of (Zhao et al. (2017)). The network has 3 layers and 2 dimensional latent code at each layer. Each image is generated by traversing each of the two-dimensional latent code in one layer, while randomly sampling from the other layers. From left to right: The top layer $z_{3}$ encodes the digit identity and tilt; $z_{2}$ encodes digit width (digits around top-left are thicker than digits around bottom-right); and the bottom layer $z_{1}$ encodes stroke width. Compared to VLAE, the representation learnt in the presented method suggests smoother traversing on digits and similar results for digit width and stroke width.
+
+# B.2 INFORMATION ALLOCATION IN EACH LAYER
+
+Table 1: Mutual information $I\left( {x;{z}_{l}}\right)$ between data $x$ and latent codes ${z}_{l}$ at each $l$ -th depth of the network, corresponding to the qualitative results presented in Fig. 4 and Fig. 6 on 3Dshapes and MNIST data sets. Both VLAE and the presented pro-VLAE models have the same hierarchical architecture with 3 layers and 3 latent dimensions for each layer. Compared to VLAE, the presented method allocates information in a more clear descending order owing to the progressive learning.
+
+| 3DShapes | I(x;z3) | I(x;z2) | I(x;z1) | total I(x;z) |
| VLAE | 4.41 | 4.69 | 5.01 | 12.75 |
| pro-VLAE | 6.94 | 6.07 | 0.00 | 13.02 |
| MNIST | I(x;z3) | I(x;z2) | I(x;z1) | total I(x;z) |
| VLAE | 8.28 | 8.89 | 7.86 | 11.04 |
| pro-VLAE | 9.83 | 8.24 | 6.28 | 10.93 |
+
+# C ABLATION STUDY ON IMPLEMENTATION STRATEGIES
+
+Table 2: The effect of progressive implementation strategies, i.e., "fade-in" and pre-trained KL penalty, on successful training rates. We conducted 15 ablations experiments that each has 4 sub-experiments. As shown, the pro-VLAE cannot be trained successfully without the presented implementation strategies, while each of the strategies helps stabilize the progressive training.
+
+| no strategies | pre-trained KL only | fade-in only | Both |
| 0.0 | 0.667 | 0.733 | 0.867 |
+
+# D CLOSER INVESTIGATION OF INFORMATION FLOW OVER LATENT VARIABLES
+
+In this section, we present additional quantitative results on how information flow among the latent variables during progressive training. We conducted experiments on both 3DShapes and MNIST data sets, considering different hierarchical architectures including a combination of different number of latent layers $L$ and different number of latent dimensions $z_{dim}$ for each layer. Each experiment was repeated three times with random initializations, from which the mean and the standard deviation of mutual information $I(x;z_l)$ were computed.
+
+As shown in Tables 3-8, for all hierarchical architectures, the information amount in each layer is captured in a clear descending order, which aligns with the motivation of the presented progressive learning strategy. Generally, the information also tends to flow from previous layers to new layers, suggesting a disentanglement of latent factors as new latent layers are added. This is especially obvious for 3DShapes data where the generative factors are better defined.
+
+In addition, models with small latent codes $(z_{dim} = 1)$ are not able to learn the same amount of information (total $I(x,z)$ ) as those with larger latent codes $(z_{dim} = 3)$ . The variance of information in each layer in the former also appears to be high. We reason that it may be because that the model is trying to squeeze too much information into a small code, resulting in large vibrations during progressive learning. On the other hand, while a model has large latent codes $(L = 4, z_{dim} = 3)$ , the information flow becomes less clear after the addition of certain layers. Overall, assuming there are $K$ generative factors and there are $D$ dimensions in total available in model, ideally we would like to design the model such that $D = K$ . However, since $K$ is unknown in most data, $L$ and $z_{dim}$ become hyperparameters that need to be tuned for different data sets.
+
+Table 3: 3DShapes, $L = 2$ , $z_{dim} = 3$
+
+| progressive step | I(x;z2) | I(x;z1) | total I(x;z) |
| 0 | 10.68 ± 0.19 | | 10.68 ± 0.19 |
| 1 | 7.22 ± 0.30 | 5.94 ± 0.26 | 12.88 ± 0.20 |
+
+Table 4: 3DShapes, $L = 3,{z}_{dim} = 2$
+
+| progressive step | I(x;z3) | I(x;z2) | I(x;z1) | total I(x;z) |
| 0 | 10.16 ± 0.13 | | | 10.16 ± 0.13 |
| 1 | 9.76 ± 0.05 | 7.36 ± 0.10 | | 13.00 ± 0.02 |
| 2 | 6.83 ± 1.37 | 6.66 ± 0.17 | 5.80 ± 0.41 | 13.07 ± 0.02 |
+
+Table 5: 3DShapes, $L = 4$ , $z_{dim} = 1$
+
+| progressive step | I(x;z4) | I(x;z3) | I(x;z2) | I(x;z1) | total I(x;z) |
| 0 | 4.89 ± 0.03 | | | | 4.89 ± 0.03 |
| 1 | 4.77 ± 0.04 | 3.55 ± 0.04 | | | 8.14 ± 0.09 |
| 2 | 4.66 ± 0.04 | 3.75 ± 0.04 | 2.70 ± 0.10 | | 10.67 ± 0.09 |
| 3 | 4.55 ± 0.11 | 3.53 ± 0.35 | 2.80 ± 0.19 | 2.17 ± 0.14 | 11.72 ± 0.03 |
+
+Table 6: MNIST, $L = 3$ , ${z}_{dim} = 1$
+
+| progressive step | I(x;z3) | I(x;z2) | I(x;z1) | total I(x;z) |
| 0 | 5.86 ± 1.19 | | | 5.86 ± 1.19 |
| 1 | 3.62 ± 1.04 | 4.64 ± 2.83 | | 7.62 ± 2.63 |
| 2 | 3.88 ± 0.75 | 4.99 ± 0.98 | 2.37 ± 0.77 | 8.25 ± 1.65 |
+
+Table 7: MNIST, $L = 3,{z}_{dim} = 3$
+
+| progressive step | I(x;z3) | I(x;z2) | I(x;z1) | total I(x;z) |
| 0 | 10.08 ± 0.10 | | | 10.08 ± 0.10 |
| 1 | 9,97 ± 0.05 | 8.03 ± 0.17 | | 11.01 ± 0.04 |
| 2 | 9.91 ± 0.04 | 8.09 ± 0.07 | 6.27 ± 0.02 | 11.02 ± 0.02 |
+
+Table 8: MNIST, $L = 4,{z}_{dim} = 3$
+
+| progressive step | I(x;z4) | I(x;z3) | I(x;z2) | I(x;z1) | total I(x;z) |
| 0 | 10.06 ± 0.22 | | | | 10.06 ± 0.22 |
| 1 | 10.11 ± 0.06 | 7.95 ± 0.08 | | | 10.98 ± 0.02 |
| 2 | 10.06 ± 0.08 | 8.1 ± 0.04 | 6.39 ± 0.12 | | 10.98 ± 0.06 |
| 3 | 9.99 ± 0.09 | 8.11 ± 0.03 | 6.45 ± 0.15 | 3.52 ± 0.07 | 11.03 ± 0.03 |
\ No newline at end of file
diff --git a/progressivelearninganddisentanglementofhierarchicalrepresentations/images.zip b/progressivelearninganddisentanglementofhierarchicalrepresentations/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..4de9b9c33de58751414d2fb9ab745a5006607bc4
--- /dev/null
+++ b/progressivelearninganddisentanglementofhierarchicalrepresentations/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:7d2876fdcc3e198a3b0bb1dd27a44cba204cba8e7f005ddbbd43a3631d541014
+size 885199
diff --git a/progressivelearninganddisentanglementofhierarchicalrepresentations/layout.json b/progressivelearninganddisentanglementofhierarchicalrepresentations/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..16b889385d3d0bceed58231ea9e7e84869593003
--- /dev/null
+++ b/progressivelearninganddisentanglementofhierarchicalrepresentations/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e2f55242e71bb95cbfe779bdc1d9b6b7ce9b8233c6a2c36055e7acb63064f90f
+size 414056
diff --git a/realornotrealthatisthequestion/1cca3eec-5cd0-47f6-89cf-954d0ef0843e_content_list.json b/realornotrealthatisthequestion/1cca3eec-5cd0-47f6-89cf-954d0ef0843e_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..21c2d822555d5e68b188e07d1314f0daab611a50
--- /dev/null
+++ b/realornotrealthatisthequestion/1cca3eec-5cd0-47f6-89cf-954d0ef0843e_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:660246ae0c85d907df77c235a9888bc23b86507e1f705fd6a127de49de0ac69a
+size 71878
diff --git a/realornotrealthatisthequestion/1cca3eec-5cd0-47f6-89cf-954d0ef0843e_model.json b/realornotrealthatisthequestion/1cca3eec-5cd0-47f6-89cf-954d0ef0843e_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..138229a0593506a5ad055c6ae383ef5310326571
--- /dev/null
+++ b/realornotrealthatisthequestion/1cca3eec-5cd0-47f6-89cf-954d0ef0843e_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c9c3715c859327e222f86de43a4ccfaa034dd159e4bd8e628baebbb4d8e54a76
+size 85116
diff --git a/realornotrealthatisthequestion/1cca3eec-5cd0-47f6-89cf-954d0ef0843e_origin.pdf b/realornotrealthatisthequestion/1cca3eec-5cd0-47f6-89cf-954d0ef0843e_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..63b8cd47730f1389e50c793d7a5f7bc8e7162074
--- /dev/null
+++ b/realornotrealthatisthequestion/1cca3eec-5cd0-47f6-89cf-954d0ef0843e_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:9f2335e63a1664e5544e322a9b140a193d657a7db916c9735e6ec852b50dc8c5
+size 6700741
diff --git a/realornotrealthatisthequestion/full.md b/realornotrealthatisthequestion/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..64d08dea047162760372fc0e20c43fea7610a181
--- /dev/null
+++ b/realornotrealthatisthequestion/full.md
@@ -0,0 +1,285 @@
+# REAL OR NOT REAL, THAT IS THE QUESTION
+
+Yuanbo Xiangli $^{1*}$ , Yubin Deng $^{1*}$ , Bo Dai $^{1*}$ , Chen Change Loy $^{2}$ , Dahua Lin $^{1}$
+The Chinese University of Hong Kong
+Nanyang Technological University
+{xy019, dy015, bdai, dhlin}@ie.cuhk.edu.hk ccloy@ntu.edu.sg
+
+# ABSTRACT
+
+While generative adversarial networks (GAN) have been widely adopted in various topics, in this paper we generalize the standard GAN to a new perspective by treating realness as a random variable that can be estimated from multiple angles. In this generalized framework, referred to as RealnessGAN1, the discriminator outputs a distribution as the measure of realness. While RealnessGAN shares similar theoretical guarantees with the standard GAN, it provides more insights on adversarial learning. Compared to multiple baselines, RealnessGAN provides stronger guidance for the generator, achieving improvements on both synthetic and real-world datasets. Moreover, it enables the basic DCGAN (Radford et al., 2015) architecture to generate realistic images at $1024*1024$ resolution when trained from scratch.
+
+# 1 INTRODUCTION
+
+The development of generative adversarial network (GAN) (Goodfellow et al., 2014; Radford et al., 2015; Arjovsky et al., 2017) is one of the most important topics in machine learning since its first appearance in (Goodfellow et al., 2014). It learns a discriminator along with the target generator in an adversarial manner, where the discriminator distinguishes generated samples from real ones. Due to its flexibility when dealing with high dimensional data, GAN has obtained remarkable progresses on realistic image generation (Brock et al., 2019).
+
+In the standard formulation (Goodfellow et al., 2014), the realness of an input sample is estimated by the discriminator using a single scalar. However, for high dimensional data such as images, we naturally perceive them from more than one angles and deduce whether it is life-like based on multiple criteria. As shown in Fig.1, when a portrait is given, one might focus on its facial structure, skin tint, hair texture and even details like iris and teeth if allowed, each of which indicates a different aspect of realness. Based on this observation, the single scalar could be viewed as an abstract or a summarization of multiple measures, which together reflect the overall realness of an image. Such a concise measurement may convey insufficient information to guide the generator, potentially leading to well-known issues such as mode-collapse and gradient vanishing.
+
+In this paper, we propose to generalize the standard framework (Goodfellow et al., 2014) by treating realness as a random variable, represented as a distribution rather than a single scalar. We refer to
+
+*Equal contribution.
+1Code will be available at https://github.com/kam1107/RealnessGAN
+
+
+
+
+(a)
+
+
+Figure 1: The perception of realness depends on various aspects. (a) Human-perceived flawless. (b) Potentially reduced realness due to: inharmonious facial structure/components, unnatural background, abnormal style combination and texture distortion.
+
+
+(b)
+
+
+
+
+
+such a generalization as RealnessGAN. The learning process of RealnessGAN abide by the standard setting, but in a distributional form. While the standard GAN can be viewed as a special case of RealnessGAN, RealnessGAN and the standard GAN share similar theoretical guarantees. i.e. RealnessGAN converges to a Nash-equilibrium where the generator and the discriminator reach their optimalities. Moreover, by expanding the scalar realness score into a distributional one, the discriminator $D$ naturally provides stronger guidance to the generator $G$ where $G$ needs to match not only the overall realness (as in the standard GAN), but the underlying realness distribution as well. Consequently, RealnessGAN facilitates $G$ to better approximate the data manifold while generating decent samples. As shown in the experiments, based on a rather simple DCGAN architecture, RealnessGAN could successfully learn from scratch to generate realistic images at 1024*1024 resolution.
+
+# 2 REALNESSGAN
+
+# 2.1 GENERATIVE ADVERSARIAL NETWORKS
+
+Generative adversarial network jointly learns a generator $G$ and a discriminator $D$ , where $G$ attempts to generate samples that are indistinguishable from the real ones, and $D$ classifies generated and real samples. In the original work of (Goodfellow et al., 2014), the learning process of $D$ and $G$ follows a minimax game with value function $V(G, D)$ :
+
+$$
+\begin{array}{l} \min _ {G} \max _ {D} V (G, D) = \mathbb {E} _ {\boldsymbol {x} \sim p _ {\mathrm {d a t a}}} [ \log D (\boldsymbol {x}) ] + \mathbb {E} _ {\boldsymbol {z} \sim p _ {\boldsymbol {z}}} [ \log (1 - D (G (\boldsymbol {z}))) ], (1) \\ = \mathbb {E} _ {\boldsymbol {x} \sim p _ {\mathrm {d a t a}}} [ \log (D (\boldsymbol {x}) - 0) ] + \mathbb {E} _ {\boldsymbol {x} \sim p _ {g}} [ \log (1 - D (\boldsymbol {x})) ], (2) \\ \end{array}
+$$
+
+where the approximated data distribution $p_{g}$ is defined by a prior $p_{z}$ on input latent variables and $G$ . As proved by Goodfellow et al. (2014), under such a learning objective, the optimal $D$ satisfies $D_{G}^{*}(\boldsymbol{x}) = \frac{p_{\mathrm{data}}(\boldsymbol{x})}{p_{\mathrm{data}}(\boldsymbol{x}) + p_{g}(\boldsymbol{x})}$ for a fixed $G$ . Fixing $D$ at its optimal, the optimal $G$ satisfies $p_{g} = p_{\mathrm{data}}$ . The theoretical guarantees provide strong supports for GAN's success in many applications (Radford et al., 2015; Yu et al., 2017; Zhu et al., 2017; Dai et al., 2017), and inspired multiple variants (Arjovsky et al., 2017; Mao et al., 2017; Zhao et al., 2017; Berthelot et al., 2017) to improve the original design. Nevertheless, a single scalar is constantly adopted as the measure of realness, while the concept of realness is essentially a random variable covering multiple factors, e.g. texture and overall configuration in the case of images. In this work, we intend to follow this observation, encouraging the discriminator $D$ to learn a realness distribution.
+
+# 2.2 A DISTRIBUTIONAL VIEW ON REALNESS
+
+We start by substituting the scalar output of a discriminator $D$ with a distribution $p_{\mathrm{realness}}$ , so that for an input sample $\pmb{x}$ , $D(\pmb{x}) = \{p_{\mathrm{realness}}(\pmb{x}, u); u \in \Omega\}$ , where $\Omega$ is the set of outcomes of $p_{\mathrm{realness}}$ . Each outcome $u$ can be viewed as a potential realness measure, estimated via some criteria. While 0 and 1 in equation 2 are used as two virtual ground-truth scalars that respectively represent the realness of real and fake images, we also need two virtual ground-truth distributions to stand for the realness distributions of real and fake images. We refer to these two distributions as $\mathcal{A}_1$ (real) and $\mathcal{A}_0$ (fake), which are also defined on $\Omega$ . As in the standard GAN where 0 and 1 can be replaced with other scalars such as -1 and 1, there are various choices for $\mathcal{A}_1$ and $\mathcal{A}_0$ . Factors lead to a good pair of $\mathcal{A}_1$ and $\mathcal{A}_0$ will be discussed later. Accordingly, the difference between two scalars is replaced with the Kullback-Leibler (KL) divergence. The minimax game between a generator $G$ and a distributional discriminator $D$ thus becomes
+
+$$
+\max _ {G} \min _ {D} V (G, D) = \mathbb {E} _ {\boldsymbol {x} \sim p _ {\mathrm {d a t a}}} [ \mathcal {D} _ {\mathrm {K L}} (\mathcal {A} _ {1} \| D (\boldsymbol {x})) ] + \mathbb {E} _ {\boldsymbol {x} \sim p _ {g}} [ \mathcal {D} _ {\mathrm {K L}} (\mathcal {A} _ {0} \| D (\boldsymbol {x})) ]. \tag {3}
+$$
+
+An immediate observation is that if we let $p_{\mathrm{realness}}$ be a discrete distribution with two outcomes $\{u_0, u_1\}$ , and set $\mathcal{A}_0(u_0) = \mathcal{A}_1(u_1) = 1$ and $\mathcal{A}_0(u_1) = \mathcal{A}_1(u_0) = 0$ , the updated objective in equation 3 can be explicitly converted to the original objective in equation 2, suggesting RealnessGAN is a generalized version of the original GAN.
+
+Following this observation, we then extend the theoretical analysis in Goodfellow et al. (2014) to the case of RealnessGAN. Similar to Goodfellow et al. (2014), our analysis concerns the space of
+
+probability density functions, where $D$ and $G$ are assumed to have infinite capacities. We start from finding the optimal realizness discriminator $D$ for any given generator $G$ .
+
+Theorem 1. When $G$ is fixed, for any outcome $u$ and input sample $x$ , the optimal discriminator $D$ satisfies
+
+$$
+D _ {G} ^ {\star} (\boldsymbol {x}, u) = \frac {\mathcal {A} _ {1} (u) p _ {d a t a} (\boldsymbol {x}) + \mathcal {A} _ {0} (u) p _ {g} (\boldsymbol {x})}{p _ {d a t a} (\boldsymbol {x}) + p _ {g} (\boldsymbol {x})}. \tag {4}
+$$
+
+Proof. Given a fixed $G$ , the objective of $D$ is:
+
+$$
+\begin{array}{l} \min _ {D} V (G, D) = \mathbb {E} _ {\boldsymbol {x} \sim p _ {\mathrm {d a t a}}} \left[ \mathcal {D} _ {\mathrm {K L}} \left(\mathcal {A} _ {1} \| D (\boldsymbol {x})\right) \right] + \mathbb {E} _ {\boldsymbol {x} \sim p _ {g}} \left[ \mathcal {D} _ {\mathrm {K L}} \left(\mathcal {A} _ {0} \| D (\boldsymbol {x})\right) \right], (5) \\ = \int_ {\boldsymbol {x}} \left(p _ {\text {d a t a}} (\boldsymbol {x}) \int_ {u} \mathcal {A} _ {1} (u) \log \frac {\mathcal {A} _ {1} (u)}{D (\boldsymbol {x} , u)} d u + p _ {g} (\boldsymbol {x}) \int_ {u} \mathcal {A} _ {0} (u) \log \frac {\mathcal {A} _ {0} (u)}{D (\boldsymbol {x} , u)} d u\right) d x, (6) \\ = - \int_ {\boldsymbol {x}} \left(p _ {\text {d a t a}} (\boldsymbol {x}) h \left(\mathcal {A} _ {1}\right) + p _ {g} (\boldsymbol {x}) h \left(\mathcal {A} _ {0}\right)\right) d x \\ - \int_ {\boldsymbol {x}} \int_ {u} \left(p _ {\text {d a t a}} (\boldsymbol {x}) \mathcal {A} _ {1} (u) + p _ {g} (\boldsymbol {x}) \mathcal {A} _ {0} (u)\right) \log D (\boldsymbol {x}, u) d u d x, (7) \\ \end{array}
+$$
+
+where $h(\mathcal{A}_1)$ and $h(\mathcal{A}_0)$ are their entropies. Marking the first term in equation 7 as $C_1$ since it is irrelevant to $D$ , the objective thus is equivalent to:
+
+$$
+\min _ {D} V (G, D) = - \int_ {\boldsymbol {x}} \left(p _ {\text {d a t a}} (\boldsymbol {x}) + p _ {g} (\boldsymbol {x})\right) \int_ {u} \frac {p _ {\text {d a t a}} (\boldsymbol {x}) \mathcal {A} _ {1} (u) + p _ {g} (\boldsymbol {x}) \mathcal {A} _ {0} (u)}{p _ {\text {d a t a}} (\boldsymbol {x}) + p _ {g} (\boldsymbol {x})} \log D (\boldsymbol {x}, u) d u d x + C _ {1}, \tag {8}
+$$
+
+where $p_{\boldsymbol{x}}(u) = \frac{p_{\mathrm{data}}(\boldsymbol{x})\mathcal{A}_1(u) + p_g(\boldsymbol{x})\mathcal{A}_0(u)}{p_{\mathrm{data}}(\boldsymbol{x}) + p_g(\boldsymbol{x})}$ is a distribution defined on $\Omega$ . Let $C_2 = p_{\mathrm{data}}(\boldsymbol{x}) + p_g(\boldsymbol{x})$ , we then have
+
+$$
+\begin{array}{l} \min _ {D} V (G, D) = C _ {1} + \int_ {\boldsymbol {x}} C _ {2} \left(- \int_ {u} p _ {\boldsymbol {x}} (u) \log D (\boldsymbol {x}, u) d u + h \left(p _ {\boldsymbol {x}}\right) - h \left(p _ {\boldsymbol {x}}\right)\right) d x, (9) \\ = C _ {1} + \int_ {\boldsymbol {x}} C _ {2} \mathcal {D} _ {\mathrm {K L}} \left(p _ {\boldsymbol {x}} \| D (\boldsymbol {x})\right) d x + \int_ {\boldsymbol {x}} C _ {2} h \left(p _ {\boldsymbol {x}}\right) d x. (10) \\ \end{array}
+$$
+
+Observing equation 10, one can see that for any valid $\pmb{x}$ , when $\mathcal{D}_{\mathrm{KL}}(p_{\pmb{x}} \| D(\pmb{x}))$ achieves its minimum, $D$ obtains its optimal $D^{\star}$ , leading to $D^{\star}(\pmb{x}) = p_{\pmb{x}}$ , which concludes the proof.
+
+Next, we move on to the conditions for $G$ to reach its optimal when $D = D_G^\star$ .
+
+Theorem 2. When $D = D_{G}^{\star}$ , and there exists an outcome $u \in \Omega$ such that $\mathcal{A}_1(u) \neq \mathcal{A}_0(u)$ , the maximum of $V(G, D_{G}^{\star})$ is achieved if and only if $p_g = p_{data}$ .
+
+Proof. When $p_g = p_{\mathrm{data}}$ , $D_G^\star(\boldsymbol{x}, u) = \frac{\mathcal{A}_1(u) + \mathcal{A}_0(u)}{2}$ , we have:
+
+$$
+V ^ {\star} (G, D _ {G} ^ {\star}) = \int_ {u} \mathcal {A} _ {1} (u) \log \frac {2 \mathcal {A} _ {1} (u)}{\mathcal {A} _ {1} (u) + \mathcal {A} _ {0} (u)} + \mathcal {A} _ {0} (u) \log \frac {2 \mathcal {A} _ {0} (u)}{\mathcal {A} _ {1} (u) + \mathcal {A} _ {0} (u)} d u. \tag {11}
+$$
+
+Subtracting $V^{\star}(G, D_{G}^{\star})$ from $V(G, D_{G}^{\star})$ gives:
+
+$$
+\begin{array}{l} V ^ {\prime} (G, D _ {G} ^ {\star}) = V (G, D _ {G} ^ {\star}) - V ^ {\star} (G, D _ {G} ^ {\star}) \\ = \int_ {\boldsymbol {x}} \int_ {u} \left(p _ {\text {d a t a}} (\boldsymbol {x}) \mathcal {A} _ {1} (u) + p _ {g} (\boldsymbol {x}) \mathcal {A} _ {0} (u)\right) \log \frac {\left(p _ {\text {d a t a}} (\boldsymbol {x}) + p _ {g} (\boldsymbol {x})\right) \left(\mathcal {A} _ {1} (u) + \mathcal {A} _ {0} (u)\right)}{2 \left(p _ {\text {d a t a}} (\boldsymbol {x}) \mathcal {A} _ {1} (u) + p _ {g} (\boldsymbol {x}) \mathcal {A} _ {0} (u)\right)} d u d x, (12) \\ = - 2 \int_ {\boldsymbol {x}} \int_ {u} \frac {p _ {\text {d a t a}} (\boldsymbol {x}) \mathcal {A} _ {1} (u) + p _ {g} (\boldsymbol {x}) \mathcal {A} _ {0} (u)}{2} \log \frac {\frac {p _ {\text {d a t a}} (\boldsymbol {x}) \mathcal {A} _ {1} (u) + p _ {g} (\boldsymbol {x}) \mathcal {A} _ {0} (u)}{2}}{\frac {(p _ {\text {d a t a}} (\boldsymbol {x}) + p _ {g} (\boldsymbol {x})) (\mathcal {A} _ {1} (u) + \mathcal {A} _ {0} (u))}{4}} d u d x, (13) \\ = - 2 \mathcal {D} _ {\mathrm {K L}} \left(\frac {p _ {\text {d a t a}} \mathcal {A} _ {1} + p _ {g} \mathcal {A} _ {0}}{2} \| \frac {(p _ {\text {d a t a}} + p _ {g}) (\mathcal {A} _ {1} + \mathcal {A} _ {0})}{4}\right). (14) \\ \end{array}
+$$
+
+Since $V^{\star}(G, D_{G}^{\star})$ is a constant with respect to $G$ , maximizing $V(G, D_{G}^{\star})$ is equivalent to maximizing $V'(G, D_{G}^{\star})$ . The optimal $V'(G, D_{G}^{\star})$ is achieved if and only if the KL divergence reaches its minimum, where:
+
+$$
+\frac {p _ {\text {d a t a}} \mathcal {A} _ {1} + p _ {g} \mathcal {A} _ {0}}{2} = \frac {(p _ {\text {d a t a}} + p _ {g}) (\mathcal {A} _ {1} + \mathcal {A} _ {0})}{4}, \tag {15}
+$$
+
+$$
+\left(p _ {\text {d a t a}} - p _ {g}\right) \left(\mathcal {A} _ {1} - \mathcal {A} _ {0}\right) = 0, \tag {16}
+$$
+
+for any valid $\pmb{x}$ and $u$ . Hence, as long as there exists a valid $u$ that $\mathcal{A}_1(u) \neq \mathcal{A}_0(u)$ , we have $p_{\mathrm{data}} = p_g$ for any valid $\pmb{x}$ .
+
+# 2.3 DISCUSSION
+
+The theoretical analysis gives us more insights on RealnessGAN.
+
+Number of outcomes: according to equation 16, each $u \in \Omega$ with $\mathcal{A}_0(u) \neq \mathcal{A}_1(u)$ may work as a constraint, pushing $p_g$ towards $p_{\mathrm{data}}$ . In the case of discrete distributions, along with the increment of the number of outcomes, the constraints imposed on $G$ accordingly become more rigorous and can cost $G$ more effort to learn. This is due to the fact that having more outcomes suggests a more fine-grained shape of the realness distribution for $G$ to match. In Sec.4, we verified that it is beneficial to update $G$ an increasing number of times before $D$ 's update as the number of outcomes grows.
+
+Effectiveness of anchors: view equation 16 as a cost function to minimize, when $p_{\mathrm{data}} \neq p_g$ , for some $u \in \Omega$ , the larger the difference between $\mathcal{A}_1(u)$ and $\mathcal{A}_0(u)$ is, the stronger the constraint on $G$ becomes. Intuitively, RealnessGAN can be more efficiently trained if we choose $\mathcal{A}_0$ and $\mathcal{A}_1$ to be adequately different.
+
+Objective of $G$ : according to equation 3, the best way to fool $D$ is to increase the KL divergence between $D(\pmb{x})$ and the anchor distribution $\mathcal{A}_0$ of fake samples, rather than decreasing the KL divergence between $D(\pmb{x})$ and the anchor distribution $\mathcal{A}_1$ of real samples. It's worth noting that these two objectives are equivalent in the original work (Goodfellow et al., 2014). An intuitive explanation is that, in the distributional view of realizness, realizness distributions of real samples are not necessarily identical. It is possible that each of them corresponds to a distinct one. While $\mathcal{A}_1$ only serves as an anchor, it is ineffective to drag all generated samples towards the same target.
+
+Flexibility of RealnessGAN: as a generalization of the standard framework, it is straightforward to integrate RealnessGAN with different GAN architectures, such as progressive GANs (Karras et al., 2018; 2019) and conditional GANs (Zhu et al., 2017; Ledig et al., 2017). Moreover, one may also combine the perspective of RealnessGAN with other reformulations of the standard GAN, such as replacing the KL divergence in equation 3 with the Earth Mover's Distance.
+
+# 2.4 IMPLEMENTATION
+
+In our implementation, the realness distribution $p_{\mathrm{realness}}$ is characterized as a discrete distribution over $N$ outcomes $\Omega = \{u_0, u_1, \dots, u_{N-1}\}$ . Given an input sample $x$ , the discriminator $D$ returns $N$ probabilities on these outcomes, following:
+
+$$
+p _ {\text {r e a l n e s s}} (\boldsymbol {x}, u _ {i}) = \frac {e ^ {\psi_ {i} (\boldsymbol {x})}}{\sum_ {j} e ^ {\psi_ {j} (\boldsymbol {x})}}, \tag {17}
+$$
+
+where $\psi = (\psi_0,\psi_1,\dots,\psi_{N - 1})$ are the parameters of $D$ . Similarly, $\mathcal{A}_1$ and $\mathcal{A}_0$ are discrete distributions defined on $\Omega$ .
+
+As shown in the theoretical analysis, the ideal objective for $G$ is maximizing the KL divergence between $D(\pmb{x})$ of generated samples and $\mathcal{A}_0$ :
+
+$$
+\left(G _ {\text {o b j e c t i v e 1}}\right) \quad \min _ {G} - \mathbb {E} _ {\boldsymbol {z} \sim p _ {\boldsymbol {z}}} \left[ \mathcal {D} _ {\mathrm {K L}} \left(\mathcal {A} _ {0} \| D (G (\boldsymbol {z})) \right]. \right. \tag {18}
+$$
+
+However, as the discriminator $D$ is not always at its optimal, especially in the early stage, directly applying this objective in practice could only lead to a generator with limited generative power. Consequently, a regularizer is needed to improve $G$ . There are several choices for the regularizer, such as the relativistic term introduced in (Jolicoeur-Martineau, 2019) that minimizes the KL divergence
+
+between $D(\pmb{x})$ of generated samples and random real samples, or the term that minimizes the KL divergence between $\mathcal{A}_1$ and $D(\pmb{x})$ of generated samples, each of which leads to a different objective:
+
+$$
+(G _ {\text {o b j e c t i v e} 2}) \quad \min _ {G} \quad \mathbb {E} _ {\boldsymbol {x} \sim p _ {\mathrm {d a t a}}, \boldsymbol {z} \sim p _ {\boldsymbol {z}}} \left[ \mathcal {D} _ {\mathrm {K L}} (D (\boldsymbol {x}) \| D (G (\boldsymbol {z})) \right] - \mathbb {E} _ {\boldsymbol {z} \sim p _ {\boldsymbol {z}}} \left[ \mathcal {D} _ {\mathrm {K L}} \left(\mathcal {A} _ {0} \| D (G (\boldsymbol {z}))\right) \right], \tag {19}
+$$
+
+$$
+\left(G _ {\text {o b j e c t i v e 3}}\right) \quad \min _ {G} \quad \mathbb {E} _ {\boldsymbol {z} \sim p _ {\boldsymbol {z}}} \left[ \right. \mathcal {D} _ {\mathrm {K L}} \left( \right.\mathcal {A} _ {1} \| D (G (\boldsymbol {z})) \left. \right] - \mathbb {E} _ {\boldsymbol {z} \sim p _ {\boldsymbol {z}}} \left[ \right. \mathcal {D} _ {\mathrm {K L}} \left( \right.\mathcal {A} _ {0} \| D (G (\boldsymbol {z})) \left. \right]\left. \right]. \tag {20}
+$$
+
+In Sec.4, these objectives are compared. And the objective in equation 19 is adopted as the default choice.
+
+Feature resampling. In practice, especially in the context of images, we are learning from a limited number of discrete samples coming from a continuous data manifold. We may encounter issues caused by insufficient data coverage during the training process. Inspired by conditioning augmentation mentioned in (Zhang et al., 2016), we introduce a resampling technique performed on the realness output to augment data variance. Given a mini-batch $\{\pmb{x}_0,\dots,\pmb{x}_{M - 1}\}$ of size $M$ , a Gaussian distribution $\mathcal{N}(\mu_i,\sigma_i)$ is fitted on $\{\psi_{i}(\pmb{x}_{0}),\psi_{i}(\pmb{x}_{1}),\dots,\psi_{i}(\pmb{x}_{M - 1})\}$ , which are logits computed by $D$ on $i$ -th outcome. We then resample $M$ new logits $\{\psi_i'(x_0),\ldots ,\psi_i'(x_{M - 1});\psi_i'\sim \mathcal{N}(\mu_i,\sigma_i)\}$ for $i$ -th outcome and use them successively.
+
+The randomness introduced by resampling benefits the training of RealnessGAN in two aspects. First of all, it augments data by probing instances around the limited training samples, leading to more robust models. Secondly, the resampling approach implicitly demands instances of $\psi_i(\pmb{x})$ to be homologous throughout the mini-batch, such that each outcome reflects realness consistently across samples. We empirically found the learning curve of RealnessGAN is more stable if feature resampling is utilized, especially in the latter stage, where models are prone to overfit.
+
+# 3 RELATED WORK
+
+Generative adversarial network (GAN) was first proposed in (Goodfellow et al., 2014), which jointly learns a discriminator $D$ and a generator $G$ in an adversarial manner. Due to its outstanding learning ability, GANs have been adopted in various generative tasks (Radford et al., 2015; Yu et al., 2017; Zhu et al., 2017), among which Deep Convolutional GAN (DCGAN) (Radford et al., 2015) has shown promising results in image generation.
+
+Although remarkable progress has been made. GAN is known to suffer from gradient diminishing and mode collapse. Variants of GAN have been proposed targeting these issues. Specifically, Wasserstein GAN (WGAN) Arjovsky et al. (2017) replaces JS-divergence with Earth-Mover's Distance, and Least-Square GAN (LSGAN) (Mao et al., 2017) transforms the objective of $G$ to Pearson divergence. Energy-based GAN (EBGAN) (Zhao et al., 2017) and Boundary Equilibrium GAN (BEGAN) (Berthelot et al., 2017) employ a pre-trained auto-encoder as the discriminator, learning to distinguish between real and generated samples via reconstruction. Besides adjusting the objective of GAN, alternative approaches include more sophisticated architectures and training paradigms. Generally, ProgressiveGAN (Karras et al., 2018) and StyleGAN (Karras et al., 2019) propose a progressive paradigm, which starts from a shallow model focusing on a low resolution, and gradually grows into a deeper model to incorporate more details as resolution grows. On the other hand, COCO-GAN (Lin et al., 2019) tackles high resolution image generation in a divide-and-conquer strategy. It learns to produce decent patches at corresponding sub-regions, and splices the patches to produce a higher resolution image.
+
+It's worth noting that many works on generative adversarial networks have discussed 'distributions' (Goodfellow et al., 2014; Radford et al., 2015; Arjovsky et al., 2017), which usually refers to the underlying distribution of samples. Some of the existing works aim to improve the original objective using different metrics to measure the divergence between the learned distribution $p_{g}$ and the real distribution $p_{\mathrm{data}}$ . Nevertheless, a single scalar is constantly adopted to represent the concept of realizness. In this paper, we propose a complementary modification that models realizness as a random variable follows the distribution $p_{\mathrm{realness}}$ . In the future work, we may study the combination of realizness discriminator and other GAN variants to enhance the effectiveness and stability of adversarial learning.
+
+
+Figure 2: Left: real data sampled from the mixture of 9 Gaussian distributions. Right: samples generated by Std-GAN, WGAN-GP, LSGAN, HingeGAN and RealnessGAN.
+
+# 4 EXPERIMENTS
+
+In this section we study RealnessGAN from multiple aspects. Specifically, 1) we firstly focus on RealnessGAN's mode coverage ability on a synthetic dataset. 2) Then we evaluate RealnessGAN on CIFAR10 (32*32) (Krizhevsky, 2009) and CelebA (256*256) (Liu et al., 2015) datasets qualitatively and quantitatively. 3) Finally we explore RealnessGAN on high-resolution image generation task, which is known to be challenging for unconditional non-progressive architectures. Surprisingly, on the FFHQ dataset (Karras et al., 2019), RealnessGAN managed to generate images at the $1024 \times 1024$ resolution based on a non-progressive architecture. We compare RealnessGAN to other popular objectives in generative adversarial learning, including the standard GAN (Std-GAN) (Radford et al., 2015), WGAN-GP (Arjovsky et al., 2017), HingeGAN (Zhao et al., 2017) and LSGAN (Mao et al., 2017).
+
+For experiments on synthetic dataset, we use a generator with four fully-connected hidden layers, each of which has 400 units, followed by batch normalization and ReLU activation. The discriminator has three fully-connected hidden layers, with 200 units each layer. LinearMaxout with 5 maxout pieces are adopted and no batch normalization is used in the discriminator. The latent input $\mathbf{z}$ is a 32-dimensional vector sampled from a Gaussian distribution $\mathcal{N}(0, I)$ . All models are trained using Adam (Kingma & Ba, 2015) for 500 iterations.
+
+On real-world datasets, the network architecture is identical to the DCGAN architecture in Radford et al. (2015), with the prior $p_{z}(z)$ a 128-dimensional Gaussian distribution $\mathcal{N}(\mathbf{0},\mathbf{I})$ . Models are trained using Adam (Kingma & Ba, 2015) for $520k$ iterations. To guarantee training stability, we adopt settings that are proved to be effective for baseline methods. Batch normalization (Ioffe & Szegedy, 2015) is used in $G$ , and spectral normalization (Miyato et al., 2018) is used in $D$ . For WGAN-GP we use $lr = 1e - 4$ , $\beta_{1} = 0.5$ , $\beta_{2} = 0.9$ , updating $D$ for 5 times per $G$ 's update (Gulrajani et al., 2017); for the remaining models, we use $lr = 2e - 4$ , $\beta_{1} = 0.5$ , $\beta_{2} = 0.999$ , updating $D$ for one time per $G$ 's update (Radford et al., 2015). Fréchet Inception Distance (FID) (Heusel et al., 2017) and Sliced Wasserstein Distance (SWD) (Karras et al., 2018) are reported as the evaluation metrics. Unless otherwise stated, $A_{1}$ and $A_{0}$ are chosen to resemble the shapes of two normal distributions with a positive skewness and a negative skewness, respectively. In particular, the number of outcomes are empirically set to 51 for CelebA and FFHQ datasets, and 3 for CIFAR10 dataset.
+
+# 4.1 SYNTHETIC DATASET
+
+Since $p_{\mathrm{data}}$ is usually intractable on real datasets, we use a toy dataset to compare the learned distribution $p_g$ and the data distribution $p_{\mathrm{data}}$ . The toy dataset consists of 100,000 2D points sampled from a mixture of 9 isotropic Gaussian distributions whose means are arranged in a 3 by 3 grid, with variances equal to 0.05. As shown in Fig.2, the data distribution $p_{\mathrm{data}}$ contains 9 welly separated modes, making it a difficult task despite its low-dimensional nature.
+
+To evaluate $p_{g}$ , we draw 10,000 samples and measure their quality and diversity. As suggested in (Dumoulin et al., 2016), we regard a sample as of high quality if it is within $4\sigma$ from the $\mu$ of its nearest Gaussian. When a Gaussian is assigned with more than 100 high quality samples, we consider this mode of $p_{\mathrm{data}}$ is recovered in $p_{g}$ . Fig.2 visualizes the sampled points of different methods, where LSGAN and HingeGAN suffer from significant mode collapse, recovering only a single mode. Points sampled by WGAN-GP are overly disperse, and only $0.03\%$ of them are of high quality. While Std-GAN recovers 4 modes in $p_{\mathrm{data}}$ with $32.4\%$ high quality samples, 8 modes are recovered by RealnessGAN with $60.2\%$ high quality samples. The average $\sigma$ s of these high quality samples in Std-GAN and RealnessGAN are respectively 0.083 and 0.043. The results suggest that treating realness as a random variable rather than a single scalar leads to a more strict discriminator
+
+
+Figure 3: First row: the results of RealnessGAN when fixing $k_{G} = k_{D} = 1$ and increasing the number of outcomes. Second row: the results of RealnessGAN when $k_{G}$ is properly increased. Bottom curves: under the settings of second row, the ratio of high quality samples and the number of recovered modes.
+
+that criticizes generated samples from various aspects, which provides more informative guidance. Consequently, $p_g$ learned by RealnessGAN is more diverse and compact.
+
+We further study the effect of adjusting the number of outcomes in the realness distribution $p_{\mathrm{realness}}$ on this dataset. To start with, we fix $k_{G}$ and $k_{D}$ to be 1, which are the number of updates for $G$ and $D$ in one iteration, and adjust the number of outcomes of $p_{\mathrm{realness}}$ , $\mathcal{A}_0$ and $\mathcal{A}_1$ . As shown in the first row of Fig.3, it can be observed that in general $G$ recovers less modes as the number of outcomes grows, which is a direct result of $D$ becoming increasingly rigorous and imposing more constraints on $G$ . An intuitive solution is to increase $k_{G}$ such that $G$ is able to catch up with current $D$ . The second row of Fig.3 demonstrates the converged cases achieved with suitable $k_{GS}$ , suggesting RealnessGAN is effective when sufficient learning capacity is granted to $G$ . The ratio of high quality samples $r_{\mathrm{HQ}}$ and the number of recovered modes $n_{\mathrm{mode}}$ in these cases are plotted in Fig.3. The two curves imply that besides $k_{G}$ , $r_{\mathrm{HQ}}$ and $n_{\mathrm{mode}}$ are all positively related to the number of outcomes, validating that measuring realness from more aspects leads to a better generator.
+
+# 4.2 REAL-WORLD DATASETS
+
+As GAN has shown promising results when modeling complex data such as natural images, we evaluate RealnessGAN on real-world datasets, namely CIFAR10, CelebA and FFHQ, which respectively contains images at $32*32$ , $256*256$ and $1024*1024$ resolutions. The training curves of baseline methods and RealnessGAN on CelebA and CIFAR10 are shown in Fig.4. The qualitative results measured in FID and SWD are listed in Tab.1. We report the minimum, the maximum, the mean and the standard deviation computed along the training process. On both datasets, compared to baselines, RealnessGAN obtains better scores in both metrics. Meantime, the learning process of RealnessGAN is smoother and steadier (see SD in Tab.1 and curves in Fig.4). Samples of generated images on both datasets are included in Fig.8.
+
+On FFHQ, we push the resolution of generated images to $1024*1024$ , which is known to be challenging especially for a non-progressive architecture. As shown in Fig.8, despite building on a relatively simple DCGAN architecture, RealnessGAN is able to produce realistic samples from scratch at such a high resolution. Quantitatively, RealnessGAN obtains an FID score of 17.18. For reference, our
+
+
+(a) FID on CelebA
+
+
+(b) SWD on CelebA
+
+
+(c) FID on CIFAR10
+
+
+(d) SWD on CIFAR10
+Figure 4: Training curves of different methods in terms of FID and SWD on both CelebA and CIFAR10, where the raise of curves in the later stage indicate mode collapse. Best viewed in color.
+
+Table 1: Minimum (min), maximum (max), mean and standard deviation (SD) of FID and SWD on CelebA and CIFAR10, calculated at 20k, 30k, ... iterations. The best indicators in baseline methods are underlined.
+
+ | Method | FID ↓ | SWD (×103) ↓ |
| Min | Max | Mean | SD | Min | Max | Mean | SD |
| CelebA | Std-GAN | 27.02 | 70.43 | 34.85 | 9.40 | 14.81 | 68.06 | 30.58 | 15.39 |
| WGAN-GP | 70.28 | 104.60 | 81.15 | 8.27 | 17.85 | 30.56 | 22.09 | 2.93 |
| LSGAN | 30.76 | 57.97 | 34.99 | 5.15 | 16.72 | 23.99 | 20.39 | 2.25 |
| HingeGAN | 25.57 | 75.03 | 33.89 | 10.61 | 14.91 | 54.30 | 28.86 | 10.34 |
| RealnessGAN | 23.51 | 81.3 | 30.82 | 7.61 | 12.72 | 31.39 | 17.11 | 3.59 |
| CIFAR10 | Std-GAN | 38.56 | 88.68 | 47.46 | 15.96 | 28.76 | 57.71 | 37.55 | 7.02 |
| WGAN-GP | 41.86 | 79.25 | 46.96 | 5.57 | 28.17 | 36.04 | 30.98 | 1.78 |
| LSGAN | 42.01 | 75.06 | 48.41 | 7.72 | 31.99 | 40.46 | 34.75 | 2.34 |
| HingeGAN | 42.40 | 117.49 | 57.30 | 20.69 | 32.18 | 61.74 | 41.85 | 7.31 |
| RealnessGAN | 34.59 | 102.98 | 42.30 | 11.84 | 22.80 | 53.38 | 26.98 | 5.47 |
+
+re-implemented StyleGAN (Karras et al., 2019) trained under a similar setting receives an FID score of 16.12. These results strongly support the effectiveness of RealnessGAN, as StyleGAN is one of the most advanced GAN architectures so far.
+
+# 4.3 ABLATION STUDY
+
+The implementation of RealnessGAN offers several choices that also worth digging into. On synthetic dataset, we explored the relationship between the number of outcomes and $G$ 's update frequency. On real-world dataset, apart from evaluating RealnessGAN as a whole, we also studied the affect of feature resampling, different settings of $\mathcal{A}_0$ and $\mathcal{A}_1$ and choices of $G$ 's objective.
+
+Table 2: Minimum (min), maximum (max), mean and standard deviation (SD) of FID on CelebA using different anchor distributions, calculated at ${20}\mathrm{k},{30}\mathrm{k},\ldots$ iterations.
+
+| DKL(A1||A0) | Min | Max | Mean | SD |
| 1.66 | 31.01 | 96.11 | 40.75 | 11.83 |
| 5.11 | 26.22 | 87.98 | 36.11 | 9.83 |
| 7.81 | 25.98 | 85.51 | 36.30 | 10.04 |
| 11.05 | 23.51 | 81.30 | 30.82 | 7.61 |
+
+
+Figure 5: Training FID curves of Realness-GAN with and without feature re-sampling.
+
+
+Figure 6: Samples generated by RealnessGAN trained with the ideal objective (equation 18). Toprow: samples when $\mathcal{D}_{\mathrm{KL}}(\mathcal{A}_1\| \mathcal{A}_0) = 11.05$ . Bottom-row: samples when $\mathcal{D}_{\mathrm{KL}}(\mathcal{A}_1\| \mathcal{A}_0) = 33.88$ .
+
+Table 3: FID scores of $G$ on CIFAR10, trained with different objectives.
+
+| G Objective | FID |
| Objective1 (equation 18) | 36.73 |
| Objective2 (equation 19) | 34.59 |
| Objective3 (equation 20) | 36.21 |
| DCGAN | 38.56 |
| WGAN-GP | 41.86 |
| LSGAN | 42.01 |
| HingeGAN | 42.40 |
+
+
+Figure 7: Training curves of RealnessGAN on CelebA using objective2 (equation 19) and objective3 (equation 20).
+
+Feature Resampling. Fig.5 shows the training curves of RealnessGAN with and without feature resampling. It can be noticed that despite the results are similar, feature resampling stabilizes the training process especially in the latter stage.
+
+Effectiveness of Anchors. Tab.2 reports the results of varying the KL divergence between anchor distributions $\mathcal{A}_0$ and $\mathcal{A}_1$ . The FID score indicates that, as the KL divergence between $\mathcal{A}_0$ and $\mathcal{A}_1$ increases, RealnessGAN tends to perform better, which verifies our discussion in Sec.2.3 that a larger difference between anchor distributions imposes stronger constraints on $G$ . To further testify, two different pairs of anchors with similar KL divergences (11.95 and 11.67) are exploited and they yield comparable FID scores (23.98 and 24.22).
+
+Objective of G. As mentioned in Sec.2.3, theoretically, the objective of $G$ is $\max_G\mathbb{E}_{\boldsymbol{x}\sim p_g}[\mathcal{D}_{\mathrm{KL}}(\mathcal{A}_0||D(\boldsymbol {x}))]$ . However, in practice, since $D$ is not always optimal, we need either a pair of $\mathcal{A}_0$ and $\mathcal{A}_1$ that are drastically different, or an additional constraint to aid this objective. Fig.6 shows that, with the ideal objective alone, when the KL divergence between $\mathcal{A}_0$ and $\mathcal{A}_1$ is sufficiently large, on CelebA we could obtain a generator with limited generative power. On the other hand, by applying constraints as discussed in Sec.2.4, $G$ can learn to produce more realistic samples as demonstrated in Fig.8. Similar results are observed on CIFAR10, where RealnessGAN obtains comparable FID scores with and without constraints, as shown in Tab.3. Fig.7 also provides the training curves of RealnessGAN on CelebA using these two alternative objectives.
+
+# 5 CONCLUSION
+
+In this paper, we extend the view of realness in generative adversarial networks under a distributional perspective. In our proposed extension, RealnessGAN, we represent the concept of realness as a realness distribution rather than a single scalar. so that the corresponding discriminator estimates realness from multiple angles, providing more informative guidance to the generator. We prove RealnessGAN has theoretical guarantees on the optimality of the generator and the discriminator. On both synthetic and real-world datasets, RealnessGAN also demonstrates the ability of effectively and steadily capturing the underlying data distribution.
+
+
+Figure 8: Images sampled from RealnessGAN, respectively trained on CIFAR10 (top), CelebA (middle) and FFHQ (bottom).
+
+Acknowledgement We thank Zhizhong Li for helpful discussion on the theoretical analysis. This work is partially supported by the Collaborative Research Grant of "Large-scale Multi-modality Analytics" from SenseTime (CUHK Agreement No. TS1712093), the General Research Funds (GRF) of Hong Kong (No. 14209217 and No. 14205719), Singapore MOE AcRF Tier 1, NTU SUG, and NTU NAP.
+
+# REFERENCES
+
+Martin Arjovsky, Soumith Chintala, and Léon Bottou. Wasserstein gan. arXiv preprint arXiv:1701.07875, 2017.
+David Berthelot, Thomas Schumm, and Luke Metz. Began: Boundary equilibrium generative adversarial networks. arXiv preprint arXiv:1703.10717, 2017.
+Andrew Brock, Jeff Donahue, and Karen Simonyan. Large scale gan training for high fidelity natural image synthesis. In ICLR, 2019.
+Bo Dai, Sanja Fidler, Raquel Urtasun, and Dahua Lin. Towards diverse and natural image descriptions via a conditional gan. In Proceedings of the IEEE International Conference on Computer Vision, pp. 2970-2979, 2017.
+Vincent Dumoulin, Ishmael Belghazi, Ben Poole, Alex Lamb, Martin Arjovsky, Olivier Mastropietro, and Aaron C. Courville. Adversarily learned inference. *ArXiv*, abs/1606.00704, 2016.
+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.
+Ishaan Gulrajani, Faruk Ahmed, Martin Arjovsky, Vincent Dumoulin, and Aaron Courville. Improved training of wasserstein gans. In Proceedings of the 31st International Conference on Neural Information Processing Systems, NIPS'17, pp. 5769-5779, USA, 2017. Curran Associates Inc. ISBN 978-1-5108-6096-4. URL http://dl.acm.org/citation.cfm?id=3295222.3295327.
+Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, and Sepp Hochreiter. Gans trained by a two time-scale update rule converge to a local nash equilibrium. In Advances in Neural Information Processing Systems, pp. 6626-6637, 2017.
+Sergey Ioffe and Christian 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, pp. 448-456. JMLR.org, 2015. URL http://dl.acm.org/citation.cfm?id=3045118.3045167.
+Alexia Jolicoeur-Martineau. The relativistic discriminator: a key element missing from standard gan. In ICLR, 2019.
+Tero Karras, Timo Aila, Samuli Laine, and Jaakko Lehtinen. Progressive growing of GANs for improved quality, stability, and variation. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id=Hk99zCeAb.
+Tero Karras, Samuli Laine, and Timo Aila. A style-based generator architecture for generative adversarial networks. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2019.
+Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In Yoshua Bengio and Yann LeCun (eds.), 3rd International Conference on Learning Representations, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Conference Track Proceedings, 2015. URL http://arxiv.org/abs/1412.6980.
+Alex Krizhevsky. Learning multiple layers of features from tiny images. Technical report, 2009.
+Christian Ledig, Lucas Theis, Ferenc Huszár, Jose Caballero, Andrew Cunningham, Alejandro Acosta, Andrew Aitken, Alykhan Tejani, Johannes Totz, Zehan Wang, and Wenzhe Shi. Photorealistic single image super-resolution using a generative adversarial network. In 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 105-114, July 2017. doi: 10.1109/CVPR.2017.19.
+Chieh Hubert Lin, Chia-Che Chang, Yu-Sheng Chen, Da-Cheng Juan, Wei Wei, and Hwann-Tzong Chen. COCO-GAN: Conditional coordinate generative adversarial network, 2019. URL https://openreview.net/forum?id=r14Aas09Y7.
+
+Ziwei Liu, Ping Luo, Xiaogang Wang, and Xiaou Tang. Deep learning face attributes in the wild. In Proceedings of International Conference on Computer Vision (ICCV), December 2015.
+Xudong Mao, Qing Li, Haoran Xie, Raymond YK Lau, Zhen Wang, and Stephen Paul Smolley. Least squares generative adversarial networks. In ICCV, 2017.
+Takeru Miyato, Toshiki Kataoka, Masanori Koyama, and Yuichi Yoshida. Spectral normalization for generative adversarial networks. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id=B1QRgziT-.
+Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. arXiv preprint arXiv:1511.06434, 2015.
+Lantao Yu, Weinan Zhang, Jun Wang, and Yong Yu. Seqgan: Sequence generative adversarial nets with policy gradient. In AAAI, 2017.
+Han Zhang, Tao Xu, Hongsheng Li, Shaoting Zhang, Xiaolei Huang, Xiaogang Wang, and Dimitris N. Metaxas. Stackgan: Text to photo-realistic image synthesis with stacked generative adversarial networks. 2017 IEEE International Conference on Computer Vision (ICCV), pp. 5908-5916, 2016.
+Junbo Zhao, Michael Mathieu, and Yann LeCun. Energy-based generative adversarial network. In ICLR, 2017.
+Jun-Yan Zhu, Taesung Park, Phillip Isola, and Alexei A Efros. Unpaired image-to-image translation using cycle-consistent adversarial networks. In ICCV, 2017.
\ No newline at end of file
diff --git a/realornotrealthatisthequestion/images.zip b/realornotrealthatisthequestion/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..56d791f93f1c1232e107c7a1dc75607c61945e60
--- /dev/null
+++ b/realornotrealthatisthequestion/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ecc4a0beff4b2cc6f672d31628a9bb228e459a142a2e9a5899d203d568e95a4b
+size 762207
diff --git a/realornotrealthatisthequestion/layout.json b/realornotrealthatisthequestion/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..ab08b061538022917b3eb31fff88a38482731643
--- /dev/null
+++ b/realornotrealthatisthequestion/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b65ad33ba5feb87514e8ca0bcd82ec1b74372455edf1c6c4a1c8ac2624653ae2
+size 471224
diff --git a/reconstructingcontinuousdistributionsof3dproteinstructurefromcryoemimages/5b9a6908-a9d2-4009-96cb-208d7b12a437_content_list.json b/reconstructingcontinuousdistributionsof3dproteinstructurefromcryoemimages/5b9a6908-a9d2-4009-96cb-208d7b12a437_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..8b764d31205efee37af18e09548b1058678814fb
--- /dev/null
+++ b/reconstructingcontinuousdistributionsof3dproteinstructurefromcryoemimages/5b9a6908-a9d2-4009-96cb-208d7b12a437_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:efe451054d183926eb3ee3f204ec8beee45f8c7c3a81644cd5116d1ceb2fee42
+size 106543
diff --git a/reconstructingcontinuousdistributionsof3dproteinstructurefromcryoemimages/5b9a6908-a9d2-4009-96cb-208d7b12a437_model.json b/reconstructingcontinuousdistributionsof3dproteinstructurefromcryoemimages/5b9a6908-a9d2-4009-96cb-208d7b12a437_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..7cc8347861f369f87979ec059d5e8f2aa1c84f52
--- /dev/null
+++ b/reconstructingcontinuousdistributionsof3dproteinstructurefromcryoemimages/5b9a6908-a9d2-4009-96cb-208d7b12a437_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:80372eede170a6b6fd013c51298469d3e7e9ac3e58f2927b65fbbfecba627f05
+size 124416
diff --git a/reconstructingcontinuousdistributionsof3dproteinstructurefromcryoemimages/5b9a6908-a9d2-4009-96cb-208d7b12a437_origin.pdf b/reconstructingcontinuousdistributionsof3dproteinstructurefromcryoemimages/5b9a6908-a9d2-4009-96cb-208d7b12a437_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..ed70ae7886378dfc0376e27c7be0d6de6ffa5b7a
--- /dev/null
+++ b/reconstructingcontinuousdistributionsof3dproteinstructurefromcryoemimages/5b9a6908-a9d2-4009-96cb-208d7b12a437_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0c536d46c3f2f45bed32d396e00d9f5e43700fbfca60969125ec6c8a07072e0b
+size 9167754
diff --git a/reconstructingcontinuousdistributionsof3dproteinstructurefromcryoemimages/full.md b/reconstructingcontinuousdistributionsof3dproteinstructurefromcryoemimages/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..43dba901a5b1a78febf6e4a9ecaaa5ef7e4b31b6
--- /dev/null
+++ b/reconstructingcontinuousdistributionsof3dproteinstructurefromcryoemimages/full.md
@@ -0,0 +1,414 @@
+# RECONSTRUCTING CONTINUOUS DISTRIBUTIONS OF 3D PROTEIN STRUCTURE FROM CRYO-EM IMAGES
+
+Ellen D. Zhong
+
+MIT
+
+zhonge@mit.edu
+
+Tristan Bepler
+
+MIT
+
+tbepler@mit.edu
+
+Joseph H. Davis*
+
+MIT
+
+jhDavis@mit.edu
+
+Bonnie Berger*
+
+MIT
+
+bab@mit.edu
+
+# ABSTRACT
+
+Cryo-electron microscopy (cryo-EM) is a powerful technique for determining the structure of proteins and other macromolecular complexes at near-atomic resolution. In single particle cryo-EM, the central problem is to reconstruct the 3D structure of a macromolecule from $10^{4 - 7}$ noisy and randomly oriented 2D projection images. However, the imaged protein complexes may exhibit structural variability, which complicates reconstruction and is typically addressed using discrete clustering approaches that fail to capture the full range of protein dynamics. Here, we introduce a novel method for cryo-EM reconstruction that extends naturally to modeling continuous generative factors of structural heterogeneity. This method encodes structures in Fourier space using coordinate-based deep neural networks, and trains these networks from unlabeled 2D cryo-EM images by combining exact inference over image orientation with variational inference for structural heterogeneity. We demonstrate that the proposed method, termed cryoDRGN, can perform ab initio reconstruction of 3D protein complexes from simulated and real 2D cryo-EM image data. To our knowledge, cryoDRGN is the first neural network-based approach for cryo-EM reconstruction and the first end-to-end method for directly reconstructing continuous ensembles of protein structures from cryo-EM images.
+
+# 1 INTRODUCTION
+
+Cryo-electron microscopy (cryo-EM) is a Nobel Prize-winning technique capable of determining the structure of proteins and macromolecular complexes at near-atomic resolution. In a single particle cryo-EM experiment, a purified solution of the target protein or biomolecular complex is frozen in a thin layer of vitreous ice and imaged at sub-nanometer resolution using an electron microscope. After initial preprocessing and segmentation of the raw data, the dataset typically comprises $10^{4-7}$ noisy projection images. Each image contains a separate instance of the molecule, recorded as the molecule's electron density integrated along the imaging axis (Figure 1). A major bottleneck in cryo-EM structure determination is the computational task of 3D reconstruction, where the goal is to solve the inverse problem of learning the structure, i.e. the 3D electron density volume, which gave rise to the projection images. Unlike classic tomographic reconstruction (e.g. MRI), cryo-EM reconstruction is complicated by the unknown orientation of each copy of the molecule in the ice. Furthermore, cryo-EM reconstruction algorithms must handle challenges such as an extremely low signal to noise ratio (SNR), unknown in-plane translations, imperfect signal transfer due to microscope optics, and discretization of the measurements. Despite these challenges, continuing advances in hardware and software have enabled structure determination at near-atomic resolution for rigid proteins (Kuhlbrandt (2014); Scheres (2012b); Renaud et al. (2018); Li et al. (2013)).
+
+Many proteins and other biomolecules are intrinsically flexible and undergo large conformational changes to perform their function. Since each cryo-EM image contains a unique instance of the molecule of interest, cryo-EM has the potential to resolve structural heterogeneity, which is experimentally infeasible with other structural biology techniques such as X-ray crystallography. However, this heterogeneity poses a substantial challenge for reconstruction as each image is no longer of the same structure. Traditional reconstruction algorithms address heterogeneity with discrete clustering
+
+approaches, however, protein conformations are continuous and may be poorly approximated with discrete clusters (Malhotra & Udgaonkar (2016); Nakane et al. (2018)).
+
+Here, we introduce a neural network-based reconstruction algorithm that learns a continuous low-dimensional manifold over a protein's conformational states from unlabeled 2D cryo-EM images. We present an end-to-end learning framework for a generative model over 3D volumes using an image encoder-volume decoder neural network architecture. Extending spatial-VAE, we formulate our decoder as a function of 3D Cartesian coordinates and unconstrained latent variables representing factors of image variation that we expect to result from protein structural heterogeneity (Bepler et al. (2019)). All inference is performed in Fourier space, which allows us to efficiently relate 2D projections to 3D volumes via the Fourier slice theorem. By
+
+
+Figure 1: Cryo-EM reconstruction algorithms tackle the inverse problem of determining the 3D electron density volume from $10^{4 - 7}$ noisy images. Each image is a noisy projection of a unique instance of the molecule suspended in ice at a random orientation. Algorithms must jointly learn the volume and the orientation of each particle image. Example image from Wong et al. (2014).
+
+formulating our decoder as a function of Cartesian coordinates, we can explicitly model the imaging operation to disentangle the orientation of the molecule during imaging from intrinsic protein structural heterogeneity. Our learning framework avoids errant local minima in image orientation by optimizing with exact inference over a discretization of $SO(3) \times \mathbb{R}^2$ using a branch and bound algorithm. The unconstrained latent variables are trained in the standard variational autoencoder approach. We present results on both real and simulated cryo-EM data.
+
+# 2 BACKGROUND AND NOTATION
+
+# 2.1 IMAGE FORMATION MODEL
+
+Cryo-EM aims to recover a structure of interest $V: \mathbb{R}^3 \to \mathbb{R}$ consisting of an electron density at each point in space based on a collection of noisy images $X_1, \ldots, X_N$ produced by projecting (i.e. integrating) the volume in an unknown orientation along the imaging axis. Formally, the generation of image $X$ can be modeled as:
+
+$$
+X \left(r _ {x}, r _ {y}\right) = g * \int_ {\mathbb {R}} V \left(R ^ {T} \mathbf {r} + t\right) d r _ {z} + n o i s e \quad \mathbf {r} = \left(r _ {x}, r _ {y}, r _ {z}\right) ^ {T} \tag {1}
+$$
+
+where $V$ is the electron density (volume), $R \in SO(3)$ , the 3D rotation group, is an unknown orientation of the volume, and $t = (tx,ty,0)$ is an unknown in-plane translation, corresponding to imperfect centering of the volume within the image. The image signal is convolved with $g$ , the point spread function for the microscope before being corrupted with frequency-dependent noise and registered on a discrete grid of size DxD, where D is the size of the image along one dimension.
+
+The reconstruction problem is simplified by the observation that the Fourier transform of a 2D projection of $V$ is a 2D slice through the origin of $V$ in the Fourier domain, where the slice is perpendicular to the projection direction. This correspondence is known as the Fourier slice theorem (Bracewell (1956)). In the Fourier domain, the generative process for image $\hat{X}$ from volume $\hat{V}$ can thus be written:
+
+$$
+\hat {X} \left(k _ {x}, k _ {y}\right) = \hat {g} S (t) A (R) \hat {V} \left(k _ {x}, k _ {y}\right) + \epsilon \tag {2}
+$$
+
+where $\hat{g} = \mathcal{F}g$ is the contrast transfer function (CTF) of the microscope, $S(t)$ is a phase shift operator corresponding to image translation by $t$ in real space, and $A(R)\hat{V} = \hat{V}(R^T(\cdot,\cdot,0)^T)$ is a linear slice operator corresponding to rotation by $R$ and linear projection along the z-axis in real space. The frequency-dependent noise $\epsilon$ is typically modelled as independent, zero-centered Gaussian noise in Fourier space. Under this model, the probability of observing an image $\hat{X}$ with pose $\phi = (R,t)$ from volume $\hat{V}$ is thus:
+
+$$
+p (\hat {X} | \phi , \hat {V}) = p (\hat {X} | R, t, \hat {V}) = \frac {1}{Z} \exp \left(\sum_ {l} \frac {- 1}{2 \sigma_ {l} ^ {2}} \left| \hat {g} _ {l} A _ {l} (R) \hat {V} - S _ {l} (t) \hat {X} _ {l} \right| ^ {2}\right) \tag {3}
+$$
+
+where $l$ is a two-component index over Fourier coefficients for the image, $\sigma_{l}$ is the width of the Gaussian noise expected at each frequency, and $Z$ is a normalization constant.
+
+# 2.2 TRADITIONAL CRYO-EM RECONSTRUCTION
+
+To recover the desired structure, cryo-EM reconstruction methods must jointly solve for the unknown volume $V$ and image poses $\phi_i = (R_i, t_i)$ . Expectation maximization (Scheres (2012a)) and simpler variants of coordinate ascent are typically employed to find a maximum a posteriori estimate of $V$ marginalizing over the posterior distribution of $\phi_i$ 's, i.e.:
+
+$$
+V ^ {\mathrm {M A P}} = \arg \max _ {V} \sum_ {i = 1} ^ {N} \log \int p \left(X _ {i} \mid \phi , V\right) p (\phi) d \phi + \log p (V) \tag {4}
+$$
+
+Intuitively, given $V^{(n)}$ , the estimate of the volume at iteration $n$ , images are first aligned with $V^{(n)}$ (E-step), then with the updated alignments, the images are backprojected to yield $V^{(n + 1)}$ (M-step). This iterative refinement procedure is sensitive to the initial estimate of $V$ as the optimization objective is highly nonconvex; stochastic gradient descent is commonly used for ab initio reconstruction1 to provide an initial estimate $V^{(0)}$ (Punjani et al. (2017)).
+
+Given sample heterogeneity, the standard approach in the cryo-EM field is to simultaneously reconstruct $K$ independent volumes. Termed multiclass refinement, the image formation model is extended to assume images are generated from $V_{1},\ldots ,V_{K}$ independent volumes, with inference now requiring marginalization over $\phi_i$ 's and class assignment probabilities $\pi_j$ 's:
+
+$$
+\underset {V _ {1}, \dots , V _ {K}} {\arg \max } \sum_ {i = 1} ^ {N} \log \sum_ {j = 1} ^ {K} \left(\pi_ {j} \int p \left(X _ {i} \mid \phi , V _ {j}\right) p (\phi) d \phi\right) + \sum_ {j = 1} ^ {K} \log p \left(V _ {j}\right) \tag {5}
+$$
+
+While this formulation is sufficiently descriptive when the structural heterogeneity consists of a small number of discrete conformations, it suffers when the heterogeneity is complex or when conformations lie along a continuum of states. In practice, resolving such heterogeneity is handled through a hierarchical approach refining subsets of the imaging dataset with manual choices for the number of classes and the initial models for refinement. Because the number and nature of the underlying structural states are unknown, multiclass refinement is error-prone, and in general, the identification and analysis of heterogeneity is an open problem in single particle cryo-EM.
+
+# 3 METHODS
+
+We propose a neural network-based reconstruction method, cryoDRGN (Deep Reconstructing Generative Networks), that can perform ab-initio unsupervised reconstruction of a continuous distribution over 3D volumes from unlabeled 2D images (Figure 2). We formulate an image encoder-volume decoder architecture based on the variational autoencoder (VAE) (Kingma & Welling (2013)), where protein structural heterogeneity is modeled in the latent variable. While a standard VAE assumes all sources of image heterogeneity are entangled in the latent variable, we propose an architecture that enables modelling the intrinsic heterogeneity of the volume separately from the extrinsic orientation of the volume during imaging. Our end-to-end training framework explicitly models the forward image formation process to relate 2D views to 3D volumes and employs two separate strategies for inference: a variational approach for the unconstrained latent variables and a global search over $SO(3)\times \mathbb{R}^2$ for the unknown pose of each image. These elements are described in further detail below.
+
+# 3.1 GENERATIVE MODEL
+
+We design a deep generative model to approximate a single function, $\hat{V}:\mathbb{R}^{3 + n}\to \mathbb{R}$ , representing a $n$ -dimensional manifold of 3D electron densities in the Fourier domain. Specifically, the volume $\hat{V}$ is modelled as a probabilistic decoder $p_{\theta}(\hat{V} |k,z)$ , where $\theta$ are parameters of a multilayer perceptron (MLP). Given Cartesian coordinates $k\in \mathbb{R}^3$ and continuous latent variable $z$ , the decoder outputs distribution parameters for a Gaussian distribution over $\hat{V} (k,z)$ , i.e. the electron density of volume $\hat{V}_z$ at frequency $k$ in Fourier space. Unlike a standard deconvolutional decoder which produces a separate distribution for each voxel of a $D^3$ lattice given the latent variable, following spatial-VAE, we model a function over Cartesian coordinates (Bepler et al. (2019)). Here, these coordinates are explicitly treated as each pixel's location in 3D Fourier space and thus enforce the topological constraints between 2D views in 3D via the Fourier slice theorem.
+
+By the image formation model, each image corresponds to an oriented central slice of the 3D volume in the Fourier domain (Section 2). During training, the 3D coordinates of an image's pixels can be explicitly represented by the rotation of a DxD lattice initially on the x-y plane. Under this model, the log probability of an image, $\hat{X}$ , represented as a vector of size DxD, given the current MLP, latent pose variables $R\in SO(3)$ and $t\in \mathbb{R}^2$ , and unconstrained latent variable, $z$ , is:
+
+$$
+\log p (\hat {X} | R, t, z) = \log p (\hat {X} ^ {\prime} | R, z) = \sum_ {i} \log p _ {\theta} (\hat {V} | R ^ {T} c _ {0} ^ {(i)}, z) \tag {6}
+$$
+
+where $i$ indexes over the coordinates of a fixed lattice $c_{0}$ . Note that $\hat{X}^{\prime} = S(-t)\hat{X}$ is the centered image, where $S$ is the phase shift operator corresponding to image translation in real space. We define $c_{0}$ as a vector of 3D coordinates of a fixed lattice spanning $[-0.5, 0.5]^{2}$ on the x-y plane to represent the unoriented coordinates of an image's pixels.
+
+Instead of directly supplying $k$ , a fixed positional encoding of $k$ is supplied to the decoder, consisting of sine and cosine waves of varying frequency:
+
+$$
+p e ^ {(2 i)} \left(k _ {j}\right) = \sin \left(k _ {j} D \pi (2 / D) ^ {2 i / D}\right), i = 1, \dots , D / 2; k _ {j} \in k \tag {7}
+$$
+
+$$
+p e ^ {(2 i + 1)} \left(k _ {j}\right) = \cos \left(k _ {j} D \pi (2 / D) ^ {2 i / D}\right), i = 1, \dots , D / 2; k _ {j} \in k \tag {8}
+$$
+
+Without loss of generality, we assume a length scale by our definition of $c_{0}$ which restricts the support of the volume to a sphere of radius 0.5. The wavelengths of the positional encoding thus follow a geometric series spanning the Fourier basis from wavelength 1 to the Nyquist limit $(2 / D)$ of the image data. While this encoding empirically works well for noiseless data, we obtain better results with a slightly modified featurization for noisy datasets consisting of a geometric series which excludes the top 10 percentile of highest frequency components of the noiseless positional encoding.
+
+# 3.2 INFERENCE
+
+We employ a standard VAE for approximate inference of the latent variable $z$ , but use a global search to infer the pose $\phi = (R, t)$ using a branch and bound algorithm.
+
+Variational encoder: As each cryo-EM image is a noisy projection of an instance of the volume at a random, unknown pose (viewing direction), the image encoder aims to learn a pose-invariant representation of the protein's structural heterogeneity. Following the standard VAE framework, the probabilistic encoder $q_{\xi}(z|\hat{X})$ is a MLP with variational parameters $\xi$ and Gaussian output with diagonal covariance. Given an input cryo-EM image $\hat{X}$ , represented as a DxD vector, the encoder MLP outputs $\mu_{z|\hat{X}}$ and $\Sigma_{z|\hat{X}}$ , statistics that parameterize an approximate posterior to the intractable true posterior $p(z|\hat{X})$ . The prior on $z$ is a standard normal, $\mathcal{N}(0,\mathbf{I})$ .
+
+Pose inference: We perform a global search over $SO(3) \times \mathbb{R}^2$ for the maximum-likelihood pose for each image given the current decoder MLP and a sampled value of $z$ from the approximate posterior. Two techniques are used to improve the efficiency of the search over poses: (1) discretizing the search space on a uniform grid and sub-dividing grid points after pruning candidate poses with
+
+
+Figure 2: CryoDRGN model architecture. We use a VAE to perform approximate inference for latent variable $z$ denoting image heterogeneity. The decoder reconstructs an image pixel by pixel given $z$ and $pe(k)$ , the positional encoding of 3D Cartesian coordinates. The 3D coordinates corresponding to each image pixel are obtained by rotating a DxD lattice on the x-y plane by $R$ , the image orientation. The latent orientation for each image is inferred through a branch and bound global optimization procedure (not shown).
+
+branch and bound (BNB), and (2) band pass limiting the objective to low frequency components and incrementally increasing the k-space limit at each iteration (frequency marching). The pose inference procedure encodes the intuition that low-frequency components dominate pose estimation, and is fully described in Appendix A.
+
+In summary, for a given image $\hat{X}_i$ , the image encoder produces $\mu_{z|\hat{X}_i}$ and $\Sigma_{z|\hat{X}_i}$ . A sampled value of the latent $z_i \sim \mathcal{N}(\mu_{z|\hat{X}_i}, \Sigma_{z|\hat{X}_i})$ is broadcast to all pixels. Given $z_i$ and the current decoder, BNB orientational search identifies the maximum likelihood rotation $R_i$ and translation $t_i$ for $\hat{X}_i$ . The decoder $p_\theta$ then reconstructs the image pixel by pixel given the positional encoding of $R_i^T c_0$ and $z_i$ . The phase shift corresponding to $t_i$ and optionally the microscope CTF $\hat{g}_i$ is then applied on the reconstructed pixel intensities. Following the standard VAE framework, the optimization objective is the variational lower bound of the model evidence:
+
+$$
+\mathcal {L} (\hat {X} _ {i}; \xi , \theta) = \mathbb {E} _ {q _ {\xi} (z | \hat {X} _ {i})} [ \log p _ {\theta} (\hat {X} _ {i} | z) ] - K L (q _ {\xi} (z | \hat {X} _ {i}) | | p (z)) \tag {9}
+$$
+
+where the expectation of the log likelihood is estimated with one Monte Carlo sample. By comparing many 2D slices from the imaging dataset, the volume can be learned through feedback from these single views. Furthermore, this learning process is denoising as overfitting to noise from a single image would lead to higher reconstruction error for other views. We note that the distribution of 3D volumes models heterogeneity within a single imaging dataset, capturing structural variation for a particular protein or biomolecular complex, and that a separate network is trained per experimental dataset. Unless otherwise specified, the encoder and decoder networks are both MLPs containing 10 hidden layers of dimension 128 with ReLU activations. Further architecture and implementation details are given in Appendix A.
+
+# 4 RELATED WORK
+
+Homogeneous cryo-EM reconstruction: Cryo-EM reconstruction is typically accomplished in two stages: 1) generation of an initial low-resolution model followed by 2) iterative refinement of the initial model with a coordinate ascent procedure alternating between projection matching and refinement of the structure. In practice, initial structures can be obtained experimentally (Leschziner & Nogales (2006)), inferred based on homology to complexes with known structure, or via ab-initio reconstruction with stochastic gradient descent (Punjani et al. (2017)). Once an initial model is generated, there are many tools for iterative refinement of the model (Scheres (2012b); Punjani et al. (2017); Hohn et al. (2007); Lyumkis, Dmitry et al. (2013); Tang et al. (2007)). For example, Scheres (2012a) presents a Bayesian approach based on a probabilistic model of the image formation process and refines the structure via Expectation Maximization. Frequency marching is used extensively in existing tools to speed up the search for the optimal pose for each image (Scheres (2012b); Barnett et al. (2016); Punjani et al. (2017)). CryoSPARC implements a branch and bound optimization scheme, where their bound is a probabilistic lower bound based on the noise characteristics from the
+
+image formation model (Punjani et al. (2017)). Ullrich et al. (2019) propose a differentiable voxel-based representation for the volume and introduce a variational inference algorithm for homogeneous reconstruction with known poses.
+
+Heterogeneous cryo-EM reconstruction: In the cryo-EM literature, standard approaches for addressing structural heterogeneity use mixture models of discrete, independent volumes, termed multiclass refinement (Scheres (2010); Lyumkis, Dmitry et al. (2013)). These mixture models assume that the clusters are independent and homogeneous, and in practice require many rounds of expert-guided hierarchical clustering from appropriate initial volumes and manual choices for number of clusters. More recently, Nakane et al. (2018) extend the image generative model to model the protein as a sum of rigid bodies (determined from a homogeneous reconstruction), thus imposing structural assumptions on the type of heterogeneity. Frank & Ourmazd (2016) aim to build a continuous manifold of the images, however their approach requires pose supervision and final structures are obtained by clustering the images along the manifold and reconstructing with traditional tools. Recent theoretical work for continuous heterogeneous reconstruction includes expansion of discrete 3D volumes in a basis of Laplacian eigenvectors (Moscovich et al. (2019)) and a general framework for modelling hyper-volumes (Lederman et al. (2019)) e.g. as a tensor product of spatial and temporal basis functions (Lederman & Singer (2017)). To our knowledge, our work is the first to apply deep neural networks to cryo-EM reconstruction, and in doing so, is the first that can learn a continually heterogeneous volume from real cryo-EM data.
+
+Neural network 3D reconstruction in computer vision: There is a large body of work in computer vision on 3D object reconstruction from 2D viewpoints. While these general approaches have elements in common with single particle cryo-EM reconstruction, the problem in the context of computer vision differs substantially in that 2D viewpoints are not projections and viewing directions are typically known. For example, Yan et al. (2016) propose a neural network that can predict a 3D volume from a single 2D viewpoint using only 2D image supervision. Gadelha et al. (2017) learn a generative model over 3D object shapes based on 2D images of the objects thereby disentangling variation in shape and pose. Tulsiani et al. (2018) also reconstruct and disentangle the shape and pose of 3D objects from 2D images by enforcing geometric consistency. These works attempt to encode the viewpoint 'projection' operation explicitly in the model in a manner similar to our use of the Fourier slice theorem.
+
+Coordinate-based neural networks in computer vision: Using spatial (i.e. pixel) coordinates as features to a convolutional decoder to improve generative modeling has been proposed many times, with recent work computing each image as a function of a fixed coordinate lattice and latent variables (Watters et al. (2019)). However, directly modeling a function that maps spatial coordinates to values is less extensively explored. In CocoNet, the authors present a deep neural network that maps 2D pixel coordinates to RBG color values. CocoNet learns an image model for single images, using the capacity of the network to memorize the image, which can then be used for various tasks such as denoising and upsampling (Bricman & Ionescu (2018)). Similarly, Spatial-VAE proposes a similar coordinate-based image model to enforce geometric consistency between rotated 2D images in order to learn latent image factors and disentangle positional information from image content (Bepler et al. (2019)). Our method extends many of these ideas from simpler 2D image modelling to enable 3D cryo-EM reconstruction in the Fourier domain.
+
+# 5 RESULTS
+
+Here, we present both qualitative and quantitative results for 1) homogeneous cryo-EM reconstruction, validating that cryoDRGN reconstructed volumes match those from existing tools; 2) heterogeneous cryo-EM reconstruction with pose supervision, demonstrating automatic learning of the latent manifold that previously required many expert-guided rounds of multiclass refinement; and 3) fully unsupervised reconstruction of continuous distributions of 3D protein structures, a capability not provided by any existing tool.
+
+# 5.1 UNSUPERVISED HOMOGENEOUS RECONSTRUCTION
+
+We first evaluate cryoDRGN on homogeneous datasets, where existing tools are capable of reconstruction. We create two synthetic datasets following the cryo-EM image formation model (image size $D = 128$ , 50k projections, with and without noise), and use one real dataset from EMPIAR-10028 consisting of 105,247 images of the 80S ribosome downsampled to image size $D = 90$ . The encoder network is not used in homogeneous reconstruction. As a baseline for comparison, we perform homogeneous ab-initio reconstruction followed by iterative refinement in cryoSPARC (Punjani et al. (2017)). We compare against cryoSPARC as a representative of traditional state-of-the-art tools, which all implement variants of the same algorithm (Section 2). Further dataset preprocessing and
+
+training details are given in Appendix B.
+
+We find that cryoDRGN inferred poses and reconstructed volumes match those from state of-the-art tools. The similarity of the volumes to the ground truth can be quantified with the with the Fourier shell correlation (FSC) curve3. Reconstructed volumes and quantitative comparison with the FSC curve is given in Figure S5. Pose error to the ground truth image poses are
+
+given in Table 1. For the real cryoEM dataset (no ground truth), the median pose difference between cryoDRGN and cryoSPARC reconstructions is 0.002 for rotations and 1.0 pixels for translations, and the resulting volumes are correlated above a FSC cutoff of 0.5 across all frequencies.
+
+| Method | Dataset |
| No Noise | SNR=0.1 |
| cryoSPARC | 0.0009 / 0.47 | 0.002 / 0.64 |
| cryoDRGN | 0.0004 / 0.27 | 0.003 / 0.38 |
+
+Table 1: Homogeneous reconstruction pose accuracy quantified by median rotation/translation error to the ground truth image poses. Rotation/translation error is defined as the Frobenius/L2 norm after alignment.
+
+to ground truth), the median pose difference between 2002 for rotations and 1.0 pixels for translations, and 1.5 C cutoff of 0.5 across all frequencies.
+
+# 5.2 HETEROGENEOUS RECONSTRUCTION WITH POSE SUPERVISION
+
+Next, we evaluate cryoDRGN for heterogeneous cryo-EM reconstruction on EMPIAR-10076, a real dataset of the $E.$ coli large ribosomal subunit (LSU) undergoing assembly (131,899 images, downsampled to D=90) (Davis et al. (2016)). Here, poses are obtained through alignment to an existing structure of the LSU and treated as known during training. In the original analysis of this dataset, multiple rounds of discrete multiclass refinement with varying number of classes followed by human comparison of similar volumes were used to identify 4 major structural states of the LSU. We train cryoDRGN with a 1-D latent variable treating image pose as fixed to skip BNB pose inference. As a baseline, we reproduce the published structures originally obtained through multiclass refinement with cryoSPARC. Further baseline and training details are given in Appendix C.
+
+We find that CryoDRGN automatically identifies all 4 major states of the LSU (Figure 3a). Quantitative comparison with FSC curves $^{3}$ and additional volumes along the latent space are shown in Figure S7. We compare the cryoDRGN latent encoding $\mu_{z|X}$ for each image to the MAP cluster assignment in cryoSPARC and find that the learned latent manifold aligns with cryoSPARC clusters (Figure 3b). CryoDRGN identifies subpopulations in some of the cryoSPARC clusters (e.g. Class D), which is partitioned by a subsequent round of cryoSPARC multiclass refinement (Figure S8). Published structures A and F correspond to impurities in the sample. CryoDRGN correctly assigns images from these impurities to distinct clusters, but does not learn their correct structure since the poses inferred from aligning to the LSU template structure are incorrect.
+
+
+cryoDRGN
+
+
+
+
+cryoSPARC
+
+
+
+
+a)
+b)
+Figure 3: a) Volumes generated at values of the latent (at dashed lines) match the published volumes of the 4 major states B-E of the LSU. b) Distribution of images in the latent space, colored by cluster assignment from a discrete multiclass reconstruction in cryoSPARC.
+
+
+Figure 4: Left: Ground truth volume containing a continuous circular 1D motion. Middle: Reconstructed structures from cryoDRGN match the ground truth volumes with the correct continuous deformation. We visualize 10 structures (superimposed) sampled at the depicted points in the latent space. The distribution of images in the latent space (visualized in 2D with PCA) matches the topology of the true data manifold. Right: Reconstructed volumes from discrete 3-class reconstruction in cryoSPARC and the distribution of images over the three reconstructed volumes.
+
+| Dataset | cryoDRGN | cryoDRGN+tilt | cryoSPARC |
| Linear 1D motion | 2.50(0.62) | 2.35(0.36) | 3.60(2.27) |
| Linear 2D motion | 4.44(2.50) | 2.93(1.02) | 6.90(3.77) |
| Circular 1D motion | 4.05(2.40) | 2.63(0.74) | 4.87(2.17) |
| Discrete 10 class | 4.95(3.16) | 2.58(1.00) | 5.69(5.15) |
+
+Table 2: Reconstruction accuracy quantified by an FSC=0.5 resolution metric between the reconstructed volumes corresponding to each image and its ground truth volume. We report the average and standard deviation across 100 images in the dataset (lower is better; best possible is 2 pixels).
+
+# 5.3 UNSUPERVISED HETEROGENEOUS RECONSTRUCTION
+
+We test the ability of cryoDRGN to perform fully unsupervised heterogeneous reconstruction from datasets with different latent structure. We generate four datasets (each 50k projections, $D = 64$ ) from an atomic model of a protein complex, containing either a 1D continuous motion, 2D continuous motion, 1D continuous circular motion, or a mixture of 10 discrete conformations (Figure S7). We train cryoDRGN with a 1D latent variable for the linear 1D dataset and a 10D latent variable for the other 3 datasets. As a baseline, we perform multiclass reconstruction in cryoSPARC sweeping $K = 2 - 5$ classes. We compare against $K = 3$ , which had the best qualitative results.
+
+We also propose a modification to cryoDRGN in order to train on tilt series pairs datasets. Tilt series pairs is a variant of cryo-EM in which, for each image $X_{i}$ , a corresponding image $X_{i}^{\prime}$ is acquired after tilting the imaging stage by a known angle. This technique was originally employed to identify the chirality of molecules (Belnap et al. (1997)), which is lost in the projection from 3D to 2D. We propose using tilt series pairs to encourage invariance of $q_{\xi}$ with respect to pose transformations for a given $\hat{V}_{\mathbf{z}}$ (and incidentally to identify the chirality of $\hat{V}_{\mathbf{z}}$ ). We make minor modifications to the architecture as described in Appendix D.
+
+In Figure 4, we show that cryoDRGN reconstructed volumes for the circular 1D dataset qualitatively match the ground truth structures. Note that while we only visualize 10 structures sampled along the latent space, the volume decoder can reconstruct the full continuum of states. In contrast, cryoSPARC multiclass reconstruction, a discrete mixture model of independent structures, is only able to reconstruct 2 (originally unaligned) structures which resemble the ground truth. Volumes contain blurring artifacts from clustering images from different conformations into the assumed-homogeneous clusters in the mixture model. Results for the remaining datasets are given in Figures S10-13.
+
+We quantitatively measure performance on this task with an FSC resolution metric computed between the MAP volume for each image $V_{z_i|\hat{X}_i}$ and the ground truth volume which generated each image, averaged across images in the dataset (Table S4). We find that cryoDRGN reconstruction accuracy is much higher than state-of-the-art discrete multiclass reconstruction in cryoSPARC, with further improvement achieved by training on tilt series pairs.
+
+# 6 CONCLUSIONS
+
+We present a novel neural network-based reconstruction method for single particle cryo-EM that learns continuous variation in protein structure. We applied cryoDRGN on a real dataset of highly heterogeneous ribosome assembly intermediates and demonstrate automatic partitioning of structural states. In the presence of simulated continuous heterogeneity, we show that cryoDRGN learns a continuous representation of structure along the true reaction coordinate, effectively disentangling imaging orientation from intrinsic structural heterogeneity. The techniques described here may also have broader applicability to image and volume generative modelling in other domains of computer vision and 3D shape reconstruction.
+
+# ACKNOWLEDGMENTS
+
+We thank Ben Demeo, Ashwin Narayan, Adam Lerer, Roy Lederman, and Kotaro Kelley for helpful discussions and feedback. This work was funded by the National Science Foundation Graduate Research Fellowship Program, NIH grant R01-GM081871, NIH grant R00-AG050749, and the MIT J-Clinic for Machine Learning and Health.
+
+# REFERENCES
+
+Alex Barnett, Leslie Greengard, Andras Pataki, and Marina Spivak. Rapid solution of the cryo-EM reconstruction problem by frequency marching. arXiv.org, October 2016.
+William T Baxter, Robert A Grassucci, Haixiao Gao, and Joachim Frank. Determination of signal-to-noise ratios and spectral SNRs in cryo-EM low-dose imaging of molecules. Journal of structural biology, 166(2):126-132, May 2009.
+D M Belnap, N H Olson, and T S Baker. A method for establishing the handedness of biological macromolecules. Journal of structural biology, 120(1):44-51, October 1997.
+Tristan Bepler, Ellen Zhong, Kotaro Kelley, Edward Brignole, and Bonnie Berger. Explicitly disentangling image content from rotation and translation with spatial-VAE. Neural Informational Processing Systems (NeurIPS), 2019.
+Ronald N Bracewell. Strip integration in radio astronomy. Australian Journal of Physics, 9(2): 198-217, 1956.
+Paul Andrei Bricman and Radu Tudor Ionescu. CocoNet: A deep neural network for mapping pixel coordinates to color values. arXiv.org, May 2018.
+Joseph H Davis, Yong Zi Tan, Bridget Carragher, Clinton S Potter, Dmitry Lyumkis, and James R Williamson. Modular Assembly of the Bacterial Large Ribosomal Subunit. Cell, 167(6):1610-1622.e15, December 2016.
+Joachim Frank and Abbas Ourmazd. Continuous changes in structure mapped by manifold embedding of single-particle data in cryo-EM. Methods (San Diego, Calif.), 100:61-67, May 2016.
+Matheus Gadelha, Subhransu Maji, and Rui Wang. 3d shape induction from 2d views of multiple objects. In 2017 International Conference on 3D Vision (3DV), pp. 402-411. IEEE, 2017.
+Krzysztof M Gorski, Eric Hivon, Anthony J Banday, Benjamin D Wandelt, Frode K Hansen, Mstvos Reinecke, and Matthia Bartelmann. Healpix: a framework for high-resolution discretization and fast analysis of data distributed on the sphere. The Astrophysical Journal, 622(2):759, 2005.
+Ralph VL Hartley. A more symmetrical fourier analysis applied to transmission problems. Proceedings of the IRE, 30(3):144-150, 1942.
+Michael Hohn, Grant Tang, Grant Goodyear, P R Baldwin, Zhong Huang, Pawel A Penczek, Chao Yang, Robert M Glaeser, Paul D Adams, and Steven J Ludtke. SPARX, a new environment for Cryo-EM image processing. Journal of structural biology, 157(1):47-55, January 2007.
+Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
+
+Diederik P Kingma and Max Welling. Auto-encoding variational bayes. In The 2nd International Conference on Learning Representations (ICLR), 2013.
+Werner Kuhlbrandt. Cryo-EM enters a new era. eLife, 3:e03678, August 2014.
+Roy R Lederman and Amit Singer. Continuously heterogeneous hyper-objects in cryo-EM and 3-D movies of many temporal dimensions. arXiv.org, April 2017.
+Roy R Lederman, Joakim Andén, and Amit Singer. Hyper-Molecules: on the Representation and Recovery of Dynamical Structures, with Application to Flexible Macro-Molecular Structures in Cryo-EM. arXiv.org, July 2019.
+Andres E Leschziner and Eva Nogales. The orthogonal tilt reconstruction method: an approach to generating single-class volumes with no missing cone for ab initio reconstruction of asymmetric particles. Journal of structural biology, 153(3):284-299, 2006.
+Xueming Li, Paul Mooney, Shawn Zheng, Christopher R Booth, Michael B Braunfeld, Sander Gubbens, David A Agard, and Yifan Cheng. Electron counting and beam-induced motion correction enable near-atomic-resolution single-particle cryo-EM. Nature methods, 10(6):584-590, June 2013.
+Lyumkis, Dmitry, Brilot, Axel F, Theobald, Douglas L, and Grigorieff, Nikolaus. Likelihood-based classification of cryo-EM images using FREALIGN. Journal of structural biology, 183(3): 377-388, September 2013.
+Pooja Malhotra and Jayant B Udgaonkar. How cooperative are protein folding and unfolding transitions? Protein science : a publication of the Protein Society, 25(11):1924-1941, November 2016.
+Amit Moscovich, Amit Halevi, Joakim Andén, and Amit Singer. Cryo-EM reconstruction of continuous heterogeneity by Laplacian spectral volumes. arXiv.org, July 2019.
+Takanori Nakane, Dari Kimanius, Erik Lindahl, and Sjors Hw Scheres. Characterisation of molecular motions in cryo-EM single-particle data by multi-body refinement in RELION. eLife, 7:e36861, June 2018.
+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. 2017.
+Ali Punjani, John L Rubinstein, David J Fleet, and Marcus A Brubaker. cryoSPARC: algorithms for rapid unsupervised cryo-EM structure determination. Nature methods, 14(3):290–296, March 2017.
+Jean-Paul Renaud, Ashwin Chari, Claudio Ciferri, Wen-Ti Liu, Hervé-William Rémigy, Holger Stark, and Christian Wiesmann. Cryo-EM in drug discovery: achievements, limitations and prospects. Nature reviews. Drug discovery, 17(7):471–492, July 2018.
+Sjors H W Scheres. A Bayesian view on cryo-EM structure determination. Journal of molecular biology, 415(2):406-418, January 2012a.
+Sjors H W Scheres. RELION: implementation of a Bayesian approach to cryo-EM structure determination. Journal of structural biology, 180(3):519-530, December 2012b.
+Sjors HW Scheres. Maximum-likelihood methods in cryo-em. part ii: Application to experimental data. Methods in enzymology, 482:295, 2010.
+Guang Tang, Liwei Peng, Philip R Baldwin, Deepinder S Mann, Wen Jiang, Ian Rees, and Steven J Ludtke. EMAN2: an extensible image processing suite for electron microscopy. Journal of structural biology, 157(1):38-46, January 2007.
+Shubham Tulsiani, Alexei A. Efros, and Jitendra Malik. Multi-view consistency as supervisory signal for learning shape and pose prediction. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2018.
+
+Karen Ullrich, Rianne van den Berg, Marcus Brubaker, David Fleet, and Max Welling. Differentiable probabilistic models of scientific imaging with the Fourier slice theorem. arXiv.org, June 2019.
+Nicholas Watters, Loic Matthey, Christopher P Burgess, and Alexander Lerchner. Spatial Broadcast Decoder: A Simple Architecture for Learning Disentangled Representations in VAEs. arXiv.org, January 2019.
+Wilson Wong, Xiao-Chen Bai, Alan Brown, Israel S Fernandez, Eric Hanssen, Melanie Condron, Yan Hong Tan, Jake Baum, and Sjors H W Scheres. Cryo-EM structure of the Plasmodium falciparum 80S ribosome bound to the anti protozoan drug emetine. eLife, 3:e01963, June 2014.
+Xinchen Yan, Jimei Yang, Ersin Yumer, Yijie Guo, and Honglak Lee. Perspective Transformer Nets: Learning Single-View 3D Object Reconstruction without 3D Supervision. arXiv.org, December 2016.
+Anna Yershova, Swati Jain, Steven M LaValle, and Julie C Mitchell. Generating Uniform Incremental Grids on SO(3) Using the Hopf Fibration. The International Journal of Robotics Research, 29(7): 801-812, May 2010.
+
+# A APPENDIX - METHODS
+
+# A.1 BRANCH AND BOUND IMPLEMENTATION DETAILS
+
+We perform a global search over $SO(3) \times \mathbb{R}^2$ for the maximum-likelihood pose for each image given the current decoder MLP. Two techniques are used to improve the efficiency of the search over poses: (1) discretizing the search space on a uniform grid and sub-dividing grid points after pruning candidate poses with branch and bound, and (2) band pass limiting the objective to low frequency components and incrementally increasing the k-space limit at each iteration (frequency marching).
+
+Our branch and bound algorithm for pose optimization is given in Algorithm 1. Briefly, we discretize $SO(3)$ uniformly using the Hopf fibration Yershova et al. (2010) at a predefined base resolution of the grid and incrementally increase the grid resolution by sub-dividing grid points. At each resolution of the grid, the set of candidate poses is pruned using a branch and bound (BNB) optimization scheme, which alternates between a computationally inexpensive lower bound on the objective function evaluated at all grid points and an upper bound consisting of the true objective evaluated on the best lower-bound candidate. Grid points whose lower bound is higher than this value are excluded for subsequent iterations. In our case, the loss is evaluated on low-frequency components of the image; specifically, Fourier components with $|\mathbf{k}| < k_{max}$ is an effective lower bound, as it is both inexpensive to compute and captures most of the power (and thus the error). This bound encodes the intuition that low-frequency components dominate pose estimation. We concomitantly increase $k_{max}$ at each iteration of grid subdivision.
+
+At each iteration, some poses are excluded by BNB, and the remaining poses are further discretized. Although BNB is risk-free in the sense that the optimal pose at a given resolution will not be pruned, our application of it is not risk-free as a candidate pose with high loss at a given resolution doesn't guarantee that its neighbor in the next iteration will not have a lower loss. Irrespective, in practice, we find that at a sufficiently fine base resolution, we obtain good results on a tractable timescale (hours on a single GPU).4
+
+We reimplement the uniform multiresolution grids on $SO(3)$ based on Yershova et al. (2010), using the Healpix Gorski et al. (2005) grid for the sphere and the Hopf fibration to uniformly lift the grid to $SO(3)$ . The base grid on $SO(3)$ contains 576 orientations. We use the ordinary grid for translations containing $7^2$ points with an extent of 20 pixels for $\mathrm{D} = 128$ datasets. We subdivide the grid 5 times for a final resolution of 0.92 degrees for the orientation and 0.08 pixels for the translation. For $\mathrm{D} = 64$ datasets, we use a translational grid with extent of 10 pixels.
+
+Algorithm 1 CryoDRGN branch and bound with frequency marching
+1: procedure OPTPHI( $\hat{X}$ , $\hat{V}_{\mathbf{z}}$ ) ▷ Find the optimal image pose given the current decoder
+2: $k_{min} \gets 12$ , $k_{max} \gets D/2$ , $N_{iter} \gets 5$
+3: $\Phi \gets SO(3) \times \mathbb{R}^2$ grid at base resolution
+4: $k \gets k_{min}$
+5: for iter = 1 ... Niter do
+6: for $\phi_i \in \Phi$ do ▷ Compute lower bound at all grid points
+7: $lb(\phi_i) \gets$ loss between $\hat{X}$ and SLICE( $\hat{V}_{\mathbf{z}}$ , $\phi_i$ ) at $\mathbf{k} < k$
+8: $\phi^* \gets$ arg min(lb)
+9: $ub \gets$ loss between $\hat{X}$ and SLICE( $\hat{V}_{\mathbf{z}}$ , $\phi^*$ ) at $\mathbf{k} < k_{max}$ ▷ Compute upper bound
+10: $\Phi_{new} \gets \{\}$
+11: for $\phi_i \in \Phi$ do ▷ Subdivide grid points below the upper bound
+12: if $lb(\phi_i) < ub$ then
+13: $\Phi_{new} \gets \Phi_{new} \cup SUBDIVIDE(\phi_i)$
+14: $\Phi \gets \Phi_{new}$
+15: $k \gets k + (k_{max} - k_{min}) / (N_{iter} - 1)$ ▷ Increase frequency band limit
+16: return $\phi^*$
+
+# A.2 TRAINING DETAILS
+
+Given an imaging dataset, $\hat{X}_1,\dots \hat{X}_N$ , we summarize three training paradigms of cryoDRGN. 1) For homogeneous reconstruction, we only train the volume decoder $p_{\theta}$ and perform BNB pose inference for the unknown $\phi_i$ 's for each image. 2) As an intermediate task, we can perform heterogeneous reconstruction training the image encoder $q_{\xi}$ and the volume decoder $p_{\theta}$ with known $\phi_i$ 's to skip BNB pose inference. 3) For fully unsupervised heterogeneous reconstruction, we jointly train $q_{\xi}$ and $p_{\theta}$ to learn a continuous latent representation, performing BNB pose inference for the unknown pose of each image.
+
+Unless otherwise specified, the encoder and decoder networks are both MLPs containing 10 hidden layers of dimension 128 with ReLU activations. A fully connected architecture is used instead of a convolutional architecture because the images are not represented in real space.
+
+Instead of representing both the real and imaginary components of each image, we use the closely-related Hartley space representation (Hartley (1942)). The Hartley transform of real-valued functions is equivalent to the real minus imaginary component of the FT, and thus is real valued. The Fourier slice theorem still holds and the error model is equivalent.
+
+In this work, we simplify the image generation model to Gaussian white noise. Therefore, for a given image, the negative log likelihood for a reconstructed slice from the decoder corresponds to the mean squared error between the phase-shifted image and the oriented slice from the volume decoder. We leave the implementation of a colored noise model to future work.
+
+We use the Adam optimizer (Kingma & Ba (2014)) with learning rate of 5e-4 for experiments involving noiseless, homogeneous datasets, and 1e-4 for all other experiments. All models are implemented in Pytorch (Paszke et al. (2017)).
+
+# B HOMOGENEOUS RECONSTRUCTION
+
+# B.1 DATASET PREPARATION
+
+Simulated datasets: From a ground truth 3D volume, we simulated datasets following the cryo-EM image formation model by 1) rotating the 3D volume in real space by $R$ , where $R \in SO(3)$ is sampled uniformly, 2) projecting (integrating) the volume along the z-axis, 3) shifting the resulting 2D image by $t$ , where $t$ is sampled uniformly from $[-10, 10]^2$ pixels, and 4) optionally adding noise to an SNR of 0.1, a typical value for cryo-EM data (Baxter et al. (2009)). Following convention in the cryo-EM field, we define SNR as the ratio of the variance of the signal to the variance of the noise. We define the noise-free signal images to be the entire DxD image. 50k projections were generated for each dataset with image size of $D = 128$ .
+
+Real dataset: To generate the real cryo-EM dataset for homogeneous reconstruction, images from EMPIAR-10028 (Wong et al. (2014)) were downsampled by a factor of 4 by clipping in Fourier space. The images were then 'phase flipped' in Fourier space by their contrast transfer function, a given real-valued function with range [-1,1] determined by the microscopy conditions, i.e. the Fourier components are negated where the CTF is negative.
+
+# B.2 TRAINING
+
+For each dataset, we train the volume decoder (10 hidden layers of dimension 128) in minibatches of 10 images with random orientations for the first epoch to learn a volume with roughly correct spatial extent, followed by 4 epochs with branch and bound (BNB) pose inference (30 min/epoch noiseless, 80 min/noisy datasets). Since BNB pose inference is the bottleneck during training, we employ a multiscale training protocol, where after 4 epochs with BNB pose inference, the latent pose is fixed, and we train a separate, larger volume decoder (10 hidden layers of dimension 500) for 15 epochs with fixed poses to "refine" the structure to high resolution (20 min/epoch). Training times are reported for 50k, $D = 128$ image datasets trained on a Nvidia Titan V GPU.
+
+# B.3 SUPPLEMENTARY RESULTS
+
+
+Figure S5: Left: CryoDRGN unsupervised homogeneous reconstruction on 2 simulated datasets and 1 real cryo-EM dataset matches state-of-the-art. Right: Fourier shell correlation (FSC) curves between the reconstructed volume and the ground truth volume for the synthetic ribosome datasets.
+
+# C HETEROGENEOUS RIBOSOME RECONSTRUCTION WITH POSE SUPERVISION
+
+Dataset preparation: We used the dataset from EMPIAR-10076 which contains 131,899 images of the $E.$ coli large ribosomal subunit (LSU) in various stages of assembly (Davis et al. (2016)). Images were downsampled to $D = 128$ by clipping in Fourier space. Poses were determined by aligning the images to a mature LSU structure obtained from a homogeneous reconstruction of the full resolution dataset in cryoSPARC, i.e. "a consensus reconstruction".
+
+Baseline: In the original analysis of this dataset, multiple rounds of multiclass refinement in sweeps of varying number of classes followed by expert manual alignment and clustering of similar volumes were used to identify 6 classes, labeled A-F consisting of 4 major structural states of the LSU (classes B-E) and 2 additional structures of the 70S and 30S ribosome, class A and F, respectively.
+
+Since the published dataset did not contain the corresponding image cluster assignments, we perform multiclass refinement in cryoSPARC using the published structures of the 6 major states, low pass filtered to $25\AA$ as initial models, to reproduce the results and obtain image cluster assignments. Aside from class A and F (low population impurities in the sample), the remaining structures correlate well with the published volumes (Figure S6).
+
+
+Figure S6: Reconstructed volumes from cryoSPARC multiclass refinement using the published structures of the 6 major states, low pass filtered to $25\AA$ as initial models. Right: FSC curves between the cryoSPARC reconstructed and published volumes.
+
+cryoDRGN training: We train cryoDRGN with a 1-D latent variable in minibatches of 10 images for 200 epochs, treating image pose as fixed (11 min/epoch on a Nvidia Titan V GPU). To simplify representation learning for $q_{\xi}$ , we center and phase flip images before inputting to the encoder. We encode and decode a circle of pixels with diameter $D = 128$ instead of the full 128x128 image.
+
+# C.1 SUPPLEMENTARY RESULTS
+
+
+
+
+
+
+Figure S7: Left: Latent encoding for each image of the dataset from EMPIAR-10076. Bottom: Volumes from 12 sampled values along the latent space (dashed lines). Right: Fourier shell correlation (FSC) curves for 4 structures against the published volumes for classes B-E from corresponding to structural states of the large ribosomal subunit during assembly (Davis et al. (2016)).
+
+
+Figure S8: The latent encoding aligns with cluster assignments from a successive round of multiclass refinement in cryoSPARC on the subset of images from class D and E.
+
+
+
+# D FULLY UNSUPERVISED HETEROGENEOUS RECONSTRUCTION
+
+# D.1 DATASET PREPARATION
+
+Linear 1D motion: We generated a dataset containing one continuous degree of freedom as follows: From an atomic model of a protein complex, a single bond in the atomic model was rotated while keeping the remaining structure fixed, and 50 atomic models were sampled along this reaction coordinate. 1000 projections with random rotations and in-plane translations were generated for each model, yielding a total of 50k images, approximating a uniform distribution along a continuous reaction coordinate.
+
+Linear 2D motion: We extended the linear 1D motion dataset by introducing a second degree of freedom from rotating a bond in the atomic model that connected a different protein in the complex. Similar to the 1D motion dataset, from a starting configuration, the original bond was rotated $+/-$ N degrees, and 50 models were sampled along this reaction coordinate. Then from the starting
+
+conformation, the second bond was rotated $+/- 90$ degrees, and 50 additional models were sampled along the second reaction coordination. 500 projections were generated from each model, yielding a total of 50k images.
+
+Circular 1D motion: For this dataset, we rotated a bond a full 360 degrees and sample 100 models along this circular reaction coordinate. 500 projections were generated from each model, yielding a total of 50k images.
+
+Discrete 10 class: For this dataset, we sampled 10 random configurations for the proteins in the complex. 5000 projection images were generated from each model, yielding a dataset containing a mixture of 10 discrete states.
+
+For all four datasets, random rotations were generated uniformly from $SO(3)$ , and translations were sampled uniformly from $[-5, 5]$ pixels. The image size was $D = 64$ with absolute spatial extent of $720\AA$ and Nyquist limit of $22.5\AA$ . Schematics of the simulated motions are given in Figure S9.
+
+
+
+
+
+
+Figure S9: Ground truth atomic model and the heterogeneity introduced for different datasets.
+
+
+
+# D.2 TILT SERIES PAIRS
+
+Tilt series pairs is a variant of cryo-EM in which, for each image $X_{i}$ , a corresponding image $X_{i}^{\prime}$ is acquired after tilting the imaging stage by a known angle. This technique was originally employed to identify the chirality of molecules (Belnap et al. (1997)), which is lost in the projection from 3D to 2D and therefore cannot be inferred from standard cryo-EM. Inferential procedures such as expectation maximization converge to one handedness or the other depending on their initialization. In multiclass reconstruction, different classes are not guaranteed to possess the same handedness even if there is a high relatedness between structures. We remark on this experimental technique as we propose using tilt series pairs to encourage invariance of $q_{\xi}$ with respect to pose transformations for a given $\hat{V}_{\mathbf{z}}$ (and incidentally also to identify the chirality of $\hat{V}_{\mathbf{z}}$ ). To train on tilt series pairs, the encoder is split into two MLPs, the first learning an intermediate encoding of each image, and the second mapping the concatenation of the two encodings to the latent space. We use an 8 layer MLP with output dimension 128 for the former and a 2 layer MLP with input dimension 256 for the latter. All hidden layers have dimension 128. For branch and bound, the combined loss over both images is evaluated for each grid point of $SO(3)\times \mathbb{R}^{2}$ . To generate the image $X_{tilt,i}$ associated with $X_{i}$ , prior to rotating the volume by $R_{i}$ , we rotate the volume by a constant 45 degrees around the x-axis.
+
+# D.3 TRAINING
+
+We trained cryoDRGN in minibatches of 5 images for 40 epochs without tilt series pairs and 20 epochs with tilt series pairs. We trained a 1-D latent variable for the linear 1D motion dataset, and 10-D latent variables for the remaining datasets. Random angles were used for the first epoch of training to learn roughly the correct spatial extent of the volume and BNB pose inference was used for the remaining epochs. The runtime was $120\mathrm{min}$ /epoch vs $2\mathrm{min}$ /epoch with and without BNB pose inference, respectively, on a Nvidia Titan V GPU.
+
+# D.4 SUPPLEMENTARY RESULTS
+
+
+Figure S10: Reconstruction results for the linear 1D dataset by cryoDRGN and by discrete multiclass reconstruction in cryoSPARC. Top: Reconstructed structures from cryoDRGN sampled along the latent space (at depicted points) matches the ground truth variation. The predicted latent encoding correlates with the ground truth latent degree of freedom. Middle: CryoDRGN results with tilt series Bottom: Reconstructed volumes and the distribution of images over clusters from discrete multiclass reconstruction in cryoSPARC. Volumes are visualized at high and low isosurface, showing artifacts in the cryoSPARC structures.
+
+
+cryoDRGN
+
+
+
+
+
+
+
+
+cryoDRGN + tilt
+
+
+
+
+cryoSPARC
+
+
+Figure S11: Reconstruction results for the circular 1D dataset by cryoDRGN and by discrete multiclass reconstruction in cryoSPARC. Top: Reconstructed structures from cryoDRGN sampled along the latent space (at depicted points) matches the ground truth variation. The distribution of images in the latent space matches the circlar topology of the true data manifold. Middle: CryoDRGN results with tilt series Bottom: Reconstructed volumes and the distribution of images over clusters from discrete multiclass reconstruction in cryoSPARC. Volumes are visualized at high and low isosurface, showing artifacts in the cryoSPARC structures.
+
+
+Figure S12: Reconstruction results for the linear 2D dataset by cryoDRGN and by discrete multiclass reconstruction in cryoSPARC. Top: Reconstructed structures from cryoDRGN sampled along the latent space (at depicted points) roughly matches the ground truth variation, however the distribution of images in the latent space does not recapitulate the true data manifold well. Middle: CryoDRGN results with tilt series reconstructs the true structural variation and the distribution of images in the latent space matches the topology of the true data manifold. Bottom: Reconstructed volumes and the distribution of images over clusters from discrete multiclass reconstruction in cryoSPARC. CryoSPARC volumes are visualized at high and low isosurface, showing artifacts at low isosurface
+
+
+Figure S13: Reconstruction results for the dataset containing 10 discrete structures by cryoDRGN and by discrete multiclass reconstruction in cryoSPARC. Top: The majority of reconstructed structures from cryoDRGN sampled along the latent space (at depicted points) matches the ground truth structures, however some are incorrect (red boxes), and the learned data manifold is not well separated into clusters. Middle: CryoDRGN results with tilt series reconstructs the 10 structures and clusters the images in the latent space accordingly. Bottom: Reconstructed volumes from discrete multiclass reconstruction in cryoSPARC and the distribution of images over clusters. CryoSPARC learns 8 out of 10 structures correctly.
+
+| Dataset | cryoSPARC |
| K=2 | K=3 | K=4 | K=5 |
| Linear 1D motion | 5.11(3.82) | 3.60(2.27) | 7.40(4.16) | 7.59(4.58) |
| Linear 2D motion | 6.89(2.21) | 6.90(3.77) | 5.98(2.10) | 6.76(4.47) |
| Circular 1D motion | 5.16(2.70) | 4.87(2.17) | 7.50(3.32) | 4.62(1.93) |
+
+Table S3: Relationship between number of classes in cryoSPARC and reconstruction accuracy quantified by an FSC=0.5 resolution metric between the reconstructed volumes corresponding to each image and its ground truth volume. We report the average and standard deviation across 100 images in the dataset (lower is better; best possible is 2 pixels).
+
+| Dataset | cryoDRGN | cryoDRGN+tilt |
| z-D=1 | z-D=2 | z-D=10 | z-D=1 | z-D=2 | z-D=10 |
| Linear 1D motion | 2.50(0.62) | 2.34(0.12) | - | 2.35(0.36) | 2.43(0.26) | - |
| Linear 2D motion | 7.16(4.69) | 4.38(3.15) | 4.44(2.50) | 3.38(1.18) | 2.97(1.24) | 2.93(1.02) |
| Circular 1D motion | 5.61(4.36) | 4.95(2.91) | 4.05(2.40) | 3.12(0.96) | 2.65(0.67) | 2.63(0.74) |
+
+Table S4: Relationship between $z$ dimension in cryoDRGN and reconstruction accuracy quantified by an FSC=0.5 resolution metric between the reconstructed volumes corresponding to each image and its ground truth volume. We report the average and standard deviation across 100 images in the dataset (lower is better; best possible is 2 pixels).
\ No newline at end of file
diff --git a/reconstructingcontinuousdistributionsof3dproteinstructurefromcryoemimages/images.zip b/reconstructingcontinuousdistributionsof3dproteinstructurefromcryoemimages/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..56ad447677e85a20e3dfa03b64395df1eb4d0d13
--- /dev/null
+++ b/reconstructingcontinuousdistributionsof3dproteinstructurefromcryoemimages/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ce87e3e8f47fb2c7f73d83ad19feb3011b957280dc72b02e276a7d7f6743a487
+size 704388
diff --git a/reconstructingcontinuousdistributionsof3dproteinstructurefromcryoemimages/layout.json b/reconstructingcontinuousdistributionsof3dproteinstructurefromcryoemimages/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..0cdb5393f99c4690342584e32a672fc36929df75
--- /dev/null
+++ b/reconstructingcontinuousdistributionsof3dproteinstructurefromcryoemimages/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f0f2b4932d3e6aee2e3a4aae3625821195b75108eebdc78da3ab29b06aef6869
+size 576283
diff --git a/ridgeregressionstructurecrossvalidationandsketching/db13e41e-7bef-4622-8db9-c394bfc127a5_content_list.json b/ridgeregressionstructurecrossvalidationandsketching/db13e41e-7bef-4622-8db9-c394bfc127a5_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..f7341dbb0f5358df075eed53687b4fb40f390846
--- /dev/null
+++ b/ridgeregressionstructurecrossvalidationandsketching/db13e41e-7bef-4622-8db9-c394bfc127a5_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:519f9578337df932b55d47e8cfdaa80d5689b585ab2946958a5d037b0a86cd2c
+size 184911
diff --git a/ridgeregressionstructurecrossvalidationandsketching/db13e41e-7bef-4622-8db9-c394bfc127a5_model.json b/ridgeregressionstructurecrossvalidationandsketching/db13e41e-7bef-4622-8db9-c394bfc127a5_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..7ac65ef7598b4407a78cfbc168b4121c01100962
--- /dev/null
+++ b/ridgeregressionstructurecrossvalidationandsketching/db13e41e-7bef-4622-8db9-c394bfc127a5_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ec9e97f50cc6b108103682e861ec0c103dce879702283ff9fcfe51184454fac2
+size 216904
diff --git a/ridgeregressionstructurecrossvalidationandsketching/db13e41e-7bef-4622-8db9-c394bfc127a5_origin.pdf b/ridgeregressionstructurecrossvalidationandsketching/db13e41e-7bef-4622-8db9-c394bfc127a5_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..d216951d1bd1b693f9901787d0a71fec3b06a863
--- /dev/null
+++ b/ridgeregressionstructurecrossvalidationandsketching/db13e41e-7bef-4622-8db9-c394bfc127a5_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:49cb8629acf237edb5aee4bb80221c1877d7e5a45ef39ebab23c6420eda0c569
+size 1147007
diff --git a/ridgeregressionstructurecrossvalidationandsketching/full.md b/ridgeregressionstructurecrossvalidationandsketching/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..0804ef890860eb41882a0d2898dbdfa7798bc608
--- /dev/null
+++ b/ridgeregressionstructurecrossvalidationandsketching/full.md
@@ -0,0 +1,1029 @@
+# RIDGE REGRESSION: STRUCTURE, CROSS-VALIDATION, AND SKETCHING
+
+# Sifan Liu
+
+Department of Statistics
+
+Stanford University
+
+Stanford, CA 94305, USA
+
+sfliu@stanford.edu
+
+# Edgar Dobriban
+
+Department of Statistics
+
+University of Pennsylvania
+
+Philadelphia, PA 19104, USA
+
+dobriban@wharton.upenn.edu
+
+# ABSTRACT
+
+We study the following three fundamental problems about ridge regression: (1) what is the structure of the estimator? (2) how to correctly use cross-validation to choose the regularization parameter? and (3) how to accelerate computation without losing too much accuracy? We consider the three problems in a unified large-data linear model. We give a precise representation of ridge regression as a covariance matrix-dependent linear combination of the true parameter and the noise. We study the bias of $K$ -fold cross-validation for choosing the regularization parameter, and propose a simple bias-correction. We analyze the accuracy of primal and dual sketching for ridge regression, showing they are surprisingly accurate. Our results are illustrated by simulations and by analyzing empirical data.
+
+# 1 INTRODUCTION
+
+Ridge or $\ell_2$ -regularized regression is a widely used method for prediction and estimation when the data dimension $p$ is large compared to the number of datapoints $n$ . This is especially so in problems with many good features, where sparsity assumptions may not be justified. A great deal is known about ridge regression. It is Bayes optimal for any quadratic loss in a Bayesian linear model where the parameters and noise are Gaussian. The asymptotic properties of ridge have been widely studied (e.g., Tulino & Verdu, 2004; Serdobolskii, 2007; Couillet & Debbah, 2011; Dicker, 2016; Dobriban & Wager, 2018, etc). For choosing the regularization parameter in practice, cross-validation (CV) is widely used. In addition, there is an exact shortcut (e.g., Hastie et al., 2009, p. 243), which has good consistency properties (Hastie et al., 2019). There is also a lot of work on fast approximate algorithms for ridge, e.g., using sketching methods (e.g., el Alaoui & Mahoney, 2015; Chen et al., 2015; Wang et al., 2018; Chowdhury et al., 2018, among others).
+
+Here we seek to develop a deeper understanding of ridge regression, going beyond existing work in multiple aspects. We work in linear models under a popular asymptotic regime where $n$ , $p \to \infty$ at the same rate (Marchenko & Pastur, 1967; Serdobolskii, 2007; Couillet & Debbah, 2011; Yao et al., 2015). In this framework, we develop a fundamental representation for ridge regression, which shows that it is well approximated by a linear scaling of the true parameters perturbed by noise. The scaling matrices are functions of the population-level covariance of the features. As a consequence, we derive formulas for the training error and bias-variance tradeoff of ridge.
+
+Second, we study commonly used methods for choosing the regularization parameter. Inspired by the observation that CV has a bias for estimating the error rate (e.g., Hastie et al., 2009, p. 243), we study the bias of CV for selecting the regularization parameter. We discover a surprisingly simple form for the bias, and propose a downward scaling bias correction procedure. Third, we study the accuracy loss of a class of randomized sketching algorithms for ridge regression. These algorithms approximate the sample covariance matrix by sketching or random projection. We show they can be surprisingly accurate, e.g., they can sometimes cut computational cost in half, only incurring $5\%$ extra error. Even more, they can sometimes improve the MSE if a suboptimal regularization parameter is originally used.
+
+Our work leverages recent results from asymptotic random matrix theory and free probability theory. One challenge in our analysis is to find the limit of the trace $\operatorname{tr}(\Sigma_1 + \Sigma_2^{-1})^{-1} / p$ , where $\Sigma_1$ and $\Sigma_2$ are $p \times p$ independent sample covariance matrices of Gaussian random vectors. The calculation requires nontrivial aspects of freely additive convolutions (e.g., Voiculescu et al., 1992; Nica & Speicher, 2006).
+
+Our work is connected to prior works on ridge regression in high-dimensional statistics (Serdobolskii, 2007) and wireless communications (Tulino & Verdu, 2004; Couillet & Debbah, 2011). Among other related works, El Karoui & Kosters (2011) discuss the implications of the geometric sensitivity of random matrix theory for ridge regression, without considering our problems. El Karoui (2018) and Dicker (2016) study ridge regression estimators, but focus only on the risk for identity covariance. Hastie et al. (2019) study "ridgeless" regression, where the regularization parameter tends to zero.
+
+Sketching is an increasingly popular research topic, see Vempala (2005); Halko et al. (2011); Mahoney (2011); Woodruff (2014); Drineas & Mahoney (2017) and references therein. For sketched ridge regression, Zhang et al. (2013a,b) study the dual problem in a complementary finite-sample setting, and their results are hard to compare. Chen et al. (2015) propose an algorithm combining sparse embedding and the subsampled randomized Hadamard transform (SRHT), proving relative approximation bounds. Wang et al. (2017) study iterative sketching algorithms from an optimization point of view, for both the primal and the dual problems. Dobriban & Liu (2018) study sketching using asymptotic random matrix theory, but only for unregularized linear regression. Chowdhury et al. (2018) propose a data-dependent algorithm in light of the ridge leverage scores. Other related works include Sarlos (2006); Ailon & Chazelle (2006); Drineas et al. (2006; 2011); Dhillon et al. (2013); Ma et al. (2015); Raskutti & Mahoney (2016); Gonen et al. (2016); Thanei et al. (2017); Ahfock et al. (2017); Lopes et al. (2018); Huang (2018).
+
+The structure of the paper is as follows: We state our results on representation, risk, and bias-variance tradeoff in Section 2. We study the bias of cross-validation for choosing the regularization parameter in Section 3. We study the accuracy of randomized primal and dual sketching for both orthogonal and Gaussian sketches in Section 4. We provide proofs and additional simulations in the Appendix. Code reproducing the experiments in the paper are available at https://github.com/liusf15/RidgeRegression.
+
+# 2 RIDGE REGRESSION
+
+We work in the usual linear regression model $Y = X\beta + \varepsilon$ , where each row $x_{i}$ of $X \in \mathbb{R}^{n \times p}$ is a datapoint in $p$ dimensions, and so there are $p$ features. The corresponding element $y_{i}$ of $Y \in \mathbb{R}^{n}$ is its continuous response (or outcome). We assume mean zero uncorrelated noise, so $\mathbb{E}\varepsilon = 0$ , and $\operatorname{Cov}[\varepsilon] = \sigma^2 I_n$ . We estimate the coefficient $\beta \in \mathbb{R}^p$ by ridge regression, solving the optimization problem
+
+$$
+\hat {\beta} = \arg \min _ {\beta \in \mathbb {R} ^ {p}} \frac {1}{n} \| Y - X \beta \| _ {2} ^ {2} + \lambda \| \beta \| _ {2} ^ {2},
+$$
+
+where $\lambda > 0$ is a regularization parameter. The solution has the closed form
+
+$$
+\hat {\beta} = \left(X ^ {\top} X / n + \lambda I _ {p}\right) ^ {- 1} X ^ {\top} Y / n. \tag {1}
+$$
+
+We work in a "big data" asymptotic limit, where both the dimension $p$ and the sample size $n$ tend to infinity, and their aspect ratio converges to a constant, $p / n \to \gamma \in (0,\infty)$ . Our results can be interpreted for any $n$ and $p$ , using $\gamma = p / n$ as an approximation.
+
+We recall that the empirical spectral distribution (ESD) of a $p \times p$ symmetric matrix $\Sigma$ is the distribution $\frac{1}{p} \sum_{i=1}^{p} \delta_{\lambda_i}$ where $\lambda_i, i = 1, \dots, p$ are the eigenvalues of $\Sigma$ , and $\delta_x$ is the point mass at $x$ . This is a standard notion in random matrix theory, see e.g., Marchenko & Pastur (1967); Tulino & Verdú (2004); Couillet & Debbah (2011); Yao et al. (2015). The ESD is a convenient tool to summarize all information obtainable from the eigenvalues of a matrix. For instance, the trace of $\Sigma$ is proportional to the mean of the distribution, while the condition number is related to the range of the support. As is common, we will work in models where there is a sequence of covariance matrices $\Sigma = \Sigma_p$ and their ESDs converges in distribution to a limiting probability distribution. The results become simpler, because they depend only on the limit.
+
+By extension, we say that the ESD of the $n \times p$ matrix $X$ is the ESD of $X^{\top} X / n$ . We will consider some very specific models for the data, assuming it is of the form $X = U \Sigma^{1/2}$ , where $U$ has iid entries of zero mean and unit variance. This means that the datapoints, i.e., the rows of $X$ , have the form $x_{i} = \Sigma^{1/2} u_{i}, i = 1, \ldots, p$ , where $u_{i}$ have iid entries. Then $\Sigma$ is the "true" covariance matrix of the features, which is typically not observed. These types of models for the data are very common in random matrix theory, see the references mentioned above.
+
+Under these models, it is possible to characterize precisely the deviations between the empirical covariance matrix $\widehat{\Sigma} = n^{-1}X^{\top}X$ and the population covariance matrix $\Sigma$ , dating back to the well known classical Marchenko-Pastur law for eigenvectors (Marchenko & Pastur, 1967), extended to more general models and made more precise, including results for eigenvectors (see e.g., Tulino & Verdu, 2004; Couillet & Debbah, 2011; Yao et al., 2015, and references therein). This has been used to study methods for estimating the true covariance matrix, with several applications (e.g., Paul & Aue, 2014; Bun et al., 2017). More recently, such models have been used to study high dimensional statistical learning problems, including classification and regression (e.g., Zollanvari & Genton, 2013; Dobriban & Wager, 2018). Our work falls in this line.
+
+We start by finding a precise representation of the ridge estimator. For random vectors $u_{n}, v_{n}$ of growing dimension, we say $u_{n}$ and $v_{n}$ are deterministic equivalents, if for any sequence of fixed (or random and independent of $u_{n}, v_{n}$ ) vectors $w_{n}$ such that $\lim \sup \| w_{n}\|_{2} < \infty$ almost surely, we have $|w_{n}^{\top}(u_{n} - v_{n})| \to 0$ almost surely. We denote this by $u_{n} \asymp v_{n}$ . Thus linear combinations of $u_{n}$ are well approximated by those of $v_{n}$ . This is a somewhat non-standard definition, but it turns out that it is precisely the one we need to use prior results from random matrix theory such as from (Rubio & Mestre, 2011).
+
+We extend scalar functions $f: \mathbb{R} \to \mathbb{R}$ to matrices in the usual way by functional calculus, applying them to the eigenvalues and keeping the eigenvectors. If $M = V\Lambda V^{\top}$ is a spectral decomposition of $M$ , then we define $f(M) := Vf(\Lambda)V^{\top}$ , where $f(\Lambda)$ is the diagonal matrix with entries $f(\Lambda_{ii})$ .
+
+For a fixed design matrix $X$ , we can write the estimator as
+
+$$
+\hat {\beta} = (\widehat {\Sigma} + \lambda I _ {p}) ^ {- 1} \widehat {\Sigma} \beta + (\widehat {\Sigma} + \lambda I _ {p}) ^ {- 1} \frac {X ^ {\top} \varepsilon}{n}.
+$$
+
+However, for a random design, we can find a representation that depends on the true covariance $\Sigma$ , which may be simpler when $\Sigma$ is simple, e.g., when $\Sigma = I_p$ is isotropic.
+
+Theorem 2.1 (Representation of ridge estimator). Suppose the data matrix has the form $X = U\Sigma^{1/2}$ , where $U \in \mathbb{R}^{n \times p}$ has iid entries of zero mean, unit variance and finite $8 + c$ -th moment for some $c > 0$ , and $\Sigma = \Sigma_p \in \mathbb{R}^{p \times p}$ is a deterministic positive definite matrix. Suppose that $n, p \to \infty$ with $p/n \to \gamma > 0$ . Suppose the ESD of the sequence of $\Sigma_s$ converges in distribution to a probability measure with compact support bounded away from the origin. Suppose that the noise is Gaussian, and that $\beta = \beta_p$ is an arbitrary sequence of deterministic vectors, such that $\lim \sup \| \beta \|_2 < \infty$ .
+
+Then the ridge regression estimator is asymptotically equivalent to a random vector with the following representation:
+
+$$
+\hat {\beta} (\lambda) \asymp A (\Sigma , \lambda) \cdot \beta + B (\Sigma , \lambda) \cdot \sigma \cdot \frac {Z}{p ^ {1 / 2}}.
+$$
+
+Here $Z \sim \mathcal{N}(0, I_p)$ is a random vector that is stochastically dependent only on the noise $\varepsilon$ , and $A, B$ are deterministic matrices defined by applying the scalar functions below to $\Sigma$ :
+
+$$
+A (x, \lambda) = (c _ {p} x + \lambda) ^ {- 2} (c _ {p} + c _ {p} ^ {\prime}) x, \qquad \qquad B (x, \lambda) = (c _ {p} x + \lambda) ^ {- 1} c _ {p} x.
+$$
+
+Here $c_{p} \coloneqq c(n, p, \Sigma, \lambda)$ is the unique positive solution of the fixed point equation
+
+$$
+1 - c _ {p} = \frac {c _ {p}}{n} \operatorname {t r} \left[ \Sigma \left(c _ {p} \Sigma + \lambda I\right) ^ {- 1} \right]. \tag {2}
+$$
+
+This result gives a precise representation of the ridge regression estimator. It is a sum of two terms: the true coefficient vector $\beta$ scaled by the matrix $A(\Sigma, \lambda)$ , and the noise vector $Z$ scaled by the matrix $B(\Sigma, \lambda)$ . The first term captures to what extent ridge regression recovers the "signal". Moreover, the
+
+
+Figure 1: Ridge regression bias-variance tradeoff. Left: $\gamma = p / n = 0.2$ ; right: $\gamma = 2$ . The data matrix $X$ has iid Gaussian entries. The coefficient $\beta$ has distribution $\beta \sim \mathcal{N}(0, I_p / p)$ , while the noise $\varepsilon \sim \mathcal{N}(0, I_p)$ .
+
+noise term $Z$ is directly coupled with the noise in the original regression problem, and thus also the estimator. The result would not hold for an independent noise vector $Z$ .
+
+However, the coefficients are not fully explicit, as they depend on the unknown population covariance matrix $\Sigma$ , as well as on the fixed-point variable $c_{p}$ .
+
+Some comments are in order:
+
+1. Structure of the proof. The proof is quite non-elementary and relies on random matrix theory. Specifically, it uses the language of the recently developed "calculus of deterministic equivalents" (Dobriban & Sheng, 2018), and results by (Rubio & Mestre, 2011). A general takeaway is that for $n$ not much larger than $p$ , the empirical covariance matrix $\widehat{\Sigma}$ is not a good estimator of the true covariance matrix $\Sigma$ . However, the deviation of linear functionals of $\widehat{\Sigma}$ , can be quantified. In particular, we have
+
+$$
+\left(\widehat {\Sigma} + \lambda I\right) ^ {- 1} \asymp \left(c _ {p} \Sigma + \lambda I\right) ^ {- 1},
+$$
+
+in the sense that linear combinations of the entries of the two matrices are close (see the proof for more details).
+
+2. Understanding the resolvent bias factor $c_p$ . Thus, $c_p$ can be viewed as a resolvent bias factor, which tells us by what factor $\Sigma$ is multiplied when evaluating the resolvent $(\widehat{\Sigma} + \lambda I)^{-1}$ , and comparing it to its naive counterpart $(\Sigma + \lambda I)^{-1}$ . It is known that $c_p$ is well defined, and this follows by a simple monotonicity argument, see Hachem et al. (2007); Rubio & Mestre (2011). Specifically, the left hand side of (2) is decreasing in $c_p$ , while the right hand size is increasing in
+
+Also $c_p'$ is the derivative of $c_p$ , when viewing it as a function of $z \coloneqq -\lambda$ . An explicit expression is provided in the proof in Section A.1, but is not crucial right now.
+
+Here we discuss some implications of this representation.
+
+For uncorrelated features, $\Sigma = I_p$ , $A$ , $B$ reduce to multiplication by scalars. Hence, each coordinate of the ridge regression estimator is simply a scalar multiple of the corresponding coordinate of $\beta$ . One can use this to find the bias in each individual coordinate.
+
+Training error and optimal regularization parameter. This theorem has implications for understanding the training error, and optimal regularization parameter of ridge regression. As it stands, the theorem itself only characterizes the behavior of linear combinations of the coordinates of the estimator. Thus, it can be directly applied to study the bias $\mathbb{E}\hat{\beta} (\lambda) - \beta$ of the estimator. However, it cannot directly be used to study the variance; as that would require understanding quadratic functionals of the estimator. This seems to require significant advances in random matrix theory, going beyond the results of Rubio & Mestre (2011). However, we show below that with additional assumptions on the structure of the parameter $\beta$ , we can derive the MSE of the estimator in other ways.
+
+We work in a random-effects model, where the $p$ -dimensional regression parameter $\beta$ is random, each coefficient has zero mean $\mathbb{E}\beta_{i} = 0$ , and is normalized so that $\mathrm{Var}\beta_{i} = \alpha^{2} / p$ . This ensures that the signal strength $\mathbb{E}\| \beta \| ^2 = \alpha^2$ is fixed for any $p$ . The asymptotically optimal $\lambda$ in this setting is always $\lambda^{*} = \gamma \sigma^{2} / \alpha^{2}$ see e.g., Tulino & Verdu (2004); Dicker (2016); Dobrian & Wager (2018). The ridge regression estimator with $\lambda = p\sigma^2 /(n\alpha^2)$ is the posterior mean of $\beta$ , when $\beta$ and $\varepsilon$ are normal random variables.
+
+For a distribution $F$ , we define the quantities
+
+$$
+\theta_ {i} (\lambda) = \int \frac {1}{(x + \lambda) ^ {i}} d F _ {\gamma} (x),
+$$
+
+$(i = 1,2,\ldots)$ . These are the moments of the resolvent and its derivatives (up to constants). We use the following loss functions: mean squared estimation error: $M(\hat{\beta}) = \mathbb{E}\| \hat{\beta} -\beta \| _2^2$ , and residual or training error: $R(\hat{\beta}) = \mathbb{E}\left[\| \right]Y - X\hat{\beta}\| _2^2$
+
+Theorem 2.2 (MSE and training error of ridge). Suppose $\beta$ has iid entries with $\mathbb{E}\beta_{i} = 0$ , $\operatorname{Var}[\beta_i] = \alpha^2 / p$ , $i = 1, \ldots, p$ and $\beta$ is independent of $X$ and $\varepsilon$ . Suppose $X$ is an arbitrary $n \times p$ matrix depending on $n$ and $p$ , and the ESD of $X$ converges weakly to a deterministic distribution $F$ as $n, p \to \infty$ and $p / n \to \gamma$ . Then the asymptotic MSE and residual error of the ridge regression estimator $\hat{\beta}(\lambda)$ has the form
+
+$$
+\lim _ {n \rightarrow \infty} M (\hat {\beta} (\lambda)) = \alpha^ {2} \lambda^ {2} \theta_ {2} + \gamma \sigma^ {2} [ \theta_ {1} - \lambda \theta_ {2} ], \tag {3}
+$$
+
+$$
+\lim _ {n \rightarrow \infty} R (\hat {\beta} (\lambda)) = \alpha^ {2} \lambda^ {2} [ \theta_ {1} - \lambda \theta_ {2} ] + \sigma^ {2} \left[ 1 - \gamma (1 + \lambda \theta_ {1} - \lambda^ {2} \theta_ {2}) \right], \qquad (4)
+$$
+
+Bias-variance tradeoff. Building on this, we can also study the bias-variance tradeoff of ridge regression. Qualitatively, large $\lambda$ leads to more regularization, and decreases the variance. However, it also increases the bias. Our theory allows us to find the explicit formulas for the bias and variance as a function of $\lambda$ . See Figure 1 for a plot and Sec. A.3 for the details. As far as we know, this is one of the few examples of high-dimensional asymptotic problems where the precise form of the bias and variance can be evaluated.
+
+Bias-variance tradeoff at optimal $\lambda^{*} = \gamma \sigma^{2} / \alpha^{2}$ . (see Figure 6) This can be viewed as the "pure" effect of dimensionality on the problem, keeping all other parameters fixed, and has intriguing properties. The variance first increases, then decreases with $\gamma$ . In the "classical" low-dimensional case, most of the risk is due to variance, while in the "modern" high-dimensional case, most of it is due to bias. This is consistent with other phenomena in proportional-limit asymptotics, e.g., that the map between population and sample eigenvalue distributions is asymptotically deterministic (Marchenko & Pastur, 1967).
+
+Future applications. This fundamental representation may have applications to important statistical inference questions. For instance, inference on the regression coefficient $\beta$ and the noise variance $\sigma^2$ are important and challenging problems. Can we use our representation to develop debiasing techniques for this task? This will be interesting to explore in future work.
+
+# 3 CROSS-VALIDATION
+
+How can we choose the regularization parameter? In practice, cross-validation (CV) is the most popular approach. However, it is well known that CV has a bias for estimating the error rate, because it uses a smaller number of samples than the full data size (e.g., Hastie et al., 2009, p. 243). In this section, we study related questions, proposing a bias-correction method for the optimal regularization parameter. This is closely connected to the previous section, because it relies on the same random-effects theoretical framework. In fact, our conclusions here are a direct consequence of the properties of that framework.
+
+Setup. Suppose we split the $n$ datapoints (samples) into $K$ equal-sized subsets, each containing $n_0 = n / K$ samples. We use the $k$ -th subset $(X_k,Y_k)$ as the validation set and the other $K - 1$ subsets $(X_{-k},Y_{-k})$ , with total sample size $n_1 = (K - 1)n / K$ as the training set. We find the ridge
+
+
+Figure 2: Left: Cross-validation on the Million Song Dataset (MSD, Bertin-Mahieux et al., 2011). For the error bar, we take $n = 1000$ , $p = 90$ , $K = 5$ , and average over 90 different sub-datasets. For the test error, we train on 1000 training datapoints and fit on 9000 test datapoints. The debiased $\lambda$ reduces the test error by 0.00024, and the minimal test error is 0.8480. Right: Cross-validation on the flights dataset Wickham (2018). For the error bar, we take $n = 300$ , $p = 21$ , $K = 5$ , and average over 180 different sub-datasets. For the test error, we train on 300 datapoints and fit on 27000 test datapoints. The debiased $\lambda$ reduces the test error by 0.0022, and the minimal test error is 0.1353.
+
+
+
+regression estimator $\hat{\beta}_{-k}$ , i.e.
+
+$$
+\hat {\beta} _ {- k} (\lambda) = \left(X _ {- k} ^ {\top} X _ {- k} + n _ {1} \lambda I _ {p}\right) ^ {- 1} X _ {- k} ^ {\top} Y _ {- k}.
+$$
+
+The expected cross-validation error is, for isotropic covariance, i.e., $\Sigma = I$
+
+$$
+C V (\lambda) = \mathbb {E} \widehat {C V} (\lambda) = \mathbb {E} \left[ \frac {1}{K} \sum_ {k = 1} ^ {K} \| Y _ {k} - X _ {k} \hat {\beta} _ {- k} (\lambda) \| _ {2} ^ {2} / n _ {0} \right] = \sigma^ {2} + \mathbb {E} \left[ \| \hat {\beta} _ {- k} - \beta \| _ {2} ^ {2} \right].
+$$
+
+Bias in CV. When $n, p$ tend to infinity so that $p / n \to \gamma > 0$ , and in the random effects model with $\mathbb{E}\beta_{i} = 0$ , $\operatorname{Var}\beta_{i} = \alpha^{2} / p$ described above, the minimizer of $CV(\lambda)$ tends to $\lambda_k^* = \tilde{\gamma}\sigma^2 /\alpha^2$ , where $\tilde{\gamma}$ is the limiting aspect ratio of $X_{-k}$ , i.e. $\tilde{\gamma} = \gamma K / (K - 1)$ . Since the aspect ratios of $X_{-k}$ and $X$ differ, the limiting minimizer of the cross-validation estimator of the test error is biased for the limiting minimizer of the actual test error, which is $\lambda^{*} = \gamma \sigma^{2} / \alpha^{2}$ .
+
+Bias-correction. Suppose we have found $\hat{\lambda}_k^*$ , the minimizer of $\widehat{CV}(\lambda)$ . Afterwards, we usually refit ridge regression on the entire dataset, i.e., find
+
+$$
+\hat {\beta} (\hat {\lambda} ^ {*}) = (X ^ {\top} X + \hat {\lambda} ^ {*} n I) ^ {- 1} X ^ {\top} Y.
+$$
+
+Based on our bias calculation, we propose to use a bias-corrected parameter
+
+$$
+\hat {\lambda} ^ {*} := \hat {\lambda} _ {k} ^ {*} \frac {K - 1}{K}.
+$$
+
+So if we use 5 folds, we should multiply the CV-optimal $\lambda$ by 0.8. We find it surprising that this theoretically justified bias-correction does not depend on any unknown parameters, such as $\beta, \alpha^2, \sigma^2$ . While the bias of CV is widely known, we are not aware that this bias-correction for the regularization parameter has been proposed before.
+
+Numerical examples. Figure 2 shows on two empirical data examples that the debiased estimator gets closer to the optimal $\lambda$ than the original minimizer of the CV. However, in this case it does not significantly improve the test error. Simulation results in Section A.4 also show that the bias-correction correctly shrinks the regularization parameter and decreases the test error. We also consider examples where $p \gg n$ (i.e., $\gamma \gg 1$ ), because this is a setting where it is known that the bias of CV can be large (Tibshirani & Tibshirani, 2009). However, in this case, we do not see a significant improvement.
+
+Extensions. The same bias-correction idea also applies to train-test validation. In addition, there is a special fast "short-cut" for leave-one-out cross-validation in ridge regression (e.g., Hastie et al.,
+
+2009, p. 243), which has the same cost as one ridge regression. The minimizer converges to $\lambda^*$ (Hastie et al., 2019). However, we think that the bias-correction idea is still valuable, as the idea applies beyond ridge regression: CV selects regularization parameters that are too large. See Section A.5 for more details and experiments comparing different ways of choosing the regularization parameter.
+
+# 4 SKETCHING
+
+A final important question about ridge regression is how to compute it in practice. In this section, we study that problem in the same high-dimensional model used throughout our paper. The computation complexity of ridge regression, $O(np\min(n,p))$ , can be intractable in modern large-scale data analysis. Sketching is a popular approach to reducing the time complexity by reducing the sample size and/or dimension, usually by random projection or sampling (e.g. Mahoney, 2011; Woodruff, 2014; Drineas & Mahoney, 2016). Specifically, primal sketching approximates the sample covariance matrix $X^{\top}X / n$ by $X^{\top}L^{\top}LX / n$ , where $L$ is an $m \times n$ sketching matrix, and $m < n$ . If $L$ is chosen as a suitable random matrix, then this can still approximate the original sample covariance matrix. Then the primal sketched ridge regression estimator is
+
+$$
+\hat {\beta} _ {p} = \left(X ^ {\top} L ^ {\top} L X / n + \lambda I _ {p}\right) ^ {- 1} X ^ {\top} Y / n. \tag {5}
+$$
+
+Dual sketching reduces $p$ instead. An equivalent expression for ridge regression is $\hat{\beta} = n^{-1}X^{\top}\left(XX^{\top} / n + \lambda I_{n}\right)^{-1}Y$ . Dual sketched ridge regression reduces the computation cost of the Gram matrix $XX^{\top}$ , approximating it by $XRR^{\top}X^{\top}$ for another sketching matrix $R\in \mathbb{R}^{p\times d}$ ( $d < p$ ), so
+
+$$
+\hat {\beta} _ {d} = X ^ {\top} \left(X R R ^ {\top} X ^ {\top} / n + \lambda I _ {n}\right) ^ {- 1} Y / n. \tag {6}
+$$
+
+The sketching matrices $R$ and $L$ are usually chosen as random matrices with iid entries (e.g., Gaussian ones) or as orthogonal matrices. In this section, we study the asymptotic MSE for both orthogonal (Section 4.1) and Gaussian sketching (Section 4.2). We also mention full sketching, which performs ridge after projecting down both $X$ and $Y$ . In section A.11, we find its MSE. However, the other two methods have better tradeoffs, and we can empirically get better results for the same computational cost.
+
+# 4.1 ORTHOGONAL SKETCHING
+
+First we consider primal sketching with orthogonal projections. These can be implemented by subsampling, Haar distributed matrices, or subsampled randomized Hadamard transforms (Sarlos, 2006). We recall that the standard Marchenko-Pastur (MP) law is the probability distribution which is the limit of the ESD of $X^{\top}X / n$ , when the $n \times p$ matrix $X$ has iid standard Gaussian entries, and $n, p \to \infty$ so that $p / n \to \gamma > 0$ , which has an explicit density (Marchenko & Pastur, 1967; Bai & Silverstein, 2010).
+
+Theorem 4.1 (Primal orthogonal sketching). Suppose $\beta$ has iid entries with $\mathbb{E}\beta_{i} = 0$ , Var $[\beta_i] = \alpha^2 /p,i = 1,\ldots ,p$ and $\beta$ is independent of $X$ and $\varepsilon$ . Suppose $X$ has iid standard normal entries.
+
+We compute primal sketched ridge regression (5) with an $m \times n$ orthogonal matrix $L$ ( $m < n$ , $LL^{\top} = I_m$ ). Let $n, p$ and $m$ tend to infinity with $p/n \to \gamma \in (0, \infty)$ and $m/n \to \xi \in (0, 1)$ . Then the MSE of $\hat{\beta}_p(\lambda)$ has the limit
+
+$$
+M (\lambda) = \alpha^ {2} \frac {\left[ (\lambda + \xi - 1) ^ {2} + \gamma (1 - \xi) \right] \theta_ {2} \left(\frac {\gamma}{\xi} , \frac {\lambda}{\xi}\right)}{\xi^ {2}} + \gamma \sigma^ {2} \frac {\xi \theta_ {1} \left(\frac {\gamma}{\xi} , \frac {\lambda}{\xi}\right) - (\lambda + \xi - 1) \theta_ {2} \left(\frac {\gamma}{\xi} , \frac {\lambda}{\xi}\right)}{\xi^ {2}}, \tag {7}
+$$
+
+where $\theta_{i}(\gamma ,\lambda) = \int (x + \lambda)^{-i}dF_{\gamma}(x)$ and $F_{\gamma}$ is the standard Marchenko-Pastur law with aspect ratio $\gamma$
+
+Structure of the proof. The proof is in Section A.6, with explicit formulas in Section A.6.1. The $\theta_{i}$ are related to the resolvent of the MP law and its derivatives. In the proof, we decompose the
+
+
+Figure 3: Primal orthogonal sketching with $n = 500$ , $\gamma = 5$ , $\lambda = 1.5$ , $\alpha = 3$ , $\sigma = 1$ . Left: MSE of primal sketching normalized by the MSE of ridge regression. The error bar is the standard deviation over 10 repetitions. Right: Bias and variance of primal sketching normalized by the bias and variance of ridge regression, respectively.
+
+
+
+MSE as the sum of variance and squared bias, both of which further reduce to the traces of certain random matrices, whose limits are determined by the MP law $F_{\gamma}$ and $\lambda$ . The two terms on the RHS of Equation (7) are the limits of squared bias and variance, respectively. There is an additional key step in the proof, which introduces the orthogonal complement $L_{1}$ of the matrix $L$ such that $L^{\top}L + L_{1}^{\top}L_{1} = I_{n}$ , which leads to some Gaussian random variables appearing in the proof, and simplifies calculations.
+
+Simulations. A simulation in Figure 3 (left) shows a good match with our theory. It also shows that sketching does not increase the MSE too much. In this case, by reducing the sample size to half the original one, we only increase the MSE by a factor of 1.05. This shows sketching can be very effective. We also see in Figure 3 (right) that variance is compromised much more than bias.
+
+Robustness to tuning parameter. The reader may wonder how strongly this depends on the choice of the regularization parameter $\lambda$ . Perhaps ridge regression works poorly with this $\lambda$ , so sketching cannot worsen it too much? What happens if we take the optimal $\lambda$ instead of a fixed one? In experiments in Section A.12 we show that the behavior is quite robust to the choice of regularization parameter.
+
+The next theorem states a result for dual orthogonal sketching.
+
+Theorem 4.2 (Dual orthogonal sketching). Under the conditions of Theorem 4.1, we compute the dual sketched ridge regression with an orthogonal $p \times d$ sketching matrix $R$ ( $d \leqslant p$ , $R^{\top}R = I_d$ ). Let $n, p$ and $d$ go to infinity with $p / n \to \gamma \in (0, \infty)$ and $d / n \to \zeta \in (0, \gamma)$ . Then the MSE of $\hat{\beta}_d(\lambda)$ has the limit
+
+$$
+\frac {\alpha^ {2}}{\gamma} \left[ \gamma - 1 + (\lambda - \gamma + \zeta) ^ {2} \bar {\theta} _ {2} (\zeta , \lambda) + (\gamma - \zeta) \bar {\theta} _ {1} ^ {2} (\zeta , \lambda) \right] + \sigma^ {2} \left[ \bar {\theta} _ {1} (\zeta , \lambda) - (\lambda + \zeta - \gamma) \bar {\theta} _ {2} (\zeta , \lambda) \right],
+$$
+
+where $\bar{\theta}_i(\zeta, \lambda) = (1 - \zeta) / \lambda^i + \zeta \int (x + \lambda)^{-i} dF_{\zeta}(x)$ , and $F_{\zeta}$ is the standard Marchenko-Pastur law.
+
+Proof structure and simulations. The proof in Section A.7 follows similar path to the previous one. Here $\bar{\theta}_i$ comes in because of the companion Stieltjes transform of MP law. The simulation results shown in Figure 11 agrees well with our theory. They are similar to the ones before: sketching has favorable properties, and the bias increases less than the variance.
+
+Optimal tuning parameters. For both primal and dual sketching, the optimal regularization parameter minimizing the MSE seems analytically intractable. Instead, we use a numerical approach in our experiments, based on a binary search. Since this is one-dimensional problem, there are no numerical issues. See Figure 13 in Section A.12.3.
+
+
+Figure 4: Left: Ratio of optimal MSE of marginal regression to that of optimally tuned ridge regression, for three values of $\gamma = p / n$ , as a function of the SNR $\alpha^2 /\sigma^2$ . Right: Gaussian dual sketch when there is no noise. $\gamma = 0.4$ , $\alpha = 1$ , $\lambda = 1$ (both for original and sketching). Standard error over 50 experiments.
+
+
+
+# 4.1.1 EXTREME PROJECTION — MARGINAL REGRESSION
+
+It is of special interest to investigate extreme projections, where the sketching dimension is much reduced compared to the sample size, so $m \ll n$ . This corresponds to $\xi = 0$ . This can also be viewed as a scaled marginal regression estimator, i.e., $\hat{\beta} \propto X^{\top}Y$ . For dual sketching, the same case can be recovered with $\zeta = 0$ . Another interest of studying this special case is that the formula for MSE simplifies a lot.
+
+Theorem 4.3 (Marginal regression). Under the same assumption as Theorem 4.1, let $\xi = 0$ . Then the form of the MSE is $M(\lambda) = [\alpha^2[(\lambda - 1)^2 + \gamma] + \sigma^2\gamma] / \lambda^2$ . Moreover, the optimal $\lambda^*$ that minimizes this equals $\gamma \sigma^2 / \alpha^2 + 1 + \gamma$ and the optimal MSE is $M(\lambda^*) = \alpha^2(1 - \alpha^2 / [\alpha^2(1 + \gamma) + \gamma \sigma^2])$ .
+
+The proof is in Section A.8. When is the optimal MSE of marginal regression small? Compared to the MSE of the zero estimator $\alpha^2$ , it is small when $\gamma (\sigma^2 /\alpha^2 +1) + 1$ is large. In Figure 4 (left), we compare marginal and ridge regression for different aspect ratios and SNR. When the signal to noise ratio (SNR) $\alpha^2 /\sigma^2$ is small or the aspect ratio $\gamma$ is large, marginal regression does not increase the MSE much. As a concrete example, if we take $\alpha^2 = \sigma^2 = 1$ and $\gamma = 0.7$ , the marginal MSE is $1 - 1 / 2.4\approx 0.58$ . The optimal ridge MSE is about 0.52, so their ratio is only ca. $0.58 / 0.52\approx 1.1$ . It seems quite surprising that a simple-minded method like marginal regression can work so well. However, the reason is that when the SNR is small, we cannot expect ridge regression to have good performance. Large $\gamma$ can also be interpreted as small SNR, where ridge regression works poorly and sketching does not harm performance too much.
+
+# 4.2 GAUSSIAN SKETCHING
+
+In this section, we study Gaussian sketching. The following theorem states the bias of dual Gaussian sketching. The bias is enough to characterize the performance in the high SNR regime where $\alpha / \sigma \rightarrow \infty$ , and we discuss the extension to low SNR after the proof.
+
+Theorem 4.4 (Bias of dual Gaussian sketch). Suppose $X$ is an $n \times p$ standard Gaussian random matrix. Suppose also that $R$ is a $p \times d$ matrix with i.i.d. $\mathcal{N}(0,1 / d)$ entries. Then the bias of dual sketch has the expression $\mathrm{Bias}^2 (\hat{\beta}_d) = \alpha^2 +\alpha^2 /\gamma \cdot [m'(z) - 2m(z)]|_{z = 0}$ , where $m$ is a function described below, and $m^{\prime}(z)$ denotes the derivative of $m$ w.r.t. $z$ . Below, we use the branch of the square root with positive imaginary part.
+
+The function $m$ is characterized by its inverse function, which has the explicit formula $m^{-1}(z) = 1 / [1 + z / \zeta] - [\gamma + 1 - \sqrt{(\gamma - 1)^2 + 4\lambda z}] / (2z)$ for complex $z$ with positive imaginary part.
+
+About the proof. The proof is in Section A.9. We mention that the same result holds when the matrices involved have iid non-Gaussian entries, but the proof is more technical. The current proof is based on free probability theory (e.g., Voiculescu et al., 1992; Hiai & Petz, 2006; Couillet & Debbah, 2011). The function $m$ is the Stieltjes transform of the free additive convolution of a standard MP law $F_{1 / \xi}$ and a scaled inverse MP law $\lambda /\gamma \cdot F_{1 / \gamma}^{-1}$ (see the proof).
+
+Numerics. To evaluate the formula, we note that $m^{-1}(m(0)) = 0$ , so $m(0)$ is a root of $m^{-1}$ . Also, $dm(0)/dz$ equals $1/(dm^{-1}(y)/dy|_{y=m(0)})$ , the reciprocal of the derivative of $m^{-1}$ evaluated at $m(0)$ . We use binary search to find the numerical solution. The theoretical result agrees with the simulation quite well, see Figure 4.
+
+Somewhat unexpectedly, the MSE of dual sketching can be below the MSE of ridge regression, see Figure 4. This can happen when the original regularization parameter is suboptimal. As $d$ grows, the MSE of Gaussian dual sketching converges to that of ridge regression.
+
+We have also found the bias of primal Gaussian sketching. However, stating the result requires free probability theory, and so we present it in the Appendix, see Theorem A.1. To further validate our results, we present additional simulations in Sec. A.12, for both fixed and optimal regularization parameters after sketching. A detailed study of the computational cost for sketching in Sec. A.13 concludes, as expected, that primal sketching can reduce cost when $p < n$ , while dual sketching can reduce it when $p > n$ ; and also provides a more detailed analysis.
+
+# ACKNOWLEDGMENTS
+
+The authors thank Ken Clarkson for helpful discussions and for providing the reference Chen et al. (2015). ED was partially supported by NSF BIGDATA grant IIS 1837992. SL was partially supported by a Tsinghua University Summer Research award. A version of our manuscript is available on arxiv at https://arxiv.org/abs/1910.02373.
+
+# REFERENCES
+
+Daniel Ahfock, William J Astle, and Sylvia Richardson. Statistical properties of sketching algorithms. arXiv preprint arXiv:1706.03665, 2017.
+Nir Ailon and Bernard Chazelle. Approximate nearest neighbors and the fast johnson-lindenstrauss transform. In Proceedings of the thirty-eighth annual ACM symposium on Theory of computing, pp. 557-563. ACM, 2006.
+Greg W Anderson, Alice Guionnet, and Ofer Zeitouni. An Introduction to Random Matrices. Number 118. Cambridge University Press, 2010.
+Theodore W Anderson. An Introduction to Multivariate Statistical Analysis. Wiley New York, 2003.
+Zhidong Bai and Jack W Silverstein. Spectral analysis of large dimensional random matrices. Springer Series in Statistics. Springer, New York, 2nd edition, 2010.
+Thierry Bertin-Mahieux, Daniel P.W. Ellis, Brian Whitman, and Paul Lamere. The million song dataset. In Proceedings of the 12th International Conference on Music Information Retrieval (ISMIR 2011), 2011.
+Joel Bun, Jean-Philippe Bouchaud, and Marc Potters. Cleaning large correlation matrices: tools from random matrix theory. Physics Reports, 666:1-109, 2017.
+Shouyuan Chen, Yang Liu, Michael R Lyu, Irwin King, and Shengyu Zhang. Fast relative-error approximation algorithm for ridge regression. In UAI, pp. 201-210, 2015.
+Agniva Chowdhury, Jiasen Yang, and Petros Drineas. An iterative, sketching-based framework for ridge regression. In International Conference on Machine Learning, pp. 988-997, 2018.
+Romain Couillet and Merouane Debbah. *Random Matrix Methods for Wireless Communications*. Cambridge University Press, 2011.
+Paramveer Dhillon, Yichao Lu, Dean P Foster, and Lyle Ungar. New subsampling algorithms for fast least squares regression. In Advances in neural information processing systems, pp. 360-368, 2013.
+Lee H Dicker. Ridge regression and asymptotic minimax estimation over spheres of growing dimension. Bernoulli, 22(1):1-37, 2016.
+Edgar Dobriban and Sifan Liu. A new theory for sketching in linear regression. arXiv preprint arXiv:1810.06089, NeurIPS 2019, 2018.
+Edgar Dobriban and Yue Sheng. Distributed linear regression by averaging. arXiv preprint arxiv:1810.00412, 2018.
+Edgar Dobriban and Yue Sheng. One-shot distributed ridge regression in high dimensions. arXiv preprint arXiv:1903.09321, 2019.
+Edgar Dobriban and Stefan Wager. High-dimensional asymptotics of prediction: Ridge regression and classification. The Annals of Statistics, 46(1):247-279, 2018.
+
+Petros Drineas and Michael W Mahoney. RandNLA: randomized numerical linear algebra. Communications of the ACM, 59(6):80-90, 2016.
+Petros Drineas and Michael W Mahoney. Lectures on randomized numerical linear algebra. arXiv preprint arXiv:1712.08880, 2017.
+Petros Drineas, Michael W Mahoney, and S Muthukrishnan. Sampling algorithms for 12 regression and applications. In Proceedings of the seventeenth annual ACM-SIAM symposium on Discrete algorithm, pp. 1127-1136. Society for Industrial and Applied Mathematics, 2006.
+Petros Drineas, Michael W Mahoney, S Muthukrishnan, and Tamás Sarlós. Faster least squares approximation. Numerische mathematik, 117(2):219-249, 2011.
+Ahmed el Alaoui and Michael W Mahoney. Fast randomized kernel ridge regression with statistical guarantees. In Advances in Neural Information Processing Systems, pp. 775-783, 2015.
+Noureddine El Karoui. On the impact of predictor geometry on the performance on high-dimensional ridge-regularized generalized robust regression estimators. *Probability Theory and Related Fields*, 170(1-2):95–175, 2018.
+Noureddine El Karoui and Holger Kösters. Geometric sensitivity of random matrix results: consequences for shrinkage estimators of covariance and related statistical methods. arXiv preprint arXiv:1105.1404, 2011.
+Alon Gonen, Francesco Orabona, and Shai Shalev-Shwartz. Solving ridge regression using sketched preconditioned svrg. In International Conference on Machine Learning, pp. 1397-1405, 2016.
+Walid Hachem, Philippe Loubaton, and Jamal Najim. Deterministic equivalents for certain functionals of large random matrices. The Annals of Applied Probability, 17(3):875-930, 2007.
+Nathan Halko, Per-Gunnar Martinsson, and Joel A Tropp. Finding structure with randomness: Probabilistic algorithms for constructing approximate matrix decompositions. SIAM review, 53(2):217-288, 2011.
+Trevor Hastie, Robert Tibshirani, and Jerome Friedman. The elements of statistical learning. Springer series in statistics, 2009.
+Trevor Hastie, Andrea Montanari, Saharon Rosset, and Ryan J Tibshirani. Surprises in high-dimensional ridgeless least squares interpolation. arXiv preprint arXiv:1903.08560, 2019.
+Fumio Hiai and Dénes Petz. The semicircle law, free random variables and entropy. Number 77. American Mathematical Soc., 2006.
+Zengfeng Huang. Near optimal frequent directions for sketching dense and sparse matrices. In International Conference on Machine Learning, pp. 2053-2062, 2018.
+Miles E Lopes, Shusen Wang, and Michael W Mahoney. Error estimation for randomized least-squares algorithms via the bootstrap. arXiv preprint arXiv:1803.08021, 2018.
+Ping Ma, Michael W Mahoney, and Bin Yu. A statistical perspective on algorithmic leveraging. The Journal of Machine Learning Research, 16(1):861-911, 2015.
+Michael W Mahoney. Randomized algorithms for matrices and data. Foundations and Trends in Machine Learning, 3(2):123-224, 2011.
+Vladimir A Marchenko and Leonid A Pastur. Distribution of eigenvalues for some sets of random matrices. Mat. Sb., 114(4):507-536, 1967.
+Robb J Muirhead. Aspects of multivariate statistical theory, volume 197. John Wiley & Sons, 2009.
+Alexandru Nica and Roland Speicher. Lectures on the combinatorics of free probability, volume 13. Cambridge University Press, 2006.
+Debashis Paul and Alexander Aue. Random matrix theory in statistics: A review. Journal of Statistical Planning and Inference, 150:1-29, 2014.
+Garvesh Raskutti and Michael W Mahoney. A statistical perspective on randomized sketching for ordinary least-squares. The Journal of Machine Learning Research, 17(1):7508-7538, 2016.
+Francisco Rubio and Xavier Mestre. Spectral convergence for a general class of random matrices. Statistics & Probability Letters, 81(5):592-602, 2011.
+Tamas Sarlos. Improved approximation algorithms for large matrices via random projections. In Foundations of Computer Science, 2006. FOCS'06. 47th Annual IEEE Symposium on, pp. 143-152. IEEE, 2006.
+Vadim Ivanovich Serdobolskii. Multiparametric Statistics. Elsevier, 2007.
+Gian-Andrea Thanei, Christina Heinze, and Nicolai Meinshausen. Random projections for large-scale regression. In *Big and complex data analysis*, pp. 51–68. Springer, 2017.
+Ryan J Tibshirani and Robert Tibshirani. A bias correction for the minimum error rate in cross-validation. The Annals of Applied Statistics, pp. 822-829, 2009.
+Antonio M Tulino and Sergio Verdú. Random matrix theory and wireless communications. Communications and Information theory, 1(1):1-182, 2004.
+Santosh S Vempala. The random projection method, volume 65. American Mathematical Soc., 2005.
+Dan V Voiculescu, Ken J Dykema, and Alexandru Nica. Free random variables. Number 1. American Mathematical Soc., 1992.
+Jialei Wang, Jason D Lee, Mehrdad Mahdavi, Mladen Kolar, and Nathan Srebro. Sketching meets random projection in the dual: A provable recovery algorithm for big and high-dimensional data. Electronic Journal of Statistics, 11(2):4896-4944, 2017.
+Shusen Wang, Alex Gittens, and Michael W Mahoney. Sketched ridge regression: Optimization perspective, statistical perspective, and model averaging. Journal of Machine Learning Research, 18:1-50, 2018.
+
+Hadley Wickham. nycflights13: Flights that Departed NYC in 2013, 2018. URL https://CRAN.R-project.org/package=nycflights13.R package version 1.0.0.
+David P Woodruff. Sketching as a tool for numerical linear algebra. Foundations and Trends in Theoretical Computer Science, 10(1-2):1-157, 2014.
+Jianfeng Yao, Zhidong Bai, and Shurong Zheng. Large Sample Covariance Matrices and High-Dimensional Data Analysis. Cambridge University Press, New York, 2015.
+Lijun Zhang, Mehrdad Mahdavi, and Rong Jin. Linear convergence with condition number independent access of full gradients. In Advances in Neural Information Processing Systems, pp. 980-988, 2013a.
+Lijun Zhang, Mehrdad Mahdavi, Rong Jin, Tianbao Yang, and Shenghuo Zhu. Recovering the optimal solution by dual random projection. In Conference on Learning Theory, pp. 135-157, 2013b.
+Amin Zollanvari and Marc G Genton. On Kolmogorov asymptotics of estimators of the misclassification error rate in linear discriminant analysis. Sankhya A, 75(2):300-326, 2013.
+
+# A APPENDIX
+
+# A.1 PROOF OF THEOREM 2.1
+
+If $p / n \to \gamma$ and the spectral distribution of $\Sigma$ converges to $H$ , we have by the general Marchenko-Pastur (MP) theorem of Rubio and Mestre (Rubio & Mestre, 2011), that
+
+$$
+\left(\widehat {\Sigma} + \lambda I\right) ^ {- 1} \asymp \left(c _ {p} \Sigma + \lambda I\right) ^ {- 1},
+$$
+
+where $c_{p} \coloneqq c(n, p, \Sigma, \lambda)$ is the unique positive solution of the fixed point equation
+
+$$
+1 - c _ {p} = \frac {c _ {p}}{n} \operatorname {t r} \left[ \Sigma (c _ {p} \Sigma + \lambda I) ^ {- 1} \right].
+$$
+
+Here, using the terminology of the calculus of deterministic equivalents (Dobriban & Sheng, 2018), two sequences of (not necessarily symmetric) $n \times n$ matrices $A_{n}, B_{n}$ of growing dimensions are equivalent, and we write
+
+$$
+A _ {n} \asymp B _ {n}
+$$
+
+if $\lim_{n\to \infty}\mathrm{tr}[C_n(A_n - B_n)] = 0$ almost surely, for any sequence $C_n$ of (not necessarily symmetric) $n\times n$ deterministic matrices with bounded trace norm, i.e., such that $\lim \sup \| C_n\|_{tr} < \infty$ (Dobrian & Sheng, 2018). Informally, linear combinations of the entries of $A_{n}$ can be approximated by the entries of $B_{n}$ .
+
+We start with
+
+$$
+\begin{array}{l} \hat {\beta} = \left(X ^ {\top} X / n + \lambda I _ {p}\right) ^ {- 1} X ^ {\top} Y / n = \left(X ^ {\top} X / n + \lambda I _ {p}\right) ^ {- 1} \frac {X ^ {\top} (X \beta + \varepsilon)}{n} \\ = (\widehat {\Sigma} + \lambda I _ {p}) ^ {- 1} \widehat {\Sigma} \beta + (\widehat {\Sigma} + \lambda I _ {p}) ^ {- 1} \frac {X ^ {\top} \varepsilon}{n}. \\ \end{array}
+$$
+
+Then, by the general MP law written in the language of the calculus of deterministic equivalents
+
+$$
+(\widehat {\Sigma} + \lambda I _ {p}) ^ {- 1} \widehat {\Sigma} = I _ {p} - \lambda (\widehat {\Sigma} + \lambda I _ {p}) ^ {- 1} \asymp I _ {p} - \lambda (c _ {p} \Sigma + \lambda I) ^ {- 1} = c _ {p} \Sigma (c _ {p} \Sigma + \lambda I) ^ {- 1}.
+$$
+
+By the definition of equivalence for vectors,
+
+$$
+\big (\widehat {\Sigma} + \lambda I _ {p} \big) ^ {- 1} \widehat {\Sigma} \beta \asymp c _ {p} \Sigma \big (c _ {p} \Sigma + \lambda I \big) ^ {- 1} \beta .
+$$
+
+We note a subtle point here. The rank of the matrix $M \coloneqq (\widehat{\Sigma} + \lambda I_p)^{-1}\widehat{\Sigma}$ is at most $n$ , and so it is not a full rank matrix when $n < p$ . In contrast, $c_p\Sigma (c_p\Sigma + \lambda I)^{-1}$ can be a full rank matrix. Therefore, for the vectors $\beta$ in the null space of $\widehat{\Sigma}$ , which is also the null space of $X$ , we certainly have that the two sides are not equal. However, here we assumed that the matrix $X$ is random, and so its null space is a random $\max(p - n, 0)$ dimensional linear space. Therefore, for any fixed vector $\beta$ , the random matrix $M$ will not contain it in its null space with high probability, and so there is no contradiction.
+
+We should also derive an asymptotic equivalent for
+
+$$
+(\widehat {\Sigma} + \lambda I _ {p}) ^ {- 1} \frac {X ^ {\top} \varepsilon}{n}.
+$$
+
+
+Figure 5: Simulation for ridge regression. We take $n = 1000$ , $\lambda = 0.3$ . Also, $X$ has iid $\mathcal{N}(0,1)$ entries, $\beta_{i} \sim_{iid} \mathcal{N}(0,\alpha^{2}/p)$ , $\varepsilon_{i} \sim_{iid} \mathcal{N}(0,\sigma^{2})$ , with $\alpha = 3$ , $\sigma = 1$ . The standard deviations are over 50 repetitions. The theoretical lines are plotted according to Theorem 2.2. The MSE is normalized by the norm of $\beta$ .
+
+Suppose we have Gaussian noise, and let $Z\sim \mathcal{N}(0,I_p)$ . Then we can write
+
+$$
+\left(\widehat {\Sigma} + \lambda I _ {p}\right) ^ {- 1} \frac {X ^ {\top} \varepsilon}{n} = _ {d} \left(\widehat {\Sigma} + \lambda I _ {p}\right) ^ {- 1} \widehat {\Sigma} ^ {1 / 2} \frac {\sigma Z}{n ^ {1 / 2}}.
+$$
+
+So the question reduces to finding a deterministic equivalent for $h(\widehat{\Sigma})$ , where $h(x) = (x + \lambda)^{-2}x$ . Note that
+
+$$
+h (x) = (x + \lambda) ^ {- 2} x = (x + \lambda) ^ {- 2} (x + \lambda - \lambda) = (x + \lambda) ^ {- 1} - \lambda (x + \lambda) ^ {- 2}.
+$$
+
+By the calculus of deterministic equivalents: $(\widehat{\Sigma} + \lambda)^{-1} \asymp (c_p \Sigma + \lambda I)^{-1}$ . Moreover, fortunately the limit of the second part was recently calculated in (Dobriban & Sheng, 2019). This used the so-called "differentiation rule" of the calculus of deterministic equivalents to find
+
+$$
+\left(\widehat {\Sigma} + \lambda\right) ^ {- 2} \asymp \left(c _ {p} \Sigma + \lambda I\right) ^ {- 2} \left(I - c _ {p} ^ {\prime} \Sigma\right).
+$$
+
+The derivative $c_p' = dc_p / dz$ has been found in Dobriban & Sheng (2019), in the proof of Theorem 3.1, part 2b. The result is (with $\gamma_p = p / n$ , $H_p$ the spectral distribution of $\Sigma$ , and $T$ a random variable distributed according to $H_p$ )
+
+$$
+c _ {p} ^ {\prime} = \frac {\gamma_ {p} \mathbb {E} _ {H _ {p}} \frac {c _ {p} T}{\left(c _ {p} T - z\right) ^ {2}}}{- 1 + \gamma_ {p} z \mathbb {E} _ {H _ {p}} \frac {T}{\left(c _ {p} T - z\right) ^ {2}}}. \tag {8}
+$$
+
+So, we find the final answer
+
+$$
+(\widehat {\Sigma} + \lambda I _ {p}) ^ {- 1} \widehat {\Sigma} ^ {1 / 2} \asymp A (\Sigma , \lambda) := (c _ {p} \Sigma + \lambda I) ^ {- 1} - \lambda (c _ {p} \Sigma + \lambda I) ^ {- 2} (I - c _ {p} ^ {\prime} \Sigma).
+$$
+
+# A.2 RISK ANALYSIS
+
+Figure 5 shows a simulation result. We see a good match between theory and simulation.
+
+# A.2.1 PROOF OF THEOREM 2.2
+
+Proof. The MSE of $\hat{\beta}$ has the form
+
+$$
+\mathbb {E} \| \hat {\beta} - \beta \| ^ {2} = \mathrm {b i a s} ^ {2} + \delta^ {2},
+$$
+
+where
+
+$$
+\operatorname {b i a s} ^ {2} = \mathbb {E} \left[ \left\| \left(X ^ {\top} X / n + \lambda I _ {p}\right) ^ {- 1} X ^ {\top} X / n \beta - \beta \right\| _ {2} ^ {2} \right],
+$$
+
+$$
+\delta^ {2} = \sigma^ {2} \mathbb {E} \left[ \left\| \left(X ^ {\top} X / n + \lambda I _ {p}\right) ^ {- 1} n ^ {- 1} X ^ {\top} \right\| _ {F} ^ {2} \right].
+$$
+
+We assume that $X$ has iid entries of zero mean and unit variance, and that $\mathbb{E}\beta = 0$ , Var $[\beta] = \alpha^2 / pI_p$ . As $p/n \to \gamma$ as $n$ goes to infinity, the ESD of $\frac{1}{n} X^\top X$ converges to the MP law $F_\gamma$ . So we have
+
+$$
+\begin{array}{l} \mathrm {b i a s} ^ {2} = \mathbb {E} \left[ \left\| \lambda \left(X ^ {\top} X / n + \lambda I _ {p}\right) ^ {- 1} \beta \right\| _ {2} ^ {2} \right] \\ = \alpha^ {2} \lambda^ {2} \mathbb {E} \left[ \frac {1}{p} \mathrm {t r} [ (X ^ {\top} X / n + \lambda I _ {p}) ^ {- 2} ] \right] \to \alpha^ {2} \lambda^ {2} \int \frac {1}{(x + \lambda) ^ {2}} d F _ {\gamma} (x), \\ \end{array}
+$$
+
+and
+
+$$
+\begin{array}{l} \delta^ {2} = \frac {\sigma^ {2}}{n ^ {2}} \mathbb {E} \left[ \mathrm {t r} [ (X ^ {\top} X / n + \lambda I _ {p}) ^ {- 2} X ^ {\top} X ] \right] \\ = \frac {\sigma^ {2}}{n} \mathbb {E} \left[ \mathrm {t r} [ (X ^ {\top} X / n + \lambda I _ {p}) ^ {- 1} - \lambda (X ^ {\top} X / n + \lambda I _ {p}) ^ {- 2} ] \right] \\ \rightarrow \sigma^ {2} \gamma \left[ \int \frac {1}{x + \lambda} d F _ {\gamma} (x) - \lambda \int \frac {1}{(x + \lambda) ^ {2}} d F _ {\gamma} (x) \right]. \\ \end{array}
+$$
+
+Denoting $\theta_{i}(\gamma ,\lambda) = \int \frac{1}{(x + \lambda)^{i}} dF_{\gamma}(x)$ , then
+
+$$
+A M S E (\hat {\beta}) = \alpha^ {2} \lambda^ {2} \theta_ {2} + \gamma \sigma^ {2} \left[ \theta_ {1} - \lambda \theta_ {2} \right]. \tag {9}
+$$
+
+For the standard Marchenko-Pastur law (i.e., when $\Sigma = I_p$ ), we have the explicit forms of $\theta_{1}$ and $\theta_{2}$ . Specifically,
+
+$$
+\theta_ {1} = \int {\frac {1}{x + \lambda}} d F _ {\gamma} (x) = - \frac {1}{2} \left[ \frac {2 (1 + \lambda)}{\lambda \gamma} + \frac {2}{\sqrt {\gamma} \lambda} z _ {2} \right]
+$$
+
+where
+
+$$
+z _ {2} = - \frac {1}{2} \left[ (\sqrt {\gamma} + \frac {1 + \lambda}{\sqrt {\gamma}}) + \sqrt {(\sqrt {\gamma} + \frac {1 + \lambda}{\sqrt {\gamma}}) ^ {2} - 4} \right].
+$$
+
+It is known that the limiting Stieltjes transform $m_{F_{\gamma}} \coloneqq m_{\gamma}$ of $\widehat{\Sigma}$ has the explicit form (Marchenko & Pastur, 1967):
+
+$$
+m _ {\gamma} (z) = \frac {(z + \gamma - 1) + \sqrt {(z + \gamma - 1) ^ {2} - 4 z \gamma}}{- 2 z \gamma}.
+$$
+
+As usual in the area, we use the principal branch of the square root of complex numbers. Hence $\theta_{1} = \frac{(-\lambda + \gamma - 1) + \sqrt{(-\lambda + \gamma - 1)^{2} + 4\lambda\gamma}}{2\lambda\gamma}$ . Also
+
+$$
+\begin{array}{l} \theta_ {2} (\gamma , \lambda) = \int \frac {1}{(x + \lambda) ^ {2}} d F _ {\gamma} (x) = - \int \frac {d}{d \lambda} \frac {1}{x + \lambda} d F _ {\gamma} (x) \\ = - \frac {d}{d \lambda} \theta_ {1} = - \frac {1}{\gamma \lambda^ {2}} + \frac {1}{\sqrt {\gamma}} \frac {d}{d \lambda} \frac {z _ {2}}{\lambda} \\ = - \frac {1}{\gamma \lambda^ {2}} + \frac {\gamma + 1}{2 \gamma \lambda^ {2}} - \frac {1}{2 \sqrt {\gamma}} [ \frac {\lambda + \gamma + 1}{\gamma \lambda \sqrt {(\sqrt {\gamma} + \frac {1 + \lambda}{\sqrt {\gamma}}) ^ {2} - 4}} - \frac {\sqrt {(\sqrt {\gamma} + \frac {1 + \lambda}{\sqrt {\gamma}}) ^ {2} - 4}}{\lambda^ {2}} ] \\ \end{array}
+$$
+
+For the residual,
+
+$$
+\begin{array}{l} \mathbb {E} \left[ \frac {1}{n} \| Y - X \hat {\beta} \| _ {2} ^ {2} | X \right] = \alpha^ {2} \lambda^ {2} \frac {1}{p} \operatorname {t r} \left[ \left(X ^ {\top} X / n + \lambda I _ {p}\right) ^ {- 1} - \lambda \left(X ^ {\top} X / n + \lambda I _ {p}\right) ^ {- 2} \right] \\ + \sigma^ {2} \frac {1}{n} [ \mathrm {t r} (I _ {n}) - 2 \mathrm {t r} \left(X ^ {\top} X / n + \lambda I _ {p}\right) ^ {- 1} X ^ {\top} X / n + \mathrm {t r} \left(\left(X ^ {\top} X / n + \lambda I _ {p}\right) ^ {- 1} X ^ {\top} X / n\right) ^ {2} ]. \\ \end{array}
+$$
+
+Next,
+
+$$
+\begin{array}{l} \mathbb {E} \left[ \frac {1}{p} \operatorname {t r} \left[ \left(\left(X ^ {\top} X / n + \lambda I _ {p}\right) ^ {- 1} X ^ {\top} X / n\right) ^ {2} \right] \right] = \mathbb {E} \left[ \frac {1}{p} \operatorname {t r} \left[ \left(I _ {p} - \lambda \left(X ^ {\top} X / n + \lambda I _ {p}\right) ^ {- 1}\right) ^ {2} \right] \right] \\ \rightarrow 1 - 2 \lambda \theta_ {1} + \lambda^ {2} \theta_ {2}. \\ \end{array}
+$$
+
+Therefore
+
+$$
+\begin{array}{l} \mathbb {E} \left[ \frac {1}{n} \| Y - X \hat {\beta} \| _ {2} ^ {2} \right]\rightarrow \alpha^ {2} \lambda^ {2} \left[ \theta_ {1} - \lambda \theta_ {2} \right] + \sigma^ {2} \left[ 1 - 2 \gamma (1 - \lambda \theta_ {1}) + \gamma (1 - 2 \lambda \theta_ {1} + \lambda^ {2} \theta_ {2}) \right] \\ = \alpha^ {2} \lambda^ {2} \left[ \theta_ {1} - \lambda \theta_ {2} \right] + \sigma^ {2} \left[ 1 - \gamma \left(1 + \lambda \theta_ {1} - \lambda^ {2} \theta_ {2}\right) \right]. \\ \end{array}
+$$
+
+
+
+# A.3 BIAS-VARIANCE TRADEOFF
+
+The limiting MSE decomposes into a limiting squared bias and variance. The specific forms of these are
+
+$$
+\mathrm {b i a s} ^ {2} = \alpha^ {2} \int \frac {\lambda^ {2}}{(x + \lambda) ^ {2}} d F _ {\gamma} (x), \qquad \mathrm {v a r} = \gamma \sigma^ {2} \int \frac {x}{(x + \lambda) ^ {2}} d F _ {\gamma} (x).
+$$
+
+See Figure 1 for a plot. We can make several observations.
+
+1. The bias increases with $\lambda$ , starting out at zero for $\lambda = 0$ (linear regression), and increasing to $\alpha^2$ as $\lambda \to \infty$ (zero estimator).
+2. The variance decreases with $\lambda$ , from $\gamma \sigma^2 \int x^{-1} dF_{\gamma}(x)$ to zero.
+3. In the setting plotted in the figure, when $\alpha^2$ and $\sigma^2$ are roughly comparable, there are additional qualitative properties we can investigate. When $\gamma$ is small, the regularization parameter $\lambda$ influences the bias more strongly than the variance (i.e., the derivative of the normalized quantities in the range plotted is generally larger for the normalized squared bias). In contrast when $\gamma$ is large, the variance is influenced more.
+
+Next we consider how bias and variance change with $\gamma$ at the optimal $\lambda^{*} = \gamma \sigma^{2} / \alpha^{2}$ . This can be viewed as the "pure" effects of dimensionality on the problem, keeping all other parameters fixed. Indeed, $\alpha^2 /\sigma^2$ can be viewed as the signal-to-noise ratio (SNR), and is fixed. This analysis allows us to study for the best possible estimator (ridge regression, a Bayes estimator), behaves with the dimension. We refer to Figure 6, where we make some specific choices of $\alpha$ and $\sigma$ .
+
+1. Clearly the overall risk increases, as the problem becomes harder with increasing dimension. This is in line with our intuition.
+2. The classical bias-variance tradeoff can be summarized by the equation
+
+$$
+\operatorname {b i a s} ^ {2} (\lambda) + \operatorname {v a r} (\lambda) \geqslant M ^ {*} (\alpha , \gamma),
+$$
+
+where we made explicit the dependence of the bias and variance on $\lambda$ , and where $M^{*}(\alpha, \gamma)$ is the minimum MSE achievable, also known as the Bayes error, for which there are explicit formulas available (Tulino & Verdu, 2004; Dobriban & Wager, 2018).
+
+3. The variance first increases, then decreases with $\gamma$ . This shows that in the "classical" low-dimensional case, most of the risk is due to variance, while in the "modern" high-dimensional case, most of it is due to bias. This observation is consistent with other phenomena in proportional-limit asymptotics, for instance that the map between population and sample eigenvalue distributions is asymptotically deterministic (Marchenko & Pastur, 1967; Bai & Silverstein, 2010).
+
+# A.4 SIMULATIONS WITH CROSS-VALIDATION
+
+See Figure 7. We consider both small and large $\gamma$ . Our bias-correction procedure shrinks the $\lambda$ to the correct direction and decreases the test error. It is also shown that the one-standard-error rule (e.g., Hastie et al., 2009) does not perform well here.
+
+
+Figure 6: Bias-variance tradeoff at optimal $\lambda^{*} = \gamma \sigma^{2} / \alpha^{2}$ , when $\alpha = 3$ , $\sigma = 1$ .
+
+
+
+
+Figure 7: Left: we generate a training set $(n = 1000, p = 700, \gamma = 0.7, \alpha = \sigma = 1)$ and a test set $(n_{test} = 500)$ from the same distribution. We split the training set into $K = 5$ equally sized folds and do cross-validation. The blue error bars plot the mean and standard error of the $K$ test errors. The red dotted line indicates the "one-standard-error" location. The green dashed line indicates the optimal $\lambda_{CV}^{*}$ obtained by $k$ -fold cross-validation, while the red dashed-dotted line indicates the debiased version $\frac{K - 1}{K} \lambda_{CV}^{*}$ . The orange line plots the test error when training on the whole training set and fit on the whole test set, and the purple dashed-dotted line indicates the minimal $\lambda_{test}^{*}$ . The test error is 1.513 at $\lambda_{CV}^{*}$ and 1.510 at $\frac{K - 1}{K} \lambda_{CV}^{*}$ . So the bias-correction decreases the test error by about 0.003. Right: we take $n = 200, p = 1000, \gamma = 5, \alpha = 3, \sigma = 1$ . The bias-correction decreases the test error from 8.92 to 8.89, so it decreases by 0.03.
+
+# A.5 CHOOSING THE REGULARIZATION PARAMETER- ADDITIONAL DETAILS
+
+Another possible prediction method is to use the average of the ridge estimators computed during cross-validation. Here it is also natural to use the CV-optimal regularization parameters, averaging $\hat{\beta}_{-k}(\hat{\lambda}_k^*)$ , i.e.
+
+$$
+\hat {\beta} _ {a v g} \left(\hat {\lambda} _ {k} ^ {*}\right) = \frac {1}{K} \sum_ {k = 1} ^ {K} \hat {\beta} _ {- k} \left(\hat {\lambda} _ {k} ^ {*}\right).
+$$
+
+This has the advantage that it does not require refitting the ridge regression estimator, and also that we use the optimal regularization parameter.
+
+# A.5.1 TRAIN-TEST VALIDATION
+
+The same bias in the regularization parameter also applies to train-test validation. Since the number of samples is changed when restricting to the training set, the optimal $\lambda$ chosen by train-test validation is also biased for the true regularization parameter minimizing the test error. We will later see in simulations (Figure 8) that retraining the ridge regression estimator on the whole data will still significantly improve the performance (this is expected based on our results on CV). For prediction, here we can also use ridge regression on the training set. This effectively reduces sample size $n\rightarrow n_{train}$ , where $n_{train}$ is the sample size of the training set. However, if the training set grows such that $n / n_{train}\to 1$ while $n_{train}\to \infty$ , the train-test split has asymptotically optimal performance.
+
+# A.5.2 LEAVE-ONE-OUT
+
+There is a special "short-cut" for leave-one-out in ridge regression, which saves us from burdensome computation. Write $loo(\lambda)$ for the leave-one-out estimator of prediction error with parameter $\lambda$ . Instead of doing ridge regression $n$ times, we can calculate the error explicitly as
+
+$$
+l o o (\lambda) = \frac {1}{n} \sum_ {i = 1} ^ {n} \left[ \frac {Y _ {i} - X _ {i} ^ {\top} \hat {\beta} (\lambda)}{1 - S _ {i i} (\lambda)} \right] ^ {2}.
+$$
+
+where $S(\lambda) = X(X^{\top}X + n\lambda I)^{-1}X^{\top}$ . The minimizer of $loo(\lambda)$ is asymptotically optimal, i.e., it converges to $\lambda^{*}$ (Hastie et al., 2019). However, the computational cost of this shortcut is the same as that of a train-test split. Therefore, the method described above has the same asymptotic performance.
+
+
+Figure 8: Comparing different ways of doing cross-validation. We take $n = 500$ , $p = 550$ , $\alpha = 20$ , $\sigma = 1$ , $K = 5$ . As for train-test validation, we take $80\%$ of samples to be training set and the rest $20\%$ be test set. The error bars are the mean and standard deviation over 20 repetitions.
+
+Simulations: Figure 8 shows simulation results comparing different cross-validation methods:
+
+1. kf — k-fold cross-validation by taking the average of the ridge estimators at the CV-optimal regularization parameter.
+
+2. kf refit — k-fold cross-validation by refitting ridge regression on the whole dataset using the CV-optimal regularization parameter.
+3. kf bic — k-fold cross-validation by refitting ridge regression on the whole dataset using the CV-optimal regularization parameter, with bias correction.
+4. tt — train-test validation, by using the ridge estimator computed on the train data, at the validation-optimal regularization parameter. Note: we expect this to be similar, but worse than the "kf" estimator.
+5. tt refit — train-test validation by refitting ridge regression on the whole dataset, using the validation-optimal regularization parameter. Note: we expect this to be similar, but slightly worse than the "kf refit" estimator.
+6. tt bic — train-test validation by refitting ridge regression on the whole dataset using the CV-optimal regularization parameter, with bias correction.
+7. loo — leave-one-out
+
+Figure 8 shows that the naive estimators (kf and tt) can be quite inaccurate without refitting or bias correction. However, if we either refit or bias-correct, the accuracy improves. In this case, there seems to be no significant difference between the various methods.
+
+# A.6 PROOF OF THEOREM 4.1
+
+Proof. Suppose $m / n\to \xi$ as $n$ goes to infinity. For $\hat{\beta}_p$ , we have
+
+$$
+\mathrm {b i a s} ^ {2} = \mathbb {E} \left[ \left\| \left(X ^ {\top} L ^ {\top} L X / n + \lambda I _ {p}\right) ^ {- 1} X ^ {\top} X / n \beta - \beta \right\| _ {2} ^ {2} \right],
+$$
+
+$$
+\delta^ {2} = \sigma^ {2} \mathbb {E} \left[ \left\| \left(X ^ {\top} L ^ {\top} L X / n + \lambda I _ {p}\right) ^ {- 1} n ^ {- 1} X ^ {\top} \right\| _ {F} ^ {2} \right].
+$$
+
+Denote $M = \left(X^{\top}L^{\top}LX / n + \lambda I_{p}\right)^{-1}$ , the resolvent of the sketched matrix. We further assume that $X$ has iid $\mathcal{N}(0,1)$ entries and $LL^{\top} = I_{m}$ . Let $L_{1}$ be an orthogonal complementary matrix of $L$ , such that $L^{\top}L + L_{1}^{\top}L_{1} = I_{n}$ . We also denote $N = \frac{X^{\top}L_{1}^{\top}L_{1}X}{n}$ . Then
+
+$$
+M X ^ {\top} X / n = M \frac {X ^ {\top} L ^ {\top} L X + X ^ {\top} L _ {1} ^ {\top} L _ {1} X}{n} = I _ {p} - \lambda M + M N.
+$$
+
+Therefore, using that $\operatorname{Cov}[\beta] = \alpha^2 / p \cdot I_p$ , we find the bias as
+
+$$
+\begin{array}{l} \operatorname {b i a s} ^ {2} = \frac {\alpha^ {2}}{p} \mathbb {E} \left[ \operatorname {t r} \left(M - I _ {p}\right) \left(M ^ {\top} - I _ {p}\right) \right] \\ = \frac {\alpha^ {2}}{p} \left\{\lambda^ {2} \mathbb {E} \left[ \operatorname {t r} \left[ M ^ {2} \right] \right] + \mathbb {E} \left[ \operatorname {t r} M ^ {2} \frac {\left(X ^ {\top} L _ {1} ^ {\top} L _ {1} X\right) ^ {2}}{n ^ {2}} \right] - 2 \lambda \mathbb {E} \left[ \operatorname {t r} M ^ {2} N \right] \right\}. \\ \end{array}
+$$
+
+By the properties of Wishart matrices (e.g., Anderson, 2003; Muirhead, 2009), we have
+
+$$
+\mathbb {E} \left[ N \right] = \frac {n - m}{n} I _ {p},
+$$
+
+$$
+\mathbb {E} \left[ (N) ^ {2} \right] = \frac {1}{n ^ {2}} \mathbb {E} \left[ W i s h a r t (I _ {p}, n - m) ^ {2} \right] = \frac {1}{n ^ {2}} [ n - m + p (n - m) + (n - m) ^ {2} ] I _ {p}.
+$$
+
+Recalling that $m, n \to \infty$ such that $m / n \to \xi$ , and that $\theta_i(\gamma, \lambda) = \int (x + \lambda)^{-i} dF_{\gamma}(x)$ ,
+
+$$
+\begin{array}{l} \mathrm {b i a s} ^ {2} = \frac {\alpha^ {2}}{p} \left[ \lambda^ {2} + \frac {n - m + p (n - m) + (n - m) ^ {2}}{n ^ {2}} - 2 \lambda \frac {n - m}{n} \right] \mathbb {E} [ \mathrm {t r} [ M ^ {2} ] ] \\ \rightarrow \alpha^ {2} [ (\lambda + \xi - 1) ^ {2} + \gamma (1 - \xi) ] \theta_ {2} (\gamma , \xi , \lambda). \\ \end{array}
+$$
+
+Moreover,
+
+$$
+\begin{array}{l} \delta^ {2} = \frac {\sigma^ {2}}{n ^ {2}} \mathbb {E} \left[ \mathrm {t r} [ M ^ {2} X ^ {\top} X ] \right] \\ = \frac {\sigma^ {2}}{n} \cdot \left\{\mathbb {E} [ \operatorname {t r} [ M ] ] - \lambda \mathbb {E} [ \operatorname {t r} [ M ^ {2} ] ] + \mathbb {E} [ \operatorname {t r} [ M ^ {2} N ] ] \right\} \\ \rightarrow \gamma \sigma^ {2} \left[ \theta_ {1} (\gamma , \xi , \lambda) - \lambda \theta_ {2} (\gamma , \xi , \lambda) + (1 - \xi) \theta_ {2} (\gamma , \xi , \lambda) \right]. \\ \end{array}
+$$
+
+Here we used the additional definitions
+
+$$
+\theta_ {i} (\gamma , \xi , \lambda) = \int \frac {1}{(\xi x + \lambda) ^ {i}} d F _ {\gamma / \xi} (x)
+$$
+
+$$
+\theta_ {i} (\gamma , \lambda) = \theta_ {i} (\gamma , \xi = 1, \lambda).
+$$
+
+Note that these can be connected to the previous definitions by
+
+$$
+\theta_ {1} (\gamma , \xi , \lambda) = \frac {1}{\xi} \int \frac {1}{x + \lambda / \xi} d F _ {\gamma / \xi} (x) = \frac {1}{\xi} \theta_ {1} \left(\frac {\gamma}{\xi}, \frac {\lambda}{\xi}\right)
+$$
+
+$$
+\theta_ {2} (\gamma , \xi , \lambda) = \frac {1}{\xi^ {2}} \theta_ {2} \left(\frac {\gamma}{\xi}, \frac {\lambda}{\xi}\right).
+$$
+
+Therefore the AMSE of $\hat{\beta}_p$ is
+
+$$
+\begin{array}{l} A M S E (\hat {\beta} _ {p}) = \alpha^ {2} [ (\lambda + \xi - 1) ^ {2} + \gamma (1 - \xi) ] \theta_ {2} (\gamma , \xi , \lambda) + \gamma \sigma^ {2} [ \theta_ {1} (\gamma , \xi , \lambda) - (\lambda + \xi - 1) \theta_ {2} (\gamma , \xi , \lambda) ] \\ = \alpha^ {2} [ (\lambda + \xi - 1) ^ {2} + \gamma (1 - \xi) ] \frac {1}{\xi^ {2}} \theta_ {2} \left(\frac {\gamma}{\xi}, \frac {\lambda}{\xi}\right) \\ + \gamma \sigma^ {2} \left[ \frac {1}{\xi} \theta_ {1} \left(\frac {\gamma}{\xi}, \frac {\lambda}{\xi}\right) - (\lambda + \xi - 1) \frac {1}{\xi^ {2}} \theta_ {2} \left(\frac {\gamma}{\xi}, \frac {\lambda}{\xi}\right) \right]. \tag {10} \\ \end{array}
+$$
+
+
+
+# A.6.1 ISOTROPIC CASE
+
+Consider the special case where $\Gamma = I$ , that is, $X$ has iid $\mathcal{N}(0,1)$ entries. Then $F_{\gamma}$ is the standard MP law, and we have the explicit forms for $\theta_{i} = \theta_{i}(\gamma ,\lambda) = \int \frac{1}{(x + \lambda)^{i}} dF_{\gamma}$ :
+
+$$
+\theta_ {1} (\gamma , \lambda) = - \frac {1 + \lambda}{\gamma \lambda} + \frac {1}{2 \sqrt {\gamma} \lambda} [ \sqrt {\gamma} + \frac {1 + \lambda}{\sqrt {\gamma}} + \sqrt {(\sqrt {\gamma} + \frac {1 + \lambda}{\sqrt {\gamma}}) ^ {2} - 4} ],
+$$
+
+$$
+\theta_ {2} (\gamma , \lambda) = - \frac {1}{\gamma \lambda^ {2}} + \frac {\gamma + 1}{2 \gamma \lambda^ {2}} - \frac {1}{2 \sqrt {\gamma}} (\frac {\lambda + 1}{\gamma} + 1) \frac {1}{\lambda \sqrt {(\sqrt {\gamma} + \frac {1 + \lambda}{\sqrt {\gamma}}) ^ {2} - 4}} + \frac {1}{2 \sqrt {\gamma}} \sqrt {(\sqrt {\gamma} + \frac {1 + \lambda}{\sqrt {\gamma}}) ^ {2} - 4} \frac {1}{\lambda^ {2}},
+$$
+
+$$
+\bar {\theta} _ {1} (\zeta , \lambda) = \zeta \theta_ {1} (\zeta , \lambda) + \frac {1 - \zeta}{\lambda},
+$$
+
+$$
+\bar {\theta} _ {2} (\zeta , \lambda) = \zeta \theta_ {2} (\zeta , \lambda) + \frac {1 - \zeta}{\lambda^ {2}},
+$$
+
+The results are obtained by the contour integral formula
+
+$$
+\int f (x) d F _ {\gamma} (x) = - \frac {1}{4 \pi i} \oint_ {| z | = 1} \frac {f (| 1 + \gamma z | ^ {2}) (1 - z ^ {2}) ^ {2}}{z ^ {2} (1 + \sqrt {\gamma} z) (z + \sqrt {\gamma})} d z.
+$$
+
+See Proposition 2.10 of Yao et al. (2015).
+
+# A.7 PROOF OF THEOREM 4.2
+
+Proof. Suppose $d / p \to \zeta$ as $n$ goes to infinity. For $\hat{\beta}_d$ , we have
+
+$$
+\operatorname {b i a s} ^ {2} = \mathbb {E} \left[ \left\| n ^ {- 1} X ^ {\top} \left(X R R ^ {\top} X ^ {\top} / n + \lambda I _ {n}\right) ^ {- 1} X \beta - \beta \right\| _ {2} ^ {2} \right],
+$$
+
+$$
+\delta^ {2} = \sigma^ {2} \operatorname {t r} \left[ \left(X R R ^ {\top} X ^ {\top} / n + \lambda I _ {n}\right) ^ {- 2} \frac {X X ^ {\top}}{n ^ {2}} \right].
+$$
+
+Denote $M = \left(XRR^{\top}X^{\top} / n + \lambda I_{n}\right)^{-1}$ . Note that, using that $\operatorname{Cov}[\beta] = \alpha^{2} / p \cdot I_{p}$
+
+$$
+\operatorname {b i a s} ^ {2} = \frac {\alpha^ {2}}{p} \mathbb {E} \left[ \operatorname {t r} \left[ M X X ^ {\top} / n \right] ^ {2} \right] - 2 \frac {\alpha^ {2}}{p} \mathbb {E} \left[ \operatorname {t r} \left[ M X X ^ {\top} / n \right] \right] + \frac {\alpha^ {2}}{p} \operatorname {t r} \left(I _ {p}\right).
+$$
+
+Moreover, letting $R_{1}$ to be an orthogonal complementary matrix of $R$ , such that $R R^{\top} + R_{1} R_{1}^{\top} = I_{n}$ , and $N = \frac{X R_{1} R_{1}^{\top} X^{\top}}{n}$ ,
+
+$$
+\begin{array}{l} \mathbb {E} \left[ \frac {1}{p} \operatorname {t r} \left[ M X X ^ {\top} / n \right] \right] = \frac {1}{p} \operatorname {t r} \left[ I _ {n} - \lambda \mathbb {E} [ \operatorname {t r} [ M ] ] + \mathbb {E} [ M N ] \right] \\ \rightarrow \frac {1}{\gamma} - \frac {\lambda}{\gamma} \int \frac {1}{x + \lambda} d \bar {F} _ {\zeta} (x) + \frac {\gamma - \zeta}{\gamma} \int \frac {1}{x + \lambda} d \bar {F} _ {\zeta} (x), \\ \end{array}
+$$
+
+where $\bar{F}_{\zeta}$ is the companion MP law, that is, $\bar{F}_{\zeta} = (1 - \gamma)\delta_{0} + \gamma F_{\zeta}$ . The third term calculated by using that $XR$ and $XR_{1}$ are independent for a Gaussian random matrix $X$ , so that $M,N$ are independent, and that $\mathbb{E}[N] = \frac{p - d}{n} I_n$ . Thus
+
+$$
+\begin{array}{l} \mathbb {E} \left[ \frac {1}{p} \operatorname {t r} \left[ M X X ^ {\top} / n \right]\right]\rightarrow \frac {1}{\gamma} - \frac {\lambda + \zeta - \gamma}{\gamma} \bar {\theta} _ {1} (\zeta , \lambda) \\ = \frac {1}{\gamma} - \frac {\lambda + \zeta - \gamma}{\gamma} \left[ \frac {1 - \zeta}{\lambda} + \zeta \theta_ {1} (\zeta , \lambda) \right]. \\ \end{array}
+$$
+
+Then
+
+$$
+\mathbb {E} \left[ \frac {1}{p} \operatorname {t r} \left[ M X X ^ {\top} / n \right] ^ {2} \right] = \frac {1}{p} \mathbb {E} \left[ \operatorname {t r} \left[ I _ {n} + \lambda^ {2} M ^ {2} + M N M N - 2 \lambda M + 2 M N - \lambda M ^ {2} N - \lambda M N M \right]. \right.
+$$
+
+Note that
+
+$$
+\begin{array}{l} \mathbb {E} [ M N M N | M ] = M \left[ (p - d) \left(M ^ {\top} + \operatorname {t r} (M) I _ {n}\right) + (p - d) ^ {2} M \right] / n ^ {2} \\ = \frac {p - d + (p - d) ^ {2}}{n ^ {2}} M ^ {2} + \frac {p - d}{n ^ {2}} \operatorname {t r} (M) M, \\ \end{array}
+$$
+
+so
+
+$$
+\begin{array}{l} \mathbb {E} \left[ \frac {1}{p} \operatorname {t r} \left[ M X X ^ {\top} / n \right] ^ {2} \right]\rightarrow \frac {1}{\gamma} [ 1 + (\lambda^ {2} - 2 \lambda (\gamma - \zeta) + (\gamma - \zeta) ^ {2}) \bar {\theta} _ {2} (\zeta , \lambda) \\ + 2 (\gamma - \zeta - \lambda) \bar {\theta} _ {1} (\zeta , \lambda) + (\gamma - \zeta) \bar {\theta} _ {1} ^ {2} (\zeta , \lambda) ]. \\ \end{array}
+$$
+
+Thus we find the following expression for the limiting squared bias:
+
+$$
+\mathrm {b i a s} ^ {2} \rightarrow \frac {\alpha^ {2}}{\gamma} [ \gamma - 1 + (\lambda - \gamma + \zeta) ^ {2} \bar {\theta} _ {2} + (\gamma - \zeta) \bar {\theta} _ {1} ^ {2} ].
+$$
+
+With similar calculations (that we omit for brevity), we can find
+
+$$
+\delta^ {2} \rightarrow \sigma^ {2} (\bar {\theta} _ {1} (\zeta , \lambda) - (\lambda + \zeta - \gamma) \bar {\theta} _ {2} (\zeta , \lambda)).
+$$
+
+Therefore the AMSE of $\hat{\beta}_d$ is
+
+$$
+A M S E = \frac {\alpha^ {2}}{\gamma} [ \gamma - 1 + (\lambda - \gamma + \zeta) ^ {2} \bar {\theta} _ {2} + (\gamma - \zeta) \bar {\theta} _ {1} ^ {2} ] + \sigma^ {2} [ \bar {\theta} _ {1} (\zeta , \lambda) - (\lambda + \zeta - \gamma) \bar {\theta} _ {2} (\zeta , \lambda) ]. \tag {11}
+$$
+
+
+
+# A.8 PROOF OF THEOREM 4.3
+
+Proof. Recall that we have $m, n \to \infty$ , such that $m / n \to \xi$ . Then we need to take $\xi \to 0$ . However, we find it more convenient to do the calculation directly from the finite sample results as $m, n, p \to \infty$ with $m / n \to 0$ , $p / n \to \gamma$ . It is not hard to check that computing the results in the other way (i.e., interchanging the limits), leads to the same results. Starting from our bias formula for primal sketching, we first get
+
+$$
+\begin{array}{l} \mathrm {b i a s} ^ {2} = \frac {\alpha^ {2}}{p} \left[ \lambda^ {2} + \frac {n - m + p (n - m) + (n - m) ^ {2}}{n ^ {2}} - 2 \lambda \frac {n - m}{n} \right] \mathbb {E} \left[ \mathrm {t r} \left[ \left(X ^ {\top} L ^ {\top} L X / n + \lambda I _ {p}\right) ^ {- 2} \right] \right] \\ \rightarrow \alpha^ {2} [ (\lambda - 1) ^ {2} + \gamma ] / \lambda^ {2}. \\ \end{array}
+$$
+
+The limit of the trace term is not entirely trivial, but it can be calculated by (1) observing that the $m \times p$ sketched data matrix $P = LX$ has iid normal entries (2) thus the operator norm of $P^{\top}P / n$ vanishes, (3) and so by a simple matrix perturbation argument the trace concentrates around $p / \lambda^2$ . This gives the rough steps of finding the above limit. Moreover,
+
+$$
+\delta^ {2} = \frac {\sigma^ {2}}{n ^ {2}} \mathbb {E} \left[ \mathrm {t r} [ (X ^ {\top} L ^ {\top} L X / n + \lambda I _ {p}) ^ {- 2} X ^ {\top} X ] \right] \to \gamma \sigma^ {2} / \lambda^ {2} \cdot \mathbb {E} _ {F _ {\gamma}} X ^ {2} = \gamma \sigma^ {2} / \lambda^ {2}
+$$
+
+So the MSE is $M(\lambda) = \alpha^2[(\lambda - 1)^2 + \gamma] / \lambda^2 + \sigma^2 \cdot \gamma / \lambda^2$ . From this it is elementary to find the optimal $\lambda$ and its objective value.
+
+# A.9 PROOF OF THEOREM 4.4
+
+Proof. Note that the bias can be written as
+
+$$
+\begin{array}{l} \mathrm {b i a s} ^ {2} = \frac {\alpha^ {2}}{p} \mathbb {E} \left[ \mathrm {t r} [ \left(\frac {X R R ^ {\top} X ^ {\top}}{n d} + \lambda I _ {n}\right) ^ {- 1} \frac {X X ^ {\top}}{n d} ] ^ {2} \right] \\ - 2 \frac {\alpha^ {2}}{p} \mathbb {E} \left[ \mathrm {t r} \left[ \left(X R R ^ {\top} X ^ {\top} / n + \lambda I _ {n}\right) ^ {- 1} X X ^ {\top} / n \right] \right] + \alpha^ {2}. \\ \end{array}
+$$
+
+Write $G = XX^{\top}$ . Since $R R^{\top} \sim \mathcal{W}_p(I_p, d)$ , we have $X R R^{\top} X^{\top} \sim \mathcal{W}_n(G, d)$ . So $X R R^{\top} X^{\top} \stackrel{d}{=} G^{1/2} W G^{1/2}$ , where $W \sim \mathcal{W}_n(I_n, d)$ .
+
+$$
+\begin{array}{l} \mathbb {E} \left[ \mathrm {t r} \left[ \left(\frac {X R R ^ {\top} X ^ {\top}}{n d} + \lambda I _ {n}\right) ^ {- 1} X X ^ {\top} / n \right] \right] = \mathbb {E} \left[ \mathrm {t r} \left[ (G ^ {1 / 2} W G ^ {1 / 2} / d + n \lambda I _ {n}) ^ {- 1} G \right] \right] \\ = \mathbb {E} \left[ \mathrm {t r} [ (\frac {W}{d} + \lambda (\frac {G}{n}) ^ {- 1}) ^ {- 1} ] \right]. \\ \end{array}
+$$
+
+So we need to find the law of $\frac{W}{d} + \frac{\lambda}{\gamma} \left( \frac{G}{p} \right)^{-1}$ . Suppose first that $G = XX^{\top} \sim \mathcal{W}_n(I_n, p)$ . Then $W$ and $G^{-1}$ are asymptotically freely independent. The l.s.d. of $W / d$ is the MP law $F_{1/\xi}$ while the l.s.d. of $G / p$ is the MP law $F_{1/\gamma}$ . We need to find the additive free convolution $W \boxplus \bar{G}$ , where $\bar{G} = \frac{\lambda}{\gamma} G^{-1}$ .
+
+Recall that the $R$ -transform of a distribution $F$ is defined by
+
+$$
+R _ {F} (z) = m _ {F} ^ {- 1} (- z) - \frac {1}{z},
+$$
+
+where $m_F^{-1}(z)$ is the inverse function of the Stieltjes transform of $F$ (e.g., Voiculescu et al., 1992; Hiai & Petz, 2006; Couillet & Debbah, 2011). We can find the $R$ -transform by solving
+
+$$
+m _ {F} \left(R _ {F} (z) + \frac {1}{z}\right) = - z.
+$$
+
+Note that the $R$ -transform of $W / d$ is
+
+$$
+R _ {W} (z) = \frac {1}{1 - z / \xi}.
+$$
+
+The Stieltjes transform of $G^{-1}$ is
+
+$$
+\begin{array}{l} m _ {G ^ {- 1}} (z) = \int \frac {1}{1 / x - z} d F _ {1 / \gamma} (x) = - \frac {1}{z} - \frac {1}{z ^ {2}} m _ {1 / \gamma} (\frac {1}{z}) \\ = - \frac {1}{z} - \frac {1 - \frac {1}{\gamma} - \frac {1}{z} + \sqrt {(1 + \frac {1}{\gamma} + \frac {1}{z}) ^ {2} - \frac {4}{\gamma}}}{2 \frac {z}{\gamma}} \\ = - \frac {1 + \frac {1}{\gamma} - \frac {1}{z} + \sqrt {(1 + \frac {1}{\gamma} - \frac {1}{z}) ^ {2} - \frac {4}{\gamma}}}{2 \frac {z}{\gamma}}. \\ \end{array}
+$$
+
+
+Figure 9: Dual Gaussian sketch improves MSE.
+
+Then the $R$ -transform of $G^{-1}$ is
+
+$$
+\begin{array}{l} R _ {G ^ {- 1}} (z) = - \frac {1}{z} + \frac {\gamma + 1 - \sqrt {(\gamma + 1) ^ {2} - 4 \gamma (z + 1)}}{2 z} \\ = \frac {\gamma - 1 - \sqrt {(\gamma - 1) ^ {2} - 4 \gamma z}}{2 z}. \\ \end{array}
+$$
+
+Since we have the property that $R_{a\mu}(z) = aR_{\mu}(az)$ ,
+
+$$
+R _ {\bar {G}} = R _ {\frac {\lambda}{\gamma} G ^ {- 1}} (z) = \frac {\gamma - 1 - \sqrt {(\gamma - 1) ^ {2} - 4 \lambda z}}{2 z}.
+$$
+
+Hence we have
+
+$$
+R _ {W \boxplus \bar {G}} = R _ {W} + R _ {\bar {G}} = \frac {1}{1 - z / \xi} + \frac {\gamma - 1 - \sqrt {(\gamma - 1) ^ {2} - 4 \lambda z}}{2 z}.
+$$
+
+Moreover, the Stieltjes transform of $\mu = W\boxplus \bar{G}$ satisfies
+
+$$
+m _ {\mu} ^ {- 1} (z) = m _ {W \boxplus \bar {G}} ^ {- 1} (z) = R _ {F} (- z) - \frac {1}{z} = \frac {1}{1 + z / \xi} + \frac {\gamma - 1 - \sqrt {(\gamma - 1) ^ {2} + 4 \lambda z}}{- 2 z} - \frac {1}{z}.
+$$
+
+Note that
+
+$$
+\begin{array}{l} 2 \frac {\alpha^ {2}}{p} \mathbb {E} \left[ \operatorname {t r} \left[\left(\frac {X R R ^ {\top} X ^ {\top}}{n d} + \lambda I _ {n}\right) ^ {- 1} X X ^ {\top} / n \right]\right]\rightarrow 2 \frac {\alpha^ {2}}{\gamma} \mathbb {E} _ {\mu} \left[ \frac {1}{x} \right] = 2 \frac {\alpha^ {2}}{\gamma} \lim _ {z \rightarrow 0} m (z), \\ \frac {\alpha^ {2}}{p} \mathbb {E} \left[ \mathrm {t r} [ \left(\frac {X R R ^ {\top} X ^ {\top}}{n d} + \lambda I _ {n}\right) ^ {- 1} \frac {X X ^ {\top}}{n d} ] ^ {2} \right]\rightarrow \frac {\alpha^ {2}}{\gamma} \mathbb {E} _ {\mu} \left[ \frac {1}{x ^ {2}} \right] = \frac {\alpha^ {2}}{\gamma} \lim _ {z \rightarrow 0} \frac {d}{d z} m (z). \\ \end{array}
+$$
+
+So it suffices to find $m(z)$ and $\frac{d}{dz} m(z)$ evaluated at zero.
+
+
+
+This result can characterize the performance of sketching in the high SNR regime, where $\alpha \gg \sigma$ . To understand the lower SNR regime, we need to study the variance, and thus we need to calculate
+
+$$
+\operatorname {v a r} = \sigma^ {2} \frac {1}{n} \mathbb {E} \left[ \operatorname {t r} \left[ \left(\frac {X R R ^ {\top} X ^ {\top}}{n d} + \lambda I _ {n}\right) ^ {- 2} X X ^ {\top} / n \right] \right] = \sigma^ {2} \mathbb {E} \left[ \operatorname {t r} \left[ \left(\frac {W}{d} + \frac {\lambda}{\gamma} (\frac {G}{p}) ^ {- 1}\right) ^ {- 2} G ^ {- 1} \right] \right]
+$$
+
+where $G = XX^{\top} \sim \mathcal{W}_n(I_n, p)$ is a Wishart distribution, and $XRR^{\top}X^{\top} = _dG^{1/2}WG^{1/2}$ , with $W \sim \mathcal{W}_n(I_n, r)$ . This seems to be quite challenging, and we leave it to future work.
+
+# A.10 RESULTS FOR PRIMAL GAUSSIAN SKETCHING
+
+The statement requires some notions from free probability, see e.g., Voiculescu et al. (1992); Hiai & Petz (2006); Nica & Speicher (2006); Anderson et al. (2010); Couillet & Debbah (2011) for references.
+
+Theorem A.1 (Bias of primal Gaussian sketch). Suppose $X$ is an $n \times p$ standard Gaussian random matrix. Suppose also that $L$ is a $d \times n$ matrix with i.i.d. $\mathcal{N}(0, 1/d)$ entries. Then the bias of primal sketch has the expression $MSE(\hat{\beta}_p) = \alpha^2 + \frac{\alpha^2}{\gamma} [\tau((a + b)^{-1}b(a + b)^{-1}b^{-1}) - 2\tau((a + b)^{-1})]$ , where $a$ and $b$ two free random variables, that are freely independent in a non-commutative probability space, and $\tau$ is their trace. Specifically, the law of $a$ is the MP law $F_{1/\xi}$ and $b = \frac{\lambda}{\gamma}\tilde{b}$ , where the law of $\tilde{b}$ is the MP law $F_{1/\gamma}$ .
+
+Proof of Theorem A.1. Note that
+
+$$
+\operatorname {b i a s} ^ {2} = \mathbb {E} \left[ \left\| \left(X ^ {\top} L ^ {\top} L X / (n d) + \lambda I _ {p}\right) ^ {- 1} (X ^ {\top} X / n) \beta - \beta \right\| _ {2} ^ {2} \right],
+$$
+
+and $\left(X^{\top}L^{\top}LX / (nd) + \lambda I_{p}\right)^{-1}X^{\top} = X^{\top}(L^{\top}LXX^{\top} / (nd) + \lambda I_{n})^{-1}$ . Thus
+
+$$
+\begin{array}{l} \operatorname {b i a s} ^ {2} = \mathbb {E} \left[ \left\| X ^ {\top} \left(\frac {L ^ {\top} L X X ^ {\top}}{n d} + \lambda I _ {n}\right) ^ {- 1} \frac {X}{n} \beta - \beta \right\| _ {2} ^ {2} \right] \\ = \alpha^ {2} + \frac {\alpha^ {2}}{p} \mathbb {E} [ \mathrm {t r} [ (\frac {X X ^ {\top} L ^ {\top} L}{n d} + \lambda I _ {n}) ^ {- 1} \frac {X X ^ {\top}}{n} (\frac {L ^ {\top} L X X ^ {\top}}{n d} + \lambda I _ {n}) ^ {- 1} \frac {X X ^ {\top}}{n} ] \\ - 2 \operatorname {t r} [ (\frac {L ^ {\top} L X X ^ {\top}}{n d} + \lambda I _ {n}) ^ {- 1} \frac {X X ^ {\top}}{n} ] ]. \\ \end{array}
+$$
+
+First we find the l.s.d. of $\left(\frac{L^\top LXX^\top}{nd} + \lambda I_n\right)^{-1}\frac{XX^\top}{n}$ . Write $W = L^\top L$ , $G = XX^\top$ . Then
+
+$$
+\left(\frac {L ^ {\top} L X X ^ {\top}}{n d} + \lambda I _ {n}\right) ^ {- 1} \frac {X X ^ {\top}}{n} = \left(\frac {W G}{n d} + \lambda I _ {n}\right) ^ {- 1} \frac {G}{n} = G ^ {- 1} \left(\frac {W}{d} + \lambda \left(\frac {G}{n}\right) ^ {- 1}\right) ^ {- 1} G,
+$$
+
+which is similar to $\left(\frac{W}{d} + \lambda\left(\frac{G}{n}\right)^{-1}\right)^{-1}$ . So it suffices to find the l.s.d. of $\left(\frac{W}{d} + \frac{\lambda}{\gamma}\left(\frac{G}{p}\right)^{-1}\right)^{-1}$ .
+
+By the definition, $W \sim \mathcal{W}_n(I_n,d)$ , $G \sim \mathcal{W}_n(I_n,p)$ , therefore the l.s.d. of $W / d$ converges to the MP law $F_{1 / \xi}$ and the l.s.d. of $G / p$ converges to the MP law $F_{1 / \gamma}$ .
+
+Also note that
+
+$$
+\left(\frac {X X ^ {\top} L ^ {\top} L}{n d} + \lambda I _ {n}\right) ^ {- 1} \frac {X X ^ {\top}}{n} \left(\frac {L ^ {\top} L X X ^ {\top}}{n d} + \lambda I _ {n}\right) ^ {- 1} \frac {X X ^ {\top}}{n} = \left(\frac {W}{d} + \lambda n G ^ {- 1}\right) ^ {- 1} G ^ {- 1} \left(\frac {W}{d} + \lambda n G ^ {- 1}\right) ^ {- 1} G.
+$$
+
+We write $A = \frac{W}{d}$ , $B = \frac{\lambda}{\gamma} \left( \frac{G}{p} \right)^{-1}$ . Then it suffices to find
+
+$$
+\frac {\alpha^ {2}}{p} \mathbb {E} \left[ \mathrm {t r} [ (A + B) ^ {- 1} B (A + B) ^ {- 1} B ^ {- 1} ] \right].
+$$
+
+We will find an expression for this using free probability. For this we will need to use some series expansions. There are two cases, depending on whether the operator norm of $BA^{-1}$ is less than or greater than unity, leading to different series expansions. We will work out below the first case, but the second case is similar and leads to the same answer.
+
+$$
+\operatorname {t r} \left[ (A + B) ^ {- 1} B (A + B) ^ {- 1} B ^ {- 1} \right] = \operatorname {t r} \left[ A ^ {- 1} \left(I + B A ^ {- 1}\right) ^ {- 1} B A ^ {- 1} \left(I + B A ^ {- 1}\right) ^ {- 1} B ^ {- 1} \right]
+$$
+
+Since the operator norm of $BA^{-1}$ is less unity, we have the von Neumann series expansion
+
+$$
+[ I + B A ^ {- 1} ] ^ {- 1} = \sum_ {i = 0} ^ {\infty} (- B A ^ {- 1}) ^ {i},
+$$
+
+then we have
+
+$$
+\begin{array}{l} \operatorname {t r} [ (A + B) ^ {- 1} B (A + B) ^ {- 1} B ^ {- 1} ] = \sum_ {i, j \geq 0} (- 1) ^ {i + j} \operatorname {t r} [ (B A ^ {- 1}) ^ {i + j + 1} B ^ {- 1} A ^ {- 1} ] \\ = \sum_ {i, j \geq 0} (- 1) ^ {i + j} \operatorname {t r} [ (A ^ {- 1} B) ^ {i + j + 1} A ^ {- 1} B ^ {- 1} ]. \\ \end{array}
+$$
+
+Since $A$ and $B$ are asymptotically freely independent in the free probability space arising in the limit (e.g., Voiculescu et al., 1992; Hiai & Petz, 2006; Couillet & Debbah, 2011), and the polynomial $(a^{-1}b)^{i + j + 1}a^{-1}b^{-1}$ involves an alternating sequence of $a, b$ , we have
+
+$$
+\frac {1}{n} \operatorname {t r} [ (A ^ {- 1} B) ^ {i + j + 1} A ^ {- 1} B ^ {- 1} ] \rightarrow \tau [ (a ^ {- 1} b) ^ {i + j + 1} a ^ {- 1} b ^ {- 1} ],
+$$
+
+where $a$ and the $b$ are free random variables and $\tau$ is their law. Specifically, $a$ is a free random variable with the MP law $F_{1 / \xi}$ and $b$ is $\frac{\lambda}{\gamma}\tilde{b}^{-1}$ , where $\tilde{b}$ is a free r.v. with MP law $F_{1 / \gamma}$ . Moreover, they are freely independent.
+
+Hence, we have
+
+$$
+\begin{array}{l} \frac {1}{n} \operatorname {t r} [ (A + B) ^ {- 1} B (A + B) ^ {- 1} B ^ {- 1} ] \rightarrow \tau \left[ \sum_ {i \geq 0} (- 1) ^ {i} (a ^ {- 1} b) ^ {i + 1} \sum_ {j \geq 0} (- 1) ^ {j} (a ^ {- 1} b) ^ {j} a ^ {- 1} b ^ {- 1} \right] \\ = \tau [ (a ^ {- 1} b) (1 + a ^ {- 1} b) ^ {- 1} (1 + a ^ {- 1} b) ^ {- 1} a ^ {- 1} b ^ {- 1} ] \\ = \tau [ (a + b) ^ {- 1} b (a + b) ^ {- 1} b ^ {- 1} ]. \\ \end{array}
+$$
+
+Therefore,
+
+$$
+\begin{array}{l} \mathrm {b i a s} ^ {2} \rightarrow \alpha^ {2} + \frac {\alpha^ {2}}{\gamma} \left[ \frac {1}{n} \mathrm {t r} [ (A + B) ^ {- 1} B (A + B) ^ {- 1} B ^ {- 1} - 2 \mathrm {t r} [ A + B ] ^ {- 1} ] \right] \\ = \alpha^ {2} + \frac {\alpha^ {2}}{\gamma} [ \tau ((a + b) ^ {- 1} b (a + b) ^ {- 1} b ^ {- 1}) - 2 \tau ((a + b) ^ {- 1}) ]. \\ \end{array}
+$$
+
+
+
+# A.11 RESULTS FOR FULL SKETCHING
+
+The full sketch estimator projects down the entire data, and then does ridge regression on the sketched data. It has the form
+
+$$
+\hat {\beta} _ {f} = \left(X ^ {\top} L ^ {\top} L X / n + \lambda I _ {p}\right) ^ {- 1} \frac {X ^ {\top} L ^ {\top} L Y}{n}.
+$$
+
+We have
+
+$$
+\begin{array}{l} \mathrm {b i a s} ^ {2} = \alpha^ {2} \lambda^ {2} \int \frac {1}{\xi x + \lambda} d F _ {\gamma / \xi} (x) = \alpha^ {2} \lambda^ {2} \frac {1}{\xi^ {2}} \theta_ {2} \left(\frac {\gamma}{\xi}, \frac {\lambda}{\xi}\right) \\ \mathrm {v a r} = \sigma^ {2} \gamma \left[ \int \frac {1}{\xi x + \lambda} d F _ {\gamma / \xi} (x) - \lambda \int \frac {1}{(\xi x + \lambda) ^ {2}} d F _ {\gamma / \xi} (x) \right] \\ = \sigma^ {2} \gamma \left[ \frac {1}{\xi} \theta_ {1} \left(\frac {\gamma}{\xi}, \frac {\lambda}{\xi}\right) - \lambda \frac {1}{\xi^ {2}} \theta_ {2} \left(\frac {\gamma}{\xi}, \frac {\lambda}{\xi}\right) \right], \\ \end{array}
+$$
+
+therefore
+
+$$
+A M S E (\hat {\beta} _ {f}) = \alpha^ {2} \lambda^ {2} \frac {1}{\xi^ {2}} \theta_ {2} \left(\frac {\gamma}{\xi}, \frac {\lambda}{\xi}\right) + \sigma^ {2} \gamma \left[ \frac {1}{\xi} \theta_ {1} \left(\frac {\gamma}{\xi}, \frac {\lambda}{\xi}\right) - \lambda \frac {1}{\xi^ {2}} \theta_ {2} \left(\frac {\gamma}{\xi}, \frac {\lambda}{\xi}\right) \right]
+$$
+
+The optimal $\lambda$ for full sketch is always $\lambda^{*} = \frac{\gamma\sigma^{2}}{\alpha^{2}}$ , the same as ridge regression. Some simulation results are shown in Figure 10, and they show the expected shape (e.g., they decrease with $\xi$ ).
+
+
+Figure 10: Simulation results for full sketch, with $n = 1000$ , $\gamma = 0.1$ . The simulation results are averaged over 30 independent experiments.
+
+
+Figure 11: Dual orthogonal sketching with $\gamma = 1.5, \lambda = 1, \alpha = 3, \sigma = 1$ . Left: MSE of dual sketching normalized by the MSE of ridge regression. The standard deviation is over 50 repetitions. Right: Bias and variance of dual sketching normalized by the bias and variance of ridge regression, respectively.
+
+
+
+# A.12 NUMERICAL RESULTS
+
+# A.12.1 DUAL ORTHOGONAL SKETCHING
+
+See Figure 11 for additional simulation results for dual orthogonal sketching.
+
+# A.12.2 PERFORMANCE AT A FIXED REGULARIZATION PARAMETER
+
+First we fix the regularization parameter at the optimal value for original ridge regression. The results are visualized in Figure 12. On the $x$ axis, we plot the reduction in sample size $m / n$ for primal sketch, and the reduction in dimension $d / p$ for dual sketch. In this case, primal and dual sketch will increase both bias and variance, and empirically in the current case, dual sketch increases them more. So in this particular case, primal sketch is preferred.
+
+# A.12.3 PERFORMANCE AT THE OPTIMAL REGULARIZATION PARAMETER
+
+We find the optimal regularization parameter $\lambda$ for primal and dual orthogonal sketching. Then we use the optimal regularization parameter for all settings, see Figure 13. Both primal and dual sketch increase the bias, but decrease the variance. It is interesting to note that, for equal parameters $\xi$ and
+
+
+Figure 12: Fixed regularization parameter $\lambda = 0.7$ , optimal for original ridge, in a setting where $\gamma = 0.7$ , and $\alpha^2 = \sigma^2$ .
+
+
+
+
+
+
+
+
+
+
+Figure 13: Primal and dual sketch at optimal $\lambda$ . We take $\gamma = 0.7$ and let $\xi$ range between 0.001 and 1, where for primal sketch $\xi = r / n$ while for dual sketch $\xi = d / p$ .
+
+
+
+$\zeta$ , and in our particular case, dual sketch has smaller variance, but larger bias. So primal sketch is preferred bias or MSE is important, but dual sketch is more desired when one wants smaller variance. All in all, dual sketch has larger MSE than primal sketch in the current setting. It can also be seen that in this specific example, the optimal $\lambda$ for primal sketch is smaller than that of dual sketch. However these results are hard to interpret, because there is no natural correspondence between the two parameters $\xi$ and $\zeta$ .
+
+# A.13 COMPUTATIONAL COMPLEXITY
+
+Since sketching is a method to reduce computational complexity, it is important to discuss how much computational efficiency we gain. Recall our three estimators
+
+$$
+\hat {\beta} = \left(X ^ {\top} X / n + \lambda I _ {p}\right) ^ {- 1} X ^ {\top} Y / n = n ^ {- 1} X ^ {\top} \left(X X ^ {\top} / n + \lambda I _ {n}\right) ^ {- 1} Y,
+$$
+
+$$
+\hat {\beta} _ {p} = \left(X ^ {\top} L ^ {\top} L X / n + \lambda I _ {p}\right) ^ {- 1} X ^ {\top} Y / n,
+$$
+
+$$
+\hat {\beta} _ {d} = n ^ {- 1} X ^ {\top} \left(X R R ^ {\top} X ^ {\top} / n + \lambda I _ {n}\right) ^ {- 1} Y,
+$$
+
+Their computational complexity, when computed in the usual way, is:
+
+- No sketch (Standard ridge): if $p < n$ , computing $X^{\top}Y$ and $X^{\top}X$ requires $O(np)$ and $O(np^{2})$ flops, then solving the linear equation $(X^{\top}X / n + \lambda I_{p})\hat{\beta} = X^{\top}Y / n$ requires $O(p^{3})$ flops by the LU decomposition. It is $O(np^{2})$ flops in total.
+
+If $p > n$ , we use the second formula for $\hat{\beta}$ , and the total flops is $O(pn^{2})$ .
+
+- Primal sketch: for the Hadamard sketch (and other sketches based on the FFT), computing $LX$ by FFT requires $mp\log n$ , computing $(LX)^{\top}LX$ requires $mp^2$ , so the total flops is $O(p^3 + mp(\log n + p))$ . So the primal sketch can reduce the computation cost only when $p < n$ .
+
+- Dual sketch: computing $XRR^{\top}X^{\top}$ requires $nd$ ( $\log p + n$ ) flops by FFT, solving $(XRR^{\top}X^{\top} / n + \lambda I_{n})^{-1}Y$ requires $O(n^{3})$ flops, the matrix-vector multiplication of $X^{\top}$ and $(XRR^{\top}X^{\top} / n + \lambda I_{n})^{-1}Y$ requires $O(np)$ flops, so the total flops is $O(n^{3} + nd(\log p + n))$ . Dual sketching can reduce the computation cost only when $p > n$ .
\ No newline at end of file
diff --git a/ridgeregressionstructurecrossvalidationandsketching/images.zip b/ridgeregressionstructurecrossvalidationandsketching/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..0cddd7281f573ef6ff6e286e1527a3cc0a484c99
--- /dev/null
+++ b/ridgeregressionstructurecrossvalidationandsketching/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:4b5fab60855c8170b20fe8ff70c4109fce5385dce4f6b8705457c2240666fd4f
+size 1427966
diff --git a/ridgeregressionstructurecrossvalidationandsketching/layout.json b/ridgeregressionstructurecrossvalidationandsketching/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..cb9006a928c40acfa541d944882a5ec4f0e447fd
--- /dev/null
+++ b/ridgeregressionstructurecrossvalidationandsketching/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:feade9ff4309d016f84d883c1383d2aa54dcff7f3b999e8cf867d10ef8e3ae89
+size 1258950
diff --git a/scalingautoregressivevideomodels/52132d47-90c4-4c7c-8f8b-3a8a5b364ea7_content_list.json b/scalingautoregressivevideomodels/52132d47-90c4-4c7c-8f8b-3a8a5b364ea7_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..c855240b94e595121a0449dc15b7289ae6844577
--- /dev/null
+++ b/scalingautoregressivevideomodels/52132d47-90c4-4c7c-8f8b-3a8a5b364ea7_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:3c66652baccb0b28fcb5bd186b835885240d3d8c62013b164f711a954c466c1e
+size 103770
diff --git a/scalingautoregressivevideomodels/52132d47-90c4-4c7c-8f8b-3a8a5b364ea7_model.json b/scalingautoregressivevideomodels/52132d47-90c4-4c7c-8f8b-3a8a5b364ea7_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..8c2f4ce34dafa76966563bbb2ba023c0a4b21ca2
--- /dev/null
+++ b/scalingautoregressivevideomodels/52132d47-90c4-4c7c-8f8b-3a8a5b364ea7_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:8c2bfd38bda49549b7f887250ba8e3019d727b44844855630561319bdd192f6b
+size 127791
diff --git a/scalingautoregressivevideomodels/52132d47-90c4-4c7c-8f8b-3a8a5b364ea7_origin.pdf b/scalingautoregressivevideomodels/52132d47-90c4-4c7c-8f8b-3a8a5b364ea7_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..eae82e68ebfc8323f23789521b0896e1f65a9705
--- /dev/null
+++ b/scalingautoregressivevideomodels/52132d47-90c4-4c7c-8f8b-3a8a5b364ea7_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e3683041626cb72af11f9076f07541bd21a9b7029e5756cd76d8c9eaf234691e
+size 10529318
diff --git a/scalingautoregressivevideomodels/full.md b/scalingautoregressivevideomodels/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..eaa756acb2f288f920ccdad9ecfc59d055ff7489
--- /dev/null
+++ b/scalingautoregressivevideomodels/full.md
@@ -0,0 +1,410 @@
+# SCALING AUTOREGRESSIVE VIDEO MODELS
+
+Dirk Weissenborn*
+
+Google Research
+
+diwe@google.com
+
+Oscar Täckström*†
+
+Sana Labs
+
+oscar@sanalabs.com
+
+Jakob Uszkoreit
+
+Google Research
+
+usz@google.com
+
+# ABSTRACT
+
+Due to the statistical complexity of video, the high degree of inherent stochasticity, and the sheer amount of data, generating natural video remains a challenging task. State-of-the-art video generation models often attempt to address these issues by combining sometimes complex, usually video-specific neural network architectures, latent variable models, adversarial training and a range of other methods. Despite their often high complexity, these approaches still fall short of generating high quality video continuations outside of narrow domains and often struggle with fidelity. In contrast, we show that conceptually simple autoregressive video generation models based on a three-dimensional self-attention mechanism achieve competitive results across multiple metrics on popular benchmark datasets, for which they produce continuations of high fidelity and realism. We also present results from training our models on Kinetics, a large scale action recognition dataset comprised of YouTube videos exhibiting phenomena such as camera movement, complex object interactions and diverse human movement. While modeling these phenomena consistently remains elusive, we hope that our results, which include occasional realistic continuations encourage further research on comparatively complex, large scale datasets such as Kinetics.
+
+# 1 INTRODUCTION
+
+Generative modeling of video holds promise for applications such as content creation, forecasting, transfer learning and model-based reinforcement learning (Srivastava et al., 2015; Carl Vondrick, 2016; Oh et al., 2015; Kaiser et al., 2019). While recently there has been a lot of progress on generative models for text, audio and images, video generation remains challenging. To some extent this is simply due to the large amount of data that needs to be produced. Autoregressive models suffer from this particularly in their generation speed. On the other hand, they have a number of desirable attributes, such as their conceptual simplicity and tractable likelihood, which enables straightforward evaluation of their ability to model the entire data distribution.
+
+Moreover, recent results on image generation by Menick & Kalchbrenner (2019) show that pixel-level autoregressive models are capable of generating images with high fidelity. These findings motivate the question of how far one can push such autoregressive models in the more general task of video generation when scaling recent advances in neural architectures to modern hardware accelerators.
+
+In this work, we introduce a generalization of the Transformer architecture of Vaswani et al. (2017) using three-dimensional, block-local self-attention. In contrast to the block-local attention mechanism of Parmar et al. (2018), our formulation can be implemented efficiently on Tensor Processing Units, or TPUs (Jouppi et al., 2017). To further reduce the memory footprint, we combine this with a three-dimensional generalization of methods from Menick & Kalchbrenner (2019), who generate images as sequences of smaller, sub-scaled image slices.
+
+Together, these techniques allow us to efficiently model videos as 3D volumes instead of sequences of still image frames, with direct interactions between representations of pixels across the spatial and temporal dimensions.
+
+We obtain strong results on popular benchmarks (Section 4.2, Appendix A) and produce high fidelity video continuations on the BAIR robot pushing dataset (Ebert et al., 2017) exhibiting plausible object interactions. Furthermore, our model achieves an almost $50\%$ reduction in perplexity compared to prior work on autoregressive models on another robot pushing dataset.
+
+Finally, we apply our models to down-sampled videos from the Kinetics-600 dataset (Carreira et al., 2018) (Section 4.3). While modeling the full range of Kinetics-600 videos still poses a major challenge, we see encouraging video continuations for a more limited subset, namely cooking videos. These feature camera movement, complex object interactions and still cover diverse subjects.
+
+We hope that these initial results will encourage future video generation work to evaluate models on more challenging datasets such as Kinetics.
+
+# 2 RELATED WORK
+
+Our setup is closely related to that of Kalchbrenner et al. (2016), who extend work on pixel-level autoregressive image generation (van den Oord et al., 2016b;a) to videos. However, whereas they model the temporal and spatial dimensions separately with dilated convolutions and convolutional LSTMs, respectively, our model is conceptually simpler in that we do not make any distinction between temporal and spatial dimensions and instead rely almost entirely on multi-head self-attention (Vaswani et al., 2017) within the 3D video volume. For comparability, we provide results on Moving MNIST and another robot pushing dataset (Finn et al., 2016a) on which our model achieves an almost $50\%$ reduction in perplexity (see Appendix A).
+
+One major drawback of autoregressive models is their notoriously slow generation speed. However, we believe that further research into (partially) parallelizing sampling (Stern et al., 2018) and future hardware accelerators will help alleviate this issue and eventually make autoregressive modeling a viable solution even for extremely high-dimensional data such as videos.
+
+To reduce the generally quadratic space complexity of the self-attention mechanism, we use block-local self-attention, generalizing the image generation approaches of Parmar et al. (2018) and Chen et al. (2018) to 3D volumes. In concurrent work, Child et al. (2019) instead use sparse attention after linearizing images to a sequence of pixels.
+
+To further reduce memory requirements, we generalize sub-scaling (Menick & Kalchbrenner, 2019) to video. An alternative approach is optionally hierarchical multi-scale generation, which has recently been explored for both image generation (Reed et al., 2017; De Fauw et al., 2019) as well as video generation (Mathieu et al., 2016).
+
+Earlier work on video generation mostly focused on deterministic approaches (Srivastava et al., 2015; Carl Vondrick, 2016; Xingjian et al., 2015; Liu et al., 2017; Jia et al., 2016), which fail to capture the high degree of stochasticity inherent in video. In response, a popular research direction has been that of generative latent-variable video models. In contrast to pixel-level autoregressive models, these posit an underlying latent process in tandem with the observed pixel values. Work in this category includes variants of variational autoencoders (Babaeizadeh et al., 2018; Denton & Fergus, 2018). To address the issues inherent in these models, most notably the tendency to generate blurry outputs possibly due to restricted modeling power, inadequate prior distributions, or optimization of a lower bound in place of the true likelihood, various directions have been explored, including the use of adversarial objectives (Mathieu et al., 2016; Vondrick et al., 2016; Lee et al., 2018), hierarchical latent-variables (Castrejon et al., 2019), or flow-based models (Kumar et al., 2019). All of these approaches admit significantly faster generation. However, in the adversarial case, they tend to only focus on a subset of the modes in the empirical distribution while flow-based models struggle with limited modeling power even when using a large number of layers and parameters.
+
+A large fraction of earlier work on video generation has encoded specific intuitions about videos, such as explicit modeling of motion (Finn et al., 2016b; Denton & Fergus, 2018) or generation of optical flow (Pătrăucean et al., 2016). The conceptual simplicity of our model, however, is more in line with recent approaches to video classification that process videos by means of 3D convolutions (Carreira & Zisserman, 2017; Xie et al., 2018) or, similar to this work, spatiotemporal self-attention (Girdhar et al., 2018).
+
+
+Figure 1: Top: Illustration of the subscale video transformer architecture and process flow. We incrementally generate $s = 4 \cdot 2 \cdot 2 = 16$ video slices. The video slices and their respective generation order are derived from subscaling. In each iteration, we first process the partially padded video (illustrated for slice index $(1,0,1)$ , black means padding and gray means already generated or visible) by an encoder, the output of which is used as conditioning for decoding the current video slice. After generating a slice we replace the respective padding in the video with the generated output and repeat the process for the next slice. Bottom: Subscaling in 3D (best viewed in color). The 3D volume is evenly divided by a given subscale factor, here $s = (4,2,2)$ , and the respective slices are extracted. The whole volume is generated by incrementally predicting the individual, much smaller slices, starting at slice $x_{(0,0,0)}$ (yellow), followed by $x_{(0,0,1)}$ (green), $x_{(0,1,0)}$ (red), etc., in raster-scan order.
+
+
+
+
+
+# 3VIDEO TRANSFORMER
+
+We generalize the one-dimensional Transformer (Vaswani et al., 2017) to explicitly model videos represented as three-dimensional spatiotemporal volumes, without resorting to sequential linearization of the positions in the volume (Child et al., 2019). This allows for maintaining spatial neighborhoods around positions, which is important as the large number of individual positions to be predicted in a video requires limiting the receptive field of the self-attention mechanism to a neighborhood around every position to avoid the quadratic blow-up in memory consumption of naive fully-connected attention.
+
+We model the distribution $p(\pmb{x})$ over videos $\pmb{x} \in \mathbb{R}^{T \times H \times W \times N_c}$ — with time, height, width and channel dimensions, respectively — by means of a pixel-channel level autoregressive factorization. That is, the joint distribution over pixels is factorized into a product of channel intensities for all $N_c$ channels, for each of the $N_p = T \cdot H \cdot W$ pixels, with respect to an ordering $\pi$ over pixels:
+
+$$
+p (\boldsymbol {x}) = \prod_ {i = 0} ^ {N _ {p} - 1} \prod_ {k = 0} ^ {N _ {c} - 1} p \left(\boldsymbol {x} _ {\pi (i)} ^ {k} \mid \boldsymbol {x} _ {\pi (< i)}, \boldsymbol {x} _ {\pi (i)} ^ {< k}\right). \tag {1}
+$$
+
+The ordering $\pi$ is given by a combination of a subscale- and raster-scan ordering, as detailed in 3.2.
+
+# 3.1 BLOCK-LOCAL SELF-ATTENTION
+
+The attention mechanism of the original Transformer lets each element in a set of $N_{p}$ elements connect to every other element, via the fully-connected weighted adjacency (attention) matrix $A \in \mathbb{R}^{N_{p} \times N_{p}}$ , with $A_{ij}$ representing attention weights from element $i$ to element $j$ . Because $A$ grows quadratically with the number of elements it becomes prohibitively large for objects such as videos, which typically consist of hundreds of thousands of pixels or more. Therefore, similar in spirit to Parmar et al. (2018), we propose to use local self-attention by dividing a video into much smaller non-overlapping sub-volumes, or 3D blocks. We then apply self-attention separately within each block. This approach is conceptually simple and amenable to highly efficient implementation on
+
+TPUs, which enables us to scale our models substantially while maintaining a comparatively high training speed with only a modest sacrifice in expressive power.
+
+The Video Transformer consists of multiple stacked self-attention layers. Each layer divides the overall video volume of shape $(T, H, W)$ into smaller blocks of shape $(t, h, w)$ of length $n_p = t \cdot h \cdot w$ , and performs attention within each block independently. Given a (flattened) block representation $\mathbf{z} \in \mathbb{R}^{n_p \times d}$ of hidden size $d$ as input, this amounts to:
+
+$$
+[ \boldsymbol {q}, \boldsymbol {k}, \boldsymbol {v} ] = \text {l a y e r n o r m} (\boldsymbol {z}) W _ {q k v} \quad \boldsymbol {q}, \boldsymbol {k}, \boldsymbol {v} \in \mathbb {R} ^ {n _ {p} \times d _ {a}}, W _ {q k v} \in \mathbb {R} ^ {d \times 3 d _ {a}}, \tag {2}
+$$
+
+$$
+A = \operatorname {s o f t m a x} \left(\boldsymbol {q} \boldsymbol {k} ^ {\top} / \sqrt {d _ {a}} + B\right) \quad A, B \in \mathbb {R} ^ {n _ {p} \times n _ {p}}, \tag {3}
+$$
+
+$$
+\operatorname {a t t e n t i o n} (\boldsymbol {z}) = A \boldsymbol {v}. \tag {4}
+$$
+
+The input is first projected to query, key and value representations (Eq. 2). The attention matrix $A$ is then formed as the scaled dot-product between all query-key pairs adding a relative position bias $B$ (Parikh et al., 2016) (Eq. 3). The bias $B_{ij}$ is defined as the sum of per-dimension relative distance biases between element $i$ and $j$ , along each of the time- and spatial dimensions. Finally, the values are aggregated with respect to the attention weights (Eq. 4).
+
+Following Vaswani et al. (2017), we concatenate the output of $n_a$ parallel attention heads in each layer and project the result by a linear transformation (Eq. 5) before applying a residual connection. Finally, the output of the multi-head self-attention layer is passed through another dense layer with ReLU activation, followed by a final linear transformation and a residual connection (Eq. 6):
+
+$$
+\tilde {z} = \left[ \text {a t t e n t i o n} _ {1} (z); \dots ; \text {a t t e n t i o n} _ {n _ {a}} (z) \right] W _ {p} + z \quad W _ {p} \in \mathbb {R} ^ {\left(n _ {a} \cdot d _ {a}\right) \times d}, \tag {5}
+$$
+
+$$
+z ^ {\prime} = \operatorname {r e l u} \left(\text {l a y e r n o r m} (\tilde {z}) T _ {1}\right) T _ {2} + \tilde {z} \quad T _ {1}, T _ {2} \in \mathbb {R} ^ {d \times d}, \tag {6}
+$$
+
+where overloading notation, attention $(z)$ denotes the blockwise application of self-attention to $z$ . Similar to Baevski & Auli (2019), we found that applying layer normalization before each block, rather than after each block as proposed by Vaswani et al. (2017), improves training.
+
+Connectivity. Operating on 3D sub-volumes (blocks) of videos means that there is no direct information exchange between blocks. However, this can be addressed by varying the block sizes between each layer. To achieve this, we define blocks that stretch over the entire extent of at least a single dimension in each layer. Following this procedure, we can effectively connect all pixel positions in the encoder, but due to masking some dependencies are missed in the decoder. However, in our experiments these did not produce any visible, systematic artifacts. We discuss missing dependencies and potential remedies in Appendix C.
+
+Efficiency. Running block-local self-attention is very efficient in practice as the cost of splitting videos into blocks is negligible. The approach of Parmar et al. (2018) uses overlapping 2D image blocks in each layer. We found this prohibitive as the required data copying is comparatively expensive. To avoid the need for overlaps to connect pixels across blocks, we simply vary block sizes between layers, which is highly efficient and, as our results show, works well in practice.
+
+# 3.2 SPATIOTEMPORAL SUBSCALING
+
+Menick & Kalchbrenner (2019) recently proposed generating images as a sequence of subscaled image slices. We similarly define a subscale factor $s = (s_t, s_h, s_w)$ which divides a video into $s = (s_t \cdot s_h \cdot s_w)$ sub-sampled videos (slices), each of resolution $(T / s_t, H / s_h, W / s_w)$ , as depicted in the bottom part of Figure 1. The slices are generated in order according to their respective offsets, such that we first generate slice $\pmb{x}_{(0,0,0)}$ , then $\pmb{x}_{(0,0,1)}$ , up until slice $\pmb{x}_{(s_t - 1, s_h - 1, s_w - 1)}$ . Generating all slices one at a time in this way drastically reduces the number of pixels in memory to $N_p / s$ , which enables scaling our architectures by a factor of $s$ . Each slice is internally generated according to the raster-scan order. In the following we explain how slices are generated and how they are conditioned on already decoded slices. An overview is illustrated in the upper part of Figure 1.
+
+Slice Encoder. The current slice $\pmb{x}_{(a,b,c)}$ is generated conditioned on the encoded pixels from preceding slices as follows. First, we create a partially masked video, where only the pixels of preceding slices $\pmb{x}_{< (a,b,c)}$ are visible. The partially masked video is then embedded by concatenating the one-hot encoding of the discretized pixel intensities of each channel. Subsequently, a 3D convolution with kernel size $\pmb{k} = (k_{1},k_{2},k_{3})$ and stride $s$ (the sub-scaling factor) results in an encoded video
+
+of resolution $(T / s_{t}, H / s_{h}, W / s_{w})$ . We apply convolution padding depending on the current slice index $(a, b, c)$ . In particular, we pad with $(\lfloor k_{1} / 2 \rfloor - a, \lfloor k_{2} / 2 \rfloor - b, \lfloor k_{3} / 2 \rfloor - c)$ , which "centers" the convolution kernel on the pixels of the current slice. Finally, we add positional embeddings for each axis, as well as embeddings for the current slice index $(a, b, c)$ , to the output of this strided convolution. The result is an initial encoder representation $z_{(a, b, c)}^{0} \in \mathbb{R}^{T / s_{t} \times H / s_{h} \times W / s_{w} \times d_{e}}$ , where $d_{e}$ is the embedding size. We can optionally condition on auxiliary information, such as per-frame action values of a robot arm, by concatenating this information to the initial encoder representation.
+
+This representation is further transformed by a linear projection to hidden size $d$ , before being fed as input to a stack of $L$ block-local self-attention layers as described in §3.1. Each layer is parameterized by a different block size and number of attention heads. The resulting output $\boldsymbol{z}_{(a,b,c)}^{L}$ is used as conditional input to the subscale slice decoder, which generates the pixels of the current slice $(a,b,c)$ .
+
+Slice Decoder. The pixel values of the current slice $\boldsymbol{x}_{(a,b,c)}$ are predicted conditioned on the encoder representation $\boldsymbol{z}_{(a,b,c)}^{L}$ . The decoder is almost identical to the encoder in structure, except for the use of masking in the decoder as defined by the generation order. First, we embed $\boldsymbol{x}_{(a,b,c)}$ by summing $N_{c}$ channel embeddings of size $d_{e}$ at every pixel, before applying a 3x3x3 masked convolution (van den Oord et al., 2016a) on the embedded pixels, effectively representing each pixel by its already generated, immediate neighbors. Similar to the encoder, we add positional embeddings for the space- and time dimensions to the output of this masked convolution. As in the encoder, this results in an initial decoder representation $\boldsymbol{y}_{(a,b,c)}^{0} \in \mathbb{R}^{T / s_{t} \times H / s_{h} \times W / s_{w} \times d}$ .
+
+To condition on the encoder state, a linear projection of $\pmb{z}_{(a,b,c)}^{L}$ is added to $\pmb{y}_{(a,b,c)}^{0}$ and the resulting representation is fed through a stack of $L$ block-local self-attention layers, with masking, to produce a state $\pmb{y}_{(a,b,c)}^{L}$ on which the final channel predictions are conditioned.
+
+# 3.3 CHANNEL PREDICTION & LOSS FUNCTION.
+
+The per-pixel channel intensities $\pmb{x}_{(a,b,c)}^{k}$ (we omit the slice index $(a,b,c)$ in the following) for each channel $k < N_{c}$ are predicted by MLPs with a single hidden layer (Eq. 8), conditioned on the flattened final decoder state $\pmb{y}^{L} \in \mathbb{R}^{n_{p} \times d}$ — which is itself conditioned on $z_{(a,b,c)}^{L}$ and hence on prior slices $\pmb{x}_{< (a,b,c)}$ — as well as the preceding channels $(\pmb{x}^{j})_{j=1\dots k-1}$ for each pixel, encoded as one-hot vectors. Finally, the per video slice loss is defined as the negative log-likelihood as in Eq. 9:
+
+$$
+\boldsymbol {u} ^ {k} = \left[ \text {l a y e r n o r m} \left(\boldsymbol {y} ^ {L}\right); \text {o n e h o t} \left(\boldsymbol {x} ^ {1}\right); \dots ; \text {o n e h o t} \left(\boldsymbol {x} ^ {k - 1}\right) \right] U _ {k}, \tag {7}
+$$
+
+$$
+p \left(x _ {i} ^ {k} \mid \boldsymbol {x} _ {i} ^ {< k}, \boldsymbol {x} _ {< i}\right) = \operatorname {s o f t m a x} \left(\operatorname {r e l u} \left(\boldsymbol {u} _ {i} ^ {k}\right) P\right), \quad P \in \mathbb {R} ^ {d \times N _ {v}}, \quad U _ {k} \in \mathbb {R} ^ {(d + (k - 1) \cdot N _ {v}) \times d}, \tag {8}
+$$
+
+$$
+\mathcal {L} (\boldsymbol {x}) = - \sum_ {i = 0} ^ {n _ {p} - 1} \sum_ {k = 0} ^ {N _ {c} - 1} \ln p \left(x _ {i} ^ {k} \mid \boldsymbol {x} _ {i} ^ {< k}, \boldsymbol {x} _ {< i}\right). \tag {9}
+$$
+
+We found that splitting the color channel values of the videos into coarse and fine bits helps slightly in terms of performance. Specifically, we split the $3 \times 8$ -bit RGB channels into $6 \times 4$ -bit channels $(N_{c} = 6, N_{v} = 16)$ , such that the coarse bits of all three channels are predicted before the fine bits. Furthermore, splitting channels this way at the input level considerably lowers memory footprint when encoding videos as onehot vectors on TPUs.
+
+# 4 EXPERIMENTS
+
+Below, we provide details on the model variants considered, our training setup and the evaluation metrics used. We focus our evaluation on the BAIR Robot Pushing and Kinetics datasets. Additional results on Moving MNIST and another robot pushing dataset are provided in Appendix A for reference. Sample videos strips of each model and dataset can be found in Appendix F and sample videos at https://bit.ly/2Zb017f.
+
+# 4.1 MODELS & SETUP
+
+Unless specified otherwise, we model video slices of 4 frames with a spatial resolution of $32 \times 32$ . Both the encoder and decoder consist of 8 layers and have a nearly identical structure, except for the use of masking in the decoder, as described in Section 3.2. We apply block-local self-attention with the following block sizes $(t, h, w)$ . Layers 1-4: (4, 8, 4); (4, 4, 8); (1, 32, 4); and (1, 4, 32). Intuitively, layers 1 and 2 are responsible for gathering temporal information whereas layers 3 and 4 gather spatial information of the entire frame. Layer 3 has access to the entire height and layer 4 to the entire width of a frame. The remaining 4 layers have the same block sizes, but in reverse order. However, as discussed in Appendix B, this particular choice of block size ordering is not crucial. There are $n_a = 8$ attention heads, each with hidden size $d_a = 128$ . Our base models are trained with embedding size $d_e = 128$ and hidden size of $d = 512$ (46M parameters). Based on ablations in Appendix B, we observed that increasing the hidden dimension is preferable to using deeper networks. Hence, we increase the hidden size to $d = 2048$ and use $n_a = 16$ instead of 8 heads for the last 4 encoder/decoder layers in our large models (373M parameters).
+
+Models. To assess the effect of subscaling, we explore the following variants. These differ mainly in the subscaling factor $s$ as well as the context kernel size $k$ , defaulting to $k = s$ :
+
+Spatiotemporal Subscaling. The subscale video transformer with full spatiotemporal subscaling applies subscaling in every dimension. For instance, a 16x64x64 video is subscaled by factors $s = (4,2,2)$ to 16 slices of 4x32x32.
+
+Spatial Subscaling. This model uses no temporal subscaling and only subscales individual frames to a resolution of $32 \times 32$ . For instance, a 4x64x64 video is subscaled by factors $s = (1, 2, 2)$ to 4 slices of $4 \times 32 \times 32$ .
+
+Single Frame. This model uses no subscaling. Instead, we here model an entire single frame at a time, conditioned only on the previous three frames to limit memory consumption. The model uses no actual subscaling. Instead, one can imagine a 16x64x64 video to be subscaled by factors $s = (16,1,1)$ to 16 slices of 1x64x64 frames. The context kernel size is $k = (6,1,1)$ which means that we merely condition on a context of 3 past frames, as the current and future frames are always masked when the temporal subscaling factor equals the full video length. Self-attention blocks are adapted as follows: Layers 1-4: (1,8,16); (1,16,8); (1,2,64); (1,64,2). For the remaining 4 layers we use the same blocks, again in reverse order.
+
+Training. All models are trained with RMSProp (Tieleman & Hinton, 2012) with a fixed learning rate of $2 \cdot 10^{-5}$ , decay of 0.95 and momentum of 0.9. We use a batch size of 64 video slices, if not stated otherwise, and shuffle the slices to avoid having all slices in a batch correspond to the same video. The smaller models are trained for 300K steps and the larger ones for 1M steps. No explicit regularization is applied as we could not observe any form of over-fitting. Videos longer than the training resolution are cropped randomly in time to the defined training length. If not stated otherwise, models are conditioned on the first frame during training, which is achieved by masking the loss corresponding to this frame. In preliminary experiments, this gave a minor improvement over computing the training loss across all frames.
+
+Intrinsic Evaluation. Most results are reported as bits per dimension (bits/dim), the average negative $\log_2$ -probability assigned by the model per (RGB) channel, averaged across all pixels in the video. This corresponds directly to the loss optimized by the model. In all experiments, we condition (prime) on a specified number of initial frames. The log-probabilities corresponding to these frames are excluded from this average.
+
+Extrinsic Evaluation. Prior work mainly reported results on the peak signal-to-noise ratio (PSNR) and mean-structural similarity (SSIM) metrics (Wang et al., 2004b). However, these metrics were developed for images and have serious flaws when applied to videos (Wang et al., 2004a; Wang & Li, 2007; Zhang et al., 2018; Lee et al., 2018). Conceptually, PSNR has a strong preference for blurry videos as it is based on pixel-level mean squared error. Similarly, SSIM does not correlate well with perceptual quality either. For instance, variational autoencoders show very strong performance on this metric despite producing blurry videos (Lee et al., 2018). Hence, we focus on the Fréchet Video Distance (FVD), which was recently proposed by Unterthiner et al. (2018) as a qualitative metric sensitive to visual quality, temporal coherence and diversity of samples. This is the spatiotemporal counterpart to the Fréchet Inception Distance (Heusel et al., 2017), replacing the ImageNet-trained
+
+Table 1: Quantitative results on BAIR Robot Pushing (left) and Kinetics (right).
+
+| Models | Bits/dim | FVD | FVD (Avg) |
| Single Frame | 1.49 | 104±4 | 99±2 |
| Spatial Sub. | 1.57 | 111±4 | 108±1 |
| Spatiotemp. Sub. | 1.53 | 106±3 | 106±2 |
| Spatiotemp. Sub. (L) | 1.35 | 94±2 | 96±2 |
| SV2P [1]† | - | 263‡ | - |
| SAVP [2]† | - | 116‡ | - |
| VideoFlow [3] | 1.87‡ | - | - |
+
+(a) BAIR Robot Pushing. Bits/dim averaged across 15 subsequent frames when priming with 1 initial frame, FVD and unrolled average FVD scores. Best results in bold. $\dagger$ Results from Unterthiner et al. (2018). $\ddagger$ Results are not strictly comparable (see text for details). [1] Babaeizadeh et al. (2018), [2] Lee et al. (2018), [3] Kumar et al. (2019).
+
+| Models | Bits/dim | FVD | FVD (Avg) |
| Single Frame | 1.40 | 243±6 | 413±11 |
| Spatial Sub. | 1.47 | 263±6 | 450±15 |
| Spatiotemp. Sub. | 1.49 | 195±7 | 375±11 |
| Single frame (L) | 1.14 | 207±8 | 353±13 |
| Spatiotemp. Sub. (L) | 1.19 | 170±5 | 316±12 |
+
+(b) Kinetics. Bits/dim averaged across 15 subsequent frames when priming with 1 initial frame, FVD and unrolled average FVD scores when priming with 5 frames. Best results in bold.
+
+Inception network of the latter with an I3D Network trained on Kinetics. Despite sharing the known drawbacks of FID (Binkowski et al., 2018), FVD has shown to correlate much stronger with human raters compared to both PSNR and SSIM (Unterthiner et al., 2018). We report the FVD of the first 16 frames, as well as the "unrolled" average FVD across all contiguous subsequences of 16 frames. In each case, we report the mean and standard deviation of 20 trials.
+
+Sampling time. Sampling from autoregressive models is notoriously slow. However, because our decoders are not very deep (8 layers) we are able to sample a batch of four 30x64x64 videos in acceptable time (approx. 8 minutes) with our large models on a Nvidia Tesla V100. Though this might still be impractical we argue that further advances in parallel sampling strategies (Stern et al., 2018) and future hardware will alleviate this disadvantage significantly.
+
+# 4.2 BAIR ROBOT PUSHING
+
+BAIR Robot Pushing (Ebert et al., 2017) shows a robotic arm pushing and grasping objects in a box. It consists of roughly 40K training- and 256 test videos. We prime on the first frame for training and evaluation.
+
+Empirical Results. All variants of the Video Transformer achieve strong results compared to prior work in terms of both intrinsic and extrinsic metrics. From Table 1a, we see that the small models already reduce the perplexity in terms of bits/dim by almost $20\%$ compared to the recently proposed VideoFlow model (Kumar et al., 2019) with our large model (L) reducing perplexity even further to a $25\%$ improvement. Similar to Menick & Kalchbrenner (2019), we find that subscaling can have a slightly negative effect on bits/dim. In terms of perceptual quality, every incarnation of our model obtains a lower (better) FVD score compared to all models evaluated by Unterthiner et al. (2018), which notably includes adversarial networks with no guarantees of covering the full empirical distribution. These results are not strictly comparable, since prior work has used longer priming sequences of two (Babaeizadeh et al., 2018; Lee et al., 2018) or three (Kumar et al., 2019) frames, whereas our models (to our disadvantage) see a single prime frame. Note that we sample with temperature 0.9 for the extrinsic metrics as we observed improved qualitative results at this temperature on the validation set. This corresponds to a mild form of mode dropping and is common practice to improve sampling quality. For fair comparison we also tweaked the "temperature" of SAVP by scaling the variance of its normal distribution when sampling. This, however, did not result in any improvements for FVD.
+
+Further results on an earlier version of robot pushing (Finn et al., 2016a) and Moving MNIST (Srivastava et al., 2015) can be found in Appendix A for brevity. In summary, like Kalchbrenner et al. (2016), we match the lower bound on Moving MNIST while obtaining an almost $50\%$ reduction in bits/dim on robotic pushing which demonstrates the superiority of our models against prior work on autoregressive video modeling.
+
+Qualitative Observations. All variants of our model reach similar quantitative results on these benchmarks and we observe no immediate differences in fidelity. However, there are some notable differences. First, whereas the spatiotemporal subscaling model is able to capture temporal depen
+
+
+(a)
+
+
+(b)
+Figure 2: Unrolled FVD metrics on BAIR Robot Pushing (left) and Kinetics (right).
+
+dencies across up to 16 frames (given subscaling in time by a factor four), the remaining models can only capture dependencies across four frames. This can, for example, result in deformation of occluded objects (e.g., Figure 4 of the Appendix). However, due to the simplicity of the benchmark datasets, this is not appropriately reflected in the metrics including better unrolled FVD curves for the single frame base model in Figure 2a. Second, we observe that lowering the sampling temperature from 1.0 to 0.9 consistently improves results. Notably, spatiotemporal subscaling seems more robust to sampling errors as its performance decays less when sampling with temperature 1.0 $(122\pm 4$ Avg. FVD) compared to the spatial subscaling $(134\pm 4)$ and single frame models $(153\pm 7)$ . We attribute this finding to the difference in generation order when spatiotemporal subscaling is employed as it predicts pixels over the entire extend of the 3D video volume early and thereby effectively anchors future predictions around these pixels. Finally, considering that our results on BAIR Robot Pushing in terms of FVD are on par with those between two ground-truth subsamples (Figure 4 of Unterthiner et al. (2018)), we may be approaching the limit of this benchmark. On the other hand, it could be that FVD suffers out-of-domain and is not sufficiently sensitive to long-range temporal dynamics, since it is trained to perform human action recognition, which is known to predominantly rely on local features (Carreira & Zisserman, 2017; Xie et al., 2018).
+
+# 4.3 KINETICS
+
+Moving from a constrained to a real world setting, we next apply our models to the Kinetics dataset (Kay et al., 2017), a large scale action-recognition dataset consisting of YouTube videos. Specifically, we use Kinetics-600, which contains roughly 400K training videos ranging over 600 action classes (Carreira et al., 2018). We center-crop and down-sample each frame to 64x64 with a width-3 Lanczos filter and anti-aliasing.
+
+We introduce a slight change to our setup by using a separate decoder for the first slice $\boldsymbol{x}_{(0,0,0)}$ . This decoder can be twice as deep (16 instead of 8 layers) as the original subscale decoder, because it does not rely on any encoder. For all other slices we train a regular subscale model (8 layers in both encoder and decoder) as before. Using a separate first-slice decoder means that there is no wasted encoder computation on the first slice and that there are additional parameters. Furthermore, for our large models we scale the batch size to 256 by training in parallel on 128 TPU v3 instances for 1M steps.
+
+Empirical Results. Results for our base models are shown in the upper part of Table 1b. In line with results on BAIR pushing, we find that the single frame model obtains better performance in terms of bits/dim. In contrast, we observe that the spatiotemporal subscaling model generates better and more robust video continuations which is reflected by its superior FVD scores. Our large models (L) show much stronger performance across the board (see lower half of Table 1b and Figures 2b), lowering the perplexity to 1.14 bits/dim for the single frame model. While the spatiotemporal subscaling model obtains slightly worse perplexity of 1.19 bits/dim, it improves FVD to 170. Despite its good performance on bits/dim, even with a temperature of 0.9, samples from the large single frame model are prone to instability and in many cases we observe color "explosions" (Figure 12 in the Appendix shows an example) which is reflected in its significantly higher FVD score. Although much less pronounced we observed such instability already when sampling with temperature 1.0 on BAIR pushing which clearly indicates the benefits of temporal subscaling for video generation.
+
+
+(a) Zoom
+
+
+(b) Perspective
+
+
+(c) Camera movement
+
+
+(d) Fire
+
+
+(e) Scene change
+
+
+(f) Object interaction
+
+
+(g) Fingers
+
+
+(h) Mouth closing
+Figure 3: Selected Kinetics continuations from a set of 128 videos and 16 samples which showcase a variety of natural, video-specific phenomena our model learns to generate. We used our large spatiotemporal subscaling model and prime generation with 5 frames (0-4) to include the first two frames in subscale order (0, 4). Samples are generated with temperature of 0.9. The examples depict frames 0, 5, 10 and 15.
+
+
+(i) Yawning
+
+Qualitative Observations. Figure 3 shows samples from a cooking subset of Kinetics that we describe in Appendix E. These are selected to showcase different aspects of real-world videos learned by the large spatiotemporal subscaling model. Figures 3a and 3c demonstrate the model's ability to handle camera movement. We find that camera movement seems to be learned early in training, possibly since it is a major source of uncertainty. This requires transforming pixels correctly while hallucinating new pixels at the edges. Similarly, object movement resulting, for instance, in a change of perspective is predicted quite well (Figure 3b). Highly stochastic motion such as fire (Figure 3d) or steam is modeled surprisingly well. Videos in Kinetics sometimes contain scene changes and our model, too, occasionally generates videos with jumps to completely new scenes (Figure 3e). Motion of human fingers and faces seems challenging to model. Nevertheless, in a number of samples the model is able to generate somewhat believable continuations as can be seen in Figures 3g, 3h or 3i.
+
+These selected examples show only a small subset of the interesting phenomena handled by the model and illustrate the sheer complexity involved in modeling this dataset. In Appendix F, we provide multiple samples, primed with the same initial frames to illustrate the diversity of the generated samples.
+
+Limitations. While we obtained the occasional encouraging sampler, we would like to point out that the diversity of Kinetics still poses a major challenge. Failure modes range from freezing movement or object distortions to continuations that "wash out" entirely after a few frames. We firmly believe that yet larger datasets and/or models will be required to capture the complexity of even short clips from YouTube videos. With this work we merely provide an initial baseline, hoping to highlight both the potential and the enormous room for improvement.
+
+# 5 CONCLUSION
+
+We presented an autoregressive model of videos based almost entirely on a variant of block-local self-attention that can easily be implemented efficiently on TPUs. Combined with spatiotemporal subscaling, our models can be scaled up substantially while retaining the ability to capture longer range spatiotemporal dependencies.
+
+Empirically, we obtain state-of-the-art results across a range of video generation benchmarks, while the scalability of our approach enables us to make an initial attempt at modeling videos of unusually high complexity and diversity as found in the Kinetics dataset. Our models occasionally generate encouraging continuations, especially on a subset of cooking videos, yet we find modeling the full range of such videos clearly remains a major challenge.
+
+# ACKNOWLEDGEMENTS
+
+This work benefited from numerous conversations with Nal Kalchbrenner, as well as discussions with Jacob Menick, Mohammad Taghi Saffar and Niki Parmar. We would also like to thank Chelsea Finn and Tom Kwiatkowski for thoughtful comments on an earlier draft.
+
+# REFERENCES
+
+Mohammad Babaeizadeh, Chelsea Finn, Dumitru Erhan, Roy H. Campbell, and Sergey Levine. Stochastic variational video prediction. *ICLR*, 2018.
+Alexei Baevski and Michael Auli. Adaptive input representations for neural language modeling. In ICLR, 2019.
+Mikołaj Binkowski, Dougal J. Sutherland, Michael Arbel, and Arthur Gretton. Demystifying MMD GANs. In ICLR, 2018.
+Antonio Torralba Carl Vondrick, Hamed Pirsiavash. Anticipating visual representations from unlabeled video. In CVPR, 2016.
+João Carreira and Andrew Zisserman. Quo vadis, action recognition? a new model and the kinetics dataset. In CVPR, 2017.
+João Carreira, Eric Noland, Andras Banki-Horvath, Chloe Hillier, and Andrew Zisserman. A short note about kinetics-600. arXiv, abs/1808.01340, 2018.
+Lluis Castrejón, Nicolas Ballas, and Aaron Courville. Improved conditional vrnns for video prediction. arXiv, abs/1904.12165, 2019.
+XI Chen, Nikhil Mishra, Mostafa Rohaninejad, and Pieter Abbeel. PixelSNAIL: An improved autoregressive generative model. In ICML, 2018.
+Rewon Child, Scott Gray, Alec Radford, and Ilya Sutskever. Generating long sequences with sparse transformers. OpenAI Preprint, 2019.
+Jeffrey De Fauw, Sander Dieleman, and Karen Simonyan. Hierarchical autoregressive image models with auxiliary decoders. In CVPR, 2019.
+Emily Denton and Rob Fergus. Stochastic video generation with a learned prior. In ICML, 2018.
+Frederik Ebert, Chelsea Finn, Alex Lee, and Sergey Levine. Self-supervised visual planning with temporal skip connections. In Conference on Robot Learning (CoRL), 2017.
+Chelsea Finn, Ian Goodfellow, and Sergey Levine. Unsupervised learning for physical interaction through video prediction. In NIPS, 2016a.
+Chelsea Finn, Ian Goodfellow, and Sergey Levine. Unsupervised learning for physical interaction through video prediction. In NIPS, 2016b.
+Rohit Girdhar, João Carreira, Carl Doersch, and Andrew Zisserman. Video action transformer network. arXiv, abs/1812.02707, 2018.
+Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, and Sepp Hochreiter. GANs trained by a two time-scale update rule converge to a local Nash equilibrium. In NIPS, 2017.
+Xu Jia, Bert De Brabandere, Tinne Tuytelaars, and Luc V Gool. Dynamic filter networks. In Advances in Neural Information Processing Systems, 2016.
+Norman P. Jouppi, Cliff Young, Nishant Patil, David Patterson, Gaurav Agrawal, Raminder Bajwa, Sarah Bates, Suresh Bhatia, Nan Boden, Al Borchers, Rick Boyle, Pierre-luc Cantin, Clifford Chao, Chris Clark, Jeremy Coriell, Mike Daley, Matt Dau, Jeffrey Dean, Ben Gelb, Tara Vazir Ghaemmaghami, Rajendra Gottipati, William Gulland, Robert Hagemann, C. Richard Ho, Doug Hogberg, John Hu, Robert Hundt, Dan Hurt, Julian Ibarz, Aaron Jaffey, Alek Jaworski,
+
+Alexander Kaplan, Harshit Khaitan, Daniel Killebrew, Andy Koch, Naveen Kumar, Steve Lacy, James Laudon, James Law, Diemthu Le, Chris Leary, Zhuyuan Liu, Kyle Lucke, Alan Lundin, Gordon MacKean, Adriana Maggiore, Maire Mahony, Kieran Miller, Rahul Nagarajan, Ravi Narayanaswami, Ray Ni, Kathy Nix, Thomas Norrie, Mark Omernick, Narayana Penukonda, Andy Phelps, Jonathan Ross, Matt Ross, Amir Salek, Emad Samadiani, Chris Severn, Gregory Sizikov, Matthew Snelham, Jed Souter, Dan Steinberg, Andy Swing, Mercedes Tan, Gregory Thorson, Bo Tian, Horia Toma, Erick Tuttle, Vijay Vasudevan, Richard Walter, Walter Wang, Eric Wilcox, and Doe Hyun Yoon. In-datacenter performance analysis of a tensor processing unit. In ISCA, 2017.
+Lukasz Kaiser, Mohammad Babaeizadeh, Piotr Milos, Blazej Osinski, Roy H. Campbell, Konrad Czechowski, Dumitru Erhan, Chelsea Finn, Piotr Kozakowski, Sergey Levine, Ryan Sepassi, George Tucker, and Henryk Michalewski. Model-based reinforcement learning for atari. arXiv, abs/1903.00374, 2019.
+Nal Kalchbrenner, Aaron van den Oord, Karen Simonyan, Ivo Danihelka, Oriol Vinyals, Alex Graves, and Koray Kavukcuoglu. Video pixel networks. In ICML, 2016.
+Will Kay, João Carreira, Karen Simonyan, Brian Zhang, Chloe Hillier, Sudheendra Vijayanarasimhan, Fabio Viola, Tim Green, Trevor Back, Apostol Natsev, Mustafa Suleyman, and Andrew Zisserman. The kinetics human action video dataset. arXiv, abs/1705.06950, 2017.
+Manoj Kumar, Mohammad Babaeizadeh, Dumitru Erhan, Chelsea Finn, Sergey Levine, Laurent Dinh, and Durk Kingma. Videoflow: A flow-based generative model for video. arXiv, abs/1903.01434, 2019.
+Alex X. Lee, Richard Zhang, Frederik Ebert, Pieter Abbeel, Chelsea Finn, and Sergey Levine. Stochastic adversarial video prediction. arXiv, abs/1804.01523, 2018.
+Ziwei Liu, Raymond A Yeh, Xiaou Tang, Yiming Liu, and Aseem Agarwala. Video frame synthesis using deep voxel flow. In ICCV, 2017.
+Jiasen Lu, Caiming Xiong, Devi Parikh, and Richard Socher. Knowing when to look: Adaptive attention via a visual sentinel for image captioning. CVPR, 2017.
+Michaël Mathieu, Camille Couprie, and Yann LeCun. Deep multi-scale video prediction beyond mean square error. In ICLR, 2016.
+Jacob Menick and Nal Kalchbrenner. Generating high fidelity images with subscale pixel networks and multidimensional upscaling. In ICLR, 2019.
+Junhyuk Oh, Xiaoxiao Guo, Honglak Lee, Richard L Lewis, and Satinder Singh. Action-conditional video prediction using deep networks in atari games. In NIPS, 2015.
+Ankur P. Parikh, Oscar Täckström, Dipanjan Das, and Jakob Uszkoreit. A decomposable attention model for natural language inference. In EMNLP, 2016.
+Niki Parmar, Ashish Vaswani, Jakob Uszkoreit, Lukasz Kaiser, Noam Shazeer, and Alexander Ku. Image transformer. In ICML, 2018.
+Viorica Pătrăucean, Ankur Handa, and Roberto Cipolla. Spatio-temporal video autoencoder with differentiable memory. In ICLR (Workshop track), 2016.
+Scott Reed, Aaron van den Oord, Nal Kalchbrenner, Sergio Gomez Colmenarejo, Ziyu Wang, Yutian Chen, Dan Belov, and Nando de Freitas. Parallel multiscale autoregressive density estimation. In ICML, 2017.
+Nitish Srivastava, Elman Mansimov, and Ruslan Salakhudinov. Unsupervised learning of video representations using lstms. In ICML, 2015.
+Mitchell Stern, Noam Shazeer, and Jakob Uszkoreit. Blockwise parallel decoding for deep autoregressive models. In NeurIPS, 2018.
+
+Tijmen Tieleman and Geoffrey Hinton. Lecture 6.5-rmsprop, coursera: Neural networks for machine learning. University of Toronto, Technical Report, 2012.
+Thomas Unterthiner, Sjoerd van Steenkiste, Karol Kurach, Raphael Marinier, Marcin Michalski, and Sylvain Gelly. Towards accurate generative models of video: A new metric & challenges. arXiv, abs/1812.01717, 2018.
+Aäron van den Oord, Nal Kalchbrenner, Lasse Espeholt, Koray Kavukcuoglu, Oriol Vinyals, and Alex Graves. Conditional image generation with pixelCNN decoders. In NIPS, 2016a.
+Aäron van den Oord, Nal Kalchbrenner, and Koray Kavukcuoglu. Pixel recurrent neural networks. In ICML, 2016b.
+Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In NIPS, 2017.
+Carl Vondrick, Hamed Pirsiavash, and Antonio Torralba. Generating videos with scene dynamics. In NIPS, 2016.
+Jiheng Wang and Qiang Li. Video quality assessment using a statistical model of human visual speed perception. Journal of the Optical Society of America. A, Optics, image science, and vision, 24 12:B61-9, 2007.
+Jiheng Wang, Ligang Lu, and Alan C. Bovik. Video quality assessment based on structural distortion measurement. *Sig. Proc.: Image Comm.*, 19, 2004a.
+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, 13(4): 600-612, 2004b.
+Saining Xie, Chen Sun, Jonathan Huang, Zhuowen Tu, and Kevin Murphy. Rethinking spatiotemporal feature learning: Speed-accuracy trade-offs in video classification. In ECCV, 2018.
+SHI Xingjian, Zhourong Chen, Hao Wang, Dit-Yan Yeung, Wai-Kin Wong, and Wang-chun Woo. Convolutional LSTM network: A machine learning approach for precipitation nowcasting. In NIPS, 2015.
+Richard Zhang, Phillip Isola, Alexei Efros, Eli Shechtman, and Oliver Wang. The unreasonable effectiveness of deep features as a perceptual metric. In CVPR, 2018.
+
+
+Figure 4: Samples (showing every 5th frame horizontally) illustrating occlusion effects on BAIR Robot Pushing. Models without temporal subscaling (rows 3-4) fail on occlusions, whereas the model with temporal subscaling (row 2) correctly maintains objects from the ground truth video (row 1). Notice the green ball deformation on rows 2 and 3 and the hallucinated green ball on the right edge of row 3, which are caused by missing temporal dependencies across the duration of occlusion.
+
+Table 2: Moving MNIST. Nats per frame averaged across 10 subsequent frames when priming with 10 initial frames. Best results in bold. $\dagger$ The lower bound reported in (Kalchbrenner et al., 2016) is slightly higher than ours.
+
+| Models | Nats/Frame (↓) |
| Single Frame | 86.2 |
| Spatial Subscaling | 91.8 |
| Spatiotemporal Subscaling | 90.0 |
| VPN (Kalchbrenner et al., 2016) | 87.6 |
| Lower bound | 85.1 (86.3)‡ |
+
+# A FURTHER BENCHMARKS
+
+# A.1 MOVING MNIST
+
+Moving MNIST (Srivastava et al., 2015) consists of 100K training- and 10K validation/test videos of two handwritten digits from the MNIST benchmark that move deterministically across the frame, crossing each other and bouncing off the borders. The partial occlusion of crossing digits makes this dataset challenging. To be comparable with Kalchbrenner et al. (2016), we use the first ten frames as priming and predict the subsequent ten frames.
+
+To allow direct comparison with Kalchbrenner et al. (2016), we change our loss to a "deterministic" loss (and derived nets-per-frame metric) which is defined as: $H(z,y) = -\sum_{i}z_{i}\ln y_{i} + (1 - z_{i})\ln (1 - y_{i})$ , where $z_{i}$ are the gray-scale targets between 0.0 and 1.0, and $y_{i}$ are the predicted scalar intensities.
+
+From Table 2, we find that like Kalchbrenner et al. (2016) our single frame prediction model (i.e., no subscaling) virtually solves the task in the sense that it almost matches the lower bound of the
+
+Table 3: Ablation of hyper-parameter settings in terms of bits per dimension for models on 256 BAIR Robot Pushing validation videos. All models were primed on 1 frame and trained for 300K steps with a batch size of 64.
+
+| Layers | Heads | Hidden size |
| 4 | 1.63 | 4 | 1.59 | 256 | 1.65 |
| 8 | 1.55 | 8 | 1.55 | 512 | 1.55 |
| 16 | 1.4816 | 1.51 | 1024 | 1.47 |
| 24 | 1.4524 | 1.47 | 2048 | 1.40 |
+
+loss. However, this is not true for our subscaling models. Employing spatial subscaling on this task gives aliasing artifacts that make it harder to predict future frames. Although this finding is limited to Moving MNIST, it suggests that spatial subscaling can potentially hurt generation.
+
+# A.2 ROBOTIC PUSHING.
+
+Robotic Pushing (Finn et al., 2016a) was used in prior work on autoregressive video generation (Kalchbrenner et al., 2016). The videos show a robotic arm pushing and grasping objects in a box and there are roughly 50K training videos and 1500 test videos with seen and novel objects, respectively. Following prior work, we use the initial two frames for priming and condition on the robot arm action for each frame as described in Section 3.2. We use the same setup as (Kalchbrenner et al., 2016) with videos of twenty frames down-sampled to 64x64 with a Lanczos filter and anti-aliasing.
+
+We report results to compare with prior work on autoregressive video generation by Kalchbrenner et al. (2016), who achieve 0.92 bits/dim (0.64 nats/dim) with 2 frames of priming on each of the test splits (one with objects seen during training and one with novel objects). We trained a large (2048 dimensional) spatiotemporal subscaling model which achieves 0.51 bits/dim on the subset with seen objects and 0.47 bits/dim on the subset with new objects, which corresponds to an almost $50\%$ reduction in perplexity.
+
+# B HYPER-PARAMETER SWEEPS
+
+Table 3 shows the impact of different architectural settings. We see that the hidden size has the biggest impact followed by the number of layers and heads. This is an interesting as well as important finding because increasing the hidden size (wider networks) requires more parallel compute which modern Deep Learning hardware excels at. Computation time grows sub-linear, memory linear and parameters partially quadratically. In contrast all of these aspects grow linearly with deep networks. For scaling up architectures depth is therefore not the preferred option as we suffer much more in terms of computation time while having less parameters.
+
+In another experiment, we shuffle the arrangement of block sizes between layers and found that it did not really matter, that is, all results were within 0.01 bits/dim. However, our setup had the best overall performance.
+
+Finally, we tried sampling temperature 0.9 and 1.0 only on the BAIR Robot Pushing validation set and found that temperature 0.9 consistently gave more robust predictions and better results on all extrinsic metrics.
+
+# C CONNECTIVITY IN BLOCK-LOCAL SELF-ATTENTION
+
+Blind Spots. Varying block sizes between layers in block-local self-attention can efficiently connect every pixel with every other pixel when no masking is employed. If masking is employed to respect the generation order (as in our slice decoder) block-local self attention produces "blind spots" which leads to independence assumptions. To exemplify these special cases, consider position $(1,0,0)$ , the top-left pixel of the second frame, and its direct predecessor in generation order $(0,h - 1,w - 1)$ , the bottom-right pixel of the first frame. The only way to establish a connection
+
+between these two positions is through a direct connection, because masking prevents any indirect connection. Thus, there has to be one layer in which both of these pixels are in the same block. This block must at least stretch over the entire extent of both width and height (i.e., the full frame) as well as at least 2 time steps. Running full self-attention in such blocks can easily become prohibitive for large $h$ and $w$ .
+
+Remedies. There seems to be no simple solution that solves the problem of blind spots completely. However, we can make sure that local dependencies up to a certain distance are all covered by increasing the kernel size of the initial, masked convolution in the decoder. It is also possible to combine block-local self-attention with its dual form, dilated self-attention in $n$ dimensions which connects all pixels at the same relative position within their respective block with each other. Finally, we find that it is important to avoid blocks of small sizes in any dimension (e.g., 1). That means, even if we stretch a block to the full extent of one dimension it is important to define sizes at least larger than 1 on all other dimensions to limit the number of unconnected pixels.
+
+On the other hand, the independence assumptions due to masking do not seem to produce any systematic, visible artifacts in our samples. We believe this to be an interesting finding by itself as it shows that there is potential for parallelizing autoregressive video generation by systematically exploring further independence assumptions.
+
+# D ADDITIONAL FINDINGS
+
+Below, we summarize some additional findings that may be of interest to some readers:
+
+- We found that using blocks stretching across a single time-/row-/column- dimension, is substantially worse than using blocks that stretch at least to some extent in all directions. This is likely due to the fact that future masking in the decoder imposes strong independence assumptions in this case, as discussed in Appendix C.
+- We found that RMSProp with momentum converges significantly faster than ADAM, which we tried with different learning rates and settings for $\beta_{1}$ and $\beta_{2}$ .
+- We tried using continuous, rather than discretized one-hot, input channel representations, but this had an overall negative impact on both performance and sample quality.
+- We experimented with a gating mechanism in Eq. 3, such that the attention matrix $A$ is masked elementwise with $(1 - I)$ to allow for not attending to any element, similar to sentinel attention (Lu et al., 2017). However, this had no effect on generation quality.
+
+# E KINETICS COOKING
+
+We found that for many video-prefixes in Kinetics it is very hard for our model to predict continuations. For instance, main objects in the videos are too small or movement is too fast which results in very blurry frames or there is little to no movement at all. Figure 13 shows some examples. Therefore, we created a subset of cooking videos that we found to exhibit these problems to a lesser degree.
+
+In particular we filtered videos whose label matched the following regular expression:
+
+$\star$ (baking|barbequing|breading|cooking|cutting|pancake|vegetables| meat|cake|sandwich|pizza|sushi|tea|peeling|fruit|eggs|salad). $\star$
+
+Note that we still train on the full Kinetics training set and only use the cooking set to showcase samples in some cases.
+
+# F SAMPLES
+
+Figures 5-8 show samples from our spatiotemporal subscaling and large spatiotemporal subscaling models on BAIR Robot Pushing. Figures 5 and 6 illustrate the fidelity and realism of the generated samples, whereas Figures 7 and 8 illustrate the diversity of samples.
+
+Figures 9-11 show samples from our spatiotemporal subscaling model on cooking videos for Kinetics-600, while Figure 12 depicts samples from the single frame model. In each case, we prime on 5 frames and sample the next 11 frames. Each figure shows 16 different samples from the same model. As can be seen, the model is able to generate diverse continuations while retaining fidelity. For the single frame model we observe strange color artifacts (exploding colors) which we attribute to the standard, raster-scan generation order of this model.
+
+
+Figure 5: Samples of 30 future frames (showing every 4th frame) for 12 test videos with the spatiotemporal subscaling model, using 1 prime frame and temperature 0.9 on BAIR Robot Pushing.
+
+
+Figure 6: Samples of 30 future frames (showing every 4th frame) for 12 test videos with the large spatiotemporal subscaling model, using 1 prime frame and temperature 0.9 on BAIR Robot Pushing.
+
+
+Figure 7: 11 samples of 30 future frames (showing every 4th frame) for 1 test video (top row) with the spatiotemporal subscaling model, using 1 prime frame and temperature 0.9 on BAIR Robot Pushing.
+
+
+Figure 8: 11 samples of 30 future frames (showing every 4th frame) for 1 test video (top row) with the large spatiotemporal subscaling model, using 1 prime frame and temperature 0.9 on BAIR Robot Pushing.
+
+
+Figure 9: Samples of 11 future frames from the spatiotemporal subscaling model with 5 prime frames on 64x64 Kinetics.
+
+
+Figure 10: Samples of 11 future frames from the spatiotemporal subscaling model with 5 prime frames on 64x64 Kinetics.
+
+
+Figure 11: Samples of 11 future frames from the spatiotemporal subscaling model with 5 prime frames on 64x64 Kinetics.
+
+
+Figure 12: Samples of 11 future frames from the single frame model with 5 prime frames on 64x64 Kinetics exhibiting strange color artifacts.
+
+
+
+
+
+
+(a) Blur and fast camera movement.
+(c) Very little movement.
+Figure 13: Ground-truth (top) and 2 samples of 30 future frames (showing every 4th frame) demonstrating that random Kinetics videos do not always lend themselves as good prefixes for generating continuations.
+
+
+(b) Blur and fast camera movement.
+(d) Very little movement and small objects.
\ No newline at end of file
diff --git a/scalingautoregressivevideomodels/images.zip b/scalingautoregressivevideomodels/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..a09aad3d4c043f42ca31cc2b5d823790c0918d31
--- /dev/null
+++ b/scalingautoregressivevideomodels/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e4c31e5d75483d70344ec0fbecdf2ba935f20deb695bd168e0badd90493102cc
+size 2442266
diff --git a/scalingautoregressivevideomodels/layout.json b/scalingautoregressivevideomodels/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..54e5b1a8cc424b7828e6ed5a6f3a118e3021b12a
--- /dev/null
+++ b/scalingautoregressivevideomodels/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:4eeee79ecf3c7c4ef805fcf3f3acafa0e9a8db9efe840d345e80498c3aafd3e0
+size 540326
diff --git a/selflabellingviasimultaneousclusteringandrepresentationlearning/004bc706-3508-40d3-9c66-d5259c84ed22_content_list.json b/selflabellingviasimultaneousclusteringandrepresentationlearning/004bc706-3508-40d3-9c66-d5259c84ed22_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..1e587c1d1f617f66fb90d91935c5a8d140c12e85
--- /dev/null
+++ b/selflabellingviasimultaneousclusteringandrepresentationlearning/004bc706-3508-40d3-9c66-d5259c84ed22_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:08b640e4d3c89b21b180244589a74736862205165c12312cf6580e3defc4ab4b
+size 145538
diff --git a/selflabellingviasimultaneousclusteringandrepresentationlearning/004bc706-3508-40d3-9c66-d5259c84ed22_model.json b/selflabellingviasimultaneousclusteringandrepresentationlearning/004bc706-3508-40d3-9c66-d5259c84ed22_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..820950333d689d2b1965db3ae33563ea3987a8e3
--- /dev/null
+++ b/selflabellingviasimultaneousclusteringandrepresentationlearning/004bc706-3508-40d3-9c66-d5259c84ed22_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b86c45646403f1a20c16387851fd28aaad93028a90504e443c9150e0986ea492
+size 158310
diff --git a/selflabellingviasimultaneousclusteringandrepresentationlearning/004bc706-3508-40d3-9c66-d5259c84ed22_origin.pdf b/selflabellingviasimultaneousclusteringandrepresentationlearning/004bc706-3508-40d3-9c66-d5259c84ed22_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..e50b08b084effa02d92c011d3ca55ce036c8eb5f
--- /dev/null
+++ b/selflabellingviasimultaneousclusteringandrepresentationlearning/004bc706-3508-40d3-9c66-d5259c84ed22_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ede248ecbda1b5507c8fb7778fe1dc3635973b77ddfa72f1af4c3d20be40858c
+size 14085181
diff --git a/selflabellingviasimultaneousclusteringandrepresentationlearning/full.md b/selflabellingviasimultaneousclusteringandrepresentationlearning/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..e721e382116ff39f76a4f96f042666672f643c9a
--- /dev/null
+++ b/selflabellingviasimultaneousclusteringandrepresentationlearning/full.md
@@ -0,0 +1,601 @@
+# SELF-LABELLING VIA SIMULTANEOUS CLUSTERING AND REPRESENTATION LEARNING
+
+Yuki M. Asano
+
+Christian Rupprecht
+
+Andrea Vedaldi
+
+Visual Geometry Group
+
+University of Oxford
+
+{yuki, chrisr, vedaldi} @robots.ox.ac.uk
+
+# ABSTRACT
+
+Combining clustering and representation learning is one of the most promising approaches for unsupervised learning of deep neural networks. However, doing so naively leads to ill posed learning problems with degenerate solutions. In this paper, we propose a novel and principled learning formulation that addresses these issues. The method is obtained by maximizing the information between labels and input data indices. We show that this criterion extends standard cross-entropy minimization to an optimal transport problem, which we solve efficiently for millions of input images and thousands of labels using a fast variant of the Sinkhorn-Knopp algorithm. The resulting method is able to self-label visual data so as to train highly competitive image representations without manual labels. Our method achieves state of the art representation learning performance for AlexNet and ResNet-50 on SVHN, CIFAR-10, CIFAR-100 and ImageNet and yields the first self-supervised AlexNet that outperforms the supervised Pascal VOC detection baseline. Code and models are available1.
+
+# 1 INTRODUCTION
+
+Learning from unlabelled data can dramatically reduce the cost of deploying machine learning algorithms to new applications, thus amplifying their impact in the real world. Self-supervision is an increasingly popular framework for learning without labels. The idea is to define pretext learning tasks that can be constructed from raw data alone, but that still result in neural networks that transfer well to useful applications.
+
+Much of the research in self-supervision has focused on designing new pretext tasks. However, given supervised data such as ImageNet (Deng et al., 2009), the standard classification objective of minimizing the cross-entropy loss still results in better or at least as good pre-training than any of such methods (for a given amount of data and for a given model complexity). This suggests that the task of classification is sufficient for pre-training networks, provided that suitable data labels are available. In this paper, we thus focus on the problem of obtaining the labels automatically by designing a self-labelling algorithm.
+
+Learning a deep neural network together while discovering the data labels can be viewed as simultaneous clustering and representation learning. The latter can be approached by combining cross-entropy minimization with an off-the-shelf clustering algorithm such as $K$ -means. This is precisely the approach adopted by the recent DeepCluster method (Caron et al., 2018), which achieves excellent results in unsupervised representation learning. However, combining representation learning, which is a discriminative task, with clustering is not at all trivial. In particular, we show that the combination of cross-entropy minimization and $K$ -means as adopted by DeepCluster cannot be described as the optimization of an overall learning objective; instead, there exist degenerate solutions that the algorithm avoids via particular implementation choices.
+
+In order to address this technical shortcoming, in this paper, we contribute a new principled formulation for simultaneous clustering and representation learning. The starting point is to minimize a single loss, the cross-entropy loss, for learning the deep network and for estimating the data labels. This
+
+is often done in semi-supervised learning and multiple instance learning. However, when applied naively to the unsupervised case, it immediately leads to a degenerate solution where all data points are mapped to the same cluster.
+
+We solve this issue by adding the constraint that the labels must induce an equipartition of the data, which we show maximizes the information between data indices and labels. We also show that the resulting label assignment problem is the same as optimal transport, and can therefore be solved in polynomial time by linear programming. However, since we want to scale the algorithm to millions of data points and thousands of labels, standard transport solvers are inadequate. Thus, we also propose to use a fast version of the Sinkhorn-Knopp algorithm for finding an approximate solution to the transport problem efficiently at scale, using fast matrix-vector algebra.
+
+Compared to methods such as DeepCluster, the new formulation is more principled and allows to more easily demonstrate properties of the method such as convergence. Most importantly, via extensive experimentation, we show that our new approach leads to significantly superior results than DeepCluster, achieving the new state of the art for representation learning approaches. In fact, the method's performance surpasses others that use a single type of supervisory signal for self-supervision, and is on par or better than very recent contributions as well (Tian et al., 2019; He et al., 2019; Misra & van der Maaten, 2019; Oord et al., 2018).
+
+# 2 RELATED WORK
+
+Our paper relates to two broad areas of research: (a) self-supervised representation learning, and (b) more specifically, training a deep neural network using pseudo-labels, i.e. the assignment of a label to each image. We discuss closely related works for each.
+
+Self-supervised learning: A wide variety of methods that do not require manual annotations have been proposed for the self-training of deep convolutional neural networks. These methods use various cues and proxy tasks namely, in-painting (Pathak et al., 2016), patch context and jigsaw puzzles (Doersch et al., 2015; Noroozi & Favaro, 2016; Noroozi et al., 2018; Mundhenk et al., 2017), clustering (Caron et al., 2018; Huang et al., 2019; Zhuang et al., 2019; Bautista et al., 2016), noise-as-targets (Bojanowski & Joulin, 2017), colorization (Zhang et al., 2016; Larsson et al., 2017), generation (Jenni & Favaro, 2018; Ren & Lee, 2018; Donahue et al., 2017; Donahue & Simonyan, 2019), geometry (Dosovitskiy et al., 2016), predicting transformations (Gidaris et al., 2018; Zhang et al., 2019) and counting (Noroozi et al., 2017). Most recently, contrastive methods have shown great performance gains, (Oord et al., 2018; Henaff et al., 2019; Tian et al., 2019; He et al., 2019) by leveraging augmentation and adequate losses. In (Feng et al., 2019), predicting rotation (Gidaris et al., 2018) is combined with instance retrieval (Wu et al., 2018) and multiple tasks are combined in (Doersch & Zisserman, 2017).
+
+Pseudo-labels for images: In the self-supervised domain, we find a spectrum of methods that either give each data point a unique label (Wu et al., 2018; Dosovitskiy et al., 2016) or train on a flexible number of labels with $K$ -means (Caron et al., 2018), with mutual information (Ji et al., 2018) or with noise (Bojanowski & Joulin, 2017). In (Noroozi et al., 2018) a large network is trained with a pretext task and a smaller network is trained via knowledge transfer of the clustered data. Finally, (Bach & Harchaoui, 2008; Vo et al., 2019) use convex relaxations to regularized affine-transformation invariant linear clustering, but can not scale to larger datasets.
+
+Our contribution is a simple method that combines a novel pseudo-label extraction procedure from raw data alone and the training of a deep neural network using a standard cross-entropy loss.
+
+# 3 METHOD
+
+We will first derive our self-labelling method, then interpret the method as optimizing labels and targets of a cross-entropy loss and finally analyze similarities and differences with other clustering-based methods.
+
+# 3.1 SELF-LABELLING
+
+Neural network pre-training is often achieved via a supervised data classification task. Formally, consider a deep neural network $\pmb{x} = \Phi(I)$ mapping data $I$ (e.g. images) to feature vectors $\pmb{x} \in \mathbb{R}^D$ . The model is trained using a dataset (e.g. ImageNet) of $N$ data points $I_1, \ldots, I_N$ with corresponding
+
+labels $y_{1},\ldots ,y_{N}\in \{1,\ldots ,K\}$ , drawn from a space of $K$ possible labels. The representation is followed by a classification head $h:\mathbb{R}^D\to \mathbb{R}^K$ , usually consisting of a single linear layer, converting the feature vector into a vector of class scores. The class scores are mapped to class probabilities via the softmax operator:
+
+$$
+p (y = \cdot | \boldsymbol {x} _ {i}) = \operatorname {s o f t m a x} (h \circ \Phi (\boldsymbol {x} _ {i})).
+$$
+
+The model and head parameters are learned by minimizing the average cross-entropy loss
+
+$$
+E (p \mid y _ {1}, \dots , y _ {N}) = - \frac {1}{N} \sum_ {i = 1} ^ {N} \log p \left(y _ {i} \mid \boldsymbol {x} _ {i}\right). \tag {1}
+$$
+
+Training with objective (1) requires a labelled dataset. When labels are unavailable, we require a self-labelling mechanism to assign the labels automatically.
+
+In semi-supervised learning, self-labelling is often achieved by jointly optimizing (1) with respect to the model $h \circ \Phi$ and the labels $y_{1}, \ldots, y_{N}$ . This can work if at least part of the labels are known, thus constraining the optimization. However, in the fully unsupervised case, it leads to a degenerate solution: eq. (1) is trivially minimized by assigning all data points to a single (arbitrary) label.
+
+To address this issue, we first rewrite eq. (1) by encoding the labels as posterior distributions $q(y|\pmb{x}_i)$ :
+
+$$
+E (p, q) = - \frac {1}{N} \sum_ {i = 1} ^ {N} \sum_ {y = 1} ^ {K} q (y | \boldsymbol {x} _ {i}) \log p (y | \boldsymbol {x} _ {i}). \tag {2}
+$$
+
+If we set the posterior distributions $q(y|\boldsymbol{x}_i) = \delta(y - y_i)$ to be deterministic, the formulations in eqs. (1) and (2) are equivalent, in the sense that $E(p,q) = E(p|y_1,\ldots,y_N)$ . In this case, optimizing $q$ is the same as reassigning the labels, which leads to the degeneracy. To avoid this, we add the constraint that the label assignments must partition the data in equally-sized subsets. Formally, the learning objective objective $^2$ is thus:
+
+$$
+\min _ {p, q} E (p, q) \quad \text {s u b j e c t} \quad \forall y: q \left(y \mid \boldsymbol {x} _ {i}\right) \in \{0, 1 \} \text {a n d} \sum_ {i = 1} ^ {N} q \left(y \mid \boldsymbol {x} _ {i}\right) = \frac {N}{K}. \tag {3}
+$$
+
+The constraints mean that each data point $\pmb{x}_i$ is assigned to exactly one label and that, overall, the $N$ data points are split uniformly among the $K$ classes.
+
+The objective in eq. (3) is combinatorial in $q$ and thus may appear very difficult to optimize. However, this is an instance of the optimal transport problem, which can be solved relatively efficiently. In order to see this more clearly, let $P_{yi} = p(y|\boldsymbol{x}_i)\frac{1}{N}$ be the $K\times N$ matrix of joint probabilities estimated by the model. Likewise, let $Q_{yi} = q(y|\boldsymbol{x}_i)\frac{1}{N}$ be $K\times N$ matrix of assigned joint probabilities. Using the notation of (Cuturi, 2013), we relax matrix $Q$ to be an element of the transportation polytope
+
+$$
+U (r, c) := \left\{Q \in \mathbb {R} _ {+} ^ {K \times N} \mid Q \mathbb {1} = r, Q ^ {\top} \mathbb {1} = c \right\}. \tag {4}
+$$
+
+Here $\mathbb{1}$ are vectors of all ones of the appropriate dimensions, so that $r$ and $c$ are the marginal projections of matrix $Q$ onto its rows and columns, respectively. In our case, we require $Q$ to be a matrix of conditional probability distributions that split the data uniformly, which is captured by:
+
+$$
+r = \frac {1}{K} \cdot \mathbb {1}, \quad c = \frac {1}{N} \cdot \mathbb {1}.
+$$
+
+With this notation, we can rewrite the objective function in eq. (3), up to a constant shift, as
+
+$$
+E (p, q) + \log N = \langle Q, - \log P \rangle , \tag {5}
+$$
+
+where $\langle \cdot \rangle$ is the Frobenius dot-product between two matrices and log is applied element-wise. Hence optimizing eq. (3) with respect to the assignments $Q$ is equivalent to solving the problem:
+
+$$
+\min _ {Q \in U (r, c)} \langle Q, - \log P \rangle . \tag {6}
+$$
+
+This is a linear program, and can thus be solved in polynomial time. Furthermore, solving this problem always leads to an integral solution despite having relaxed $Q$ to the continuous polytope $U(r,c)$ , guaranteeing the exact equivalence to the original problem.
+
+In practice, however, the resulting linear program is large, involving millions of data points and thousands of classes. Traditional algorithms to solve the transport problem scale badly to instances of this size. We address this issue by adopting a fast version (Cuturi, 2013) of the Sinkhorn-Knopp algorithm. This amounts to introducing a regularization term
+
+$$
+\min _ {Q \in U (r, c)} \left\langle Q, - \log P \right\rangle + \frac {1}{\lambda} \operatorname {K L} (Q \| r c ^ {\top}), \tag {7}
+$$
+
+where KL is the Kullback-Leibler divergence and $rc^{\top}$ can be interpreted as a $K\times N$ probability matrix. The advantage of this regularization term is that the minimizer of eq. (7) can be written as:
+
+$$
+Q = \operatorname {d i a g} (\alpha) P ^ {\lambda} \operatorname {d i a g} (\beta) \tag {8}
+$$
+
+where exponentiation is meant element-wise and $\alpha$ and $\beta$ are two vectors of scaling coefficients chosen so that the resulting matrix $Q$ is also a probability matrix (see (Cuturi, 2013) for a derivation). The vectors $\alpha$ and $\beta$ can be obtained, as shown below, via a simple matrix scaling iteration.
+
+For very large $\lambda$ , optimizing eq. (7) is of course equivalent to optimizing eq. (6), but even for moderate values of $\lambda$ the two objectives tend to have approximately the same optimizer (Cuturei, 2013). Choosing $\lambda$ trades off convergence speed with closeness to the original transport problem. In our case, using a fixed $\lambda$ is appropriate as we are ultimately interested in the final clustering and representation learning results, rather than in solving the transport problem exactly.
+
+Our final algorithm's core can be described as follows. We learn a model $h \circ \Phi$ and a label assignment matrix $Q$ by solving the optimization problem eq. (6) with respect to both $Q$ , which is a probability matrix, and the model $h \circ \Phi$ , which determines the predictions $P_{yi} = \operatorname{softmax}_y(h \circ \Phi(\boldsymbol{x}_i))$ . We do so by alternating the following two steps:
+
+Step 1: representation learning. Given the current label assignments $Q$ , the model is updated by minimizing eq. (6) with respect to (the parameters of) $h \circ \Phi$ . This is the same as training the model using the common cross-entropy loss for classification.
+
+Step 2: self-labelling. Given the current model $h \circ \Phi$ , we compute the log probabilities $P$ . Then, we find $Q$ using eq. (8) by iterating the updates (Cuturi, 2013)
+
+$$
+\forall y: \alpha_ {y} \leftarrow [ P ^ {\lambda} \beta ] _ {y} ^ {- 1} \qquad \forall i: \beta_ {i} \leftarrow [ \alpha^ {\top} P ^ {\lambda} ] _ {i} ^ {- 1}.
+$$
+
+Each update involves a single matrix-vector multiplication with complexity $\mathcal{O}(NK)$ , so it is relatively quick even for millions of data points and thousands of labels and so the cost of this method scales linearly with the number of images $N$ . In practice, convergence is reached within 2 minutes on ImageNet when computed on a GPU. Also, note that the parameters $\alpha$ and $\beta$ can be retained between steps, thus allowing a warm start of Step 2.
+
+# 3.2 INTERPRETATION
+
+As shown above, the formulation in eq. (2) uses scaled versions of the probabilities. We can interpret these by treating the data index $i$ as a random variable with uniform distribution $p(i) = 1 / N$ and by rewriting the posteriors $p(y|\pmb{x}_i) = p(y|i)$ and $q(y|\pmb{x}_i) = q(y|i)$ as conditional distributions with respect to the data index $i$ instead of the feature vector $\pmb{x}_i$ . With these changes, we can rewrite eq. (5) as
+
+$$
+E (p, q) + \log N = - \sum_ {i = 1} ^ {N} \sum_ {y = 1} ^ {K} q (y, i) \log p (y, i) = H (q, p), \tag {9}
+$$
+
+which is the cross-entropy between the joint label-index distributions $q(y, i)$ and $p(y, i)$ . The minimum of this quantity w.r.t. $q$ is obtained when $p = q$ , in which case $E(q, q) + \log N$ reduces to the entropy $H_{q}(y, i)$ of the random variables $y$ and $i$ . Additionally, since we assumed that $q(i) = 1 / N$ , the marginal entropy $H_{q}(i) = \log N$ is constant and, due to the equipartition condition $q(y) = 1 / K$ , $H_{q}(y) = \log K$ is also constant. Subtracting these two constants from the entropy yields:
+
+$$
+\min _ {p} E (p, q) + \log N = E (q, q) + \log N = H _ {q} (y, i) = H _ {q} (y) + H _ {q} (i) - I _ {q} (y, i) = \mathrm {c o n s t .} - I _ {q} (y, i).
+$$
+
+Thus we see that minimizing $E(p, q)$ is the same as maximizing the mutual information between the label $y$ and the data index $i$ .
+
+In our formulation, the maximization above is carried out under the equipartition constraint. We can instead relax this constraint and directly maximize the information $I(y,i)$ . However, by rewriting information as the difference $I(y,i) = H(y) - H(y|i)$ , we see that the optimal solution is given by $H(y|i) = 0$ , which states each data point $i$ is associated to only one label deterministically, and by $H(y) = \ln K$ , which is another way of stating the equipartition condition.
+
+In other words, our learning formulation can be interpreted as maximizing the information between data indices and labels while explicitly enforcing the equipartition condition, which is implied by maximizing the information in any case. Compared to minimizing the entropy alone, maximizing information avoids degenerate solutions as the latter carry no mutual information between labels $y$ and indices $i$ . Similar considerations can be found in (Ji et al., 2018).
+
+# 3.3 RELATIONTO SIMULTANEOUS REPRESENTATION LEARNING AND CLUSTERING
+
+In the discussion above, self-labelling amounts to assigning discrete labels to data and can thus be interpreted as clustering. Most of the traditional clustering approaches are generative. For example, $K$ -means takes a dataset $x_{1},\ldots ,x_{N}$ of vectors and partitions it into $K$ classes in order to minimize the reconstruction error
+
+$$
+E \left(\boldsymbol {\mu} _ {1}, \dots , \boldsymbol {\mu} _ {K}, y _ {1}, \dots , y _ {N}\right) = \frac {1}{N} \sum_ {i = 1} ^ {N} \left\| \boldsymbol {x} _ {i} - \boldsymbol {\mu} _ {y _ {i}} \right\| ^ {2} \tag {10}
+$$
+
+where $y_{i}\in \{1,\ldots ,K\}$ are the data-to-cluster assignments and $\mu_y$ are means approximating the vectors in the corresponding clusters. The $K$ -means energy can thus be interpreted as the average data reconstruction error.
+
+It is natural to ask whether a clustering method such as $K$ -means, which is based on approximating the input data, could be combined with representation learning, which uses a discriminative objective. In this setting, the feature vectors $\boldsymbol{x} = \Phi(I)$ are extracted by the neural network $\Phi$ from the input data $I$ . Unfortunately, optimizing a loss such as eq. (10) with respect to the clustering and representation parameters is meaningless: in fact, the obvious solution is to let the representation send all the data points to the same constant feature vector and setting all the means to coincide with it, in which case the $K$ -means reconstruction error is zero (and thus minimal).
+
+Nevertheless, DeepCluster (Caron et al., 2018) does successfully combine $K$ -means with representation learning. DeepCluster can be related to our approach as follows. Step 1 of the algorithm, namely representation learning via cross-entropy minimization, is exactly the same. Step 2, namely self-labelling, differs: where we solve an optimal transport problem to obtain the pseudo-labels, they do so by running $K$ -means on the feature vectors extracted by the neural network.
+
+DeepCluster does have an obvious degenerate solution: we can assign all data points to the same label and learn a constant representation, achieving simultaneously a minimum of the cross-entropy loss in Step 1 and of the $K$ -means loss in Step 2. The reason why DeepCluster avoids this pitfall is due to the particular interaction between the two steps. First, during Step 2, the features $\boldsymbol{x}_i$ are fixed so $K$ -means cannot pull them together. Instead, the means spread to cover the features as they are, resulting in a balanced partitioning. Second, during the classification step, the cluster assignments $y_i$ are fixed, and optimizing the features $\boldsymbol{x}_i$ with respect to the cross-entropy loss tends to separate them. Lastly, the method in (Caron et al., 2018) also uses other heuristics such as sampling the training data inversely to their associated clusters' size, leading to further regularization.
+
+However, a downside of DeepCluster is that it does not have a single, well-defined objective to optimize, which means that it is difficult to characterize its convergence properties. By contrast, in our formulation, both Step 1 and Step 2 optimize the same objective, with the advantage that convergence to a (local) optimum is guaranteed.
+
+# 3.4 AUGMENTING SELF-LABELLING VIA DATA TRANSFORMATIONS
+
+Methods such as DeepCluster extend the training data via augmentations. In vision problems, this amounts to (heavily) distorting and cropping the input images at random. Augmentations are applied so that the neural network is encouraged to learn a labelling function which is transformation invariant.
+
+In practice, this is crucial to learn good clusters and representations, so we adopt it here. This is achieved by setting $P_{yi} = \mathbb{E}_t[\log \mathrm{softmax}_y h\circ \Phi (tx_i)]$ where the transformations $t$ are sampled at random. In practice, in Step 1 (representation learning), this is implemented via the application of the random transformations to data batches during optimization via SGD, which is corresponds to the usual data augmentation scheme for deep neural networks. As noted in (YM. et al., 2020), and as can be noted by an analysis of recent publications (Hénaff et al., 2019; Tian et al., 2019; Misra & van der Maaten, 2019), augmentation is critical for good performance.
+
+# 3.5 MULTIPLE SIMULTANEOUS SELF-LABELINGS
+
+Intuitively, the same data can often be clustered in many equally good ways. For example, visual objects can be clustered by color, size, typology, viewpoint, and many other attributes. Since our main objective is to use clustering to learn a good data representation $\Phi$ , we consider a multi-task setting in which the same representation is shared among several different clustering tasks, which can potentially capture different and complementary clustering axis.
+
+In our formulation, this is easily achieved by considering multiple heads (Ji et al., 2018) $h_1,\ldots ,h_T$ , one for each of $T$ clustering tasks (which may also have a different number of labels). Then, we optimize a sum of objective functions of the type eq. (6), one for each task, while sharing the parameters of the feature extractor $\Phi$ among them.
+
+# 4 EXPERIMENTS
+
+In this section, we evaluate the quality of the representations learned by our Self Labelling (SeLa) technique. We first test variants of our method, including ablating its components, in order to find an optimal configuration. Then, we compare our results to the state of the art in self-supervised representation learning, where we find that our method is the best among clustering-based techniques and overall state-of-the-art or at least highly competitive in many benchmarks. In the appendix, we also show qualitatively that the labels identified by our algorithm are usually meaningful and group visually similar concepts in the same clusters, often even capturing whole ImageNet classes.
+
+# 4.1 SETUP
+
+Linear probes. In order to quantify if a neural network has learned useful feature representations, we follow the standard approach of using linear probes (Zhang et al., 2017). This amounts to solving a difficult task, such as ImageNet classification, by training a linear classifier on top of a pre-trained feature representation, which is kept fixed. Linear classifiers heavily rely on the quality of the representation since their discriminative power is low. We apply linear probes to all intermediate convolutional blocks of representative networks. While linear probes are conceptually straightforward, there are several technical details that can affect the final accuracy, so we follow the standard protocol further outlined in the Appendix.
+
+Data. For training data we consider ImageNet LSVRC-12 (Deng et al., 2009) and other smaller scale datasets. We also test our features by transferring them to MIT Places (Zhou et al., 2014). All of these are standard benchmarks for evaluation in self-supervised learning.
+
+Architectures. Our base encoder architecture is AlexNet (Krizhevsky et al., 2012), since this is the most frequently used in other self-supervised learning works for the purpose of benchmarking. We inject the probes right after the ReLU layer in each of the five blocks, and denote these entry points conv1 to conv5. Furthermore, since the conv1 and conv2 can be learned effectively from data augmentations alone (YM. et al., 2020), we focus the analysis on the deeper layers conv2 to conv5 which are more sensitive to the quality of the learning algorithm. In addition to AlexNet, we also test ResNet-50 (He et al., 2016) models. Further experimental details are given in the Appendix.
+
+# 4.2 OPTIMAL CONFIGURATION AND ABLATIONS
+
+In tables 1 and 5, we first validate various modelling and configuration choices. Two key hyperparameters are the number of clusters $K$ and the number of clustering heads $T$ , which we denote in the experiments below with the shorthand "SeLa[K \times T]". We run SeLa by alternating steps 1 and 2 as described in section 3.1. Step 1 amounts to standard CE training, which we run for a fixed number of epochs. Step 2 can be interleaved at any point in the optimization; to amortize its cost, we run it
+
+Table 1: Ablation: number of self-labelling steps.
+
+| Method | #opt. | c3 | c4 | c5 |
| SeLa [3k × 1] | 0 | 20.8 | 18.3 | 13.4 |
| SeLa [3k × 1] | 40 | 42.7 | 43.4 | 39.2 |
| SeLa [3k × 1] | 80 | 43.0 | 44.7 | 40.9 |
| SeLa [3k × 1] | 160 | 42.4 | 44.6 | 40.7 |
+
+Table 2: Number of clusters $K$
+
+| Method | c3 | c4 | c5 |
| SeLa [1k × 1] | 40.1 | 42.1 | 38.8 |
| SeLa [3k × 1] | 43.0 | 44.7 | 40.9 |
| SeLa [5k × 1] | 42.5 | 43.9 | 40.2 |
| SeLa [10k × 1] | 42.2 | 43.8 | 39.7 |
+
+Table 3: Ablation: number of heads $T$ . (c4 for AlexNet)
+
+| Method | Architecture | Top-1 |
| SeLa [3k × 1] | AlexNet | 44.7 |
| SeLa [3k × 10] | AlexNet | 46.7 |
| SeLa [3k × 1] | ResNet-50 | 51.8 |
| SeLa [3k × 10] | ResNet-50 | 61.5 |
+
+Table 4: Different architectures.
+
+| Method | Architecture | Top-1 |
| SeLa [3k × 1] AlexNet (small) | 41.3 | |
| SeLa [3k × 1] AlexNet | 44.7 | |
| SeLa [3k × 1] ResNet-50 | 51.8 | |
+
+Table 5: Label transfer.
+
+| Method | Source (Top-1) | Target (Top-1) |
| SeLa [3k × 10] | AlexNet (46.7) | AlexNet (46.5) |
| SeLa [3k × 1] | ResNet-50 (51.8) | AlexNet (45.0) |
| SeLa [3k × 10] | ResNet-50 (61.5) | AlexNet (48.4) |
+
+at most once per epoch, and usually less, with a schedule described and validated below. For these experiments, we train the representation and the linear probes on ImageNet.
+
+Number of clusters $K$ . Table 2, compares different values for $K$ : moving from 1k to 3k improves the results, but larger numbers decrease the quality slightly.
+
+Ablation: number of heads $T$ . Table 3 shows that increasing the number of heads from $T = 1$ to $T = 10$ yields a large performance gain: $+2\%$ for AlexNet and $+10\%$ for ResNet. The latter more expressive model appears to benefit more from a more diverse training signal.
+
+Ablation: number of self-labelling iterations. First, in table 1, we show that self-labelling (step 2) is essential for good performance, as opposed to only relying on the initial random label assignments and the data augmentations. For this, we vary the number of times the self-labelling algorithm (step 2) is run during training (#opts), from zero to once per step 1 epoch. We see that self-labelling is essential, with the best value around 80 (for 160 step 1 epochs in total).
+
+Architectures. Table 4 compares a smaller variant of AlexNet which uses (64, 192) filters in its first two convolutional layers (Krizhevsky, 2014), to the standard variant with (96, 256) (Krizhevsky et al., 2012), all the way to a ResNet-50. SeLa works well in all cases, for large models such as ResNet but also smaller ones such as AlexNet, for which methods such as BigBiGAN (Donahue & Simonyan, 2019) or CPC (Hénaff et al., 2019) are unsuitable.
+
+# 4.3 LABEL TRANSFER
+
+An appealing property of SeLa is that the label it assigns to the images can be used to train another model from scratch, using standard supervised training. For instance, table 5 shows that, given the labels assigned by applying SeLa to AlexNet, we can re-train AlexNet from scratch using a shorter 90-epochs schedule with achieving the same final accuracy. This shows that the quality of the learned representation depends only on the final label assignment, not on the fact that the representation is learned jointly with the labels. More interestingly, we can transfer labels between different architectures. For example, the labels obtained by applying SeLa $[3k \times 1]$ and SeLa $[3k \times 10]$ to ResNet-50 can be used to train a better AlexNet model than applying SeLa to the latter directly. For this reason, we publish on our website the self-labels for the ImageNet dataset in addition to the code and trained models.
+
+# 4.4 SMALL-SCALE DATASETS
+
+Here, we evaluate our method on relatively simple and small datasets, namely CIFAR-10/100 (Krizhevsky et al., 2009) and SVHN (Netzer et al., 2011). For this, we follow the experimental and evaluation protocol from the current state of the art in self-supervised learning in these datasets, AND (Huang et al., 2019). In table 6, we compare our method with the settings $[128 \times 10]$ for CIFAR-10, $[512 \times 10]$ for CIFAR-100 and $[128 \times 1]$ for SVHN to other published methods; details on the evaluation method are provided in the appendix. We observe that our proposed method outperforms the best previous method by $5.8\%$ for CIFAR-10, by $9.5\%$ for CIFAR-100 and by $0.8\%$ for SVHN when training a linear classifier on top of the frozen network. The relatively minor gains on SVHN can be explained by the fact that the gap between the supervised
+
+Table 6: Nearest Neighbour and linear classification evaluation on small datasets using AlexNet. Results of previous methods are taken from (Huang et al., 2019).
+
+| Method | Dataset |
| CIFAR-10 | CIFAR-100 | SVHN |
| Classifier/Feature | Linear Classifier / conv5 |
| Supervised | 91.8 | 71.0 | 96.1 |
| Counting | 50.9 | 18.2 | 63.4 |
| DeepCluster | 77.9 | 41.9 | 92.0 |
| Instance | 70.1 | 39.4 | 89.3 |
| AND | 77.6 | 47.9 | 93.7 |
| SL | 83.4 | 57.4 | 94.5 |
| Classifier/Feature | Weighted kNN / FC |
| Supervised | 91.9 | 69.7 | 96.5 |
| Counting | 41.7 | 15.9 | 43.4 |
| DeepCluster | 62.3 | 22.7 | 84.9 |
| Instance | 60.3 | 32.7 | 79.8 |
| AND | 74.8 | 41.5 | 90.9 |
| SL | 77.6 | 44.2 | 92.8 |
+
+Table 7: PASCAL VOC finetuning. VOC07-Classification %mAP, VOC07-Detection %mAP and VOC12-Segmentation %mIU. * denotes a larger AlexNet variant.
+
+| Method | PASCAL
+Cls. | VOC Task |
| fc6-8 | all | Det. | Seg. |
| ImageNet labels | 78.9 | 79.9 | 59.1 | 48.0 |
| Random | - | 53.3 | 43.4 | - |
| Random Rescaled | - | 56.6 | 45.6 | 32.6 |
| BiGAN | 52.3 | 60.1 | 46.9 | 35.2 |
| Context* | 55.1 | 65.3 | 51.1 | - |
| Context 2 | - | 69.6 | 55.8 | 41.4 |
| CC+VGG | - | 72.5 | 56.5 | 42.6 |
| RotNet | 70.9 | 73.0 | 54.4 | 39.1 |
| DeepCluster* | 72.0 | 73.4 | 55.4 | 45.1 |
| RotNet+retrieval* | 72.5 | 74.7 | 58.0 | 45.9 |
| SeLa* [3k × 10] | 73.1 | 75.3 | 55.9 | 43.7 |
| SeLa* [3k × 10]− | 74.4 | 75.9 | 57.8 | 44.7 |
| SeLa* [3k × 10]−+Rot | 75.6 | 77.2 | 59.2 | 45.7 |
+
+Table 8: Nearest Neighbour and linear classification evaluation using imbalanced CIFAR-10 training data. We evaluate on the normal CIFAR-10 test set and on CIFAR-100 to analyze the transferability of the features. Difference to the supervised baseline in parentheses. See section 4.5 for details.
+
+| Training data/Method | kNN | Linear/conv5 |
| CIFAR-10 | CIFAR-100 | CIFAR-10 | CIFAR-100 |
| CIFAR-10, full | | | | |
| Supervised | 92.1 | 24.0 | 90.2 | 54.2 |
| ours (K-means) [128 × 1] | 64.7 (-17.4) | 19.3 (-4.7) | 77.5 (-12.7) | 45.6 (-8.8) |
| ours (SK) [128 × 1] | 72.9 (-9.2) | 28.9 (+4.9) | 79.8 (-9.4) | 49.4 (-4.8) |
| CIFAR-10, light imbalance | | | | |
| Supervised | 92.0 | 24.0 | 90.4 | 53.6 |
| ours (K-means) [128 × 1] | 64.2 (-17.8) | 18.1 (-5.9) | 77.0 (-13.4) | 44.8 (-8.8) |
| ours (SK) [128 × 1] | 71.7 (-10.3) | 28.2 (+4.2) | 79.5 (-10.9) | 48.6 (-5.0) |
| CIFAR-10, heavy imbalance | | | | |
| Supervised | 86.7 | 22.6 | 86.8 | 51.4 |
| ours (K-means) [128 × 1] | 60.7 (-16.0) | 17.8 (-4.8) | 75.2 (-11.6) | 44.3 (-7.1) |
| ours (SK) [128 × 1] | 67.6 (-9.1) | 26.7 (+3.9) | 77.2 (-9.6) | 47.5 (-2.9) |
+
+baseline and the self-supervised results is already very small ( $< 3\%$ ). We also evaluate our method using weighted kNN using an embedding of size 128. We find that the proposed method consistently outperforms the previous state of the art by around $2\%$ across these datasets, even though AND is based on explicitly learning local neighbourhoods.
+
+# 4.5 IMBALANCED DATA EXPERIMENTS
+
+In order to understand if our equipartition regularization is affected by the underlying class distribution of a dataset, we perform multiple ablation experiments on artificially imbalanced datasets in table 8. We consider three training datasets based on CIFAR-10. The first is the original dataset with 5000 images for each class (full in table 8). Second, we remove $50\%$ of the images of one class (truck) while the rest remains untouched (light imbalance) and finally we remove $10\%$ of one class, $20\%$ of the second class and so on (heavy imbalance). On each of the three datasets we compare the performance of our method "ours (SK)" with a baseline that replaces our Sinkhorn-Knopp optimization with $K$ -means clustering "ours ( $K$ -means)". We also compare the performance to training a network under full supervision. The evaluation follows Huang et al. (2019) and is based on linear probing and kNN classification — both on CIFAR-10 and, to understand feature generalization, on CIFAR-100.
+
+Table 9: Linear probing evaluation - AlexNet. A linear classifier is trained on the (downsampled) activations of each layer in the pretrained model. We bold the best result in each layer and underline the second best. The best layer is highlighted in blue. * denotes a larger AlexNet variant. - refers to AlexNets trained with self-label transfer from a corresponding ResNet-50. "+"Rot" refers to retraining using labels and an additional RotNet loss, "+ more aug." includes further augmentation during retraining. See Table A.2 in the Appendix for a full version of this table and details.
+
+| Method | ILSVRC-12 | Places |
| c1 | c2 | c3 | c4 | c5 | c1 | c2 | c3 | c4 | c5 |
| ImageNet supervised, (Zhang et al., 2017) | 19.3 | 36.3 | 44.2 | 48.3 | 50.5 | 22.7 | 34.8 | 38.4 | 39.4 | 38.7 |
| Places supervised, (Zhang et al., 2017) | - | - | - | - | - | 22.1 | 35.1 | 40.2 | 43.3 | 44.6 |
| Random, (Zhang et al., 2017) | 11.6 | 17.1 | 16.9 | 16.3 | 14.1 | 15.7 | 20.3 | 19.8 | 19.1 | 17.5 |
| Inpainting, (Pathak et al., 2016) | 14.1 | 20.7 | 21.0 | 19.8 | 15.5 | 18.2 | 23.2 | 23.4 | 21.9 | 18.4 |
| BiGAN, (Donahue et al., 2017) | 17.7 | 24.5 | 31.0 | 29.9 | 28.0 | 22.0 | 28.7 | 31.8 | 31.3 | 29.7 |
| Instance retrieval, (Wu et al., 2018) | 16.8 | 26.5 | 31.8 | 34.1 | 35.6 | 18.8 | 24.3 | 31.9 | 34.5 | 33.6 |
| RotNet, (Gidaris et al., 2018) | 18.8 | 31.7 | 38.7 | 38.2 | 36.5 | 21.5 | 31.0 | 35.1 | 34.6 | 33.7 |
| AND*, (Huang et al., 2019) | 15.6 | 27.0 | 35.9 | 39.7 | 37.9 | - | - | - | - | - |
| CMC*, (Tian et al., 2019) | 18.4 | 33.5 | 38.1 | 40.4 | 42.6 | - | - | - | - | - |
| AET*, (Zhang et al., 2019) | 19.3 | 35.4 | 44.0 | 43.6 | 42.4 | 22.1 | 32.9 | 37.1 | 36.2 | 34.7 |
| RotNet+retrieval*, (Feng et al., 2019) | 20.8 | 35.2 | 41.8 | 44.3 | 44.4 | 24.0 | 33.8 | 37.5 | 39.3 | 38.9 |
| SeLa [3k × 10]* | 20.3 | 32.2 | 38.6 | 41.4 | 39.6 | 24.5 | 31.9 | 36.7 | 38.0 | 37.0 |
| SeLa [3k × 10]−+Rot* | 20.6 | 32.3 | 40.4 | 43.1 | 42.3 | 24.0 | 31.7 | 37.1 | 39.0 | 37.6 |
| SeLa [3k × 10]−+Rot*+more aug. | 19.2 | 32.6 | 40.8 | 44.4 | 44.7 | 21.1 | 30.4 | 36.5 | 37.9 | 37.3 |
| ImageNet supervised* | 21.6 | 37.2 | 46.9 | 52.9 | 54.4 | 22.6 | 33.2 | 39.0 | 41.3 | 39.7 |
| DeepCluster*, (Caron et al., 2018) | 13.4 | 32.3 | 41.0 | 39.6 | 38.2 | 23.8 | 32.8 | 37.3 | 36.0 | 31.0 |
| Local Agg.*, (Zhuang et al., 2019) | 18.7 | 32.7 | 38.1 | 42.3 | 42.4 | 18.7 | 32.7 | 38.2 | 40.3 | 39.5 |
| RotNet+retrieval*, (Feng et al., 2019) | 22.2 | 38.2 | 45.7 | 48.7 | 48.3 | 25.5 | 36.0 | 40.1 | 42.2 | 41.3 |
| SeLa [3k × 10]* | 22.5 | 37.4 | 44.7 | 47.1 | 44.1 | 26.7 | 34.9 | 39.9 | 41.8 | 39.7 |
| SeLa [3k × 10]−+Rot* | 22.8 | 37.8 | 46.7 | 49.7 | 48.4 | 26.8 | 35.5 | 41.0 | 43.0 | 41.3 |
| SeLa [3k × 10]−+Rot*+more aug. | 21.9 | 37.1 | 46.0 | 50.0 | 50.0 | 23.4 | 33.0 | 39.4 | 41.4 | 39.9 |
+
+To our surprise, we find that our method generalizes better to CIFAR-100 than the supervised baseline during kNN evaluation, potentially due to overfitting when training with labels. We also find that using SK optimization for obtaining pseudo-labels is always better than $K$ -means on all metrics and datasets. When comparing the imbalance settings, we find that under the light imbalance scenario, the methods' performances are ranked the same and no method is strongly affected by the imbalance. Under the heavy imbalance scenario, all methods drop in performance. However, compared to full data and light imbalance, the gap between supervised and self-supervised even decreases slightly for both $K$ -means and our method, indicating stronger robustness of self-supervised methods compared to a supervised one.
+
+In conclusion, our proposed method does not rely on the data to contain the same number of images for every class and outperforms a $K$ -means baseline even in very strong imbalance settings. This confirms the intuition that the equipartioning constraint acts as a regularizer and does not exploit the class distribution of the dataset.
+
+# 4.6 LARGE SCALE BENCHMARKS
+
+To compare to the state of the art and concurrent work, we evaluate several architectures using linear probes on public benchmark datasets.
+
+AlexNet. The main benchmark for feature learning methods is linear probing of an AlexNet trained on ImageNet. In table 9 we compare the performance across layers also on the Places dataset. We find that across both datasets our method outperforms DeepCluster and local Aggregation at every layer. From our ablation studies in tables 1-5 we also note that even our single head variant $[3k \times 1]$ outperforms both methods. Given that our method provides labels for a dataset that can be used for retraining a network quickly, we find that we can improve upon this initial performance. And by adopting a hybrid approach, similar to (Feng et al., 2019), of training an AlexNet with 10 heads and one additional head for computing the RotNet loss, we find further improvement. This result (SeLa
+
+Table 10: Linear evaluation - ResNet. A linear layer is trained on top of the global average pooled features of ResNets. All evaluations use a single centred crop. We have separated much larger architectures such as RevNet-50×4 and ResNet-161. Methods in brackets use a augmentation policy learned from supervised training and methods with * are not explicit about which further augmentations they use. See Table A.3 in the Appendix for a full version of this table.
+
+| Method | Architecture | Top-1 | Top-5 |
| Supervised, (Donahue & Simonyan, 2019) | ResNet-50 | 76.3 | 93.1 |
| Jigsaw, (Kolesnikov et al., 2019) | ResNet-50 | 38.4 | - |
| Rotation, (Kolesnikov et al., 2019) | ResNet-50 | 43.8 | - |
| CPC, (Oord et al., 2018) | ResNet-101 | 48.7 | 73.6 |
| BigBiGAN, (Donahue & Simonyan, 2019) | ResNet-50 | 55.4 | 77.4 |
| LocalAggregation, (Zhuang et al., 2019) | ResNet-50 | 60.2 | - |
| Efficient CPC v2.1, (Hénaff et al., 2019) | ResNet-50 | (63.8) | (85.3) |
| CMC, (Tian et al., 2019) | ResNet-50 | (64.1) | (85.4) |
| MoCo, (He et al., 2019) | ResNet-50 | 60.6 | - |
| PIRL, (Misra & van der Maaten, 2019)* | ResNet-50 | 63.6 | - |
| SeLa [3k × 10] | ResNet-50 | 61.5 | 84.0 |
| other architectures |
| MoCo, (He et al., 2019) | RevNet-50×4 | 68.6 | - |
| Efficient CPC v2.1, (Hénaff et al., 2019) | ResNet-161 | 71.5 | 90.1 |
+
+$[3\mathrm{k} \times 10]^{-} + \mathrm{Rot})$ achieves state of the art in unsupervised representation learning for AlexNet, with a gap of $1.3\%$ to the previous best performance on ImageNet and surpasses the ImageNet supervised baseline transferred to Places by $1.7\%$ .
+
+ResNet. Training better models than AlexNets is not yet standardized in the feature learning community. In Table 10 we compare a ResNet-50 trained with our method to other works. With top-1 accuracy of 61.5, we outperform than all other methods including Local Aggregation, CPCv1 and MoCo that use the same level of data augmentation. We even outperform larger architectures such as BigBiGAN's RevNet-50x4 and reach close to the performance of models using AutoAugment-style transformations.
+
+# 4.7 FINE-TUNING: CLASSIFICATION, OBJECT DETECTION AND SEMANTIC SEGMENTATION
+
+Finally, since pre-training is usually aimed at improving down-stream tasks, we evaluate the quality of the learned features by fine-tuning the model for three distinct tasks on the PASCAL VOC benchmark. In Table 7 we compare results with regard to multi-label classification, object detection and semantic segmentation on PASCAL VOC (Everingham et al., 2010).
+
+As in the linear probe experiments, we find our method better than the current state of the art in detection and classification with both fine-tuning only the last fully connected layers and when fine-tuning the whole network ("all". Notably, our fine-tuned AlexNet outperforms its supervised ImageNet baseline on the VOC detection task. Also for segmentation the method is very close $(0.2\%)$ to the best performing method. This shows that our trained network does not only learn useful feature representations but is also able to perform well when fine-tuned on actual down-stream tasks.
+
+# 5 CONCLUSION
+
+We present a self-supervised feature learning method that is based on clustering. In contrast to other methods, ours optimizes the same objective during feature learning and during clustering. This becomes possible through a weak assumption that the number of samples should be equal across clusters. This constraint is explicitly encoded in the label assignment step and can be solved for efficiently using a modified Sinkhorn-Knopp algorithm. Our method outperforms all other feature learning approaches and achieves SOTA on SVHN, CIFAR-10/100 and ImageNet for AlexNet and ResNet-50. By virtue of the method, the resulting self-labels can be used to quickly learn features for new architectures using simple cross-entropy training.
+
+# ACKNOWLEDGMENTS
+
+Yuki Asano gratefully acknowledges support from the EPSRC Centre for Doctoral Training in Autonomous Intelligent Machines & Systems (EP/L015897/1). We are also grateful to ERC IDIU-638009, AWS Machine Learning Research Awards (MLRA) and the use of the University of Oxford Advanced Research Computing (ARC).
+
+# REFERENCES
+
+Francis R. Bach and Zaid Harchaoui. Diffrac: a discriminative and flexible framework for clustering. In J. C. Platt, D. Koller, Y. Singer, and S. T. Roweis (eds.), Advances in Neural Information Processing Systems 20, pp. 49-56. Curran Associates, Inc., 2008. 2
+Philip Bachman, R Devon Hjelm, and William Buchwalter. Learning representations by maximizing mutual information across views. arXiv preprint arXiv:1906.00910, 2019. 18
+Miguel A Bautista, Artsiom Sanakoyeu, Ekaterina Tikhoncheva, and Björn Ommer. Clipecnn: Deep unsupervised exemplar learning. In Proceedings of the Conference on Advances in Neural Information Processing Systems (NIPS), pp. 3846-3854, 2016. 2
+Piotr Bojanowski and Armand Joulin. Unsupervised learning by predicting noise. In Proc. ICML, pp. 517-526. PMLR, 2017. 2
+M. Caron, P. Bojanowski, A. Joulin, and M. Douze. Deep clustering for unsupervised learning of visual features. In Proc. ECCV, 2018. 1, 2, 5, 9, 14, 15, 16, 17
+Marco Cuturi. Sinkhorn distances: Lightspeed computation of optimal transport. In Advances in neural information processing systems, pp. 2292-2300, 2013. 3, 4, 14
+J. Deng, W. Dong, R. Socher, L.-J. Li, K. Li, and L. Fei-Fei. Imagenet: A large-scale hierarchical image database. In Proc. CVPR, 2009. 1, 6
+Carl Doersch and Andrew Zisserman. Multi-task self-supervised visual learning. In Proc. ICCV, 2017. 2, 18
+Carl Doersch, Abhinav Gupta, and Alexei A Efros. Unsupervised visual representation learning by context prediction. In Proc. ICCV, pp. 1422-1430, 2015. 2, 17
+Jeff Donahue and Karen Simonyan. Large scale adversarial representation learning, 2019. 2, 7, 10, 18
+Jeff Donahue, Philipp Krahenbuhl, and Trevor Darrell. Adversarial feature learning. Proc. ICLR, 2017. 2, 9, 17
+A. Dosovitskiy, P. Fischer, J. T. Springenberg, M. Riedmiller, and T. Brox. Discriminative unsupervised feature learning with exemplar convolutional neural networks. IEEE PAMI, 38(9):1734-1747, Sept 2016. ISSN 0162-8828. doi: 10.1109/TPAMI.2015.2496141. 2
+Mark Everingham, Luc Van Gool, Christopher KI Williams, John Winn, and Andrew Zisserman. The Pascal visual object classes (voc) challenge. International journal of computer vision, 88(2): 303-338, 2010. 10
+Zeyu Feng, Chang Xu, and Dacheng Tao. Self-supervised representation learning by rotation feature decoupling. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 10364-10374, 2019. 2, 9, 17
+Spyros Gidaris, Praveen Singh, and Nikos Komodakis. Unsupervised representation learning by predicting image rotations. In Proc. ICLR, 2018. 2, 9, 17
+Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Identity mappings in deep residual networks. In European conference on computer vision, pp. 630-645. Springer, 2016. 6
+Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross Girshick. Momentum contrast for unsupervised visual representation learning, 2019. 2, 10, 18
+
+Olivier J Henaff, Ali Razavi, Carl Doersch, SM Eslami, and Aaron van den Oord. Data-efficient image recognition with contrastive predictive coding. arXiv preprint arXiv:1905.09272v2, 2019. 2, 6, 7, 10, 18
+Jiabo Huang, Q Dong, Shaogang Gong, and Xiatian Zhu. Unsupervised deep learning by neighbourhood discovery. In Proceedings of the International Conference on machine learning (ICML), 2019. 2, 7, 8, 9, 14, 17
+Simon Jenni and Paolo Favaro. Self-supervised feature learning by learning to spot artifacts. In Proc. CVPR, 2018. 2, 17
+Xu Ji, João F Henriques, and Andrea Vedaldi. Invariant information distillation for unsupervised image segmentation and clustering. arXiv preprint arXiv:1807.06653, 2018. 2, 5, 6
+Alexander Kolesnikov, Xiaohua Zhai, and Lucas Beyer. Revisiting self-supervised visual representation learning. arXiv preprint arXiv:1901.09005, 2019. 10, 18
+A. Krizhevsky, I. Sutskever, and G. E. Hinton. ImageNet classification with deep convolutional neural networks. In NIPS, pp. 1106-1114, 2012. 6, 7
+Alex Krizhevsky. One weird trick for parallelizing convolutional neural networks. arXiv preprint arXiv:1404.5997, 2014. 7
+Alex Krizhevsky et al. Learning multiple layers of features from tiny images. Technical report, Citeseer, 2009. 7
+Gustav Larsson, Michael Maire, and Gregory Shakhnarovich. Colorization as a proxy task for visual understanding. In Proc. CVPR, 2017. 2
+Ishan Misra and Laurens van der Maaten. Self-supervised learning of pretext-invariant representations, 2019. 2, 6, 10, 18
+T Mundhenk, Daniel Ho, and Barry Y. Chen. Improvements to context based self-supervised learning. In Proc. CVPR, 2017. 2
+T. Nathan Mundhenk, Daniel Ho, and Barry Y. Chen. Improvements to context based self-supervised learning. pp. 9339-9348, 2018. 17
+Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew Ng. Reading digits in natural images with unsupervised feature learning. NIPS, 01 2011. 7
+Mehdi Noroozi and Paolo Favaro. Unsupervised learning of visual representations by solving jigsaw puzzles. In Proc. ECCV, pp. 69-84. Springer, 2016. 2, 17
+Mehdi Noroozi, Hamed Pirsiavash, and Paolo Favaro. Representation learning by learning to count. In Proc. ICCV, 2017. 2, 17
+Mehdi Noroozi, Ananth Vinjimoor, Paolo Favaro, and Hamed Piriavash. Boosting self-supervised learning via knowledge transfer. In Proc. CVPR, 2018. 2, 17
+Aaron van den Oord, Yazhe Li, and Oriol Vinyals. Representation learning with contrastive predictive coding. arXiv preprint arXiv:1807.03748, 2018. 2, 10, 18
+Deepak Pathak, Philipp Krahenbuhl, Jeff Donahue, Trevor Darrell, and Alexei A Efros. Context encoders: Feature learning by inpainting. In Proc. CVPR, pp. 2536-2544, 2016. 2, 9, 17
+Zhongzheng Ren and Yong Jae Lee. Cross-domain self-supervised multi-task feature learning using synthetic imagery. In Proc. CVPR, 2018. 2
+Yonglong Tian, Dilip Krishnan, and Phillip Isola. Contrastive multiview coding, 2019. 2, 6, 9, 10, 17, 18
+Nguyen Xuan Vinh, Julien Epps, and James Bailey. Information theoretic measures for clusterings comparison: Variants, properties, normalization and correction for chance. Journal of Machine Learning Research, 11(Oct):2837-2854, 2010. 14
+
+Huy V Vo, Francis Bach, Minsu Cho, Kai Han, Yann LeCun, Patrick Pérez, and Jean Ponce. Unsupervised image matching and object discovery as optimization. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 8287-8296, 2019. 2
+Zhirong Wu, Yuanjun Xiong, Stella X Yu, and Dahua Lin. Unsupervised feature learning via nonparametric instance discrimination. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 3733-3742, 2018. 2, 9, 14, 17
+Asano YM., Rupprecht C., and Vedaldi A. A critical analysis of self-supervision, or what we can learn from a single image. In International Conference on Learning Representations, 2020. URL https://openreview.net/forum?id=Blesx6EYvr.6
+Liheng Zhang, Guo-Jun Qi, Liqiang Wang, and Jiebo Luo. Aet vs. aed: Unsupervised representation learning by auto-encoding transformations rather than data. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2547–2555, 2019. 2, 9, 17
+Richard Zhang, Phillip Isola, and Alexei A Efros. Colorful image colorization. In Proc. ECCV, pp. 649-666. Springer, 2016. 2, 17
+Richard Zhang, Phillip Isola, and Alexei A. Efros. Split-brain autoencoders: Unsupervised learning by cross-channel prediction. In Proc. CVPR, 2017. 6, 9, 14, 17
+Bolei Zhou, Agata Lapedriza, Jianxiong Xiao, Antonio Torralba, and Aude Oliva. Learning deep features for scene recognition using places database. In Advances in neural information processing systems, pp. 487-495, 2014. 6
+Chengxu Zhuang, Alex Lin Zhai, and Daniel Yamins. Local aggregation for unsupervised learning of visual embeddings. In Proceedings of the IEEE International Conference on Computer Vision, pp. 6002-6012, 2019. 2, 9, 10, 17, 18
+
+# A APPENDIX
+
+# A.1 IMPLEMENTATION DETAILS
+
+Learning Details Unless otherwise noted, we train all our self-supervised models with SGD and initial learning rate 0.05 for 400 epochs with two learning rate drops where we divide the rate by ten at 150 and 300 and 350 epochs. We spread our pseudo-label optimizations throughout the whole training process in a logarithmic distribution. We optimize the label assignment at $t_i = \left(\frac{i}{M - 1}\right)^2, i \in \{1, \dots, M\}$ , where $M$ is the user-defined number of optimizations and $t_i$ is expressed as a fraction of total training epochs. For the Sinkhorn-Knopp optimization we set $\lambda = 25$ as in (Cuturi, 2013). We use standard data augmentations during training that consist of randomly resized crops, horizontal flipping and adding noise, as in (Wu et al., 2018).
+
+Quantitative Evaluation – Technical Details. Unfortunately, prior work has used several slightly different setups, so that comparing results between different publications must be done with caution.
+
+In our ImageNet implementation, we follow the original proposal (Zhang et al., 2017) in pooling each representation to a vector with 9600, 9216, 9600, 9600, 9216 dimensions for conv1-5 using adaptive max-pooling, and absorb the batch normalization weights into the preceding convolutions. For evaluation on ImageNet we follow RotNet to train linear probes: images are resized such that the shorter edge has a length of 256 pixels, random crops of $224 \times 224$ are computed and flipped horizontally with $50\%$ probability. Learning lasts for 36 epochs and the learning rate schedule starts from 0.01 and is divided by five at epochs 5, 15 and 25. The top-1 accuracy of the linear classifier is then measured on the ImageNet validation subset by optionally extracting 10 crops for each validation image (four at the corners and one at the center along with their horizontal flips) and averaging the prediction scores before the accuracy is computed or just taking the a centred crop. For CIFAR-10/100 and SVHN we train AlexNet architectures on the resized images with batchsize 128, learning rate 0.03 and also the same image augmentations (random resized crops, color jitter and random grayscale) as is used in prior work (Huang et al., 2019). We use the same linear probing protocol as for our ImageNet experiments but without using 10 crops. For the weighted kNN experiments we use $k = 50$ , $\sigma = 0.1$ and we use an embedding of size 128 as done in previous works.
+
+In Table 9, when retraining an AlexNet using ResNet generated labels, we can apply heavier augmentation strategies as the labels are kept constant. Hence for the experiments denoted by "+" more aug.", in addition to the usual augmentations, we further randomly apply one of equalize, autoconstrast and sharpening. We find that this raises the performance for ImageNet but lowers the performance on Places by a small amount, hence illuminating the need to always also report performance on both datasets.
+
+# A.2 FURTHER DETAILS
+
+NMI over time In fig. A.1 we find that most learning takes place in the early epochs, and we reach a final NMI value of around $66\%$ . Similarly, we find that due to the updating of the pseudo-labels at regular intervals and our data augmentation, the pseudo-label accuracies keep continuously rising without overfitting to these labels.
+
+**Clustering metrics** In table A.1, we report standard clustering metrics (see (Vinh et al., 2010) for detailed definitions) of our trained models with regards to the ImageNet validation set ground-truth labels. These metrics include chance-corrected metrics which are the adjusted normalized mutual information (NMI) and the adjusted Rand-Index, as well as the default NMI, also reported in DeepCluster (Caron et al., 2018).
+
+Conv1 filters In fig. A.3 we show the first convolutional filters of two of our trained models. We can find the typical Gabor-like edge detectors as well as color blobs and dot-detectors.
+
+Entropy over time In fig. A.4, we show how the distribution of entropy with regards to the true ImageNet labels changes with training time. We find that while at first, all 3000 pseudo-labels contain random real ImageNet labels, yielding high entropy of around $6 \approx \ln(400) = \ln(1.2 \cdot 10^{6} / 3000)$ . Towards the end of training we arrive at a broad spectrum of entropies with some as low as
+
+
+
+
+Figure A.1: Left: Normalized Mutual Information (NMI) against validation set ImageNet labels. This measure is not used for training but indicates how good a clustering is. Right: Similarities of consecutive labellings using NMI. Both plots use the $[10\mathrm{k} \times 1]$ AlexNet for comparability with the DeepCluster paper (Caron et al., 2018).
+
+Table A.1: Clustering metrics that compare with ground-truth labels of the ImageNet validation set (with 1-crop). For reference, we provide the best Top-1 error on ImageNet linear probing (as reported in the main part).*: for the multi-head variants, we simply use predictions of a randomly picked, single head.
+
+| Metric |
| Variant | NMI | adjusted NMI | Rand-Index | Top-1 Acc. |
| SeLa [1k × 1] AlexNet | 50.5% | 12.2% | 2.7% | 42.1% |
| SeLa [3k × 1] AlexNet | 59.1% | 9.8% | 2.5% | 44.7% |
| SeLa [5k × 1] AlexNet | 66.2% | 7.4% | 1.8% | 43.9% |
| SeLa [10k × 1] AlexNet | 66.4% | 4.7% | 1.0% | 43.8% |
| SeLa [3k × 1] ResNet-50 | 60.0% | 13.5% | 3.8% | 51.8% |
| SeLa [3k × 10]* ResNet-50 | 66.3% | 26.4% | 10.3% | 61.5% |
+
+
+Figure A.2: Pseudo-label accuracies for the training data versus training time for the $[10\mathrm{k}\times 1]$ AlexNet.
+
+
+Figure A.3: Visualization of the first convolutional layers of our $[3k\times 10]$ AlexNet (left) and the $[1k\times 1]$ ResNet-50 (right). The filters are scaled to lie between $(0,1)$ for visualization.
+
+
+
+$0.07 \approx \ln(1.07)$ (see Fig. A.5 and A.6 for low entropy label visualizations) and the mean around $4.2 \approx \ln(66)$ (see Fig. A.7 and A.8 for randomly chosen labels' visualizations).
+
+
+Figure A.4: Cross-entropy of the pseudo-labels with the true ImageNet training set labels. This measure is not used for training but indicates how good a clustering is. This plot uses the $[10\mathrm{k}\times 1]$ AlexNet to compare to the equivalent plot in (Caron et al., 2018).
+
+# A.3 COMPLETE TABLES
+
+In the following, we report the unabridged tables with all related work.
+
+Table A.2: Linear probing evaluation - AlexNet. A linear classifier is trained on the (downsampled) activations of each layer in the pretrained model. We bold the best result in each layer and underline the second best. The best layer is highlighted in blue. * denotes a larger AlexNet variant. - refers to AlexNets trained with self-label transfer from a corresponding ResNet-50. "+Rot" refers to retraining using labels and an additional RotNet loss, "+ more aug." includes further augmentation during retraining.
+
+| Method | ILSVRC-12 | Places |
| c1 | c2 | c3 | c4 | c5 | c1 | c2 | c3 | c4 | c5 |
| ImageNet supervised, (Zhang et al., 2017) | 19.3 | 36.3 | 44.2 | 48.3 | 50.5 | 22.7 | 34.8 | 38.4 | 39.4 | 38.7 |
| Places supervised, (Zhang et al., 2017) | - | - | - | - | - | 22.1 | 35.1 | 40.2 | 43.3 | 44.6 |
| Random, (Zhang et al., 2017) | 11.6 | 17.1 | 16.9 | 16.3 | 14.1 | 15.7 | 20.3 | 19.8 | 19.1 | 17.5 |
| Random* | 15.6 | 16.8 | 17.4 | 15.6 | 10.6 | 16.5 | 17.6 | 18.6 | 18.1 | 16.3 |
| Inpainting, (Pathak et al., 2016) | 14.1 | 20.7 | 21.0 | 19.8 | 15.5 | 18.2 | 23.2 | 23.4 | 21.9 | 18.4 |
| BiGAN, (Donahue et al., 2017) | 17.7 | 24.5 | 31.0 | 29.9 | 28.0 | 22.0 | 28.7 | 31.8 | 31.3 | 29.7 |
| Context*, (Doersch et al., 2015) | 16.2 | 23.3 | 30.2 | 31.7 | 29.6 | 19.7 | 26.7 | 31.9 | 32.7 | 30.9 |
| Colorization, (Zhang et al., 2016) | 13.1 | 24.8 | 31.0 | 32.6 | 31.8 | 16.0 | 25.7 | 29.6 | 30.3 | 29.7 |
| Jigsaw, (Noroozi & Favaro, 2016) | 18.2 | 28.8 | 34.0 | 33.9 | 27.1 | 23.0 | 31.9 | 35.0 | 34.2 | 29.3 |
| Counting, (Noroozi et al., 2017) | 18.0 | 30.6 | 34.3 | 32.5 | 25.7 | 23.3 | 33.9 | 36.3 | 34.7 | 29.6 |
| SplitBrain, (Zhang et al., 2017) | 17.7 | 29.3 | 35.4 | 35.2 | 32.8 | 21.3 | 30.7 | 34.0 | 34.1 | 32.5 |
| Instance retrieval, (Wu et al., 2018) | 16.8 | 26.5 | 31.8 | 34.1 | 35.6 | 18.8 | 24.3 | 31.9 | 34.5 | 33.6 |
| CC+VGG-, (Noroozi et al., 2018) | 19.2 | 32.0 | 37.3 | 37.1 | 34.6 | 22.9 | 34.2 | 37.5 | 37.1 | 34.4 |
| Context 2 (Mundhenk et al., 2018) | 19.6 | 31.8 | 37.6 | 37.8 | 33.7 | 23.7 | 34.2 | 37.2 | 37.2 | 34.9 |
| RotNet, (Gidaris et al., 2018) | 18.8 | 31.7 | 38.7 | 38.2 | 36.5 | 21.5 | 31.0 | 35.1 | 34.6 | 33.7 |
| Artifacts, (Jenni & Favaro, 2018) | 19.5 | 33.3 | 37.9 | 38.9 | 34.9 | 23.3 | 34.3 | 36.9 | 37.3 | 34.4 |
| AND*, (Huang et al., 2019) | 15.6 | 27.0 | 35.9 | 39.7 | 37.9 | - | - | - | - | - |
| CMC*, (Tian et al., 2019) | 18.4 | 33.5 | 38.1 | 40.4 | 42.6 | - | - | - | - | - |
| AET*, (Zhang et al., 2019) | 19.3 | 35.4 | 44.0 | 43.6 | 42.4 | 22.1 | 32.9 | 37.1 | 36.2 | 34.7 |
| RotNet+retrieval*, (Feng et al., 2019) | 20.8 | 35.2 | 41.8 | 44.3 | 44.4 | 24.0 | 33.8 | 37.5 | 39.3 | 38.9 |
| SeLa [3k × 10]* | 20.3 | 32.2 | 38.6 | 41.4 | 39.6 | 24.5 | 31.9 | 36.7 | 38.0 | 37.0 |
| SeLa [3k × 10]−+Rot* | 20.6 | 32.3 | 40.4 | 43.1 | 42.3 | 24.0 | 31.7 | 37.1 | 39.0 | 37.6 |
| SeLa [3k × 10]−+Rot*+more aug. | 19.2 | 32.6 | 40.8 | 44.4 | 44.7 | 21.1 | 30.4 | 36.5 | 37.9 | 37.3 |
| ImageNet supervised* | 21.6 | 37.2 | 46.9 | 52.9 | 54.4 | 22.6 | 33.2 | 39.0 | 41.3 | 39.7 |
| Random* | 17.6 | 20.3 | 20.6 | 17.8 | 11.0 | 19.2 | 20.7 | 21.8 | 21.3 | 19.0 |
| DeepCluster (RGB)*, (Caron et al., 2018) | 18.0 | 32.5 | 39.2 | 37.2 | 30.6 | - | - | - | - | - |
| DeepCluster*, (Caron et al., 2018) | 13.4 | 32.3 | 41.0 | 39.6 | 38.2 | 23.8 | 32.8 | 37.3 | 36.0 | 31.0 |
| Local Agg.*, (Zhuang et al., 2019) | 18.7 | 32.7 | 38.1 | 42.3 | 42.4 | 18.7 | 32.7 | 38.2 | 40.3 | 39.5 |
| RotNet+retrieval*, (Feng et al., 2019) | 22.2 | 38.2 | 45.7 | 48.7 | 48.3 | 25.5 | 36.0 | 40.1 | 42.2 | 41.3 |
| SeLa [3k × 10]* | 22.5 | 37.4 | 44.7 | 47.1 | 44.1 | 26.7 | 34.9 | 39.9 | 41.8 | 39.7 |
| SeLa [3k × 10]−+Rot* | 22.8 | 37.8 | 46.7 | 49.7 | 48.4 | 26.8 | 35.5 | 41.0 | 43.0 | 41.3 |
| SeLa [3k × 10]−+Rot*+more aug. | 21.9 | 37.1 | 46.0 | 50.0 | 50.0 | 23.4 | 33.0 | 39.4 | 41.4 | 39.9 |
+
+Table A.3: Linear evaluation - ResNet. A linear layer is trained on top of the global average pooled features of ResNets. All evaluations use a single centred crop. We have separated much larger architectures such as RevNet-50×4 and ResNet-161. Methods in brackets use a augmentation policy learned from supervised training and methods with * are not explicit about which further augmentations they use.
+
+| Method | Architecture | Top-1 | Top-5 |
| Supervised, (Donahue & Simonyan, 2019) | ResNet-50 | 76.3 | 93.1 |
| Supervised, (Donahue & Simonyan, 2019) | ResNet-101 | 77.8 | 93.8 |
| Jigsaw, (Kolesnikov et al., 2019) | ResNet-50 | 38.4 | - |
| RelPathLoc, (Kolesnikov et al., 2019) | ResNet-50 | 42.2 | - |
| Exemplar, (Kolesnikov et al., 2019) | ResNet-50 | 43.0 | - |
| Rotation, (Kolesnikov et al., 2019) | ResNet-50 | 43.8 | - |
| Multi-task, (Doersch & Zisserman, 2017) | ResNet-101 | - | 69.3 |
| CPC, (Oord et al., 2018) | ResNet-101 | 48.7 | 73.6 |
| BigBiGAN, (Donahue & Simonyan, 2019) | ResNet-50 | 55.4 | 77.4 |
| LocalAggregation, (Zhuang et al., 2019) | ResNet-50 | 60.2 | - |
| Efficient CPC v2.1, (Hénaff et al., 2019) | ResNet-50 | (63.8) | (85.3) |
| CMC, (Tian et al., 2019) | ResNet-50 | (64.1) | (85.4) |
| MoCo, (He et al., 2019) | ResNet-50 | 60.6 | - |
| PIRL, (Misra & van der Maaten, 2019)* | ResNet-50 | 63.6 | - |
| SeLa [3k × 10] | ResNet-50 | 61.5 | 84.0 |
| other architectures |
| Rotation, (Kolesnikov et al., 2019) | RevNet-50×4 | 53.7 | - |
| BigBiGAN, (Donahue & Simonyan, 2019) | RevNet-50×4 | 60.8 | 81.4 |
| AMDIM, (Bachman et al., 2019) | Custom-103 | (67.4) | (81.8) |
| CMC, (Tian et al., 2019) | RevNet-50×4 | 68.4 | 88.2 |
| MoCo, (He et al., 2019) | RevNet-50×4 | 68.6 | - |
| Efficient CPC v2.1, (Hénaff et al., 2019) | ResNet-161 | 71.5 | 90.1 |
+
+# A.4 LOW ENTROPY PSEUDOCLASSES
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Figure A.5: Here we show a random sample of images associated to the lowest entropy pseudoclasses. The entropy is given by true image labels which are also shown as a frame around each picture with a random color. This visualization uses ResNet-50 $[3k \times 1]$ . The entropy varies from $0.07 - -0.83$
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Figure A.6: Visualization of pseudoclasses on the validation set. Here we show random samples of validation set images associated to the lowest entropy pseudoclasses of training set. For further details, see Figure A.5. Classes with less than 9 images are sampled with repetition.
+
+
+
+
+
+
+
+# A.5 RANDOM PSEUDOCLASSES
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Figure A.7: Here we show a random sample of Imagenet training set images associated to the random pseudoclasses. The entropy is given by true image labels which are also shown as a frame around each picture with a random color. This visualization uses ResNet-50 $[3k\times 1]$ .
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Figure A.8: Here we show a random sample of validation set images associated to random pseudoclasses. The entropy is given by true image labels which are also shown as a frame around each picture with a random color. This visualization uses ResNet-50 $[3k \times 1]$ . Classes with less than 9 images are sampled with repetition.
+
+
+
+
+
+
\ No newline at end of file
diff --git a/selflabellingviasimultaneousclusteringandrepresentationlearning/images.zip b/selflabellingviasimultaneousclusteringandrepresentationlearning/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..205ae33a9564259edabf51c2ba49f82ea553a7de
--- /dev/null
+++ b/selflabellingviasimultaneousclusteringandrepresentationlearning/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:01e3a659d8dbf348ca7e4940108fbc5293bec64b90d32504961d3fa4311b016b
+size 2771328
diff --git a/selflabellingviasimultaneousclusteringandrepresentationlearning/layout.json b/selflabellingviasimultaneousclusteringandrepresentationlearning/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..382c84dabe16292af889512c686710198ffeeac8
--- /dev/null
+++ b/selflabellingviasimultaneousclusteringandrepresentationlearning/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:94b6f7148780e3e1b50ab4586fbe8a68fbaa74ec57b33be27fb12b1b74cd58f2
+size 735287
diff --git a/sequentiallatentknowledgeselectionforknowledgegroundeddialogue/ca93921d-cb92-4906-9128-e3e02463141c_content_list.json b/sequentiallatentknowledgeselectionforknowledgegroundeddialogue/ca93921d-cb92-4906-9128-e3e02463141c_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..bf44edc10b999673178fc1c2492c48437ed66826
--- /dev/null
+++ b/sequentiallatentknowledgeselectionforknowledgegroundeddialogue/ca93921d-cb92-4906-9128-e3e02463141c_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:5ab23634ce6046d160b79ffaeca2bc812c0dbb80fd6f1e85e48ab3702488fda9
+size 90882
diff --git a/sequentiallatentknowledgeselectionforknowledgegroundeddialogue/ca93921d-cb92-4906-9128-e3e02463141c_model.json b/sequentiallatentknowledgeselectionforknowledgegroundeddialogue/ca93921d-cb92-4906-9128-e3e02463141c_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..81abf3dd0ff656134abd3ec4ebe246fcb499c018
--- /dev/null
+++ b/sequentiallatentknowledgeselectionforknowledgegroundeddialogue/ca93921d-cb92-4906-9128-e3e02463141c_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:91314ed5645af1f77baf996a4486c4cf842ab00f6cac6e6296e49e37e3e09109
+size 108536
diff --git a/sequentiallatentknowledgeselectionforknowledgegroundeddialogue/ca93921d-cb92-4906-9128-e3e02463141c_origin.pdf b/sequentiallatentknowledgeselectionforknowledgegroundeddialogue/ca93921d-cb92-4906-9128-e3e02463141c_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..c7f8acc56e9af8b3364c7b43713d2844ecc3e1b1
--- /dev/null
+++ b/sequentiallatentknowledgeselectionforknowledgegroundeddialogue/ca93921d-cb92-4906-9128-e3e02463141c_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:41ee35421ee83cb02fa8e0a01546b0426fbebddde79caf52d058195b565cb0e4
+size 618960
diff --git a/sequentiallatentknowledgeselectionforknowledgegroundeddialogue/full.md b/sequentiallatentknowledgeselectionforknowledgegroundeddialogue/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..deea039a44ed3f00e4593205d24481b3dd1ecab7
--- /dev/null
+++ b/sequentiallatentknowledgeselectionforknowledgegroundeddialogue/full.md
@@ -0,0 +1,327 @@
+# SEQUENTIAL LATENT KNOWLEDGE SELECTION FOR KNOWLEDGE-GROUNDED DIALOGUE
+
+Byeongchang Kim Jaewoo Ahn Gunhee Kim
+
+Department of Computer Science and Engineering
+
+Seoul National University, Seoul, Korea
+
+{byeongchang.kim,jaewoo.ahn}@vision.snu.ac.kr gunhee@snu.ac.kr
+
+http://vision.snu.ac.kr/projects/skt
+
+# ABSTRACT
+
+Knowledge-grounded dialogue is a task of generating an informative response based on both discourse context and external knowledge. As we focus on better modeling the knowledge selection in the multi-turn knowledge-grounded dialogue, we propose a sequential latent variable model as the first approach to this matter. The model named sequential knowledge transformer (SKT) can keep track of the prior and posterior distribution over knowledge; as a result, it can not only reduce the ambiguity caused from the diversity in knowledge selection of conversation but also better leverage the response information for proper choice of knowledge. Our experimental results show that the proposed model improves the knowledge selection accuracy and subsequently the performance of utterance generation. We achieve the new state-of-the-art performance on Wizard of Wikipedia (Dinan et al., 2019) as one of the most large-scale and challenging benchmarks. We further validate the effectiveness of our model over existing conversation methods in another knowledge-based dialogue Holl-E dataset (Moghe et al., 2018).
+
+# 1 INTRODUCTION
+
+Knowledge-grounded dialogue is a task of generating an informative response based on both discourse context and selected external knowledge (Ghazvininejad et al., 2018). For example, it is more descriptive and engaging to respond "I've always been more of a fan of the American football team from Pittsburgh, the Steelers!" than "Nice, I like football too." (Dinan & Weston, 2019). As it has been one of the key milestone tasks in conversational research (Zhang et al., 2018), a majority of previous works have studied how to effectively combine given knowledge and dialogue context to generate an utterance (Zhang et al., 2018; Li et al., 2019b; Parthasarathi & Pineau, 2018; Madotto et al., 2018; Gopalakrishnan et al., 2019). Recently, Dinan et al. (2019) proposed to tackle the knowledge-grounded dialogue by decomposing it into two sub-problems: first selecting knowledge from a large pool of candidates and generating a response based on the selected knowledge and context.
+
+In this work, we investigate the issue of knowledge selection in the multi-turn knowledge-grounded dialogue, since practically the selection of pertinent topics is critical to better engage humans in conversation, and technically the utterance generation becomes easier with a more powerful and consistent knowledge selector in the system. Especially, we focus on developing a sequential latent variable model for knowledge selection, which has not been discussed in previous research. We believe it brings several advantages for more engaging and accurate knowledge-based chit-chat. First, it can correctly deal with the diversity in knowledge selection of conversation. Since one can choose any knowledge to carry on the conversation, there can be one-to-many relations between dialogue context and knowledge selection. Such multimodality by nature makes the training of a dialogue system much more difficult in a data-driven way. However, if we can sequentially model the history of knowledge selection in previous turns, we can reduce the scope of probable knowledge candidates at current turn. Second, the sequential latent model can better leverage the response information, which makes knowledge selection even more accurate. It is naturally easy to select the knowledge in the pool once the response is known, because the response is generated based on the
+
+
+Figure 1: An example of wizard's tasks in knowledge-grounded conversation of Wizard of Wikipedia (Dinan et al., 2019).
+
+Table 1: Accuracy of knowledge selection with and without knowing the response. We test with GRU (Cho et al., 2014), Transformer (Vaswani et al., 2017) and BERT (Devlin et al., 2019) as the sentence encoder. For human evaluation, we randomly sample 20 dialogues and ask human annotators to select the most likely knowledge sentence from the pool.
+
+| Methods | w/o response | w/ response |
| GRU | 20.0 | 66.0 |
| Transformer | 22.5 | 70.4 |
| BERT | 23.4 | 78.2 |
| Transformer + GT history | 25.4 | 70.4 |
| BERT + GT history | 27.3 | 79.2 |
| Random | 2.7 | 2.7 |
| Human | 17.1 | 83.7 |
+
+selected knowledge. Our sequential model can keep track of prior and posterior distribution over knowledge, which are sequentially updated considering the responses in previous turns, and thus we can better predict the knowledge by sampling from the posterior. Third, the latent model works even when the knowledge selection labels for previous dialogue are not available, which is common in practice. For example, if multiple people have discussion about given documents, knowledge selection of previous turns is done by others. The latent model can infer which knowledge others are likely to select and use.
+
+Finally, the contributions of this work are as follows.
+
+1. We propose a novel model named sequential knowledge transformer (SKT). To the best of our knowledge, our model is the first attempt to leverage a sequential latent variable model for knowledge selection, which subsequently improves knowledge-grounded chit-chat.
+2. Our experimental results show that the proposed model improves not only the knowledge selection accuracy but also the performance of utterance generation. As a result, we achieve the new state-of-the-art performance on Wizard of Wikipedia (Dinan et al., 2019) and a knowledge-annotated version of Holl-E (Moghe et al., 2018) dataset.
+
+# 2 PROBLEM STATEMENT AND MOTIVATION
+
+As a main testbed of our research, we choose the Wizard of Wikipedia (WoW) benchmark (Dinan et al., 2019), since it is one of the most large-scale and challenging datasets for open-domain multi-turn knowledge-based dialogue. Moreover, the dataset can evaluate the algorithm's ability for solving the two subproblems of knowledge selection and response generation. That is, it provides ground-truth labels of knowledge selection and clear grounding between the pairs of selected knowledge and response. In our experiments, we also evaluate on Holl-E (Moghe et al., 2018) as another dataset for knowledge-grounded dialogue, after collecting clearer labels of knowledge sentences.
+
+The Flow of Conversation. The WoW (Dinan et al., 2019) deals with a chit-chat dialogue task where two speakers discuss in depth about a given topic. One speaker (coined as Wizard) is to be both engaging and knowledgeable on the topic with access to an information retrieval (IR) system over Wikipedia to supplement its knowledge. The other speaker (Apprentice) is curious and eager to learn about the topic. With an example in Figure 1, the conversation flow takes place as follows.
+
+1. One topic is chosen among 1,431 topics and shared between the two speakers.
+2. Given an apprentice's utterance and a wizard's previous utterance, the IR system retrieves relevant knowledge, which includes the first paragraph of top 7 articles each for wizard and apprentice and the first 10 sentences of the original Wikipedia page of the topic (e.g. the lifeguard wikipage). The knowledge pool contains 67.57 sentences on average. Then,
+
+the wizard must choose a single relevant sentence from them (knowledge selection) and construct an utterance (response generation).
+
+3. The conversation repeats until a minimum number of turns (5 each) reaches.
+
+The Motivation of Sequential Latent Models. The goal of the task is to model the wizard that solves the two subproblems of knowledge selection and response generation (Dinan et al., 2019). In the knowledge selection step, a single relevant knowledge sentence is chosen from a pool of candidates, and in the response generation step, a final utterance is generated with the chosen knowledge and dialogue context. This pipeline is originally proposed to tackle open-domain TextQA (Chen et al., 2017); for example, Min et al. (2018) show its effectiveness for single-document TextQA, to which the key is to locate the sentences that contain the information about the answer to a question.
+
+For knowledge-grounded dialogue, however, there can be one-to-many relations between the dialogue context and the knowledge to be selected unlike TextQA. Except a direct question about context, one can choose any diverse knowledge to carry on the conversation. Therefore, the knowledge selection in dialogue is diverse (i.e. multimodal) by nature, which should be correctly considered in the model. It is our main motivation to propose a sequential latent variable model for knowledge selection, which has not been studied yet. The latent variable not only models such diversity of knowledge but also sequentially track the topic flow of knowledge in the multi-turn dialogue.
+
+Another practical advantage of the sequential latent model lies in that it is easy to find which knowledge is chosen once the response is known, since the response is written based on the selected knowledge. Table 1 clearly validates this relation between knowledge and response. In the WoW dataset, knowing a response boosts the accuracy of knowledge sentence selection for both human and different models. These results hint that knowledge selection may need to be jointly modeled with response generation in a sequence of multi-turn chit-chats, which can be done by the sequential latent models.
+
+# 3 APPROACH
+
+We propose a novel model for knowledge-grounded conversation named sequential knowledge transformer (SKT), whose graphical model is illustrated in Figure 2. It is a sequential latent model that sequentially conditions on previously selected knowledge to generate a response.
+
+We will use $1 \leq t \leq T$ to iterate over dialogue turns, $1 \leq m \leq M$ and $1 \leq n \leq N$ to respectively iterate over words in the utterance of apprentice and wizard, and $1 \leq l \leq L$ to denote knowledge sentences in the pool. Thus, $T$ is the dialogue length, $M$ and $N$ are the length of each utterance of apprentice and wizard, and $L$ is the size of the knowledge pool.
+
+The input to our model at turn $t$ is previous turns of conversation, which consists of utterances from apprentice $\mathbf{x}^1, \ldots, \mathbf{x}^t$ , utterances from wizard $\mathbf{y}^1, \ldots, \mathbf{y}^{t-1}$ and the knowledge pool $\mathbf{k}^1, \ldots, \mathbf{k}^t$ , where $\mathbf{k}^t = \{\mathbf{k}^{t,l}\} = \mathbf{k}^{t,1}, \ldots, \mathbf{k}^{t,L}$ . The output of the model is selected knowledge $\mathbf{k}_s^t$ and the wizard's response $\mathbf{y}^t$ . Below, we discuss sentence embedding, knowledge selection and utterance decoding in our approach. Note that our technical novelty lies in the knowledge selection model, while exploiting existing techniques for text encoding and utterance decoding.
+
+Sentence Encoding. We represent an apprentice utterance $\mathbf{x}^t$ to an embedding $\mathbf{h}_x^t$ using BERT (Devlin et al., 2019) and average pooling over time steps (Cer et al., 2018):
+
+$$
+\mathbf {H} _ {x} ^ {t} = \operatorname {B E R T} _ {\text {b a s e}} \left(\left[ x _ {1} ^ {t}; \dots ; x _ {M} ^ {t} \right]\right) \in \mathbb {R} ^ {M \times 7 6 8}, \mathbf {h} _ {x} ^ {t} = \operatorname {a v g p o o l} \left(\mathbf {H} _ {x} ^ {t}\right) \in \mathbb {R} ^ {7 6 8}. \tag {1}
+$$
+
+Likewise, the utterance of Wizard $\mathbf{y}^{t - 1}$ is embedded as $\mathbf{h}_y^{t - 1}$ and knowledge sentences are as $\{\mathbf{h}_k^{t,l}\} = \mathbf{h}_k^{t,1},\dots,\mathbf{h}_k^{t,L}$ . Each apprentice-wizard utterance pair $\mathbf{h}_{xy}^t = [\mathbf{h}_x^t;\mathbf{h}_y^t]$ at dialog turn $t$ is jointly represented through a GRU (Cho et al., 2014) layer: $\mathbf{d}_{xy}^t = \mathrm{GRU}_{dialog}(\mathbf{d}_{xy}^{t - 1},\mathbf{h}_{xy}^t)\in \mathbb{R}^{768}$ .
+
+Sequential Knowledge Selection. Compared to previous works, we make two significant modifications. First, we regard the knowledge selection as a sequential decision process instead of a single-step decision process. Second, due to the diversity of knowledge selection in dialogue, we model it as latent variables. As a result, we can carry out the joint inference of multi-turns of knowledge selection and response generation rather than separate inference turn by turn.
+
+
+Figure 2: A graphical representation of the proposed sequential knowledge transformer (SKT) model. At the third turn, the goal is to generate wizard's response $(\mathbf{y}^3)$ given dialogue context $(\mathbf{x}^{\leq 3},\mathbf{y}^{< 3})$ . Our model sequentially infer which knowledge is likely to be used $(\mathbf{k}^{\leq 3})$ , from which the utterance $\mathbf{y}^3$ is generated.
+
+There have been much research on sequential latent variable models (Chung et al., 2015; Fraccaro et al., 2016; Goyal et al., 2017; Aneja et al., 2019; Shankar & Sarawagi, 2019). For example, Shankar & Sarawagi (2019) propose a posterior attention model that represents the attention of seq2seq models as sequential latent variables. Inspired by them, we factorize the response generation with latent knowledge selection and derive the variational lower bound as follows:
+
+$$
+\begin{array}{l} \log p (\mathbf {y} \mid \mathbf {x}) = \log \prod_ {t} \sum_ {\mathbf {k} ^ {t}} p _ {\theta} \left(\mathbf {y} ^ {t} \mid \mathbf {x} ^ {\leq t}, \mathbf {y} ^ {< t}, \mathbf {k} ^ {\leq t}\right) \pi_ {\theta} \left(\mathbf {k} ^ {t} \mid \mathbf {x} ^ {\leq t}, \mathbf {y} ^ {< t}, \mathbf {k} ^ {< t}\right) (2) \\ \geq \sum_ {t} \mathbb {E} _ {q _ {\phi} (\mathbf {k} ^ {t - 1})} \left[ \mathbb {E} _ {q _ {\phi} (\mathbf {k} ^ {t})} \left[ \log p _ {\theta} \left(\mathbf {y} ^ {t} \mid \mathbf {x} ^ {\leq t}, \mathbf {y} ^ {< t}, \mathbf {k} ^ {t}\right) \right] - D _ {K L} \left(q _ {\phi} \left(\mathbf {k} ^ {t}\right) \| \pi_ {\theta} \left(\mathbf {k} ^ {t}\right)\right) \right], (3) \\ \end{array}
+$$
+
+where $q_{\phi}(\mathbf{k}^t)$ is shorthand for $q_{\phi}(\mathbf{k}^{t}|\mathbf{x}^{\le t},\mathbf{y}^{\le t},\mathbf{k}^{< t})$ and $\pi_{\theta}(\mathbf{k}^{t})$ for $\pi_{\theta}(\mathbf{k}^{t}|\mathbf{x}^{\le t},\mathbf{y}^{< t},\mathbf{k}^{< t})$ for brevity. Note that $p_{\theta}(\mathbf{y}^{t}|\cdot)$ is a decoder network, $\pi_{\theta}(\mathbf{k}^{t})$ is a categorical conditional distribution of knowledge given dialogue context and previously selected knowledge, and $q_{\phi}(\mathbf{k}^{t})$ is an inference network to approximate posterior distribution $p_{\theta}(\mathbf{k}^{t}|\mathbf{x}^{\le t},\mathbf{y}^{\le t},\mathbf{k}^{< t})$
+
+The conditional probability of generating wizard's response $\mathbf{y}^t$ given dialogue context $\mathbf{x}^{\leq t}$ and $\mathbf{y}^{< t}$ , can be re-written from Eq. (2) as follows:
+
+$$
+p \left(\mathbf {y} ^ {t} \mid \mathbf {x} ^ {\leq t}, \mathbf {y} ^ {< t}\right) \approx \prod_ {i = 1} ^ {t - 1} \sum_ {\mathbf {k} ^ {i}} q _ {\phi} \left(\mathbf {k} ^ {i}\right) \left(\sum_ {\mathbf {k} ^ {t}} p _ {\theta} \left(\mathbf {y} ^ {t} \mid \mathbf {x} ^ {\leq t}, \mathbf {y} ^ {< t}, \mathbf {k} ^ {t}\right) \pi_ {\theta} \left(\mathbf {k} ^ {t}\right)\right). \tag {4}
+$$
+
+The detailed derivation can be found in Appendix. Eq.(4) means that we first infer from the knowledge posterior which knowledge would be used up to previous turn $t - 1$ , estimate the knowledge for current turn $t$ from prior knowledge distribution and generate an utterance from the inferred knowledge. Figure 2 shows an example of this generation process at $t = 3$ . We parameterize the decoder network $p_{\theta}$ , the prior distribution of knowledge $\pi_{\theta}$ , and the approximate posterior $q_{\phi}$ with deep neural networks as will be discussed.
+
+From the posterior distribution $q_{\phi}(\mathbf{k}^{t - 1})$ we draw a sample $\mathbf{k}_s^{t - 1}$ , and then update $\pi_{\theta}$ and $q_{\phi}$ with the sentence embedding of sampled knowledge $(\mathbf{h}_k^{t - 1,s})$ and the embeddings of previous and current utterances $(\mathbf{d}_{xy}^{t - 1},\mathbf{d}_{xy}^t,\mathbf{h}_x^t)$ . We use an attention mechanism over current knowledge pool $\{\mathbf{h}_k^{t,l}\}$ to compute knowledge distribution given the dialogue context. This process is modeled as
+
+$$
+\pi_ {\theta} \left(\mathbf {k} ^ {t} \mid \mathbf {x} ^ {\leq t}, \mathbf {y} ^ {< t}, \mathbf {k} _ {s} ^ {\leq t - 1}\right) = \operatorname {s o f t m a x} \left(\mathbf {q} _ {p r i o r} ^ {t} \left[ \mathbf {h} _ {k} ^ {t, 1}, \dots , \mathbf {h} _ {k} ^ {t, L} \right] ^ {\top}\right) \in \mathbb {R} ^ {L} \tag {5}
+$$
+
+$$
+q _ {\phi} \left(\mathbf {k} ^ {t} \mid \mathbf {x} ^ {\leq t}, \mathbf {y} ^ {\leq t}, \mathbf {k} _ {s} ^ {\leq t - 1}\right) = \operatorname {s o f t m a x} \left(\mathbf {q} _ {p o s t} ^ {t} \left[ \mathbf {h} _ {k} ^ {t, 1}, \dots , \mathbf {h} _ {k} ^ {t, L} \right] ^ {\top}\right) \in \mathbb {R} ^ {L}, \tag {6}
+$$
+
+where
+
+$$
+\mathbf {q} _ {\text {p r i o r}} ^ {t} = \mathbf {W} _ {\text {p r i o r}} \left(\left[ \mathbf {d} _ {x y} ^ {t - 1}; \mathbf {h} _ {x} ^ {t}; \operatorname {G R U} _ {\text {h i s t}} \left(\mathbf {d} _ {k} ^ {t - 2}, \mathbf {h} _ {k} ^ {t - 1, s}\right) \right]\right), \tag {7}
+$$
+
+$$
+\mathbf {q} _ {\text {p o s t}} ^ {t} = \mathbf {W} _ {\text {p o s t}} \left(\left[ \mathbf {d} _ {x y} ^ {t}; \operatorname {G R U} _ {\text {h i s t}} \left(\mathbf {d} _ {k} ^ {t - 2}, \mathbf {h} _ {k} ^ {t - 1, s}\right) \right]\right), \tag {8}
+$$
+
+$\mathbf{d}_k^t$ is the hidden state of GRU $_{hist}$ and we initialize $\mathbf{d}_{xy}^{0} = \mathbf{d}_{k}^{0} = \mathbf{0}\in \mathbb{R}^{768}$ , and $\mathbf{W}_{prior},\mathbf{W}_{post}\in \mathbb{R}^{768\times (768*2)}$ are the parameters. We here use the GRU (Li et al., 2017; Aneja et al., 2019) to sequentially condition previously selected knowledge to $\pi_{\theta}$ and $q_{\phi}$ .
+
+Finally, we sample knowledge $\mathbf{k}_s^t$ over attention distribution in Eq. (6) and pass it to the decoder. At test time, we select the knowledge with the highest probability over distribution in Eq. (5).
+
+Decoding with Copy Mechanism. We generate the wizard's response at turn $t$ , given current context $\mathbf{x}^t$ and selected knowledge sentence $\mathbf{k}_s^t$ . We feed their concatenated embedding $\mathbf{H}_{xk_s}^t = [\mathbf{H}_x^t;\mathbf{H}_{k_s}^t]$ to the decoder $p_{\theta}$ . To maximize the effect of selected knowledge for response generation, we choose the Copy mechanism (Xia et al., 2017; Li et al., 2019b) with Transformer decoder (Vaswani et al., 2017). We obtain the output word probability (Zhao et al., 2019a):
+
+$$
+\mathbf {h} _ {n} ^ {t} = \operatorname {D e c o d e r} \left(\mathbf {H} _ {x k _ {s}} ^ {t}, \mathbf {y} _ {< n} ^ {t}\right), \quad \mathbf {q} _ {n} ^ {t}, \mathbf {K} ^ {t}, \mathbf {V} ^ {t} = \mathbf {h} _ {n} ^ {t} \mathbf {W} _ {q} ^ {\top}, \mathbf {H} _ {x k _ {s}} ^ {t} \mathbf {W} _ {k} ^ {\top}, \mathbf {H} _ {x k _ {s}} ^ {t} \mathbf {W} _ {v} ^ {\top}, \tag {9}
+$$
+
+$$
+p _ {t, n} ^ {\text {g e n}} (w) = \operatorname {s o f t m a x} \left(\mathbf {W} _ {\text {o u t}} \mathbf {h} _ {n} ^ {t}\right), \quad p _ {t, n} ^ {\text {c o p y}} (w) = \operatorname {s o f t m a x} \left(\mathbf {q} _ {n} ^ {t} \mathbf {K} ^ {t}\right), \tag {10}
+$$
+
+$$
+p _ {t, n} (w) = \left(1 - \alpha_ {t, n} ^ {\text {c o p y}}\right) * p _ {t, n} ^ {\text {g e n}} (w) + \alpha_ {t, n} ^ {\text {c o p y}} * p _ {t, n} ^ {\text {c o p y}} (w), \tag {11}
+$$
+
+where $\alpha_{t,n}^{copy} = \sigma (\mathbf{W}_{copy}^{\top}\sum p_{t,n}^{copy}(w)\cdot \mathbf{V}^{t})$ and $\sigma$ is a sigmoid. Finally, we select the word with the highest probability $y_{n + 1}^{t} = \arg \max_{w\in \mathcal{V}}p_{t,n}(w)$ where $\mathcal{V}$ is the dictionary. Unless the word $y_{n + 1}^{t}$ is an EOS token, we repeat generating the next word by feeding $y_{n + 1}^{t}$ to the decoder.
+
+# 3.1 TRAINING
+
+Obviously, there is a large gap in knowledge selection accuracy between training with or without true labels (e.g. 23.2 of E2E Transformer MemNet with labels vs 4.8 of PostKS without labels in Table 2). As one way to take advantage of true labels for training of latent models, prior research has employed auxiliary losses over latent variables (Wen et al., 2017; Zhao et al., 2017). Similarly, we use the knowledge loss from Dinan et al. (2019) (i.e. the cross-entropy loss between predicted and true knowledge sentences) as an auxiliary loss for the latent variable. Thus, the training objective is a combination of the variational lower-bound from Eq. (3) and the auxiliary knowledge loss as
+
+$$
+\begin{array}{l} \mathcal {L} = - \frac {1}{T} \sum_ {t = 1} ^ {T} \mathbb {E} _ {q _ {\phi} (\mathbf {k} ^ {t - 1})} \left[ \mathbb {E} _ {q _ {\phi} (\mathbf {k} ^ {t})} [ \log p _ {\theta} (\mathbf {y} ^ {t} | \mathbf {x} ^ {\le t}, \mathbf {y} ^ {< t}, \mathbf {k} _ {s} ^ {t}) ] \right. \\ \left. - D _ {K L} \left(q _ {\phi} \left(\mathbf {k} ^ {t}\right) \| \pi_ {\theta} \left(\mathbf {k} ^ {t}\right)\right) + \lambda \underbrace {\log q _ {\phi} \left(\mathbf {k} _ {a} ^ {t}\right)} _ {\text {K n o w l e d g e l o s s}} \right], \tag {12} \\ \end{array}
+$$
+
+where $\mathbf{k}_s^t$ is a sampled knowledge from $q_{\phi}(\mathbf{k}^t | \mathbf{x}^{\le t}, \mathbf{y}^{\le t}, \mathbf{k}^{< t})$ , $\mathbf{k}_a^t$ is a true knowledge, and $\lambda$ is a hyperparameter. Note that knowledge is sequentially sampled from attention distribution as in Eq. (6). We train our model by mini-batch gradient descent. We approximate the expectation by drawing one sample from the posterior with Gumbel-Softmax function (Jang et al., 2017; Maddison et al., 2017b). Further details of optimization can be found in Appendix.
+
+# 4 EXPERIMENTS
+
+We evaluate our model mainly on the Wizard of Wikipedia (Dinan et al., 2019) and additionally Holl-E (Moghe et al., 2018) as another knowledge-grounded chit-chat dataset. We quantitatively and qualitatively compare our approach with other state-of-the-art models.
+
+# 4.1 DATASETS
+
+Wizard of Wikipedia. It contains 18,430 dialogues for training, 1,948 dialogues for validation and 1,933 dialogues for test. The test set is split into two subsets, Test Seen and Test Unseen. Test Seen contains 965 dialogues on the topics overlapped with the training set, while Test Unseen contains 968 dialogues on the topics never seen before in training and validation set.
+
+Holl-E. It contains 7,228 dialogues for training, 930 dialogues for validation and 913 dialogues for test. A single document is given per dialogue; the documents include about 58 and 63 sentences on average for training/validation and test set, respectively. The dataset provides spans in the document as additional information to provide which parts of the document is used to generate a response. However, the span labels are rather inconsistent; for example, they are often shorter than a single sentence or contain multiple consecutive sentences. Thus, we collect a new set of ground-truth (GT)
+
+Table 2: Quantitative results on the Wizard of Wikipedia dataset (Dinan et al., 2019). The method with $[^{*}]$ does not use the knowledge loss. The scores of E2E Transformer MemNet† and Transformer (no knowledge)† are from the original paper. The variant (BERT vocab)‡ is re-runned using the authors' code, since the vocabulary is different from original paper due to the use of BERT.
+
+| Method | Test Seen | Test Unseen |
| PPL | R-1 | R-2 | Acc | PPL | R-1 | R-2 | Acc |
| Random knowledge selection | - | 8.4 | 1.4 | 2.7 | - | 8.0 | 1.2 | 2.3 |
| Repeat last utterance | - | 14.5 | 3.1 | - | - | 14.1 | 2.9 | - |
| Transformer (no knowledge)† (Dinan et al., 2019) | 41.8 | 17.8 | - | - | 87.0 | 14.0 | - | - |
| E2E Transformer MemNet† (Dinan et al., 2019) | 63.5 | 16.9 | - | 22.5 | 97.3 | 14.4 | - | 12.2 |
| E2E Transformer MemNet (BERT vocab)‡ | 53.2 | 17.7 | 4.8 | 23.2 | 137.8 | 13.6 | 1.9 | 10.5 |
| PostKS* (Lian et al., 2019) | 79.1 | 13.0 | 1.0 | 4.8 | 193.8 | 13.1 | 1.0 | 4.2 |
| E2E BERT | 53.5 | 16.8 | 4.5 | 23.7 | 105.7 | 13.5 | 2.2 | 13.6 |
| PostKS + Knowledge Loss | 54.5 | 18.1 | 5.3 | 23.4 | 144.8 | 13.5 | 2.0 | 9.4 |
| E2E BERT + PostKS | 54.6 | 17.8 | 5.3 | 25.5 | 113.2 | 13.4 | 2.3 | 14.1 |
| E2E BERT + PostKS + Copy | 52.2 | 19.0 | 6.5 | 25.5 | 83.4 | 15.6 | 3.9 | 14.4 |
| Ours | 52.0 | 19.3 | 6.8 | 26.8 | 81.4 | 16.1 | 4.2 | 18.3 |
+
+Table 3: Quantitative results on the Holl-E dataset (Moghe et al., 2018) with single reference and multiple references test set.
+
+| Method | Single Reference | Multiple References |
| PPL | R-1 | R-2 | Acc | PPL | R-1 | R-2 | Acc |
| Random knowledge selection | - | 7.4 | 1.8 | 1.9 | - | 10.3 | 3.6 | 3.5 |
| Repeat last utterance | - | 11.4 | 1.5 | - | - | 13.6 | 2.0 | - |
| E2E Transformer MemNet (Dinan et al., 2019) | 140.6 | 20.1 | 10.3 | 22.7 | 83.6 | 24.3 | 12.8 | 32.3 |
| PostKS* (Lian et al., 2019) | 196.6 | 15.2 | 6.0 | 1.5 | 114.1 | 19.2 | 7.9 | 3.2 |
| E2E BERT | 112.6 | 25.9 | 18.3 | 28.2 | 66.9 | 31.1 | 22.7 | 37.5 |
| PostKS + Knowledge Loss | 135.1 | 19.9 | 10.7 | 22.5 | 81.9 | 23.8 | 12.9 | 32.2 |
| E2E BERT + PostKS | 119.9 | 27.8 | 20.1 | 27.6 | 66.7 | 33.7 | 25.8 | 37.3 |
| E2E BERT + PostKS + Copy | 47.4 | 29.2 | 22.3 | 27.8 | 27.9 | 35.9 | 29.0 | 37.8 |
| Ours | 48.9 | 29.8 | 23.1 | 29.2 | 28.5 | 36.5 | 29.7 | 39.2 |
+
+knowledge per document so that it is similar to that of WoW where all of the GT knowledge are in the form of sentences. Basically, we select the sentence that includes the span as the GT knowledge sentence. If the span is given over multiple sentences, we select the minimum number of consecutive sentences containing the span as GT. If no span is given, we use the no passages used tag as GT, which amounts to $5\%$ of all GT labels. It indicates that the gold utterance is generated with no knowledge grounding and the model should predict the label of no passages used for this sample to be correct. We make our new set of GT annotations available in the project page.
+
+# 4.2 EXPERIMENTAL SETTING
+
+Evaluation Metrics. We follow the evaluation protocol of WoW (Dinan et al., 2019). We measure unigram F1 (R-1), bigram F1 (R-2) and perplexity (PPL) for response generation, and the accuracy for knowledge selection. For $n$ -gram metrics, we remove all the punctuations and (a, an, the) before computing the score. We remind that lower perplexity and higher $n$ -gram (R-1, R-2) scores indicate better performance.
+
+The test set for Holl-E is split into two subsets, single reference and multiple references. The dataset basically provides a single response per context (denoted as single reference). However, for some conversations, more responses (e.g. 2-13) are collected from multiple annotators per context (multiple references). For evaluation of multiple references, we take the best score over multiple GTs by following Moghe et al. (2018). For knowledge accuracy, we regard the model's prediction is correct if it matches at least one of the correct answers.
+
+Baselines. We closely compare with two state-of-the-art knowledge-grounded dialogue models. The first one is E2E Transformer MemNet (Dinan et al., 2019), which uses a Transformer memory network for knowledge selection and a Transformer decoder for utterance prediction. The second
+
+one is PostKS (Lian et al., 2019), which uses the posterior knowledge distribution as a pseudo-label for knowledge selection. For fair comparison, we replace all GRU layers in PostKS with Transformers. We also compare with four variants of these models as an ablation study: (i) E2E BERT, where we replace the Transformer memory network with pre-trained BERT, (ii) PostKS + Knowledge loss, where we additionally use the knowledge loss, (iii) E2E BERT + PostKS, which combines all the components of baselines, and (iv) E2E BERT + PostKS + Copy, where we additionally use the copy mechanism with the Transformer decoder.
+
+We use official BERT tokenizer to tokenize the words and use pre-defined BERT vocabulary $(\mathcal{V} = 30522)$ to convert token to index1. All the baselines use the exactly same inputs with our model except PostKS, which does not make use of knowledge labels as proposed in the original paper.
+
+# 4.3 QUANTITATIVE RESULTS
+
+Table 2 compares the performance of different methods on the Wizard of Wikipedia dataset. Our model outperforms the state-of-the-art knowledge-grounded dialogue models in all metrics for knowledge selection (accuracy) and utterance generation (unigram F1, bigram F1). The PostKS that is trained with no knowledge label shows low accuracy on knowledge selection, which is slightly better than random guess. However, it attains better performance than E2E Transformer MemNet with the knowledge loss in the WoW Test Seen, which shows that leveraging prior and posterior knowledge distribution is effective for knowledge-grounded dialogue, although using sequential latent variable improves further. BERT improves knowledge selection accuracy, but not much as in TextQA because of diversity in knowledge selection of conversation. The E2E BERT + PostKS + Copy performs the best among baselines, but not as good as ours, which validates that sequential latent modeling is critical for improving the accuracy of knowledge selection and subsequently utterance generation. Additionally, the performance gaps between ours and baselines are larger in Test Unseen. It can be understood that the sequential latent variable can generalize better. Adding the copy mechanism to the baseline substantially improves the accuracy of utterance generation, but barely improves the knowledge selection, which also justifies the effectiveness of the sequential latent variable. Transformer (no knowledge) shows the lowest perplexity in the WoW Test Seen, and it is mainly due to that it may generate only general and simple utterances since no knowledge is grounded. This behavior can be advantageous for the perplexity, while the other knowledge-based models take a risk of predicting wrong knowledge, which is unfavorable for perplexity.
+
+Table 3 compares the performance of our model on Holl-E dataset. Similarly, our model outperforms all the baselines in all metrics. One notable trend is that BERT considerably reduces the perplexity in all models, which may be due to that the dataset size of Holl-E is much smaller than WoW and BERT prevents overfitting (Hao et al., 2019).
+
+# 4.4 QUALITATIVE RESULTS
+
+Single-Turn Human Evaluation. We perform a user study to complement the limitation of automatic language metrics. We evaluate several aspects of utterance generation using the similar setting in Guu et al. (2018). We randomly sample 100 test examples, and each sample is evaluated by three unique human annotators on Amazon Mechanical Turk (AMT). At test, we show dialogue context and generated utterance by our method or baselines. We ask turkers to rate the quality of each utterance in two aspects, which are referred to Li et al. (2019a): (i) Engagingness: how much do you like the response? and (ii) Knowledgeability: how much is the response informative? Each item is scored from 1 to 4 to avoid catch-all category in the answer (Dalal et al., 2014), where 1 means not at all, 2 is a little, 3 is somewhat, and 4 is a lot. To mitigate annotator bias and inter-annotator variability, we adjust human scoring with Bayesian calibration (Kulikov et al., 2019). Note that human evaluation on knowledge selection is not possible, since any knowledge could be fine for a given context, which is key motivation for our sequential latent model - diversity of knowledge selection.
+
+Table 4 summarizes the results of the single-turn human evaluation, which validates that annotators prefer our results to those of baselines. Again, the performance gaps between ours and baselines are larger in Test Unseen, thank to better generality of our sequential latent model.
+
+Table 4: Single-turn human evaluation results on the Wizard of Wikipedia. We report the mean ratings and their standard errors of different methods for engagingness and knowledgeability scores. TMN stands for E2E Transformer MemNet (Dinan et al., 2019).
+
+| Method | Test Seen | Test Unseen |
| Raw | Calibrated | Raw | Calibrated |
| Engage | Knowledge | Engage | Knowledge | Engage | Knowledge | Engage | Knowledge |
| PostKS | 1.65 (0.05) | 1.72 (0.06) | 1.51 (0.02) | 1.72 (0.01) | 1.66 (0.06) | 1.74 (0.06) | 1.38 (0.02) | 1.60 (0.02) |
| TMN | 2.57 (0.05) | 2.47 (0.06) | 2.41 (0.02) | 2.49 (0.01) | 2.39 (0.06) | 2.21 (0.06) | 2.12 (0.02) | 2.05 (0.02) |
| Ours | 2.59 (0.05) | 2.53 (0.06) | 2.45 (0.02) | 2.55 (0.01) | 2.52 (0.06) | 2.35 (0.06) | 2.26 (0.02) | 2.21 (0.02) |
| Human | 3.14 (0.05) | 3.09 (0.05) | 3.00 (0.02) | 3.12 (0.01) | 3.11 (0.05) | 2.99 (0.05) | 2.83 (0.01) | 2.85 (0.02) |
+
+Table 5: Multi-turn human evaluation results on the Wizard of Wikipedia. We report the averages and standard deviations (in parentheses).
+
+| Method | Test Seen | Test Unseen |
| E2E Transformer MemNet (Dinan et al., 2019) | 2.36 (1.38) | 2.10 (0.96) |
| Ours | 2.39 (0.99) | 2.38 (1.01) |
| Human (Dinan et al., 2019) | 4.13 (1.08) | 4.34 (0.98) |
+
+Multi-turn Human Evaluation. We add another human evaluation results in a multi-turn setting using the evaluation toolkit from Wizard of Wikipedia (Dinan et al., 2019). Humans are paired with one of the models and chat about a specific topic (given a choice of 2-3 topics) for 3-5 dialogue turns. After conversation, they score their dialogue partners on a scale of 1-5, with the rating indicating how much they liked the conversation. We collect the votes for 110 randomly sampled conversations from 11 different turkers.
+
+Table 5 compares the results of different methods for the multi-turn evaluation. Human annotators prefer our results to those of baselines with a larger gap in Test Unseen.
+
+Dialogue Examples. Figure 3 shows selected examples of utterance prediction. In each set, we show dialogue context, human response, and utterances generated by our method and baselines. Thanks to the use of latent variables, our model can better capture the changes in dialogue topics and thus generate more appropriate responses.
+
+# 5 RELATED WORK
+
+Knowledge-based conversations have been studied much including collecting new datasets (Qin et al., 2019; Zhang et al., 2018; Ghazvininejad et al., 2018; Zhou et al., 2018; Dinan et al., 2019; Moghe et al., 2018) or developing new models (Lian et al., 2019; Li et al., 2019b; Yavuz et al., 2019; Zhao et al., 2019b; Dinan et al., 2019; Liu et al., 2019). Most works on the models have less investigated the knowledge selection issue but instead focused on how to effectively combine given knowledge and dialogue context to improve response informativeness. For example, Ghazvininejad et al. (2018) aid a Seq2Seq model with an external knowledge memory network, and Li et al. (2019b) propose an Incremental Transformer to encode multi-turn utterances along with knowledge in related documents. Recently, Dinan et al. (2019) propose both a dataset of Wizard of Wikipedia and a model to leverage the two-step procedure of selecting knowledge from the pool and generating a response based on chosen knowledge and given context.
+
+One of the most related models to ours may be Lian et al. (2019), who also focus on the knowledge selection issue in the two-stage knowledge-grounded dialogue. However, our work is novel in that we model it as a sequential decision process with latent variables and introduce the knowledge loss. Thanks to these updates, our model achieves significantly better performance as shown in the experiments.
+
+Sequential Latent Variable Models. There have been many studies about sequential latent variable models. Chung et al. (2015) propose one of the earliest latent models for sequential data, named VRNN. Later, this architecture is extended to SRNN (Fraccaro et al., 2016) and Z-Forcing (Goyal et al., 2017). There have been some notable applications of sequential latent models, including doc
+
+| Seen Test (Topic: Italian Cuisine) | Unseen Test (Topic: Hunting) |
| A: I love chicken parligiana as well, but I think my ultimate favorite is beef lasagna... Extra cheese please!W: Chicken with sauce and mozzarella.... Be still my heart!A: Truthfully, anything with cheese is the best | A: W: That is true but we always have to watch out for excessive hunting. It has caused some species to be endangered.A: Yes I agree. I don’t believe in the useless hunting that poachers do. Its so cruel. |
| (Ours) i love pizza too ! it ’ s a traditional Italian dish consisting of yeasted flatbread typically topped with tomato sauce and cheese(TMN) i love cheese !(E2E BERT+KL) i like mine topped with vegetables , meats , and condiments.(Human) especially cheddar cheese ! it ’ s the second most popular cheese in the use ! | (Ours) i agree , poaching has been defined as the illegal hunting or capturing of wild animals .(TMN) i thinks so , i ’ m not sure if you ’ re talking about poaching , but i know that poodles are the second most intelligent breed behind the poodle .(E2E BERT+KL) i agree . i think it ’ s a great way to catch fish .(Human) agreed , i remember reading one time that unless you plan to kill the animals its not considered hunting . |
+
+Figure 3: Examples of generated responses by our model and baselines on Wizard of Wikipedia. TMN stands for E2E Transformer MemNet, and A and W for apprentice and wizard. Examples with selected knowledge sentences can be found at Appendix E.
+
+ument summarization (Li et al., 2017), image captioning (Aneja et al., 2019) and text generation (Shao et al., 2019). Another related class of sequential latent models may be latent attention models (Deng et al., 2018; Wang et al., 2018; Yang et al., 2017), which exploit the latent variables to model the attention mapping between input and output sequences. Although our method is partly influenced by such recent models, it is novel to propose a sequential latent model for the knowledge-grounded chit-chat problem.
+
+# 6 CONCLUSION
+
+This work investigated the issue of knowledge selection in multi-turn knowledge-grounded dialogue, and proposed a sequential latent variable model, for the first time, named sequential knowledge transformer (SKT). Our method achieved the new state-of-the-art performance on the Wizard of Wikipedia benchmark (Dinan et al., 2019) and a knowledge-annotated version of Holl-E dataset (Moghe et al., 2018). There are several promising future directions beyond this work. First, we can explore other inference models such as sequential Monte Carlo methods using filtering variational objectives (Maddison et al., 2017a). Second, we can study the interpretability of knowledge selection such as measuring the uncertainty of attention (Heo et al., 2018).
+
+# ACKNOWLEDGMENTS
+
+We thank Hyunwoo Kim, Chris Dongjoo Kim, Soochan Lee, Junsoo Ha and the anonymous reviewers for their helpful comments. This work was supported by SK T-Brain corporation and Institute of Information & communications Technology Planning & Evaluation (IITP) grant funded by the Korea government (MSIT) (No.2019-0-01082, SW StarLab). Gunhee Kim is the corresponding author.
+
+# REFERENCES
+
+Jyoti Aneja, Harsh Agrawai, Dhruv Batra, and Alexander Schwing. Sequential Latent Spaces for Modeling the Intention During Diverse Image Captioning. In ICCV, 2019.
+Piotr Bojanowski, Edouard Grave, Armand Joulin, and Tomas Mikolov. Enriching Word Vectors with Subword Information. In TACL, 2016.
+Daniel Cer, Yinfei Yang, Sheng-yi Kong, Nan Hua, Nicole Limtiaco, Rhomni St John, Noah Constant, Mario Guajardo-Cespedes, Steve Yuan, Chris Tar, et al. Universal Sentence Encoder. arXiv:1803.11175, 2018.
+Danqi Chen, Adam Fisch, Jason Weston, and Antoine Bordes. Reading Wikipedia to Answer Open-Domain Questions. In ACL, 2017.
+
+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.
+Junyoung Chung, Kyle Kastner, Laurent Dinh, Kratarth Goel, Aaron C Courville, and Yoshua Bengio. A Recurrent Latent Variable Model for Sequential Data. In NIPS, 2015.
+Dev K Dalal, Nathan T Carter, and Christopher J Lake. Middle Response Scale Options are Inappropriate for Ideal Point Scales. J. Bus. Psychol., 29(3):463-478, 2014.
+Yuntian Deng, Yoon Kim, Justin Chiu, Demi Guo, and Alexander Rush. Latent Alignment and Variational Attention. In NIPS, 2018.
+Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-Training of Deep Bidirectional Transformers for Language Understanding. In *NAACL-HLT*, 2019.
+Emily Dinan and Jason Weston. Advances in Conversational AI. https://ai.facebook.com/blog/advances-in-conversational-ai/, 2019.
+Emily Dinan, Stephen Roller, Kurt Shuster, Angela Fan, Michael Auli, and Jason Weston. Wizard of Wikipedia: Knowledge-Powered Conversational Agents. In ICLR, 2019.
+Sergey Edunov, Myle Ott, Michael Auli, David Grangier, and Marc'Aurelio Ranzato. Classical Structured Prediction Losses for Sequence to Sequence Learning. In NAACL-HLT, 2017.
+Marco Fraccaro, Soren Kaae Sønderby, Ulrich Paquet, and Ole Winther. Sequential Neural Models with Stochastic Layers. In NIPS, 2016.
+Marjan Ghazvininejad, Chris Brockett, Ming-Wei Chang, Bill Dolan, Jianfeng Gao, Wen-tau Yih, and Michel Galley. A Knowledge-Grounded Neural Conversation Model. In AAAI, 2018.
+Xavier Glorot and Yoshua Bengio. Understanding the Difficulty of Training Deep Feedforward Neural Networks. In AISTATS, 2010.
+Karthik Gopalakrishnan, Behnam Hedayatnia, Qinlang Chen, Anna Gottardi, Sanjeev Kwatra, Anu Venkatesh, Raefer Gabriel, Dilek Hakkani-Tür, and Amazon Alexa AI. Topical-Chat: Towards Knowledge-Grounded Open-Domain Conversations. In Interspeech, 2019.
+Anirudh Goyal Alias Parth Goyal, Alessandro Sordoni, Marc-Alexandre Côté, Nan Rosemary Ke, and Yoshua Bengio. Z-Forcing: Training Stochastic Recurrent Networks. In NIPS, 2017.
+Kelvin Guu, Tatsunori B Hashimoto, Yonatan Oren, and Percy Liang. Generating Sentences by Editing Prototypes. TACL, 6:437-450, 2018.
+Yaru Hao, Li Dong, Furu Wei, and Ke Xu. Visualizing and Understanding the Effectiveness of BERT. In EMNLP, 2019.
+Jay Heo, Hae Beom Lee, Saehoon Kim, Juho Lee, Kwang Joon Kim, Eunho Yang, and Sung Ju Hwang. Uncertainty-Aware Attention for Reliable Interpretation and Prediction. In NIPS, 2018.
+Eric Jang, Shixiang Gu, and Ben Poole. Categorical Reparameterization with Gumbel-Softmax. In ICLR, 2017.
+Diederik Kingma and Jimmy Ba. Adam: A Method for Stochastic Optimization. In ICLR, 2015.
+Ilya Kulikov, Alexander H Miller, Kyunghyun Cho, and Jason Weston. Importance of a Search Strategy in Neural Dialogue Modelling. In INLG, 2019.
+Margaret Li, Jason Weston, and Stephen Roller. ACUTE-EVAL: Improved Dialogue Evaluation with Optimized Questions and Multi-turn Comparisons. arXiv:1909.03087, 2019a.
+Piji Li, Wai Lam, Lidong Bing, and Zihao Wang. Deep Recurrent Generative Decoder for Abstractive Text Summarization. In EMNLP, 2017.
+
+Zekang Li, Cheng Niu, Fandong Meng, Yang Feng, Qian Li, and Jie Zhou. Incremental Transformer with Deliberation Decoder for Document Grounded Conversations. In ACL, 2019b.
+Rongzhong Lian, Min Xie, Fan Wang, Jinhua Peng, and Hua Wu. Learning to Select Knowledge for Response Generation in Dialog Systems. In IJCAI, 2019.
+Zhibin Liu, Zheng-Yu Niu, Hua Wu, and Haifeng Wang. Knowledge aware conversation generation with reasoning on augmented graph. In EMNLP, 2019.
+Chris J Maddison, John Lawson, George Tucker, Nicolas Heess, Mohammad Norouzi, Andriy Mnih, Arnaud Doucet, and Yee Teh. Filtering Variational Objectives. In NIPS, 2017a.
+Chris J Maddison, Andriy Mnih, and Yee Whye Teh. The Concrete Distribution: A Continuous Relaxation of Discrete Random Variables. 2017b.
+Andrea Madotto, Chien-Sheng Wu, and Pascale Fung. Mem2Seq: Effectively Incorporating Knowledge Bases into End-to-End Task-Oriented Dialog Systems. In EMNLP, 2018.
+Sewon Min, Victor Zhong, Richard Socher, and Caiming Xiong. Efficient and Robust Question Answering from Minimal Context over Documents. In ACL, 2018.
+Nikita Moghe, Siddhartha Arora, Suman Banerjee, and Mitesh M Khapra. Towards Exploiting Background Knowledge for Building Conversation Systems. In EMNLP, 2018.
+Prasanna Parthasarathi and Joelle Pineau. Extending Neural Generative Conversational Model using External Knowledge Sources. In EMNLP, 2018.
+Gabriel Pereyra, George Tucker, Jan Chorowski, Łukasz Kaiser, and Geoffrey Hinton. Regularizing Neural Networks by Penalizing Confident Output Distributions. In ICLR, 2017.
+Lianhui Qin, Michel Galley, Chris Brockett, Xiaodong Liu, Xiang Gao, Bill Dolan, Yejin Choi, and Jianfeng Gao. Conversing by Reading: Contentful Neural Conversation with On-Demand Machine Reading. In ACL, 2019.
+Shiv Shankar and Sunita Sarawagi. Posterior Attention Models for Sequence to Sequence Learning. In ICLR, 2019.
+Zhihong Shao, Minlie Huang, Jiangtao Wen, Wenfei Xu, and Xiaoyan Zhu. Long and Diverse Text Generation with Planning-based Hierarchical Variational Model. In EMNLP, 2019.
+Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is All You Need. In NIPS, 2017.
+Weiyue Wang, Derui Zhu, Tamer Alkhouli, Zixuan Gan, and Hermann Ney. Neural Hidden Markov Model for Machine Translation. In ACL, 2018.
+Tsung-Hsien Wen, Yishu Miao, Phil Blunsom, and Steve Young. Latent intention dialogue models. In ICML, 2017.
+Yingce Xia, Fei Tian, Lijun Wu, Jianxin Lin, Tao Qin, Nenghai Yu, and Tie-Yan Liu. Deliberation Networks: Sequence Generation Beyond One-Pass Decoding. In NIPS, 2017.
+Zichao Yang, Zhiting Hu, Yuntian Deng, Chris Dyer, and Alex Smola. Neural Machine Translation with Recurrent Attention Modeling. In EACL, 2017.
+Semih Yavuz, Abhinav Rastogi, Guan-Lin Chao, and Hakkani-Tur Dilek. DeepCopy: Grounded Response Generation with Hierarchical Pointer Networks. In SIGDIAL, 2019.
+Saizheng Zhang, Emily Dinan, Jack Urbanek, Arthur Szlam, Douwe Kiela, and Jason Weston. Personalizing Dialogue Agents: I Have a Dog, Do You Have Pets Too? In ACL, 2018.
+Tiancheng Zhao, Ran Zhao, and Maxine Eskenazi. Learning Discourse-level Diversity for Neural Dialog Models using Conditional Variational Autoencoders. In ACL, 2017.
+
+Wei Zhao, Liang Wang, Kewei Shen, Ruoyu Jia, and Jingming Liu. Improving Grammatical Error Correction via Pre-Training a Copy-Augmented Architecture with Unlabeled Data. In NAACL-HLT, 2019a.
+
+Xueliang Zhao, Chongyang Tao, Wei Wu, Can Xu, Dongyan Zhao, and Rui Yan. A Document-Grounded Matching Network for Response Selection in Retrieval-based Chatbots. In *IJCAI*, 2019b.
+
+Kangyan Zhou, Shrimai Prabhumoye, and Alan W Black. A Dataset for Document Grounded Conversations. In EMNLP, 2018.
+
+# A DERIVATION OF CONDITIONAL PROBABILITY
+
+In Section 3, we re-write the conditional probability of wizard's response $\mathbf{y}^t$ given dialogue context $\mathbf{x}^{\leq t}$ and $\mathbf{y}^{< t}$ from Eq. (2) to Eq. (4). We can simply derive it as follows:
+
+$$
+\begin{array}{l} p (\mathbf {y} | \mathbf {x}) (13) \\ = \prod_ {t} \sum_ {\mathbf {k} ^ {t}} p _ {\theta} \left(\mathbf {y} ^ {t} \mid \mathbf {x} ^ {\leq t}, \mathbf {y} ^ {< t}, \mathbf {k} ^ {\leq t}\right) \pi_ {\theta} \left(\mathbf {k} ^ {t}\right) \quad (\text {b y E q . (2)}) (14) \\ = \prod_ {i = 1} ^ {t - 1} \sum_ {\mathbf {k} ^ {i}} p _ {\theta} \left(\mathbf {y} ^ {i} \mid \mathbf {x} ^ {\leq i}, \mathbf {y} ^ {< i}\right) p _ {\theta} \left(\mathbf {k} ^ {i}\right) \left(\sum_ {\mathbf {k} ^ {t}} p _ {\theta} \left(\mathbf {y} ^ {t} \mid \mathbf {x} ^ {\leq t}, \mathbf {y} ^ {< t}, \mathbf {k} ^ {\leq t}\right) \pi_ {\theta} \left(\mathbf {k} ^ {t}\right)\right) \quad (\text {b y}) (15) \\ \approx \prod_ {i = 1} ^ {t - 1} \sum_ {\mathbf {k} ^ {i}} p _ {\theta} \left(\mathbf {y} ^ {i} \mid \mathbf {x} ^ {\leq i}, \mathbf {y} ^ {< i}\right) q _ {\phi} \left(\mathbf {k} ^ {i}\right) \left(\sum_ {\mathbf {k} ^ {t}} p _ {\theta} \left(\mathbf {y} ^ {t} \mid \mathbf {x} ^ {\leq t}, \mathbf {y} ^ {< t}, \mathbf {k} ^ {\leq t}\right) \pi_ {\theta} \left(\mathbf {k} ^ {t}\right)\right) (16) \\ = \prod_ {i = 1} ^ {t - 1} \sum_ {\mathbf {k} ^ {i}} q _ {\phi} \left(\mathbf {k} ^ {i}\right) \left(\sum_ {\mathbf {k} ^ {t}} p _ {\theta} \left(\mathbf {y} ^ {t} \mid \mathbf {x} ^ {\leq t}, \mathbf {y} ^ {< t}, \mathbf {k} ^ {t}\right) \pi_ {\theta} \left(\mathbf {k} ^ {t}\right)\right) \quad \left(\mathbf {x} ^ {\leq t} \text {a n d} \mathbf {y} ^ {< t} \text {a r e g i v e n}\right) (17) \\ \approx p \left(\mathbf {y} ^ {t} \mid \mathbf {x} ^ {\leq t}, \mathbf {y} ^ {< t}\right), (18) \\ \end{array}
+$$
+
+where $q_{\phi}(\mathbf{k}^i)$ is an approximated posterior distribution and $p_{\theta}(\mathbf{k}^i)$ is a true posterior distribution.
+
+# B TRAINING DETAILS
+
+All the parameters except pretrained parts are initialized with Xavier method (Glorot & Bengio, 2010). We use Adam optimizer (Kingma & Ba, 2015) with $\beta_{1} = 0.9$ , $\beta_{2} = 0.999$ , $\epsilon = 1e - 07$ . For the models without BERT, we set the learning rate to 0.001 and initialize the embedding matrix with fastText (Bojanowski et al., 2016) trained on the Common Crawl corpus. For the models with BERT, we set the learning rate to 0.00002 and initialize encoder weights with BERT-Base, Uncased pretrained weights. We apply label smoothing (Pereyra et al., 2017; Edunov et al., 2017; Vaswani et al., 2017) for both knowledge selection and response generation, and set 0.1 and 0.05 for each. We set the temperature of Gumbel-Softmax to $\tau = 0.1$ and the hyperparameter for the knowledge loss to $\lambda = 1.0$ . For efficiency, we batch the dialogues rather than individual turns. We train our model up to 5 epochs on two NVIDIA Titan Xp GPU.
+
+# C KNOWLEDGE SELECTION ACCURACY OVER TURNS
+
+Table 6 compares the knowledge selection accuracy of different methods for each turn on the Wizard of Wikipedia. Thanks to the sequential latent variable, our model consistently outperforms other methods for all turns in knowledge selection accuracy. Notably, in all models, the accuracy significantly drops after the first turn, which is often easily predictable as a topic definition sentence. It shows the diversity nature in knowledge selection, as discussed in Section 2.
+
+# D QUANTITATIVE RESULTS ON SEMI-SUPERVISED SETTING
+
+Table 7 shows the results of our model with partial knowledge labels on the Wizard of Wikipedia. We attain better performance with more labeled knowledge data for training as expected. Furthermore,
+
+Table 6: Knowledge selection accuracy for each turn on the Wizard of Wikipedia (Dinan et al., 2019). The method with $\left[\ast\right]$ uses no knowledge loss. TMN stands for E2E Transformer MemNet.
+
+| Method | Test Seen | Test Unseen |
| 1st | 2nd | 3rd | 4th | 5th | 1st | 2nd | 3rd | 4th | 5th |
| PostKS* (Lian et al., 2019) | 3.6 | 3.6 | 4.1 | 7.0 | 9.5 | 3.4 | 3.0 | 4.7 | 4.1 | 9.9 |
| PostKS + Knowledge Loss | 55.4 | 19.3 | 10.7 | 8.7 | 7.0 | 26.0 | 3.8 | 4.0 | 3.9 | 3.8 |
| TMN (Dinan et al., 2019) | 55.8 | 19.5 | 10.4 | 7.6 | 6.2 | 25.9 | 7.0 | 4.1 | 4.2 | 6.1 |
| E2E BERT + PostKS | 56.5 | 20.6 | 13.7 | 10.4 | 9.2 | 36.0 | 8.1 | 6.1 | 6.8 | 5.7 |
| Ours | 59.1 | 20.6 | 15.8 | 12.8 | 9.1 | 52.9 | 8.8 | 8.4 | 6.4 | 10.7 |
+
+Table 7: Performance of our model with partial knowledge labels on Wizard of Wikipedia (Dinan et al., 2019).
+
+| Method | Test Seen | Test Unseen |
| PPL | R-1 | R-2 | Acc | PPL | R-1 | R-2 | Acc |
| E2E Transformer MemNet† (Dinan et al., 2019) | 63.5 | 16.9 | - | 22.5 | 97.3 | 14.4 | - | 12.2 |
| E2E Transformer MemNet (BERT vocab)‡ | 53.2 | 17.7 | 4.8 | 23.2 | 137.8 | 13.6 | 1.9 | 10.5 |
| Ours | 52.0 | 19.3 | 6.8 | 26.8 | 81.4 | 16.1 | 4.2 | 18.3 |
| 1/2 knowledge labeled | 49.0 | 19.2 | 6.6 | 25.1 | 77.8 | 16.1 | 4.1 | 16.7 |
| 1/4 knowledge labeled | 45.7 | 18.7 | 6.1 | 22.4 | 78.0 | 15.8 | 3.6 | 13.8 |
| 1/8 knowledge labeled | 45.3 | 18.6 | 6.0 | 21.0 | 79.9 | 15.7 | 3.6 | 12.3 |
| no knowledge loss | 54.7 | 17.1 | 4.6 | 0.3 | 88.2 | 15.5 | 3.4 | 0.1 |
+
+our model achieves competitive performance with less label. For instance, our model using only 1/4 labeled training data is comparable to E2E Transformer MemNet and even better in Test Unseen. As a result, our sequential latent knowledge selection model can be utilized in a semi-supervised method without severe drop in the performance.
+
+# E EXAMPLES WITH SELECTED KNOWLEDGE
+
+Figure 4 and 5 show selected examples of knowledge selection and response generation. In each set, given dialogue context, we compare selected knowledge and generated utterances by our method and baselines with human ground truths.
+
+| Seen Test (Topic: Italian Cuisine) |
| A: I love chicken paramigiana as well, but I think my ultimate favorite is beef lasagna...Extra cheese please!W: Chicken with sauce and mozzarella.... Be still my heart!A: Truthfully, anything with cheese is the best |
| Task 1: Knowledge Selection | Task 2: Response Generation |
| Ours | Pizza is a traditional Italian dish consisting of a yeasted flatbread typically topped with tomato sauce and cheese and baked in an oven.(from “Pizza” Wikipedia page) | i love pizza too ! it ’s a traditionalitalian dish consisting of yeasted flatbread typically topped with tomato sauce and cheese |
| TMN | no_passages_used | i love cheese ! |
| E2EBERT+KL | It can also be topped with additional vegetables, meats, and condiments, and can be made without cheese.(from “Pizza” Wikipedia page) | i like mine topped with vegetables , meats , and condiments . |
| Human | It is the second-most popular cheese in the US (behind mozzarella), with an average annual consumption of 10 lb (4.5 kg) per capita.(from “Cheddar cheese” Wikipedia page) | especially cheddar cheese ! it ’s the second most popular cheese in the use ! |
+
+Figure 4: Examples of selected knowledge and generated responses by our model and baselines on the WoW Seen Test set.
+
+| Unseen Test (Topic: Hunting) |
| A: Yes, that is the best way to do it. Apparently in some areas the government will actually pay money to hunt for ...
+W: That is true but we always have to watch out for excessive hunting. It has cause some species to be endangered.
+A: Yes I agree. I don’t believe in the useless hunting that poachers do. It’s so cruel. |
| Task 1: Knowledge Selection | Task 2: Response Generation |
| Ours | Poaching has traditionally been defined as the illegal hunting or capturing of wild animals, usually associated with land use rights.
+(from “Poaching” Wikipedia page) | i agree , poaching has been defined as the illegal hunting or capturing of wild animals . |
| TMN | no_passages_used | i thinks so , i ’m not sure if you ’re talking about poaching , but i know that poodles are the second most intelligent breed behind the poodle . |
| E2EBERT+KL | Hunting can also be a means of pest control.
+(from “Poaching” Wikipedia page) | i agree . i think it ’s a great way to catch fish . |
| Human | It is also not considered hunting to pursue animals without intent to kill them, as in wildlife photography, birdwatching, or scientific research
+(from “Hunting” Wikipedia page) | agreed , i remember reading one time that unless you plan to kill the animals its not considered hunting . |
+
+Figure 5: Examples of selected knowledge and generated responses by our model and baselines on the WoW Unseen Test set.
\ No newline at end of file
diff --git a/sequentiallatentknowledgeselectionforknowledgegroundeddialogue/images.zip b/sequentiallatentknowledgeselectionforknowledgegroundeddialogue/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..2fb115bba628a25360928e6e25695e5209732e46
--- /dev/null
+++ b/sequentiallatentknowledgeselectionforknowledgegroundeddialogue/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:423821ce2caddca876e8ca8f276f690d619d1593ee200475606a9d704280d31f
+size 883791
diff --git a/sequentiallatentknowledgeselectionforknowledgegroundeddialogue/layout.json b/sequentiallatentknowledgeselectionforknowledgegroundeddialogue/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..f986e3fa0cb3c476d9a6737512c258320cf27f80
--- /dev/null
+++ b/sequentiallatentknowledgeselectionforknowledgegroundeddialogue/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:397721ec2194ce15152980ba209ad834b354c3bf6121a38b08099f1c70d71d29
+size 398301
diff --git a/simplifiedactiondecoderfordeepmultiagentreinforcementlearning/4a6b773a-4021-48cc-8733-113e9413b64e_content_list.json b/simplifiedactiondecoderfordeepmultiagentreinforcementlearning/4a6b773a-4021-48cc-8733-113e9413b64e_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..bf7ecdff408a97a7a2756c25c318c8a0c8362a7a
--- /dev/null
+++ b/simplifiedactiondecoderfordeepmultiagentreinforcementlearning/4a6b773a-4021-48cc-8733-113e9413b64e_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:bf90233a2beade9f7fd9e5acf594a8b590a0ca60382b3f190b29bcf0b40d6bdb
+size 78068
diff --git a/simplifiedactiondecoderfordeepmultiagentreinforcementlearning/4a6b773a-4021-48cc-8733-113e9413b64e_model.json b/simplifiedactiondecoderfordeepmultiagentreinforcementlearning/4a6b773a-4021-48cc-8733-113e9413b64e_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..0cc90225f29d44ce77bc6dcb29cbd4428d5f25ad
--- /dev/null
+++ b/simplifiedactiondecoderfordeepmultiagentreinforcementlearning/4a6b773a-4021-48cc-8733-113e9413b64e_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a3055ef466bab93d8babbff8586f01660cae833aae06c207c4b08cb6c59c17da
+size 93703
diff --git a/simplifiedactiondecoderfordeepmultiagentreinforcementlearning/4a6b773a-4021-48cc-8733-113e9413b64e_origin.pdf b/simplifiedactiondecoderfordeepmultiagentreinforcementlearning/4a6b773a-4021-48cc-8733-113e9413b64e_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..33558134169270a4bf299ecdbade93b0fa9c4ad4
--- /dev/null
+++ b/simplifiedactiondecoderfordeepmultiagentreinforcementlearning/4a6b773a-4021-48cc-8733-113e9413b64e_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c71c9aefda346a2d8f445f1f5d23ba344fbcb354ef9dd581c5de4b8b78015226
+size 1509293
diff --git a/simplifiedactiondecoderfordeepmultiagentreinforcementlearning/full.md b/simplifiedactiondecoderfordeepmultiagentreinforcementlearning/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..bca25f30feacca301a68e67604a0df388213234e
--- /dev/null
+++ b/simplifiedactiondecoderfordeepmultiagentreinforcementlearning/full.md
@@ -0,0 +1,268 @@
+# SIMPLIFIED ACTION DECODER FOR DEEP MULTI-AGENT REINFORCEMENT LEARNING
+
+Hengyuan Hu, Jakob N Foerster
+
+Facebook AI Research, CA, USA
+
+{hengyuan,jnf}@fb.com
+
+# ABSTRACT
+
+In recent years we have seen fast progress on a number of benchmark problems in AI, with modern methods achieving near or super human performance in Go, Poker and Dota. One common aspect of all of these challenges is that they are by design adversarial or, technically speaking, zero-sum. In contrast to these settings, success in the real world commonly requires humans to collaborate and communicate with others, in settings that are, at least partially, cooperative. In the last year, the card game Hanabi has been established as a new benchmark environment for AI to fill this gap. In particular, Hanabi is interesting to humans since it is entirely focused on theory of mind, i.e., the ability to effectively reason over the intentions, beliefs and point of view of other agents when observing their actions. Learning to be informative when observed by others is an interesting challenge for Reinforcement Learning (RL): Fundamentally, RL requires agents to explore in order to discover good policies. However, when done naively, this randomness will inherently make their actions less informative to others during training. We present a new deep multi-agent RL method, the Simplified Action Decoder (SAD), which resolves this contradiction exploiting the centralized training phase. During training SAD allows other agents to not only observe the (exploratory) action chosen, but agents instead also observe the greedy action of their team mates. By combining this simple intuition with best practices for multi-agent learning, SAD establishes a new SOTA for learning methods for 2-5 players on the self-play part of the Hanabi challenge. Our ablations show the contributions of SAD compared with the best practice components. All of our code and trained agents are available at https://github.com/facebookresearch/Hanabi_SAD.
+
+# 1 INTRODUCTION
+
+Humans are highly social creatures and spend vast amounts of time coordinating, collaborating and communicating with others. In contrast to these, at least partially, cooperative settings most progress on AI in games has been in zero-sum games where agents compete against each other, typically rendering communication futile. This includes examples such as Go (Silver et al., 2016; 2017; 2018), poker (Brown & Sandholm, 2017; Moravčík et al., 2017; Brown & Sandholm, 2019) and chess (Campbell et al., 2002).
+
+This narrow focus is unfortunate, since communication and coordination require unique abilities. In order to enable smooth and efficient social interactions of groups of people, it is commonly required to reason over the intents, points of views and beliefs of other agents from observing their actions. For example, a driver can reasonably infer that if a truck in front of them is slowing down when approaching an intersection, then there is likely an obstacle ahead. Furthermore, humans are both able to interpret the actions of others and can act in a way that is informative when their actions are being observed by others, capabilities that are commonly called theory of Mind (ToM), (Baker et al., 2017). Importantly, in order to carry out this kind of reasoning, an agent needs to consider why a given action is taken and what this decision indicates about the state of the world. Simply observing what other agents are doing is not sufficient.
+
+While these abilities are particularly relevant in partially observable, fully cooperative multi-agent settings, ToM reasoning clearly matters in a variety of real world scenarios. For example, autonomous
+
+cars will likely need to understand the point of view, intents and beliefs of other traffic participants in order to deal with highly interactive settings such as 4-way crossing or dense traffic in cities.
+
+Hanabi is a fully cooperative, partially-observable card game that has recently been proposed as a new benchmark challenge problem for AI research (Bard et al., 2019) to fill the gap around ToM. In Hanabi, players need to find conventions that allow them to effectively exchange information from their local observations through their actions, taking advantage of the fact that actions are observed by all team mates.
+
+Most prior state-of-the-art agents for Hanabi were developed using handcrafted algorithms, which beat off-the-shelf deep multi-agent RL methods by a large margin. This makes intuitive sense: Beyond the "standard" multi-agent challenges of credit assignment, nonstationarity and joint exploration, learning an informative policy presents an additional fundamentally new conflict. On the one hand, an RL agent needs to explore in order to discover good policies through trial and error. On the other hand, when carried out naively, this exploration will add noise to the policy of the agent during the training process, making their actions strictly less informative to their team mates.
+
+One possible solution to this is to explore in the space of deterministic partial policies, rather than actions, and sample these policies from a distribution that conditions on a common knowledge Bayesian belief. This is successfully carried out in the Bayesian Action Decoder (BAD) (Foerster et al., 2019), the only previous Deep RL method to achieve a state-of-the-art in Hanabi. While this is a notable accomplishment, it comes at the cost of simplicity and generality. For a start, BAD requires an explicit common knowledge Bayesian belief to be tracked, which not only adds computational burden due to the required sampling steps, but also uses expert knowledge regarding the game dynamics. Furthermore, BAD, as presented, is trained using actor-critic methods which are sample inefficient and suffer from local optima. In order to get around this, BAD uses population based training, further increasing the number of samples required. Lastly, BAD's explicit reliance on common knowledge limits the generality of the method.
+
+In this paper we propose the Simplified Action Decoder (SAD), a method that achieves a similar goal to BAD, but addresses all of the issues mentioned above. At the core of SAD is a different approach towards resolving the conflict between exploration and being interpretable, which, like BAD, relies on the centralized training with decentralized control (CT/DC) regime. Under CT/DC information can be exchanged freely amongst all agents during centralized training, as long as the final policies are compatible with decentralized execution.
+
+The key insight is that during training we do not have to chose between being informative, by taking greedy actions, and exploring, by taking random actions. To be informative, the greedy actions do not need to be executed by the environment, but only need to be observed by the team mates. Thus in SAD each agent takes two different actions at each time step: One greedy action, which is not presented to the environment but observed by the team mates at the next time step as an additional input, and the "standard" (exploratory) action that gets executed by the environment and is observed by the team mates as part of the environment dynamics. Importantly, during greedy execution the observed environment action can be used instead of centralized information for the additional input, since now the agent has stopped exploring.
+
+Furthermore, to ensure that these greedy actions and observations get decoded into a meaningful representation, we can optionally train an auxiliary task that predicts key hidden game properties from the action-observation trajectories. While we note that this idea is in principle compatible with any kind of model-free deep RL method with minimal modifications to the core algorithm, we use a distributed version of recurrent DQN in order to improve sample efficiency, account for partial observability and reduce the risk of local optima. We also train a joint-action Q-function that consists of the sum of per-agent Q-values to allow for off-policy learning in this multi-agent setting using Value Decomposition Networks (VDN) (Sunehag et al., 2017).
+
+Using SAD we establish a new SOTA for learning methods for 2-5 players in Hanabi, with a method that not only requires less expert knowledge and compute, but is also more general than previous approaches. In order to ensure that our results can be easily verified and extended, we also evaluate our method on a proof-of-principle matrix game and open-source our training code and agents. Beyond enabling more research into the self-play aspect of Hanabi, we believe these resources will provide a much needed starting point for the ad-hoc teamwork part of the Hanabi challenge.
+
+# 2 RELATED WORK
+
+Our work relates closely to research on emergent communication protocols using deep multi-agent RL, as first undertaken by Sukhbaatar et al. (2016) and Foerster et al. (2016). There has been a large number of follow-up papers in this area, so listing all relevant work is beyond the scope and we refer the reader to Nguyen et al. (2018), a recent survey on deep multi-agent RL. One major difference to our work is that the environments considered typically contain a cheap-talk channel, which can be modeled as a continuous variable during the course of training. This allows agents to, for example, use differentiation across the communication channel in order to learn protocols. In contrast, in our setting agents have to communicate through the observable environment actions themselves, requiring fundamentally different methods.
+
+Furthermore, our work is an example of cooperative multi-agent learning in partially observable settings under centralized training and decentralized control. There have been a large number of papers in this space, with seminal work including MADDPG (Lowe et al., 2017) and COMA (Foerster et al., 2018a), both of which are actor-critic methods that employ a centralized critic with decentralized actors. Again, we refer the reader to Nguyen et al. (2018) for a more comprehensive survey.
+
+Until 2018, work on Hanabi had been focused on hand-coded methods and heuristics. Some relevant examples include SmartBot (O'Dwyer, 2019) and the so-called "hat-coding" strategies, as implemented by WTFWThat (Wu, 2018). These strategies use the information theoretic ideas that allow each hint to reveal information to all other agents at the same time. While they do not perform well for 2-player Hanabi due to the smaller action space, they get near perfect scores for 3-5 players.
+
+In contrast, so far learning methods have seen limited success on Hanabi. Bard et al. (2019) undertake a systematic evaluation of current Deep RL methods for 2-5 players in two different regimes and open-source the Hanabi-Learning-Environment (HLE) to foster research on the game. They evaluate a feed-forward version of DQN trained on 100 million samples and a recurrent actor-critic agent with population based training using 20 billion samples. Notably, while both agents achieve near $0\%$ win rate for 3-5 players in Hanabim, at a high level their DQN agent is a good starting point for our work. However, since the authors did not propose any specific method of accounting for the issues introduced by $\epsilon$ -greedy exploration in a ToM task, they resorted to setting $\epsilon$ to zero after a short burn-in phase. The only state-of-the-art in Hanabi established by an RL agent is from Foerster et al. (2019) which we refer to in more detail in Section 1 and Section 4. Recently there have also been attempts to train agents that are robust to different team-mates (Canaan et al., 2019) and even to extend to human-AI collaboration (Liang et al., 2019). For a more comprehensive review on previous results on Hanabi we refer the reader to Bard et al. (2019).
+
+Poker is another partially observable multi-agent setting, although it is fundamentally different due to the game being zero-sum. Recent success in Poker has extensively benefited from search (Brown et al.). Examples of using search in Hanabi include Goodman (2019).
+
+# 3 BACKGROUND
+
+# 3.1 SETTING
+
+In this paper we assume a Dec-POMDP (Oliehoek, 2012), in which $N$ agents interact in a partially observable environment. At each time step agent $a \in 1..N$ obtains an observation, $o_t^a = O(s_t, a)$ where $s_t \in S$ is the Markov state of the system and $O(s_t, a)$ is the deterministic observation function. Since we are interested in ToM, in our setting the observation function includes the last action of the acting agent, which is observed by all other agents at the next time step. We note that actions are commonly observable not only in board games but also in some real world multi-agent settings, such as autonomous driving.
+
+For simplicity, we restrict ourselves to turn based settings, in which at each time step only the acting agents takes an action, $u_{t}^{a}$ , which is sampled from their policy, $u^{a} \sim \pi_{\theta}^{a}(u^{a}|\tau^{a})$ , while all other agents take a no-op action. Here $\tau^{a}$ is the action-observation history of agent $a$ , $\tau^{a} = \{o_{0}^{a}, u_{0}^{a}, r_{1},..r_{T}, o_{T}^{a}\}$ , $T$ is the length of the episode and $\theta$ are the weights of a function approximator that represents the policy, in our case recurrent neural networks, such as LSTMs (Hochreiter & Schmidhuber, 1997).
+
+We further use $\tau_{t}$ to describe the state-action sequence, $\tau = \{s_0,\mathbf{u_0},r_1,\dots r_T,s_T\}$ , where $\mathbf{u_t}$ is the joint action of all agents.
+
+As is typical in cooperative multi-agent RL, the goal of the agents is to maximize the total expected return, $J_{\theta} = \mathbb{E}_{\tau \sim P(\tau|\theta)} R_0(\tau)$ , where $R_0(\tau)$ is the return of the trajectory (in general $R_t(\tau) = \sum_{t' \geq t} \gamma^{t' - t} r_{t'}$ ) and $\gamma$ is an optional discount factor. We have also assumed that agents are sharing parameters, $\theta$ , as is common in cooperative MARL.
+
+# 3.2 DISTRIBUTED RECURRENT DQN AND AUXILIARY TASKS
+
+In Q-learning the agent approximates the expected return for a given state action-pair, $s$ , $u$ , assuming that the agent acts greedily with respect to the Q-function for all future time steps, $Q(s,u) = \mathbb{E}_{\tau \sim P(\tau | s, u)} R_t(\tau)$ , where $\tau = \{s_t, u_t, r_{t+1}, \ldots, s_T\}$ , $u_t = u$ and $u_{t'} = \arg \max_{u'} Q(s_{t'}, u')$ , $\forall t' > t$ . A common exploration scheme is $\epsilon$ -greedy, in which the agent takes a random action with probability $\epsilon$ and acts greedily otherwise. Importantly, the Q-function can be trained efficiently using the Bellman equation: $Q(s,u) = \mathbb{E}_{s'}[r_{t+1} + \gamma \max_{u'} Q(s', u')]$ , where for simplicity we have assumed a deterministic reward. In Deep Q-Learning (DQN) (Mnih et al., 2015) the Q-function is parameterized by a deep neural network and trained with transitions sampled from experience replay.
+
+In our work we also incorporate other best practice components of the last few years, including double-DQN (van Hasselt et al., 2015),ueling network architecture (Wang et al., 2015) and prioritized replay (Schaul et al., 2015). We also employ a distributed training architecture similar to the one proposed by Horgan et al. (2018) where a number of different actors with their own exploration rates collect experiences in parallel and feed them into a central replay buffer. Since our setting is partially observable the natural choice for the function approximator is a recurrent neural network. A combination of these techniques was first explored by Kapturowski et al. (2019) in single agent environments such as Atari and DMLab-30.
+
+Another common best-practice in RL are auxiliary tasks Mirowski et al. (2016); Jaderberg et al. (2016), in which the agent produces extra output-heads that are trained on supervised tasks and optimized alongside the RL loss.
+
+# 3.3 CENTRALISED TRAINING, DECENTRALIZED EXECUTION AND JOINT Q-FUNCTIONS
+
+The most straight forward application of Q-learning to multi-agent settings is Independent Q-Learning (IQL) (Tan, 1993) in which each agent keeps an independent estimate of the expected return, treating all other agents as part of the environment. One challenge with IQL is that the exploratory behavior of other agents is not corrected for via the max operator in the bootstrap. Notably, IQL does typically not take any advantage of centralized training with decentralized control (CT/DC), a paradigm under which information can be exchanged freely amongst agents during the training phase as long as the policies rely only on local observations during execution.
+
+There are various approaches for learning joint-Q-functions in the CT/DC regime. For example, Value-Decomposition-Networks (VDN) (Sunehag et al., 2017) represent the joint-Q-function as a sum of per-agent contributions and QMIX (Rashid et al., 2018) learns a non-linear but monotonic combination of these contributions.
+
+# 4 METHOD
+
+# 4.1 THEORY OF MIND AND BAYESIAN REASONING
+
+At the very core of interpreting the actions of another agent, and ToM in general, is Bayesian reasoning. Fundamentally, asking what a given action by another agent implies about the state of the world requires understanding of why this action was taken. To illustrate this, we start out with an agent that has a given belief about the state-action history of the world, $\tau_{t}$ , given her own action-observation history $\tau_{t}^{a}$ : $B(\tau_{t}) = P(\tau_{t}|\tau_{t}^{a})$ .
+
+Next the agent observes the action $u_{t}^{a^{\prime}}$ of her team mate, $a^\prime$ , and carries out a Bayesian update:
+
+$$
+\begin{array}{l} P \left(\tau_ {t} \mid \tau_ {t} ^ {a}, u _ {t} ^ {a ^ {\prime}}\right) = \frac {P \left(u _ {t} ^ {a ^ {\prime}} \mid \tau_ {t}\right) P \left(\tau_ {t} \mid \tau_ {t} ^ {a}\right)}{\sum_ {\tau_ {t} ^ {\prime}} P \left(u _ {t} ^ {a ^ {\prime}} \mid \tau_ {t} ^ {\prime}\right) P \left(\tau_ {t} ^ {\prime} \mid \tau_ {t} ^ {a}\right)} (1) \\ = \frac {\pi^ {a ^ {\prime}} \left(u _ {t} ^ {a ^ {\prime}} \mid O \left(a ^ {\prime} , \tau_ {t}\right)\right) B \left(\tau_ {t}\right)}{\sum_ {\tau_ {t} ^ {\prime}} \pi^ {a ^ {\prime}} \left(u _ {t} ^ {a ^ {\prime}} \mid O \left(a ^ {\prime} , \tau_ {t} ^ {\prime}\right)\right) B \left(\tau_ {t} ^ {\prime}\right)}, (2) \\ \end{array}
+$$
+
+where, with a slight abuse of notation, we have used (and will keep using) $O(a', \tau_t)$ for the action-observation history, $\tau_t^{a'}$ , that results from applying the observation function for agent $a'$ to $\tau_t$ at each time step. Note that for non-deterministic observation functions we would have to marginalize over $P(\tau_t^{a'} | \tau_t)$ .
+
+Clearly, since agents have access to the policy of their teammate during centralised training, we could in principle evaluate this explicit Bayesian belief. However, beyond the practical difficulty of computing this explicit belief, when it is used as an input to the policy it will lead to prohibitively costly higher order beliefs. The typical workout for this is a public belief over private features which only conditions on common knowledge and can therefore be calculated by all agents individually, we refer to Moravčík et al. (2017); Nayyar et al. (2013); Foerster et al. (2018b) for more details.
+
+Instead, in this work we rely on RNNs to learn implicit representations of the sufficient statistics over the distribution of the Markov state given the action-observation histories, noting that they are unlikely to recover exact beliefs due to the issues mentioned above.
+
+# 4.2 EXPLORATION AND BELIEFS
+
+Next we illustrate the impact of exploration on the beliefs, which we will do in the explicit (exact) case, since it serves as an upper bound on the accuracy of the implicit beliefs. Since we are looking at fully-cooperative settings we assume that the optimal policy of the agent is deterministic and any randomness is due to exploration. Given that we are focused on value based methods we furthermore assume an $\epsilon$ -greedy exploration scheme, noting that the same analysis can be extended to other methods. Under this exploration scheme $\pi^{a'}(u_t^{a'}|O(a',\tau_t))$ becomes:
+
+$$
+\pi^ {a ^ {\prime}} \left(u _ {t} ^ {a ^ {\prime}} \mid O \left(a ^ {\prime}, \tau_ {t}\right)\right) = (1 - \epsilon) \mathbf {I} \left(u ^ {*} \left(\tau_ {t}\right), u _ {t} ^ {a ^ {\prime}}\right) + \epsilon / | U |, \tag {3}
+$$
+
+where we have used $u^{*}(\tau_{t})$ to indicate the greedy action of the agent $a'$ , $u^{*}(\tau_{t}) = \arg \max_{u} Q^{a'}(u, O(a', \tau_{t}))$ and $\mathbf{I}$ is the indicator function.
+
+While the first part corresponds to a filtering operator, in which the indicator function only attributes finite probability to those histories that are consistent with the action taken under greedy execution, the exploration term adds a fixed (history independent) probability, which effectively 'blurs' the posterior:
+
+$$
+\begin{array}{l} P \left(\tau_ {t} \mid \tau_ {t} ^ {a}, u _ {t} ^ {a ^ {\prime}}\right) = \frac {\left((1 - \epsilon) \mathbf {I} \left(u ^ {*} \left(\tau_ {t}\right) , u _ {t} ^ {a ^ {\prime}}\right) + \epsilon / | U |\right) B \left(\tau_ {t}\right)}{\sum_ {\tau^ {\prime}} \left((1 - \epsilon) \mathbf {I} \left(u ^ {*} \left(\tau^ {\prime}\right) , u _ {t} ^ {a ^ {\prime}}\right) + \epsilon / | U |\right) B \left(\tau^ {\prime}\right)} (4) \\ = \frac {\left((1 - \epsilon) \mathbf {I} \left(u ^ {*} \left(\tau_ {t}\right) , u _ {t} ^ {a ^ {\prime}}\right) + \epsilon / | U |\right) B \left(\tau_ {t}\right)}{\epsilon / | U | + \sum_ {\tau^ {\prime}} \left((1 - \epsilon) \mathbf {I} \left(u ^ {*} \left(\tau^ {\prime}\right) , u _ {t} ^ {a ^ {\prime}}\right)\right) B \left(\tau^ {\prime}\right)} (5) \\ = \frac {B \left(\tau_ {t}\right)}{1 + | U | \sum_ {s ^ {\prime}} \left((1 / \epsilon - 1) \mathbf {I} \left(u ^ {*} \left(\tau^ {\prime}\right), u _ {t} ^ {a ^ {\prime}}\right) B \left(\tau^ {\prime}\right) \right.} (6) \\ + \frac {\left((1 - \epsilon) \mathbf {I} \left(u ^ {*} \left(\tau_ {t}\right) , u _ {t} ^ {a ^ {\prime}}\right)\right) B \left(\tau_ {t}\right)}{\epsilon / | U | + \sum_ {\tau^ {\prime}} \left((1 - \epsilon) \mathbf {I} \left(u ^ {*} \left(\tau^ {\prime}\right) , u _ {t} ^ {a ^ {\prime}}\right)\right) B \left(\tau^ {\prime}\right)}. (7) \\ \end{array}
+$$
+
+We find that the posterior includes an additional term of the form $B(\tau_t)$ which carries over an unfiltered density over the trajectories from the prior. We further confirm that in the limit of $\epsilon = 1$ , the posterior collapses to the prior, $P(\tau_t|\tau_t^a,u_t^{a'}) = B(\tau_t)$ . This can be particularly worrisome in
+
+the context of our training setup, whereby different agents run different, and potentially high, $\epsilon$ throughout the course of training. It fundamentally makes the beliefs obtained less informative.
+
+While not making the above argument explicitly, the Bayesian Action Decoder (BAD) (Foerster et al., 2019), resolves this issue by shifting exploration to the level of deterministic partial policies, rather than action-level, and tracking an approximate Bayesian belief. As outlined in Section 1 this comes at a huge cost in the complexity of the method, the computation requirements and in the loss of generality of the method.
+
+# 4.3 SIMPLIFIED ACTION DECODING
+
+In this paper we take a drastically simpler and different approach towards the issue. We note that the 'blurring', which makes decoding of an action challenging, is entirely due to the $\epsilon$ -greedy exploration term. Furthermore, in order for another agent to do an implicit Bayesian update over an action taken, it is not required that this action is executed by the environment. Indeed, if we assume that other agents can observe the greedy action, $u^{*}$ , at every time step and condition their belief update on this, the terms depending on $\epsilon$ disappear from the Bayesian update:
+
+$$
+P \left(\tau_ {t} \mid \tau_ {t} ^ {a}, u ^ {*}\right) = \frac {\mathbf {I} \left(u ^ {*} \left(\tau_ {t}\right) , u ^ {*}\right)\left. \right) B \left(\tau_ {t}\right)}{\sum_ {\tau^ {\prime}} \mathbf {I} \left(u ^ {*} \left(\tau^ {\prime}\right) , u ^ {*}\right)\left. \right) B \left(\tau^ {\prime}\right)} \tag {8}
+$$
+
+Therefore, to have our cake and eat it, in the Simplified Action Decoder (SAD) the acting agent is allowed to 'take' two actions at any given time step during training. The first action, $u^a$ , is the standard environment action, which gets executed as usual and is observed by all agents through the observation function at the next time step, as mentioned in Section 3. The second action, $u^*$ , is the greedy action of the active agent. This action does not get executed by the environment but instead is presented as an additional input to the other agents at the next time step, taking advantage of the centralized training regime during which information can be exchanged freely.
+
+Clearly we are not allowed to pass around extra information during decentralized control, but luckily this is not needed. Since we set $\epsilon$ to 0 at test time we can simply use the, now greedy, environment action obtained from the observation function as our greedy-action input.
+
+While this is most straight forward in settings where the last action is observed by other agents directly, in principle SAD can also be extended to settings where it is indirectly observed by all agents through the environment dynamics. In these cases we can replace the greedy-action side-channel with a learned inverse model that recovers the action from the observation history during execution.
+
+Furthermore, to encourage the agent to meaningfully decode the information contained in the greedy action, we can optionally add an auxiliary task to the training process, such as predicting unobserved information from their observation history.
+
+While this idea is compatible with any deep RL algorithm with minimal modifications, we use a recurrent version of DQN with distributed training,ueling networks and prioritized replay. We also learn a joint Q-function using VDN in order to address the challenges of multi-agent off-policy learning, please see Section 3 for details on all of these standard methods.
+
+# 5 EXPERIMENTS
+
+# 5.1 MATRIX GAME
+
+We first verify the effectiveness of SAD in the two step, two player matrix game from Foerster et al. (2019), which replicates the communication through action challenge of Hanabi in a highly simplified setting. In this fully cooperative game each player obtains a privately observed 'card', which is drawn iid from two options (1,2).
+
+After observing her card, the first player takes one of three possible discrete actions (1, 2, 3). Crucially, the second player observes both her own private card and the team mate's action before acting herself, which establishes the opportunity to communicate. The payout is a function of both the two private cards and the two actions taken by both agents, as shown in Figure 1.
+
+Importantly, there are some obvious strategies that do not require any communication. For example, if both player learn to play the 2nd action, the payout is always 8 points, independent of the cards dealt. However, if the players do learn to communicate it is possible to achieve 10 points for every pair of cards dealt.
+
+# 5.2 HANABI
+
+Hanabi is a fully cooperative card game in which all players work together to complete piles of cards referred to as fireworks. Each card has a rank, 1 to 5, and a color, $\mathbf{G} / \mathbf{B} / \mathbf{W} / \mathbf{Y} / \mathbf{R}$ . Each firework (one per color) starts with a 1 and is finished once the 5 has been added. There are three 1s, one 5 and two of all other ranks for each of the colors, adding up to a total of 50 cards in the deck. The twist in Hanabi is that while players can observe the cards held by their team mates, they cannot observe their own cards and
+
+thus need to exchange information with each other in order to understand what cards can be played. There are two main means for doing so: First of all, players can take grounded hint actions, in which they reveal the subset of a team mate's hand that matches a specific rank or color. An example hint is "Your third and fifth card are 1s". These hint actions cost scarce information tokens, which can be replenished by discarding a card, an action that both removes the card from the game and makes it visible to all players.
+
+Finally players can also choose to play a card. If this card is the next card for the firework of the corresponding color, it is added to the firework and the team scores one point. Otherwise the card is removed from the game, the identity is made public, and the team loses one of the 3 life tokens. If the team runs out of life tokens before the end of the game, all points collected so far are lost and the game finishes immediately. These rules result in a maximum score of $5 \times 5 = 25$ points in any game, which corresponds to all five fireworks being completed with five cards per firework.
+
+To ensure reproducibility and comparability of our results we use the Hanabi Learning Environment (HLE) (Bard et al., 2019) for all experimentation. For further details regarding Hanabi and the self-play part of the Hanabi challenge please see Bard et al. (2019).
+
+# 5.3 ARCHITECTURE AND COMPUTATION REQUIREMENTS
+
+We borrow some ideas and insights from prior distributed Q-learning methods while bring extensions to MARL as well as innovations to improve throughput and efficiency. Following Horgan et al. (2018) and Kapturowski et al. (2019), we use a distributed prioritized replay buffer shared by $N$ asynchronous actors and a centralized trainer that samples mini-batches from the replay buffer to update the model. In each actor thread, we run $K$ environments sequentially and batch their observations together. The observation batch is then fed into an actor that utilizes a GPU to compute a batch of actions. All asynchronous actors share one GPU and the trainer uses another GPU for gradient computation and model updates. This is different from prior works which run single actor and single environment in each thread on a CPU. Our method enables us to run a very large number of simulations with moderate computation resources. In all Hanabi experiments, we run $N = 80$ actor threads with $K = 80$ environments in each thread on single machine with 40 CPU cores and 2 GPUs. Without this architectural improvement, it may require at least a few hundred CPU cores to run 6400 Hanabi environments, in which case neural network agents and simulations have to be distributed across multiple machines, greatly reducing the reproducibility and accessibility of such research. Please refer to Appendix A for implementation details and hyper-parameters.
+
+
+Figure 1: Illustration of the matrix game from Foerster et al. (2019)
+
+# 6 RESULTS
+
+# 6.1 MATRIX GAME
+
+As we can see in Figure 2, even in our simple matrix game the greedy action input makes a drastic difference. With an average reward of around 9.5 points, tabular IQL does well in this task, matching the BAD results from Foerster et al. (2019). However, just by adding the greedy action as an additional input, we obtain an average performance of $9.97 \pm 0.02$ . Results are averaged over 100 seeds, and shading is s.e.m. The code is available here: www.bit.ly/2mBJLyk.
+
+
+Figure 2: Results for the matrix game.
+
+# 6.2 HANABI
+
+As shown in Table 1, our findings from the matrix game are for the most part confirmed on the challenging Hanabi benchmark. To illustrate the contributions of the different components, we compare average scores and win rates across 13 independent training runs of SAD and three different options: IQL is simply the recurrent DQN agent with parameter sharing, VDN is the same agent but also learns a joint Q-function and finally SAD & AuxTask is the SAD agent with the auxiliary task.
+
+While we find that SAD significantly outperforms our baselines (IQL and VDN) for 2, 4 and 5 players in terms of average score and/or win rate, there is no significant difference for 3 players, where VDN matches the performance of SAD.
+
+Interestingly, the auxiliary task only significantly helps the 2-player performance, where it substantially boosts the average score and win rate. In contrast, it drastically hurts performance for 3-5 players, which opens an interesting avenue for future work.
+
+For completeness we have included training curves showing average scores and s.e.m. across all training runs for all numbers of players for our methods and ablations in Appendix B. We find that for 5 players the auxiliary task drastically reduces the variance of SAD and intermittently leads to higher performance during training but ultimately results in lower final performance. We can also clearly see that despite 72 hours of training and billions of samples consumed, the performance has not plateaued for 3-5 players, pointing to an obvious avenue for further improvements.
+
+The original numbers in the Hanabi challenge and BAD used population based training (Jaderberg et al., 2018), effectively reporting maximum performance across a large number of different runs. Therefore, for reproducibility purposes, we report evaluations of the best model from our various training runs for each method in Table 2.
+
+As shown, under this reporting we establish a new SOTA for learning methods on the self-play part of the Hanabi challenge for 2-5 players, with the most drastic improvements being achieved for 3-5 players. In particular, we beat both the ACHA agent from Bard et al. (2019) and the BAD agent on average score, even though both of them used population based training and require more compute. We note that while we follow the counting convention proposed by the challenge paper, BAD was optimized for a different counting scheme, in which agents keep their scores when they run out of lives. This may explain the higher win rate $(58.6\%)$ of BAD combined with a relatively low mean score, which is exceeded even by our baseline methods. Once again, only the performance for 2-player is significantly improved by the auxiliary task and the 3-player setting is an outlier in the sense that SAD does not improve the best performance compared to VDN.
+
+# 7 CONCLUSION AND FUTURE WORK
+
+In this paper we presented the Simplified Action Decoder (SAD), a novel deep multi-agent RL algorithm that allows agents to learn communication protocols in settings where no cheap-talk channel is available. On the challenging benchmark Hanabi our work substantially improves the SOTA for an RL method for all numbers of players. For two players SAD establishes a new high-score
+
+| Agent | 2 Players | 3 Players | 4 Players | 5 Players |
| IQL
+(Baseline) | 23.77 ± 0.04 | 23.02 ± 0.10 | 21.99 ± 0.09 | 20.60 ± 0.11 |
| 43.88 ± 1.21 % | 26.16 ± 2.01 % | 10.15 ± 0.86 % | 2.27 ± 0.32 % |
| VDN
+(Baseline) | 23.83 ± 0.03 | 23.71 ± 0.06 | 23.03 ± 0.15 | 21.18 ± 0.12 |
| 44.97 ± 1.28 % | 41.16 ± 1.27 % | 23.57 ± 2.20 % | 2.26 ± 0.32 % |
| SAD | 23.87 ± 0.03 | 23.69 ± 0.05 | 23.27 ± 0.16 | 22.06 ± 0.23 |
| 47.90 ± 1.10 % | 41.12 ± 1.10 % | 29.38 ± 2.63 % | 7.22 ± 1.29 % |
| SAD
+AuxTask | 24.02 ± 0.01 | 23.56 ± 0.07 | 22.78 ± 0.10 | 21.47 ± 0.08 |
| 54.38 ± 0.41 % | 40.77 ± 1.35 % | 20.80 ± 1.65 % | 2.92 ± 0.40 % |
+
+Table 1: Mean performance of our methods and baselines on Hanabi. We take the final models of 13 independent runs, i.e. 13 models per algorithm per player setting. Each model is evaluated on 100K games. Mean and s.e.m over the mean scores of the 13 models are shown in the table. The second row of each section is the win rate.
+
+| Agent | 2 Players | 3 Players | 4 Players | 5 Players |
| Rainbow(Bard et al., 2019) | 20.64 ± 0.032.5% | 18.71 ±0.010.2% | 18.00 ± 0.170% | 15.26 ± 0.180% |
| ACHA(Bard et al., 2019) | 22.73 ± 0.1215.1% | 20.24 ± 0.151.1% | 21.57 ± 0.122.4% | 16.80 ± 0.130% |
| BAD(Foerster et al., 2019) | 23.92 ± 0.0158.56% | - | - | - |
| IQL(Baseline) 50.47% | 23.97 ± 0.0140.25% | 23.69 ± 0.0119.39% | 22.76 ± 0.014.93% | 21.29 ± 0.01 |
| VDN(Baseline) | 23.96 ± 0.0150.27% | 23.99 ± 0.0150.37% | 23.79 ± 0.0038.86% | 21.80 ± 0.014.98% |
| SAD | 24.01 ± 0.0152.39% | 23.93 ± 0.0148.05% | 23.81 ± 0.0141.45% | 23.01 ± 0.0113.93% |
| SAD &AuxTask | 24.08 ± 0.0156.09% | 23.81 ± 0.0149.74% | 23.47 ± 0.0133.87% | 22.25 ± 0.017.33% |
+
+Table 2: Comparison between the previous SOTA learning methods and ours. We take the best model of 13 runs for each of our methods and baselines. Each model is evaluated on 100K games with different seeds. Mean and s.e.m over the 100K games are shown in the table. The s.e.m. is less than 0.01 for most models. Bold numbers are the best results achieved with learning algorithms. The second row of each section is the win rate.
+
+across any method. Furthermore we accomplish all of this with a method that is both simpler and requires less compute than previous advances. While these are encouraging steps, there is clearly more work to do. In particular, there remains a large performance gap between the numbers achieved by SAD and the known performance of hat-coding strategies (Wu, 2018) for 3-5 players. One possible reason is that SAD does not undertake any explicit exploration in the space of possible conventions. Another promising route for future work is to integrate search with RL, since this has produced SOTA results in a number of different domains including Poker, Go and backgammon.
+
+# REFERENCES
+
+Chris L Baker, Julian Jara-Ettinger, Rebecca Saxe, and Joshua B Tenenbaum. Rational quantitative attribution of beliefs, desires and percepts in human mentalizing. Nature Human Behaviour, 1(4): 0064, 2017.
+Nolan Bard, Jakob N. Foerster, Sarath Chandar, Neil Burch, Marc Lanctot, H. Francis Song, Emilio Parisotto, Vincent Dumoulin, Subhodeep Moitra, Edward Hughes, Iain Dunning, Shibl Mourad, Hugo Larochelle, Marc G. Bellemare, and Michael Bowling. The Hanabi Challenge: A New Frontier for AI Research. arXiv:1902.00506 [cs, stat], February 2019. URL http://arxiv.org/abs/1902.00506.arXiv:1902.00506.
+Noam Brown and Tuomas Sandholm. Superhuman AI for heads-up no-limit poker: Libratus beats top professionals. Science, pp. eaao1733, 2017.
+Noam Brown and Tuomas Sandholm. Superhuman AI for multiplayer poker. Science, pp. eaay2400, 2019.
+Noam Brown, Tuomas Sandholm, and Brandon Amos. Depth-Limited Solving for Imperfect-Information Games. pp. 14.
+Murray Campbell, A Joseph Hoane Jr, and Feng-hsiung Hsu. Deep Blue. Artificial intelligence, 134 (1-2):57-83, 2002.
+Rodrigo Canaan, Julian Togelius, Andy Nealen, and Stefan Menzel. Diverse agents for ad-hoc cooperation in hanabi. arXiv preprint arXiv:1907.03840, 2019.
+Jakob Foerster, Ioannis Alexandros Assael, Nando de Freitas, and Shimon Whiteson. Learning to communicate with deep multi-agent reinforcement learning. In Advances in Neural Information Processing Systems, pp. 2137-2145, 2016.
+Jakob Foerster, Francis Song, Edward Hughes, Neil Burch, Iain Dunning, Shimon Whiteson, Matthew Botvinick, and Michael Bowling. Bayesian action decoder for deep multi-agent reinforcement learning. In International Conference on Machine Learning, pp. 1942-1951, 2019.
+Jakob N Foerster, Gregory Farquhar, Triantafyllos Afouras, Nantas Nardelli, and Shimon Whiteson. Counterfactual multi-agent policy gradients. In Thirty-Second AAAI Conference on Artificial Intelligence, 2018a.
+Jakob N. Foerster, Francis Song, Edward Hughes, Neil Burch, Iain Dunning, Shimon Whiteson, Matthew Botvinick, and Michael Bowling. Bayesian Action Decoder for Deep Multi-Agent Reinforcement Learning. arXiv:1811.01458 [cs], November 2018b. URL http://arxiv.org/abs/1811.01458. arXiv:1811.01458.
+James Goodman. Re-determinizing information set monte carlo tree search in hanabi. arXiv preprint arXiv:1902.06075, 2019.
+Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural Comput., 9(8):1735-1780, November 1997. ISSN 0899-7667. doi: 10.1162/neco.1997.9.8.1735. URL http://dx.doi.org/10.1162/neco.1997.9.8.1735.
+Dan Horgan, John Quan, David Budden, Gabriel Barth-Maron, Matteo Hessel, Hado van Hasselt, and David Silver. Distributed prioritized experience replay. CoRR, abs/1803.00933, 2018. URL http://arxiv.org/abs/1803.00933.
+Max Jaderberg, Volodymyr Mnih, Wojciech Marian Czarnecki, Tom Schaul, Joel Z Leibo, David Silver, and Koray Kavukcuoglu. Reinforcement learning with unsupervised auxiliary tasks. arXiv preprint arXiv:1611.05397, 2016.
+Max Jaderberg, Wojciech M. Czarnecki, Iain Dunning, Luke Marris, Guy Lever, Antonio Garcia Castaneda, Charles Beattie, Neil C. Rabinowitz, Ari S. Morcos, Avraham Ruderman, Nicolas Sonnerat, Tim Green, Louise Deason, Joel Z. Leibo, David Silver, Demis Hassabis, Koray Kavukcuoglu, and Thore Graepel. Human-level performance in first-person multiplayer games with population-based deep reinforcement learning. arXiv:1807.01281 [cs, stat], July 2018. doi: 10.1126/science.aau6249. URL http://arxiv.org/abs/1807.01281.arXiv:1807.01281.
+
+Steven Kapturowski, Georg Ostrovski, John Quan, and Will Dabney. RECURRENT EXPERIENCE REPLAY IN DISTRIBUTED REINFORCEMENT LEARNING. pp. 1-19, 2019.
+Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
+Claire Liang, Julia Proft, Erik Andersen, and Ross A Knepper. Implicit communication of actionable information in human-ai teams. In Proceedings of the 2019 CHI Conference on Human Factors in Computing Systems, pp. 95. ACM, 2019.
+Ryan Lowe, Yi Wu, Aviv Tamar, Jean Harb, OpenAI Pieter Abbeel, and Igor Mordatch. Multi-agent actor-critic for mixed cooperative-competitive environments. In Advances in Neural Information Processing Systems, pp. 6379–6390, 2017.
+Piotr Mirowski, Razvan Pascanu, Fabio Viola, Hubert Soyer, Andrew J Ballard, Andrea Banino, Misha Denil, Ross Goroshin, Laurent Sifre, Koray Kavukcuoglu, et al. Learning to navigate in complex environments. arXiv preprint arXiv:1611.03673, 2016.
+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, 02 2015. URL http://dx.doi.org/10.1038/nature14236.
+Matej Moravčík, Martin Schmid, Neil Burch, Viliam Lisý, Dustin Morrill, Nolan Bard, Trevor Davis, Kevin Waugh, Michael Johanson, and Michael Bowling. Deepstack: Expert-level artificial intelligence in heads-up no-limit poker. Science, 356(6337):508-513, 2017.
+Ashutosh Nayyar, Aditya Mahajan, and Demosthenis Teneketzis. Decentralized stochastic control with partial history sharing: A common information approach. IEEE Transactions on Automatic Control, 58(7):1644-1658, 2013.
+Thanh Thi Nguyen, Ngoc Duy Nguyen, and Saeid Nahavandi. Deep reinforcement learning for multiagent systems: a review of challenges, solutions and applications. arXiv preprint arXiv:1812.11794, 2018.
+Arthur O'Dwyer. Hanabi. https://github.com/Quuxplusone/Hanabi, 2019.
+Frans A Oliehoek. Decentralized pomdps. In Reinforcement Learning, pp. 471-503. Springer, 2012.
+Tabish Rashid, Mikayel Samvelyan, Christian Schröder de Witt, Gregory Farquhar, Jakob N. Foerster, and Shimon Whiteson. QMIX: monotonic value function factorisation for deep multi-agent reinforcement learning. CoRR, abs/1803.11485, 2018. URL http://arxiv.org/abs/1803.11485.
+Tom Schaul, John Quan, Ioannis Antonoglou, and David Silver. Prioritized Experience Replay. arXiv e-prints, art. arXiv:1511.05952, Nov 2015.
+David Silver, Aja Huang, Chris J Maddison, Arthur Guez, Laurent Sifre, George Van Den Driessche, Julian Schrittwieser, Ioannis Antonoglou, Veda Panneershelvam, Marc Lanctot, et al. Mastering the game of go with deep neural networks and tree search. Nature, 529(7587):484-489, 2016.
+David Silver, Julian Schrittwieser, Karen Simonyan, Ioannis Antonoglou, Aja Huang, Arthur Guez, Thomas Hubert, Lucas Baker, Matthew Lai, Adrian Bolton, et al. Mastering the game of go without human knowledge. Nature, 550(7676):354, 2017.
+David Silver, Thomas Hubert, Julian Schrittwieser, Ioannis Antonoglou, Matthew Lai, Arthur Guez, Marc Lanctot, Laurent Sifre, Dharshan Kumaran, Thore Graepel, et al. A general reinforcement learning algorithm that masters chess, shogi, and go through self-play. Science, 362(6419): 1140-1144, 2018.
+
+Sainbayar Sukhbaatar, arthur szlam, and Rob Fergus. Learning Multiagent Communication with Backpropagation. In D. D. Lee, M. Sugiyama, U. V. Luxburg, I. Guyon, and R. Garnett (eds.), Advances in Neural Information Processing Systems 29, pp. 2244-2252. Curran Associates, Inc., 2016. URL http://papers.nips.cc/paper/6398-learning-multiagent-communication-with-backpropagation.pdf.
+Peter Sunehag, Guy Lever, Audrunas Gruslys, Wojciech Marian Czarnecki, Vinicius Flores Zambaldi, Max Jaderberg, Marc Lanctot, Nicolas Sonnerat, Joel Z. Leibo, Karl Tuyls, and Thore Graepel. Value-decomposition networks for cooperative multi-agent learning. CoRR, abs/1706.05296, 2017. URL http://arxiv.org/abs/1706.05296.
+Richard S. Sutton. Learning to predict by the methods of temporal differences. Mach. Learn., 3(1):9-44, August 1988. ISSN 0885-6125. doi: 10.1023/A:1022633531479. URL https://doi.org/10.1023/A:1022633531479.
+Ming Tan. Multi-agent reinforcement learning: Independent vs. cooperative agents. In Proceedings of the tenth international conference on machine learning, pp. 330-337, 1993.
+Hado van Hasselt, Arthur Guez, and David Silver. Deep reinforcement learning with double q-learning. CoRR, abs/1509.06461, 2015. URL http://arxiv.org/abs/1509.06461.
+Ziyu Wang, Nando de Freitas, and Marc Lanctot. Dueling network architectures for deep reinforcement learning. CoRR, abs/1511.06581, 2015. URL http://arxiv.org/abs/1511.06581.
+Jeff Wu. Hanabi simulation in rust. https://github.com/WuTheFWasThat/hanabi.rs, 2018.
+
+# A NETWORK ARCHITECTURE AND HYPER-PAMAMETERS FOR HANABI
+
+Our Hanabi agent uses dueling network architecture (Wang et al., 2015). The main body of the network consists of 1 fully connected layer of 512 units and 2 LSTM (Hochreiter & Schmidhuber, 1997) layers of 512 units, followed by two output heads for value and advantages respectively. The same network configuration is used across all Hanabi experiments. We take the default featurization of HLE and replace the card knowledge section with the V0-Belief proposed by Foerster et al. (2019). The maximum length of an episode is capped at 80 steps and the entire episode is stored in the replay buffer as one training sample. This avoids the "slate hidden states" problem as described in Kapturowski et al. (2019) because we can simply initialize the hidden states of LSTM as zero during training. For exploration and experience prioritization, we follow the simple strategy as in Horgan et al. (2018) and Kapturowski et al. (2019). Each actor executes an $\epsilon_{i}$ -greedy policy where $\epsilon_{i} = \epsilon^{1 + \frac{1}{N - 1}\alpha}$ for $i\in \{0,\dots,N - 1\}$ but with a smaller $\epsilon = 0.1$ and $\alpha = 7$ . For simplicity, all players of a game use the same epsilon. The per time-step priority $\delta_t$ is the TD error and per episode priority is computed following $\delta_{e} = \eta \max_{t}\delta_{i} + (1 - \eta)\hat{\delta}$ where $\eta = 0.9$ . Priority exponent is set to 0.9 and importance sampling exponent is set to 0.6. We use $n$ -step return (Sutton, 1988) and double Q-learning (van Hasselt et al., 2015) for target computation during training. The discount factor $\gamma$ is set to 0.999. The network is updated using Adam optimizer (Kingma & Ba, 2014) with learning rate $lr = 6.25\times 10^{-5}$ and $\epsilon = 1.5\times 10^{-5}$ . Trainer sends its network weights to all actors every 10 updates and target network is synchronized with online network every 2500 updates. These hyper-parameters are fixed across all experiments.
+
+In the baseline, we use Independent Q-Learning where each player estimates the Q value and selects action independently at each time-step. Note that all players need to operate on the observations in order to update their recurrent hidden states while only the current player has non-trivial legal moves and other players can only select 'pass'. Each player then writes its own version of the episode into the prioritized replay buffer and they are sampled independently during training. The prioritized replay buffer contains $2^{17}$ (131072) episodes. We warm up the replay buffer with 10,000 episodes before training starts. Batch size during training is 128 for games of different numbers of players.
+
+As mentioned in Section 4, the SAD agent is built on top of joint Q-function where the Q value is the sum of the individual Q value of all players given their own actions. One episode produces only one training sample with an extra dimension for the number of players. The replay buffer size is reduced to $2^{16}$ for 2-player and 3-player games and $2^{15}$ for 4-player and 5-player games. The batch sizes for 2-, 3-, 4-, 5-players are 64, 43, 32, 26 respectively to account for the fact that each sample contains more data.
+
+Auxiliary task can be added to the agent to help it decode the greedy action more effectively. In Hanabi, the natural choice is the predict the card of player's own hand. In our experiments, the auxiliary task is to predict the status of a card, which can be playable, discardable, or unknown. The loss is the average cross entropy loss per card and is simply added to the TD-error of reinforcement learning during training.
+
+# B LEARNING CURVES FOR HANABI
+
+
+Figure 3 shows learning curves of different algorithms averaged over 13 seeds per algorithm per player setting. Shading is error of the mean.
+
+
+(b) 3-Player
+
+
+(a) 2-Player
+(c) 4-Player
+Figure 3: Learning Curves
+
+
+(d) 5-Player
\ No newline at end of file
diff --git a/simplifiedactiondecoderfordeepmultiagentreinforcementlearning/images.zip b/simplifiedactiondecoderfordeepmultiagentreinforcementlearning/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..e2533f9dd5b2fcfb29d2c806a7273ef0c50c5c68
--- /dev/null
+++ b/simplifiedactiondecoderfordeepmultiagentreinforcementlearning/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:3589ab072aea9e5809c031529bb4dbbac85c547bc6727370bdf1c85f7199f74c
+size 323616
diff --git a/simplifiedactiondecoderfordeepmultiagentreinforcementlearning/layout.json b/simplifiedactiondecoderfordeepmultiagentreinforcementlearning/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..ac72db15314bd7e1c6dfafaac04819efc6ae9345
--- /dev/null
+++ b/simplifiedactiondecoderfordeepmultiagentreinforcementlearning/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:9d24c8ab3c3b9a185b5ad7adb2e6872c4f9f4a64c4ef29f6ce1120dc3b156354
+size 348989
diff --git a/skipconnectionsmatteronthetransferabilityofadversarialexamplesgeneratedwithresnets/f29e1597-30ff-4f92-91eb-c2b5fbbc04b8_content_list.json b/skipconnectionsmatteronthetransferabilityofadversarialexamplesgeneratedwithresnets/f29e1597-30ff-4f92-91eb-c2b5fbbc04b8_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..9ad0741f5c070f203e0c8203fbbf65174ee8415c
--- /dev/null
+++ b/skipconnectionsmatteronthetransferabilityofadversarialexamplesgeneratedwithresnets/f29e1597-30ff-4f92-91eb-c2b5fbbc04b8_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:047d475894550f8e6d8e106cb552eb1c7a1ca3bd0d20a56731d324d549283d2f
+size 98351
diff --git a/skipconnectionsmatteronthetransferabilityofadversarialexamplesgeneratedwithresnets/f29e1597-30ff-4f92-91eb-c2b5fbbc04b8_model.json b/skipconnectionsmatteronthetransferabilityofadversarialexamplesgeneratedwithresnets/f29e1597-30ff-4f92-91eb-c2b5fbbc04b8_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..2cccbb3a528c2b9d8411bc111d05805c00df182f
--- /dev/null
+++ b/skipconnectionsmatteronthetransferabilityofadversarialexamplesgeneratedwithresnets/f29e1597-30ff-4f92-91eb-c2b5fbbc04b8_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c29c20dd88334fc8124a9f2a41388c64209bb764c352e058e63926345d449f02
+size 116600
diff --git a/skipconnectionsmatteronthetransferabilityofadversarialexamplesgeneratedwithresnets/f29e1597-30ff-4f92-91eb-c2b5fbbc04b8_origin.pdf b/skipconnectionsmatteronthetransferabilityofadversarialexamplesgeneratedwithresnets/f29e1597-30ff-4f92-91eb-c2b5fbbc04b8_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..299d274625540c5bdc6a8a62f67b8be4822c8ce8
--- /dev/null
+++ b/skipconnectionsmatteronthetransferabilityofadversarialexamplesgeneratedwithresnets/f29e1597-30ff-4f92-91eb-c2b5fbbc04b8_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:8fc06d8eb9e9b7100aeb9cf63c997297f5c913f63305848ec9f0c543261efed0
+size 8653197
diff --git a/skipconnectionsmatteronthetransferabilityofadversarialexamplesgeneratedwithresnets/full.md b/skipconnectionsmatteronthetransferabilityofadversarialexamplesgeneratedwithresnets/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..862c18be5bd06b7fee231e284912225a44fdc052
--- /dev/null
+++ b/skipconnectionsmatteronthetransferabilityofadversarialexamplesgeneratedwithresnets/full.md
@@ -0,0 +1,338 @@
+# SKIP CONNECTIONS MATTER: ON THE TRANSFERABILITY OF ADVERSARIAL EXAMPLES GENERATED WITH RESNETS
+
+Dongxian Wu $^{1,3}$ Yisen Wang $^{2\dagger}$ Shu-Tao Xia $^{1,3}$ James Bailey $^{4}$ Xingjun Ma $^{4}$
+
+Tsinghua University
+$^{2}$ Shanghai Jiao Tong University
+$^{3}$ PCL Research Center of Networks and Communications, Peng Cheng Laboratory
+4The University of Melbourne
+
+# ABSTRACT
+
+Skip connections are an essential component of current state-of-the-art deep neural networks (DNNs) such as ResNet, WideResNet, DenseNet, and ResNeXt. Despite their huge success in building deeper and more powerful DNNs, we identify a surprising security weakness of skip connections in this paper. Use of skip connections allows easier generation of highly transferable adversarial examples. Specifically, in ResNet-like (with skip connections) neural networks, gradients can backpropagate through either skip connections or residual modules. We find that using more gradients from the skip connections rather than the residual modules according to a decay factor, allows one to craft adversarial examples with high transferability. Our method is termed Skip Gradient Method (SGM). We conduct comprehensive transfer attacks against state-of-the-art DNNs including ResNets, DenseNets, Inceptions, Inception-ResNet, Squeeze-and-Excitation Network (SENet) and robustly trained DNNs. We show that employing SGM on the gradient flow can greatly improve the transferability of crafted attacks in almost all cases. Furthermore, SGM can be easily combined with existing black-box attack techniques, and obtain high improvements over state-of-the-art transferability methods. Our findings not only motivate new research into the architectural vulnerability of DNNs, but also open up further challenges for the design of secure DNN architectures.
+
+# 1 INTRODUCTION
+
+In deep neural networks (DNNs), a skip connection builds a short-cut from a shallow layer to a deep layer by connecting the input of a convolutional block (also known as the residual module) directly to its output. While different layers of a neural network learn different "levels" of features, skip connections can help preserve low-level features and avoid performance degradation when adding more layers. This has been shown to be crucial for building very deep and powerful DNNs such as ResNet (He et al., 2016a;b), WideResNet (Zagoruyko & Komodakis, 2016), DenseNet (Huang et al., 2017) and ResNeXt (Xie et al., 2017). In the meantime, despite their superior performance, DNNs have been found extremely vulnerable to adversarial examples (or attacks), which are input examples slightly perturbed with an intention to fool the network to make a wrong prediction (Szegedy et al., 2013; Goodfellow et al., 2014; Ma et al., 2018; Bai et al., 2019; Wang et al., 2019; 2020). Adversarial examples often appear imperceptible to human observers, and are transferable across different models (Liu et al., 2017). This has raised security concerns on the deployment of DNNs in security critical scenarios, such as face recognition (Sharif et al., 2016), autonomous driving (Evtimov et al., 2018), video analysis (Jiang et al., 2019) and medical diagnosis (Ma et al., 2019).
+
+Adversarial examples can be crafted following either a white-box setting (the adversary has full access to the target model) or a black-box setting (the adversary has no information of the target model). White-box methods such as Fast Gradient Sign Method (FGSM) (Goodfellow et al., 2014), Basic Iterative Method (BIM) (Kurakin et al., 2016), Projected Gradient Decent (PGD) (Madry et al., 2018) and Carlini and Wagner (CW) (Carlini & Wagner, 2017) often suffer from low transferability
+
+
+Figure 1: Left: Illustration of the last 3 skip connections (green lines) and residual modules (black boxes) of a ImageNet-trained ResNet-18. Right: The success rate (in the form of "white-box/black-box") of adversarial attacks crafted using gradients flowing through either a skip connection (going upwards) or a residual module (going leftwards) at each junction point (circle). Three example backpropagation paths are highlighted in different colors, with the green path skipping over the last two residual modules having the best attack success rate while the red path through all 3 residual modules having the worst attack success rate. The attacks are crafted by BIM on 5000 ImageNet validation images under maximum $L_{\infty}$ perturbation $\epsilon = 16$ (pixel values are in [0,255]). The black-box success rate is tested against a VGG19 target model.
+
+in a black-box setting, thus posing only limited threats to DNN models which are usually kept secret in practice (Dong et al., 2018; Xie et al., 2019). Several techniques have been proposed to improve the transferability of black-box attacks crafted on a surrogate model, such as momentum boosting (Dong et al., 2018), diverse input (Xie et al., 2019) and translation invariance (Dong et al., 2019). Although these techniques are effective, they (as well as white-box methods) all treat the entire network (either the target model or the surrogate model) as a single component while ignore its inner architectural characteristics. The question of whether or not the DNN architecture itself can expose more transferability of adversarial attacks is an unexplored problem.
+
+In this paper, we identify one such weakness about the skip connections used by many state-of-the-art DNNs. We first conduct a toy experiment with the BIM attack and ResNet-18 on the ImageNet validation dataset (Deng et al., 2009) to investigate how skip connections affect the adversarial strength of attacks crafted on the network. At each of the last 3 skip connections and residual modules of ResNet-18, we illustrate the success rate of attacks crafted using gradients backpropagate through either the skip connection or the residual module in Figure 1. As can be observed, the success rate drops more drastically whenever using gradients from a residual module instead of the skip connection. This implies that gradients from the skip connections are more vulnerable (high success rate). In addition, we surprisingly find that skip connections expose more transferable information. For example, the black-box success rate was even improved from $52.52\%$ to $62.10\%$ when the attack skips the last two residual modules (following the path in green color).
+
+Motivated by the above observations, in this paper, we propose the Skip Gradient Method (SGM) to generate adversarial examples using gradients more from the skip connections rather than the residual modules. In particular, SGM utilizes a decay factor to reduce gradients from the residual modules. We find that this simple adjustment on the gradient flow can generate highly transferable adversarial examples, and the more skip connections in a network, the more transferable are the crafted attacks. This is in sharp contrast to the design principles (e.g., "going deeper" with skip connections) underpinning many modern DNNs. In particular, our main contributions are:
+
+- We identify one surprising property of skip connections in ResNet-like neural networks, i.e., they allow an easy generation of highly transferable adversarial examples.
+- We propose the Skip Gradient Method (SGM) to craft adversarial examples using gradients more from the skip connections. Using a single decay factor on gradients, SGM is an appealingly simple and generic technique that can be used by any existing gradient-based attack methods.
+- We provide comprehensive transfer attack experiments, from different source models against 10 state-of-the-art DNNs, showing that SGM can greatly improve the transferability of crafted adversarial examples. When combined with existing transfer techniques, SGM improves the state-of-the-art transferability benchmarks by a large margin.
+
+# 2 RELATED WORK
+
+Existing adversarial attacks can be categorized into two groups: 1) white-box attacks and 2) black-box attacks. In the white-box setting, the adversary has full access to the parameters of the target model, while in the black-box setting, the target model is kept secret from the adversary.
+
+# 2.1 WHITE-BOX ATTACKS
+
+Given a clean example $\pmb{x}$ with class label $y$ and a target DNN model $f$ , the goal of an adversary is to find an adversarial example $\pmb{x}_{adv}$ that fools the network into making an incorrect prediction (eg. $f(\pmb{x}_{adv}) \neq y$ ), while still remaining in the $\epsilon$ -ball centered at $\pmb{x}$ (eg. $\| \pmb{x}_{adv} - \pmb{x} \|_{\infty} \leq \epsilon$ ).
+
+Fast Gradient Sign Method (FGSM) (Goodfellow et al., 2014). FGSM perturbs clean example $\pmb{x}$ for one step by the amount of $\epsilon$ along the gradient direction:
+
+$$
+\boldsymbol {x} _ {a d v} = \boldsymbol {x} + \epsilon \cdot \operatorname {s i g n} \left(\nabla_ {\boldsymbol {x}} \ell (f (\boldsymbol {x}), y)\right). \tag {1}
+$$
+
+The Basic Iterative Method (BIM) (Kurakin et al., 2016) is an iterative version of FGSM that perturbs for $T$ steps with step size $\epsilon / T$ .
+
+Projected Gradient Descent (PGD) (Madry et al., 2018). PGD perturbs normal example $\pmb{x}$ for $T$ steps with smaller step size. After each step of perturbation, PGD projects the adversarial example back onto the $\epsilon$ -ball of $\pmb{x}$ , if it goes beyond the $\epsilon$ -ball:
+
+$$
+\boldsymbol {x} _ {a d v} ^ {t + 1} = \Pi_ {\epsilon} \left(\boldsymbol {x} _ {a d v} ^ {t} + \alpha \cdot \operatorname {s i g n} \left(\nabla_ {\boldsymbol {x}} \ell \left(f \left(\boldsymbol {x} _ {a d v} ^ {t}\right), y\right)\right)\right), \tag {2}
+$$
+
+where $\Pi_{\epsilon}(\cdot)$ is the projection operation. Different to BIM, PGD allows step size $\alpha >\epsilon /T$
+
+There are also other types of white-box attacks including sparsity-based methods such as Jacobian-based Saliency Map Attack (JSMA) (Papernot et al., 2016), sparse attack (Modas et al., 2019), one-pixel attack (Su et al., 2019), and optimization-based methods such as Carlini and Wagner (CW) (Carlini & Wagner, 2017) and elastic-net (EAD) (Chen et al., 2018).
+
+# 2.2 BLACK-BOX ATTACKS
+
+Black-box attacks can be generated by either attacking a surrogate model or using gradient estimation methods in combination with queries to the target model. Gradient estimation methods estimate the gradients of the target model using black-box optimization methods such as Finite Differences (FD) (Chen et al., 2017; Bhagoji et al., 2018) or Natural Evolution Strategies (NES) (Ilyas et al., 2018; Jiang et al., 2019). These methods all require a large number of queries to the target model, which not only reduces efficiency but also potentially exposes the attack. Alternatively, black-box adversarial examples can be crafted on a surrogate model then applied to attack the target model. Although the white-box methods can be directly applied on the surrogate model, they are far less effective in the black-box setting (Dong et al., 2018; Xie et al., 2019). Several transfer techniques have been proposed to improve the transferability of black-box attacks.
+
+Momentum Iterative boosting (MI) (Dong et al., 2018). MI incorporates a momentum term into the gradient to boost the transferability:
+
+$$
+\boldsymbol {x} _ {a d v} ^ {t + 1} = \Pi_ {\epsilon} \left(\boldsymbol {x} _ {a d v} ^ {t} + \alpha \cdot \operatorname {s i g n} \left(\boldsymbol {g} ^ {t + 1}\right)\right), \quad \boldsymbol {g} ^ {t + 1} = \mu \cdot \boldsymbol {g} ^ {t} + \frac {\nabla_ {\boldsymbol {x}} \ell \left(f \left(\boldsymbol {x} _ {a d v} ^ {t}\right) , y\right)}{\| \nabla_ {\boldsymbol {x}} \ell \left(f \left(\boldsymbol {x} _ {a d v} ^ {t}\right) , y\right) \| _ {1}}, \tag {3}
+$$
+
+where $\pmb{g}^t$ is the adversarial gradient at the $t$ -th step, $\alpha = \epsilon / T$ is the step size for a total of $T$ steps, $\mu$ is a decay factor, and $\| \cdot \|_1$ is the $L_1$ norm.
+
+Diverse Input (DI) (Xie et al., 2019). DI proposes to craft adversarial examples using gradient with respect to the randomly-transformed input example:
+
+$$
+\boldsymbol {x} _ {a d v} ^ {t + 1} = \Pi_ {\epsilon} \left(\boldsymbol {x} _ {a d v} ^ {t} + \alpha \cdot \operatorname {s i g n} \left(\nabla_ {\boldsymbol {x}} \ell \left(f \left(H \left(\boldsymbol {x} _ {a d v} ^ {t}; p\right), y\right)\right)\right)\right), \tag {4}
+$$
+
+where $H(\pmb{x}_{add}^t; p)$ is a stochastic transformation function on $\pmb{x}_{add}^t$ for a given probability $p$ .
+
+Translation Invariant (TI) (Dong et al., 2019). TI targets to evade robustly trained DNNs by generating adversarial examples that are less sensitive to the discriminative regions of the surrogate model. More specifically, TI computes the gradients with respect to a set of translated versions of the original input:
+
+$$
+\boldsymbol {x} _ {a d v} ^ {t + 1} = \Pi_ {\epsilon} \left(\boldsymbol {x} _ {a d v} ^ {t} + \alpha \cdot \operatorname {s i g n} \left(\boldsymbol {W} * \nabla_ {\boldsymbol {x}} \ell \left(f \left(\boldsymbol {x} _ {a d v} ^ {t}, y\right)\right)\right), \right. \tag {5}
+$$
+
+where $\mathbf{W}$ is a predefined kernel (e.g., uniform, linear, and Gaussian) matrix of size $(2k + 1)(2k + 1)$ ( $k$ being the maximal number of pixels to shift). This kernel convolution is equivalent to the weighted sum of gradients over $(2k + 1)^2$ number of shifted input examples.
+
+Furthermore, there are other studies focusing on intermediate feature representations. For example, Activation Attack (Inkawwhich et al., 2019) drives the activation of a specified layer on a given image towards the layer of a target image, to yield a highly transferable targeted example. Intermediate Level Attack (Huang et al., 2019) attempts to fine-tune an existing adversarial example for greater black-box transferability by increasing its perturbation on a pre-specified layer of the source model.
+
+Although the above transfer techniques are effective, they (including white-box attacks) either 1) treat the network (either the surrogate model or the target model) as a single component or 2) only use the intermediate layer output of the network. In other words, they do not directly consider the effects of different DNN architectural characteristics. Li et al. (2018) investigated the use of skip connections and dropout layers for sampling networks, which generates a huge set of ghost networks to perform an ensemble attack. Here, we focus on the architectural property of skip connections from the gradient view without modifying or generating any extra networks.
+
+# 3 PROPOSED SKIP GRADIENT ATTACK
+
+In this section, we first introduce the gradient decomposition of skip connection and residual module. Following that, we propose our Skip Gradient Method (SGM), then demonstrate the adversarial transferability property of skip connection via a case study.
+
+# 3.1 GRADIENT DECOMPOSITION WITH SKIP CONNECTIONS
+
+In ResNet-like neural networks, a skip connection uses identity mapping to bypass residual layers, allowing data flow from a shallow layer directly to subsequent deep layers. Thus, we can decompose the network into a collection of paths of different lengths (Veit et al., 2016). We denote a skip connection together with its associated residual module as a building block (residual block) of a network. Considering three successive building blocks (eg. $z_{i+1} = z_i + f_{i+1}(z_i)$ ) in a residual network from input $z_0$ to output $z_3$ , the output $z_3$ can be expanded as:
+
+$$
+\begin{array}{l} \boldsymbol {z} _ {3} = \boldsymbol {z} _ {2} + f _ {3} (\boldsymbol {z} _ {2}) = [ \boldsymbol {z} _ {1} + f _ {2} (\boldsymbol {z} _ {1}) ] + f _ {3} (\boldsymbol {z} _ {1} + f _ {2} (\boldsymbol {z} _ {1})) \\ = \left[ \boldsymbol {z} _ {0} + f _ {1} \left(\boldsymbol {z} _ {0}\right) + f _ {2} \left(\boldsymbol {z} _ {0} + f _ {1} \left(\boldsymbol {z} _ {0}\right)\right) \right] + f _ {3} \left(\left(\boldsymbol {z} _ {0} + f _ {1} \left(\boldsymbol {z} _ {0}\right)\right) + f _ {2} \left(\boldsymbol {z} _ {0} + f _ {1} \left(\boldsymbol {z} _ {0}\right)\right)\right). \tag {6} \\ \end{array}
+$$
+
+According to the chain rule in calculus, the gradient of a loss function $\ell$ with respect to input $z_0$ can then be decomposed as,
+
+$$
+\frac {\partial \ell}{\partial \boldsymbol {z} _ {0}} = \frac {\partial \ell}{\partial \boldsymbol {z} _ {3}} \frac {\partial \boldsymbol {z} _ {3}}{\partial \boldsymbol {z} _ {2}} \frac {\partial \boldsymbol {z} _ {2}}{\partial \boldsymbol {z} _ {1}} \frac {\partial \boldsymbol {z} _ {1}}{\partial \boldsymbol {z} _ {0}} = \frac {\partial \ell}{\partial \boldsymbol {z} _ {3}} (1 + \frac {\partial f _ {3}}{\partial \boldsymbol {z} _ {2}}) (1 + \frac {\partial f _ {2}}{\partial \boldsymbol {z} _ {1}}) (1 + \frac {\partial f _ {1}}{\partial \boldsymbol {z} _ {0}}). \tag {7}
+$$
+
+Extending this toy example to a network with $L$ residual blocks, the gradient can be decomposed from $L$ -th to the $(l + 1)$ -th $(0 \leq l < L)$ residual block as,
+
+$$
+\frac {\partial \ell}{\partial \boldsymbol {x}} = \frac {\partial \ell}{\partial \boldsymbol {z} _ {L}} \prod_ {i = l} ^ {L - 1} \left(\frac {\partial f _ {i + 1}}{\partial \boldsymbol {z} _ {i}} + 1\right) \frac {\partial \boldsymbol {z} _ {l}}{\partial \boldsymbol {x}}. \tag {8}
+$$
+
+The example illustrated in Figure 1 is a the above decomposition of a ResNet-18 at the last 3 building blocks $(l = L - 3)$ .
+
+# 3.2 SKIP GRADIENT METHOD (SGM)
+
+In order to use more gradient from the skip connections, here, we introduce a decay parameter into the decomposed gradient to reduce the gradient from the residual modules. Following the decomposition in Equation (8), the "skipped" gradient is,
+
+$$
+\nabla_ {\boldsymbol {x}} \ell = \frac {\partial \ell}{\partial \boldsymbol {z} _ {L}} \prod_ {i = 0} ^ {L - 1} \left(\gamma \frac {\partial f _ {i + 1}}{\partial \boldsymbol {z} _ {i}} + 1\right) \frac {\partial \boldsymbol {z} _ {0}}{\partial \boldsymbol {x}}, \tag {9}
+$$
+
+where $\mathbf{z}_0 = \mathbf{x}$ is the input of the network, and $\gamma \in (0,1]$ is the decay parameter. Accordingly, given a clean example $\mathbf{x}$ and a DNN model $f$ , an adversarial example can be crafted iteratively by,
+
+$$
+\boldsymbol {x} _ {a d v} ^ {t + 1} = \Pi_ {\epsilon} \left(\boldsymbol {x} _ {a d v} ^ {t} + \alpha \cdot \operatorname {s i g n} \left(\frac {\partial \ell}{\partial \boldsymbol {z} _ {L}} \prod_ {i = 0} ^ {L - 1} \left(\gamma \frac {\partial f _ {i + 1}}{\partial \boldsymbol {z} _ {i}} + 1\right) \frac {\partial \boldsymbol {z} _ {0}}{\partial \boldsymbol {x}}\right)\right). \tag {10}
+$$
+
+Table 1: The success rates ( $\%\pm$ std over 5 random runs) of black-box attacks (untargeted) crafted by PGD and its "skip gradient" (SGM) version, on different source models against a Inception V3 target model. The best results are in bold.
+
+ | RN18 | RN34 | RN50 | RN101 | RN152 | DN121 | DN169 | DN201 |
| PGD | 23.23±0.69 | 24.38±0.41 | 22.80±0.55 | 22.98±0.83 | 26.56±0.75 | 30.71±0.60 | 30.90±0.31 | 36.01±0.59 |
| SGM | 28.92±0.45 | 43.43±0.32 | 36.71±0.55 | 38.38±0.53 | 44.84±0.14 | 57.38±0.14 | 60.45±0.42 | 65.48±0.23 |
+
+SGM is a generic technique that can be easily implemented on any neural network that has skip connections. During the backpropagation process, SGM simply multiplies the decay parameter to the gradient whenever it passes a residual module. Therefore, SGM does not require any computation overhead, and works efficiently even on densely connected networks such as DenseNets. The reduction of residual gradients is accumulated along the backpropagation path, that is, the residual gradients at lower layers will be reduced more times than those at higher layers. This is because, compared to high-level features, low-level features have already been well preserved by skip connections (see feature decompositions in Equation (6)).
+
+# 3.3 ADVERSARIAL TRANSFERABILITY WITH SKIP CONNECTIONS: A CASE STUDY
+
+To demonstrate the adversarial transferability of skip connections, we conduct a case study on 10-step PGD, and their corresponding SGM versions, to investigate the success rates of black-box attacks crafted with or without manipulating the skip connections. The black-box attacks are generated on 8 different source (surrogate) models ResNet(RN)-18/34/50/101/152 and DenseNet(DN)-121/169/201, then applied to attack a Inception V3 target model. All models were trained on ImageNet training set. We randomly select 5000 ImageNet validation images that are correctly classified by all source models, and craft untargeted attacks under maximum $L_{\infty}$ perturbation $\epsilon = 16$ , which is a typical black-box setting (Dong et al., 2018; Xie et al., 2019; Dong et al., 2019). The step size of PGD was set to $\alpha = 2$ , and the decay parameter of SGM was set to $\gamma = 0.5$ .
+
+We run the attack for 5 times with different random seeds, and report the success rates (transferability) of different methods in Table 1. As can be seen, when the skip connections are manipulated with our SGM, the transferability of PGD is greatly improved across all source models. On all source models except RN18, the improvements are more than $13\%$ . Without SGM, the best transferability against the Inception-V3 target model is $35.48\%$ which is achieved by PGD on DN201, however, this is improved further by our proposed SGM to $65.38\%$ ( $>29\%$ gain). This not only highlights the surprising property of skip connections in terms of the generation of highly transferable attacks, but also indicates the significance of this property, as such a huge boost in transferability only takes a single decay factor.
+
+The 8 source models can be interpreted as from 3 ResNet families: 1) RN18/34 are ResNets with normal residual blocks, 2) RN50/101/152 are ResNets with "bottleneck" residual blocks, and 3) DN121/169/201 are densely connected ResNets. Another important observation is that when there are more skip connections in a network within the same ResNet family (e.g., RN34 > RN18, RN152 > RN101 > RN50, and DN201 > DN169 > DN121), or from ResNets to DenseNets (e.g. DN121/169/201 > RN18/34 and DN121/169/201 > RN50/101/152), the crafted adversarial examples become more transferable, especially when the skip connections are manipulated by our SGM. This raises questions about the design principle behind many state-of-the-art DNNs: "going deeper" with techniques like skip connection and $1 \times 1$ convolution.
+
+# 4 COMPARISON TO EXISTING TRANSFER ATTACKS
+
+In this section, we compare the transferability of adversarial examples crafted by our proposed SGM and existing methods on ImageNet against both unsecured and secured target models.
+
+Baselines. We compare SGM with FGSM, PGD, and 3 state-of-the-art transfer attacks: (1) Momentum Iterative (MI) (Dong et al., 2018), (2) Diverse Input (DI) (Xie et al., 2019), and (3) Transition Invariant (TI) (Dong et al., 2019). Note that the TI attack was originally proposed to attack secured models, although here we include TI to attack both unsecured models and secured models. For TI and our SGM, we test both the one-step and the iterative version, however, the other methods DI and MI only have an iterative version. The iteration step is set to 10 and 20 for unsecured and secured target models respectively. For all iterative methods PGD, TI and our SGM, the step size is set to $\alpha = 2$ . For our proposed SGM, the decay parameter is set to $\gamma = 0.2$ (0.5) and $\gamma = 0.5$ (0.7)
+
+on ResNet and DenseNet source models in PGD (FGSM) respectively. For simplicity, we utilize SGM to indicate FGSM+SGM in one-step attacks, and PGD+SGM in multi-step attacks. Other parameters of existing methods are configured as in their original papers.
+
+Threat Model. We adopt a black-box threat model in which adversarial examples are generated by attacking a source model and then applied to attack the target model. The target model is of a different architecture (indicated by the model name) to the source model, expect when the source and target models are of the same architecture, where we directly use the source model as the target model (equivalent to a white-box setting). The attacks are crafted on 5000 randomly selected ImageNet validation images that are classified correctly by all source models, and are repeated for 5 times with different random seeds. For all attack methods, we follow the standard setting (Dong et al., 2018; Xie et al., 2019) to craft untargeted attacks under maximum $L_{\infty}$ perturbation $\epsilon = 16$ with respect to pixel values in [0, 255].
+
+Target Models. We consider two types of target models: 1) unsecured models that are trained on ImageNet training set using traditional training; and 2) secured models trained using adversarial training. For unsecured target model, we choose 7 state-of-the-art DNNs: VGG19 (with batch normalization) (Simonyan & Zisserman, 2015), ResNet-152 (RN152) (He et al., 2016a), DenseNet-201 (DN152), 154 layer Squeeze-and-Elicitation network (SE154) (Hu et al., 2018), Inception V3 (IncV3) (Szegedy et al., 2016), Inception V4 (IncV3) (Szegedy et al., 2017) and Inception-ResNet V2 (IncResV2) (Szegedy et al., 2017). For secured target models, we consider 3 robustly trained DNNs using ensemble adversarial training (Tramèr et al., 2018): IncV3ens3 (ensemble of 3 IncV3 networks), IncV3ens4 (ensemble of 4 IncV3 networks) and IncResV2ens3 (ensemble of 3 IncResV2 networks).
+
+Source Models. We choose 8 different source models from the ResNet family: ResNet(RN)-18/34/50/101/152 and DenseNet(DN)-121/169/201. Whenever the input size of the source model does not match the target model, we resize the crafted adversarial images to the input size of the target model. For VGG19, ResNet and DenseNet models, images are cropped and resized to $224 \times 224$ , while for Inception/Inception-ResNet models, images are cropped and resized to $299 \times 299$ .
+
+# 4.1 TRANSFERABILITY AGAINST UNSECURED MODELS
+
+We first investigate the transferability of all attack methods against 7 unsecured models, which is to find the best method that can generate the most transferable attacks on one source model against all target models.
+
+One-step Transferability. The one-step transferability is measured by the success rate of one-step attacks, as reported in Table 2. Here, we only show the results on two source models: 1) RN152 which is the best ResNet source model with the highest success rate on average against all target models, and 2) DN201 which is the best DenseNet source model. Also note that, when the source and target models are the same, the result represents the white-box success rate. Overall, adversarial examples crafted on DN201 have significantly better transferability than those crafted on RN152, especially for our SGM method. This is because there are $\sim 30\times$ more skip connections that can be manipulated by our SGM in DN201 compared to RN152. In comparison to both FGSM and TI, transferability is improved considerably by SGM in almost all test scenarios, except when transferring from RN152 to VGG19/IncV3/IncV4 where SGM is outperformed by TI. This implies that, when transferring across different architectures (eg. ResNet $\rightarrow$ VGG/Inception), translation adaptation may help increase the transferability of one-step perturbations. However, this advantage of TI disappears when there are more skip connections, as is the case for the DN201 source model.
+
+Table 2: One-step transferability: the success rates ( $\%\pm$ std over 5 random runs) of black-box attacks crafted by different methods on 2 source models against 7 unsecured target models. The best results are in bold.
+
+| Source | Attack | VGG19 | RN152 | DN201 | SE154 | IncV3 | IncV4 | IncResV2 |
| RN152 | FGSM | 41.96±0.52 | 71.53±0.34 | 37.49±0.10 | 30.00±0.56 | 25.66±0.07 | 21.55±0.16 | 19.90±0.49 |
| TI | 49.61±0.11 | 49.33±0.35 | 36.87±0.42 | 29.95±0.32 | 33.59±0.73 | 29.05±0.34 | 20.62±0.09 |
| SGM | 47.54±0.14 | 76.90±0.60 | 43.73±0.21 | 31.16±0.45 | 29.41±0.24 | 25.11±0.20 | 22.63±0.15 |
| DN201 | FGSM | 49.87±0.17 | 38.89±0.29 | 81.51±0.33 | 34.94±0.53 | 31.21±0.47 | 27.08±0.23 | 23.87±0.45 |
| TI | 54.37±0.58 | 33.49±0.18 | 57.71±0.05 | 34.46±0.47 | 34.45±0.25 | 30.17±0.23 | 20.36±0.33 |
| SGM | 56.97±0.25 | 47.54±0.14 | 87.73±0.76 | 42.31±0.67 | 37.91±0.56 | 32.83±0.38 | 29.64±0.25 |
+
+
+Figure 2: The attack success rates of black-box attacks crafted by different attack methods on 8 source models against 3 unsecured target models: VGG19 (left), SE154 (middle) and IncV3 (right).
+
+
+
+
+
+Table 3: Multi-step transferability: the success rates ( $\%\pm$ std over 5 random runs) of black-box attacks crafted by different methods on 2 source models against 7 unsecured target models. The best results are in bold.
+
+| Source | Attack | VGG19 | RN152 | DN201 | SE154 | IncV3 | IncV4 | IncRes |
| RN152 | PGD | 45.03±0.21 | 99.91±0.04 | 51.49±0.51 | 29.35±0.49 | 26.56±0.75 | 21.03±0.19 | 19.10±0.37 |
| TI | 54.59±0.63 | 99.73±0.11 | 63.77±0.93 | 41.89±0.58 | 37.97±0.39 | 36.25±1.13 | 28.90±0.52 |
| MI | 65.42±0.60 | 99.77±0.02 | 75.79±0.69 | 53.07±0.44 | 50.22±0.07 | 43.32±0.27 | 41.71±0.36 |
| DI | 74.01±0.48 | 99.90±0.02 | 77.81±0.80 | 57.49±1.22 | 53.95±0.68 | 47.16±0.52 | 43.47±0.30 |
| SGM | 79.90±0.69 | 99.87±0.03 | 81.56±0.35 | 61.83±0.17 | 57.22±0.51 | 48.57±0.09 | 45.44±0.36 |
| DN201 | PGD | 57.61±0.82 | 59.84±0.76 | 99.89±0.02 | 39.78±0.69 | 36.01±0.59 | 31.76±0.27 | 25.92±0.13 |
| TI | 54.90±0.75 | 50.63±1.02 | 99.64±0.07 | 40.40±0.31 | 39.13±0.52 | 37.03±1.00 | 28.83±0.49 |
| MI | 75.09±0.80 | 76.39±0.61 | 99.84±0.05 | 64.38±0.69 | 59.62±0.36 | 54.85±0.56 | 50.05±0.25 |
| DI | 78.11±0.56 | 78.18±0.91 | 99.81±0.05 | 61.75±0.88 | 60.04±0.81 | 56.15±0.36 | 49.00±0.83 |
| SGM | 82.66±0.29 | 86.65±0.50 | 99.67±0.08 | 72.03±0.53 | 65.48±0.23 | 58.77±0.78 | 54.97±0.25 |
+
+Multi-step Transferability. First we provide a detailed study about the transferability of all attack methods from the 8 source models to the 3 representative unsecured target models. We then compare different attack methods on two best source models against all unsecured target models: the best ResNet source model and the best DenseNet source model. The multi-step (e.g., 10 step) transferability from all source models to three representative target models (VGG19, SE154 and IncV3) is illustrated in Figure 2. In all transfer scenarios, our proposed SGM outperforms existing methods consistently on almost all source models except RN18. Adversarial attacks crafted by SGM become more transferable when there are more skip connections in the source model (e.g., from RN18 to DN201). An interesting observation is that, when the target model is shallow such as VGG19 (left figure in Figure 2), shallow source models transfer better, however, when the target model is deep such as SE154 and IncV3 (middle and right figures in Figure 2), deeper source models tend to have better transferability. We suspect this is due to the architectural similarities shared by the target and source models. Note that against the VGG19 target model, the success rate of baseline methods all drop significantly when the ResNet source models become more complex (from RN18 to RN152). The small variations at RN50 and DN121 source models may be caused by the architectural difference between RN18/34 which consist of normal residual blocks, RN50/101/152 which consist of "bottleneck" residual blocks and DN121/169/201 which has dense skip connections.
+
+Results for the best source models RN152 and DN201 against unsecured target models are reported in Table 3. The proposed SGM attack outperforms existing methods by a large margin consistently against different target models. Particularly, for transfer $\mathrm{DN}201\rightarrow \mathrm{SE}154$ (a recent state-of-the-art DNN with only $2.251\%$ top-5 error on ImageNet), SGM achieves a success rate of $72.03\%$ , which is $>7\%$ and $>10\%$ higher than MI and DI respectively.
+
+Combining with Existing Methods. We further demonstrate that the adversarial transferability of skip connections can be exploited in combination with existing techniques. The experiments are conducted on DN201 (the best source model in the above multi-step experiments), and TI attack is excluded as it was originally proposed against secured models and demonstrates limited improvement over PGD against unsecured models. The results are reported in Table $4^{*}$ . The transferability of MI and DI is improved remarkably by $11.98\% \sim 21.98\%$ by SGM. When combined with both MI
+
+Table 4: Combined with existing methods: the success rates (\%) of attacks crafted on source model DN201 against 7 unsecured target models. The best results are in **bold** and + indicates improvement.
+
+| Attack\Target | VGG19 | RN152 | DN201 | SE154 | IncV3 | IncV4 | IncRes |
| MI | 75.09 | 76.39 | 99.84 | 64.38 | 59.62 | 54.85 | 50.05 |
| MI+SGM | +12.01 | +13.24 | 99.52 | +17.16 | +21.88 | +15.57 | +18.35 |
| DI | 78.11 | 78.18 | 99.81 | 61.75 | 60.04 | 56.15 | 49.00 |
| DI+SGM | +12.28 | +13.76 | 99.52 | +20.92 | +17.66 | +15.78 | +20.20 |
| MI+DI | 87.16 | 87.28 | 99.76 | 79.80 | 76.68 | 75.20 | 71.05 |
| MI+DI+SGM | 93.00 | 93.92 | 99.42 | 89.86 | 85.72 | 81.23 | 80.50 |
+
+Table 5: Transferability against secured models: the success rates ( $\%\pm$ std over 5 random runs) of multi-step attacks crafted on RN152 and DN201 source models against 3 secured models. The best results are in bold.
+
+| Source | Attack | IncV3ens3 | IncVens4 | IncResens3 |
| RN152 | PGD | 12.47±1.27 | 10.72±1.37 | 6.97±0.71 |
| TI | 45.36±0.97 | 45.81±0.93 | 38.19±0.81 |
| MI | 24.20±1.15 | 22.04±0.98 | 16.10±0.56 |
| DI | 28.48±1.21 | 24.19±1.22 | 17.31±0.77 |
| SGM | 31.57±0.55 | 27.77±0.47 | 20.02±0.66 |
| TI+SGM | 52.62±0.40 | 52.80±0.79 | 43.96±0.62 |
| DN201 | PGD | 18.16±0.56 | 15.30±0.62 | 10.40±0.49 |
| TI | 42.76±0.91 | 42.01±0.79 | 34.28±0.88 |
| MI | 31.79±0.83 | 28.21±0.15 | 20.60±0.38 |
| DI | 34.84±1.35 | 29.23±0.83 | 21.64±0.80 |
| SGM | 41.45±0.30 | 37.85±0.22 | 29.41±0.02 |
| TI+SGM | 46.11±1.23 | 47.38±0.89 | 39.32±0.80 |
+
+and DI, SGM improves the state-of-the-art (MI+DI) transferability by a huge margin consistently against all target models. In particular, SGM pushes the new state-of-the-art to at least $80.52\%$ which previously was only $71\%$ . This illustrates that skip connections can be easily manipulated to craft highly transferable attacks against many state-of-the-art DNN models.
+
+# 4.2 TRANSFERABILITY AGAINST ROBUSTLY TRAINED MODELS
+
+The success rates of our SGM and other baseline methods against the 3 secured target models are reported in Table 5. Overall, with translation adaptation specifically designed for evading adversarially trained models, TI achieves the best standalone transferability, while SGM is the second best with higher success rates than either PGD, MI or DI. When combined with TI, SGM also improves the TI attack by a considerable margin across all transfer scenarios. This indicates that, although manipulating the skip connections alone may not sufficient to attack secured models, it still can make existing attacks more powerful. One interesting observation is that attacks crafted here on RN152 are more transferable than those crafted on DN201, which is quite the opposite to attacking unsecured models.
+
+# 4.3 A CLOSER LOOK AT SGM
+
+In this part, we conduct more experiments to investigate the gradient decay factor of our proposed SGM, and explore the potential use of SGM for ensemble-based attacks and white-box attacks.
+
+Effect of Residual Gradient Decay $\gamma$ . We test the transferability of our proposed SGM with varying decay parameter $\gamma \in [0.1, 1.0]$ , where $\gamma = 1.0$ means no decay on the residual gradients. The attacks are crafted by 10-step SGM on 5000 random ImageNet validation images. The results against 3 target models (VGG19, SE154 and IncV3) are illustrated in Figure 3. As can be observed, the trends are very consistent against different target models. On DenseNet source models, decreasing decay parameter (increasing decay strength) tends to improve transferability until it exceeds a certain threshold, e.g., $\gamma = 0.5$ . This is because the decay encourages the attack to focus on more transferable low-level information, however, it becomes less sufficient if all high-level class-relevant information is ignored. On ResNet source models, decreasing decay parameter can constantly improve transferability for $\gamma \geq 0.2$ . Compared to DenseNet source models, ResNets require more
+
+
+Figure 3: Parameter tuning: the success rates of black-box attacks crafted by 10-step SGM with varying decay parameter $\gamma \in [0.1, 1.0]$ . The solid and dash curves represent results on ResNet and DenseNet source models respectively.
+
+
+
+
+
+Table 6: Multi-step transferability of ensemble-based attack: the success rates ( $\% \pm$ std over 5 random runs) of multi-step attacks crafted by different methods on an ensemble of 3 source models (e.g. RN34, RN152 and DN201) against 7 unsecured target models. The best results are in bold.
+
+| Source | Attack | VGG19 | RN152 | DN201 | SE154 | IncV3 | IncV4 | IncRes |
| RN34 | PGD | 86.69±0.20 | 99.99±0.01 | 99.99±0.02 | 69.65±0.71 | 65.95±0.35 | 59.30±0.32 | 53.91±0.40 |
| TI | 84.35±0.21 | 99.59±0.11 | 99.77±0.06 | 71.67±0.19 | 67.22±0.82 | 66.02±0.66 | 56.83±0.89 |
| + RN152 | MI | 92.86±0.19 | 99.91±0.04 | 99.91±0.06 | 86.11±0.38 | 83.25±0.35 | 79.25±1.16 | 76.53±0.66 |
| DI | 96.34±0.23 | 99.84±0.20 | 99.84±0.20 | 89.72±0.52 | 87.53±0.29 | 85.04±0.75 | 81.11±0.44 |
| + DN201 | SGM | 97.36±0.17 | 99.87±0.07 | 99.86±0.09 | 90.40±0.26 | 87.86±0.51 | 82.97±0.71 | 80.93±0.55 |
| DI+SGM | 98.65±0.08 | 99.84±0.04 | 99.86±0.04 | 94.36±0.19 | 93.08±0.41 | 89.56±0.07 | 88.27±0.43 |
+
+Table 7: Transferability of ensemble-based attack against secured models: the success rates ( $\%\pm$ std over 5 random runs) of black-box attacks crafted on an ensemble of 3 source models (e.g. RN34, RN152 and DN201). The best results are in bold.
+
+| Source | Attack | IncV3ens3 | IncVens4 | IncResens3 |
| RN34 | PGD | 37.63±0.37 | 32.69±0.62 | 23.49±0.55 |
| TI | 75.04±0.50 | 75.94±0.63 | 66.24±0.45 |
| + RN152 | MI | 54.68±0.27 | 50.24±0.48 | 39.27±0.33 |
| DI | 65.29±0.31 | 57.48±0.45 | 46.41±0.42 |
| + DN201 | SGM | 66.08±0.42 | 62.22±0.73 | 51.16±0.12 |
| TI+SGM | 87.65±1.00 | 85.11±0.27 | 77.75±0.41 |
+
+decay on the residual gradients. Recalling that skip connections reveal more transferable information of the source model, ResNets require more penalty on the residual gradients to increase the importance of skip gradients that reveal more transferable information of the source model.
+
+As for the selection of $\gamma$ under a scenario without knowing the target model, from Figure 3 and Appendix C, we can see that the influence of $\gamma$ is more related to the source model rather than the target model, that is, given a source model, the best $\gamma$ against different target models are generally the same. This makes the selection of $\gamma$ quite straightforward: choosing the best $\gamma$ on the source model(s). For instance, in Figure 3, suppose the unknown target model is SE154 (middle figure), the adversary could tune $\gamma$ on source model DN201 to attack VGG19 (left figure) and find the best $\gamma = 0.5$ . The attacks crafted on DN201 with $\gamma = 0.5$ indeed achieved the best success rate against the SE154 target model (and other target models).
+
+Ensemble-based Attacks. It has been shown that attacking multiple source models simultaneously can improve the transferability of the crafted adversarial examples, and is commonly adopted in practice. We follow the ensemble-based strategy (Liu et al., 2017) and craft attacks on an ensemble of RN34, RN152 and DN201. According to the discussion above, we select the best $\gamma$ individually for each source model: choose $\gamma$ for source RN34 and RN152 against target DN201, and $\gamma$ for source DN201 against target RN152. The success rates (transferability) against 7 unsecured models and 3 secured models are reported in Table 6 and Table 7 respectively. Similar to the results of single source model attacks, against unsecured target models, SGM has a similar standalone performance with DI, better than the others (except the two "white-box" scenarios against RN152 and DN201). When combined with other methods, e.g. DI, it improves the success rates again by a large margin.
+
+
+(a) White-box $(\epsilon = 8)$
+
+
+(b) Varying $\epsilon$ on ResNets
+Figure 4: White-box success rate for FGSM versus SGM. In (b) and (c), each color corresponds to one model, with FGSM is represented by solid curve and SGM is represented by dashed curve.
+
+
+(c) Varying $\epsilon$ on DenseNets
+
+Against secured models, SGM achieves the second best standalone transferability, with TI is still the best. When combined with TI, SGM improves the success rate by $\sim 10\%$ consistently against all secured target models. In particular, against IncV3ens3, TI+SGM achieves higher success rate (87.65%) than reported in (Dong et al., 2019) (84.8%), even if only 3 source models are used here and the source models (e.g. RN34, RN152 and DN201) are all of different architecture to IncV3 target model ((Dong et al., 2019) uses 6 source models including even the IncV3 model). From all aspects analyzed above, the existence of skip connections makes transferable attacks much easier to craft in practice.
+
+Improving Weak White-box Attacks. In addition to the black-box transferability, we next show that SGM can also improve the weak (one-step) white-box attack FGSM. Note that the one-step version of SGM is equivalent to FGSM plus residual gradient decay. Our experiments are conducted on the 8 source models, and the white-box success rates under maximum $L_{\infty}$ perturbation $\epsilon = 8$ (a typical white-box setting) are shown in Figure 4a. As can be observed, using SGM can help improve the adversarial strength (i.e., higher success rate). We then vary the maximum perturbation $\epsilon \in [1,64]$ , and show the results on ResNet and DenseNet models separately in Figure 4b and Figure 4c. Compared to FGSM, SGM can always give better adversarial strength, except when $\epsilon$ is extremely small ( $\epsilon \leq 2$ ). When the perturbation space becomes infinitely small, the loss landscape within the space becomes flat and the gradient points to the optimal perturbation direction. However, when the perturbation space expands, one-step gradient becomes less accurate due to changes in the loss landscape (success rate decreases as $\epsilon$ increases from 4 to 16), and in this case, the skip gradient which contains more low-level information is more reliable than the residual gradient (the improvement is more significant for $\epsilon \in [4,16]$ ). Another interesting observation is that adversarial strength decreases when the model becomes more complex from RN18 to RN152, or DN121 to DN201. This is likely because the loss landscape of complex models is steeper than shallow models, making one-step gradient less reliable.
+
+# 5 CONCLUSION
+
+In this paper, we have identified a surprising property of the skip connections used by many state-of-the-art ResNet-like neural networks, that is, they can be easily used to generate highly transferable adversarial examples. To demonstrate this architectural "weakness", we proposed the Skip Gradient Method (SGM) to craft adversarial examples using more gradients from the skip connections rather than the residual ones, via a decay factor on gradients. We conducted a series of transfer attack experiments with 8 source models and 10 target models including 7 unsecured and 3 secured models, and showed that attacks crafted by SGM have significantly better transferability than those crafted by existing methods. When combined with existing techniques, SGM can also boost state-of-the-art transferability by a huge margin. We believe the high adversarial transferability of skip connections is due to the fact that they expose extra low-level information which is more transferable across different DNNs. Our findings in this paper not only remind researchers in adversarial research to pay attention to the architectural vulnerability of DNNs, but also raise new challenges for secure DNN architecture design.
+
+# ACKNOWLEDGEMENT
+
+Shu-Tao Xia is supported in part by National Key Research and Development Program of China under Grant 2018YFB1800204, National Natural Science Foundation of China under Grant 61771273, R&D Program of Shenzhen under Grant JCYJ20180508152204044, and research fund of PCL Future Regional Network Facilities for Large-scale Experiments and Applications (PCL2018KP001).
+
+# REFERENCES
+
+Yang Bai, Yan Feng, Yisen Wang, Tao Dai, Shu-Tao Xia, and Yong Jiang. Hilbert-based generative defense for adversarial examples. In ICCV, 2019.
+Arjun Nitin Bhagoji, Warren He, Bo Li, and Dawn Song. Practical black-box attacks on deep neural networks using efficient query mechanisms. In ECCV, 2018.
+Nicholas Carlini and David Wagner. Towards evaluating the robustness of neural networks. In S&P, 2017.
+Pin-Yu Chen, Huan Zhang, Yash Sharma, Jinfeng Yi, and Cho-Jui Hsieh. Zoo: Zeroth order optimization based black-box attacks to deep neural networks without training substitute models. In AISec, 2017.
+Pin-Yu Chen, Yash Sharma, Huan Zhang, Jinfeng Yi, and Cho-Jui Hsieh. Ead: elastic-net attacks to deep neural networks via adversarial examples. In AAAI, 2018.
+Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In CVPR, 2009.
+Gavin Weiguang Ding, Luyu Wang, and Xiaomeng Jin. AdverTorch v0.1: An adversarial robustness toolbox based on pytorch. arXiv preprint arXiv:1902.07623, 2019.
+Yinpeng Dong, Fangzhou Liao, Tianyu Pang, Hang Su, Jun Zhu, Xiaolin Hu, and Jianguo Li. Boosting adversarial attacks with momentum. In CVPR, 2018.
+Yinpeng Dong, Tianyu Pang, Hang Su, and Jun Zhu. Evading defenses to transferable adversarial examples by translation-invariant attacks. In CVPR, 2019.
+Ivan Evtimov, Kevin Eykholt, Earlence Fernandes, Tadayoshi Kohno, Bo Li, Atul Prakash, Amir Rahmati, and Dawn Song. Robust physical-world attacks on deep learning models. In CVPR, 2018.
+Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. In ICLR, 2014.
+Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016a.
+Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Identity mappings in deep residual networks. In ECCV, 2016b.
+Jie Hu, Li Shen, and Gang Sun. Squeeze-and-excitation networks. In CVPR, 2018.
+Gao Huang, Zhuang Liu, Laurens Van Der Maaten, and Kilian Q Weinberger. Densely connected convolutional networks. In CVPR, 2017.
+Qian Huang, Isay Katsman, Horace He, Zeqi Gu, Serge Belongie, and Ser-Nam Lim. Enhancing adversarial example transferability with an intermediate level attack. In ICCV, 2019.
+Andrew Ilyas, Logan Engstrom, Anish Athalye, and Jessy Lin. Black-box adversarial attacks with limited queries and information. In ICML, 2018.
+Nathan Inkawich, Wei Wen, Hai Helen Li, and Yiran Chen. Feature space perturbations yield more transferable adversarial examples. In CVPR, 2019.
+Linxi Jiang, Xingjun Ma, Shaoxiang Chen, James Bailey, and Yu-Gang Jiang. Black-box adversarial attacks on video recognition models. In ACM MM, 2019.
+Alexey Kurakin, Ian Goodfellow, and Samy Bengio. Adversarial examples in the physical world. In ICLR, 2016.
+Yingwei Li, Song Bai, Yuyin Zhou, Cihang Xie, Zhishuai Zhang, and Alan Yuille. Learning transferable adversarial examples via ghost networks. arXiv preprint arXiv:1812.03413, 2018.
+
+Yanpei Liu, Xinyun Chen, Chang Liu, and Dawn Song. Delving into transferable adversarial examples and black-box attacks. In ICLR, 2017.
+Xingjun Ma, Bo Li, Yisen Wang, Sarah M Erfani, Sudanthi Wijewickrema, Grant Schoenebeck, Dawn Song, Michael E Houle, and James Bailey. Characterizing adversarial subspaces using local intrinsic dimensionality. In ICLR, 2018.
+Xingjun Ma, Yuhao Niu, Lin Gu, Yisen Wang, Yitian Zhao, James Bailey, and Feng Lu. Understanding adversarial attacks on deep learning based medical image analysis systems. arXiv preprint arXiv:1907.10456, 2019.
+Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards deep learning models resistant to adversarial attacks. In ICLR, 2018.
+Apostolos Modas, Seyed-Mohsen Moosavi-Dezfooli, and Pascal Frossard. Sparsefool: a few pixels make a big difference. In CVPR, 2019.
+Nicolas Papernot, Patrick McDaniel, Somesh Jha, Matt Fredrikson, Z Berkay Celik, and Ananthram Swami. The limitations of deep learning in adversarial settings. In EuroS&P, 2016.
+Mahmood Sharif, Sruti Bhagavatula, Lujo Bauer, and Michael K Reiter. Accessorize to a crime: Real and stealthy attacks on state-of-the-art face recognition. In CCS, 2016.
+Carl-Johann Simon-Gabriel, Yann Ollivier, Leon Bottou, Bernhard Scholkopf, and David Lopez-Paz. First-order adversarial vulnerability of neural networks and input dimension. In ICML, 2019.
+Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. In ICLR, 2015.
+Jiawei Su, Danilo Vasconcellos Vargas, and Kouichi Sakurai. One pixel attack for fooling deep neural networks. In IEEE Transactions on Evolutionary Computation. IEEE, 2019.
+Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, and Rob Fergus. Intriguing properties of neural networks. In *ICLR*, 2013.
+Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jon Shlens, and Zbigniew Wojna. Rethinking the inception architecture for computer vision. In CVPR, 2016.
+Christian Szegedy, Sergey Ioffe, Vincent Vanhoucke, and Alexander A Alemi. Inception-v4, inception-resnet and the impact of residual connections on learning. In AAAI, 2017.
+Florian Tramér, Alexey Kurakin, Nicolas Papernot, Ian Goodfellow, Dan Boneh, and Patrick McDaniel. Ensemble adversarial training: Attacks and defenses. In ICLR, 2018.
+Andreas Veit, Michael J Wilber, and Serge Belongie. Residual networks behave like ensembles of relatively shallow networks. In NeurIPS, 2016.
+Yisen Wang, Xingjun Ma, James Bailey, Jinfeng Yi, Bowen Zhou, and Quanquan Gu. On the convergence and robustness of adversarial training. In ICML, 2019.
+Yisen Wang, Difan Zou, Jinfeng Yi, James Bailey, Xingjun Ma, and Quanquan Gu. Improving adversarial robustness requires revisiting misclassified examples. In ICLR, 2020.
+Cihang Xie, Zhishuai Zhang, Yuyin Zhou, Song Bai, Jianyu Wang, Zhou Ren, and Alan L Yuille. Improving transferability of adversarial examples with input diversity. In CVPR, 2019.
+Saining Xie, Ross Girshick, Piotr Dollár, Zhuowen Tu, and Kaiming He. Aggregated residual transformations for deep neural networks. In CVPR, 2017.
+Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. arXiv preprint arXiv:1605.07146, 2016.
+
+# A VISUALIZATION OF ADVERSARIAL EXAMPLES CRAFTED BY SGM
+
+In this section, we visualize 6 clean images and their corresponding adversarial examples crafted using our SGM on either a ResNet-152 or a DenseNet201 in Figure 5. These visualization results show that the generated adversarial perturbations are human imperceptible.
+
+
+
+
+
+
+Figure 5: Visualization of 6 clean images and their corresponding adversarial examples. The clean images are shown in the top row, adversarial images crafted on ResNet-152 are shown in the middle row, while those crafted on DenseNet-201 are shown in the bottom row. All adversarial images are crafted using our proposed SGM (10-step) under maximum perturbation $\epsilon = 16$ .
+
+# B COMPARISON WITH PREVIOUSLY PUBLISHED RESULTS
+
+In this section, we compare the experimental settings in previous and our works, and discuss some small discrepancies of the baseline performance reported in ours and previous works.
+
+Table 8 and 9 summarizes these differences for single-source and ensemble-based attack respectively. Out of all these works (Dong et al., 2018; 2019; Xie et al., 2019), results reported in (Xie et al., 2019) are more complete. Our reported success rate of baseline attacks (e.g. MI and DI) matches that reported in (Xie et al., 2019), sometimes even higher. The slight discrepancy is caused by the difference in experimental settings. Table 10 summarizes the different source models used by baseline attacks, and Table 11 summarizes the difference in dataset, number of test images, input image size, maximum $L_{\infty}$ perturbation $\epsilon$ , number of attack steps $N$ and attack step size $\alpha$ . Compared to $299 \times 299$ image size, here we use a more standard image size $224 \times 224$ on ImageNet. The use of smaller input size may reduce the effectiveness of existing attacks (Simon-Gabriel et al., 2019).
+
+In another work by Liu et al. (2017), $81\%$ success rate was reported for optimization-based attack crafted on ResNet-152 against target VGG16, which is higher than our $65.52\%$ from ResNet-152 to VGG19. This is because they did not restrict the maximum perturbation $\epsilon$ . The root mean square deviation (RMSD) of their attacks is 22.83, which indicates that many pixels are perturbed more than 16 pixel values. In our experiments, the RMSD is 6.29 for PGD, 7.71 for SGM, and 12.55 for MI. This appears to be another reason for the performance discrepancy. Note that the advantage of bounded small perturbation is increasing imperceptibility to human observers (see Figure 5).
+
+Table 8: Previously reported attack success rates (%) of baseline single-source attacks against 6 target models. “-” means no results were reported.
+
+| Reference | Attack | IncV3 | IncV4 | IncRes | IncV3ens3 | IncV3ens4 | IncResens3 |
| Dong et al. (2018) | FGSM | 35.0 | 28.2 | 27.5 | 14.6 | 13.2 | 7.5 |
| BIM | 26.7 | 22.7 | 21.2 | 9.3 | 8.9 | 6.2 |
| MI | 53.6 | 48.9 | 44.7 | 22.1 | 21.7 | 12.9 |
| Dong et al. (2019) | FGSM | - | - | - | 20.2 | 17.7 | 9.9 |
| MI | - | - | - | 25.1 | 23.7 | 13.3 |
| DI | - | - | - | 40.5 | 36.0 | 24.1 |
| Xie et al. (2019) | FGSM | 34.4 | 28.50 | 27.1 | 12.4 | 11.0 | 6.0 |
| PGD | 20.8 | 17.2 | 14.9 | 5.4 | 4.6 | 2.8 |
| MI | 50.1 | 44.1 | 42.2 | 18.2 | 15.2 | 9.0 |
| DI | 53.8 | 49.0 | 44.8 | 13.0 | 11.1 | 6.9 |
| Ours | FGSM | 26.56 | 21.03 | 19.10 | - | - | - |
| PGD | 26.56 | 21.03 | 19.10 | 12.47 | 10.72 | 6.97 |
| MI | 50.22 | 43.32 | 41.71 | 24.20 | 22.04 | 16.10 |
| DI | 53.95 | 47.16 | 43.47 | 34.84 | 29.23 | 21.64 |
+
+Table 9: Previously reported attack success rates (%) of ensemble-based baseline attacks against 6 target models. “-” means no results were reported.
+
+| Reference | Attack | IncV3 | IncV4 | IncRes | IncV3ens3 | IncV3ens4 | IncResens3 |
| Dong et al. (2018) | FGSM | 45.7 | 39.9 | 38.8 | 15.4 | 15.0 | 6.4 |
| BIM | 72.1 | 61.0 | 54.4 | 18.6 | 18.7 | 9.9 |
| MI | 87.9 | 81.2 | 76.5 | 37.6 | 40.3 | 23.3 |
| Dong et al. (2019) | FGSM | - | - | - | 27.5 | 23.7 | 13.4 |
| MI | - | - | - | 50.5 | 48.3 | 32.8 |
| DI | - | - | - | 66.0 | 63.3 | 45.9 |
| TI+DI | - | - | - | 84.8 | 82.7 | 78.0 |
| Xie et al. (2019) | PGD | 43.7 | 36.4 | 33.3 | 12.9 | 15.1 | 8.8 |
| MI | 69.9 | 67.9 | 64.1 | 36.3 | 35.0 | 30.4 |
| DI | 71.4 | 65.9 | 64.6 | 22.8 | 26.1 | 15.8 |
| DI+MI | 80.7 | 80.6 | 80.7 | 44.6 | 44.5 | 39.4 |
| Ours | PGD | 65.95 | 59.30 | 53.91 | 37.63 | 32.69 | 23.49 |
| MI | 83.25 | 79.25 | 76.53 | 54.68 | 50.24 | 39.27 |
| DI | 87.53 | 85.04 | 81.11 | 65.29 | 57.48 | 46.41 |
| DI+SGM | 93.08 | 89.56 | 88.27 | 80.14 | 76.52 | 66.40 |
| TI+SGM | - | - | - | 87.65 | 85.11 | 77.75 |
+
+Table 10: Source models used by existing single-source and ensemble-based black-box attacks. "Hold-out" refers to the hold-out target model from the group, with all remaining models are used as source models. Group 1 consists of ResNet-v2-152, IncV3, IncV4 and IncRes, while group 2 consists of ResNet-v2-152, IncV3, IncV4, IncRes, IncV3 $_{ens3}$ , IncV3 $_{ens4}$ and IncRes $_{ens3}$ .
+
+| Reference | Single-source attack | Ensemble-based attack |
| Dong et al. (2018) | ResNet-v2-152 | hold-out from group 1 or group 2 |
| Dong et al. (2019) | ResNet-v2-152 | hold-out from group 1 |
| Xie et al. (2019) | ResNet-v2-152 | hold-out from group 2 |
| Ours | RN152 | RN34 + RN152 + DN201 |
+
+For proper implementation, we use open-source codes and pretrained models for our experiments, e.g., AdverTorch (Ding et al., 2019) for FGSM, PGD and MI, and source/target models from two GitHub repositories $^{\dagger \ddagger \S}$ for all models. We reproduced DI and TI in PyTorch.
+
+Table 11: Difference in experimental settings of our work compared to previous works. "NeurIPS 2017" indicates the dataset used for NeurIPS 2017 adversarial competition. $\epsilon$ : maximum per-pixel perturbation; $N$ : number of attack steps; $\alpha$ : attack step size.
+
+| Reference | Dataset | Number | Input size | ε | N | α |
| Dong et al. (2018) | ImageNet | 1000 | 299 × 299 | 16 | 10 | 1.6 |
| Dong et al. (2019) | NeurIPS 2017 | 1000 | 299 × 299 | 16 | 10 | 1.6 |
| Xie et al. (2019) | ImageNet | 5000 | 299 × 299 | 15 | 19 | 1.0 |
| Ours | ImageNet | 5000 | 224 × 224 | 16 | 10 / 20 | 2.0 |
+
+# C TRANSFERABILITY OF DECAY PARAMETER $\gamma$
+
+In this section, we study the "transferability" of decay parameter $\gamma$ across different target models. RN152 and DN201 are used as the source model, and the target model are varying to observe trends. As indicated in Figure 6, all black-box target models share the same best selection of $\gamma$ , which makes $\gamma$ selection quite simple. Even if the true target model is unknown, the adversary can tune the gamma for a resnet-like neural network through another model and obtain the best selection as well.
+
+
+Figure 6: "Transferability" of decay parameter: the success rates of black-box attacks crafted by 10-step SGM with varying decay parameter $\gamma \in [0.1,1.0]$ . The curves represent results against different target models respectively.
+
+
\ No newline at end of file
diff --git a/skipconnectionsmatteronthetransferabilityofadversarialexamplesgeneratedwithresnets/images.zip b/skipconnectionsmatteronthetransferabilityofadversarialexamplesgeneratedwithresnets/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..370e3a76a34fd4fbb9f22b744e9e895ce12ad90b
--- /dev/null
+++ b/skipconnectionsmatteronthetransferabilityofadversarialexamplesgeneratedwithresnets/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:3283f9bd1d6bc4273475e65b3832d2317a89e3630a119d6610ed58ce86e88b7e
+size 1040676
diff --git a/skipconnectionsmatteronthetransferabilityofadversarialexamplesgeneratedwithresnets/layout.json b/skipconnectionsmatteronthetransferabilityofadversarialexamplesgeneratedwithresnets/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..7892529c77e12173bcf39e91d2cd69341eb2f848
--- /dev/null
+++ b/skipconnectionsmatteronthetransferabilityofadversarialexamplesgeneratedwithresnets/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ec049be2d405f2e0de28c944c2830621c37ee91cc767da2fd74c2b3cf7699869
+size 482735
diff --git a/slicedcramersynapticconsolidationforpreservingdeeplylearnedrepresentations/c8fd609c-c85f-449a-bc1c-b5e9a29724b7_content_list.json b/slicedcramersynapticconsolidationforpreservingdeeplylearnedrepresentations/c8fd609c-c85f-449a-bc1c-b5e9a29724b7_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..51428ec76f3ffaeb69bdf3cf867276ed01054c44
--- /dev/null
+++ b/slicedcramersynapticconsolidationforpreservingdeeplylearnedrepresentations/c8fd609c-c85f-449a-bc1c-b5e9a29724b7_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:07902476f10fbb239962dffe708180028e426df9d461f97f0bb690bbbf116245
+size 113562
diff --git a/slicedcramersynapticconsolidationforpreservingdeeplylearnedrepresentations/c8fd609c-c85f-449a-bc1c-b5e9a29724b7_model.json b/slicedcramersynapticconsolidationforpreservingdeeplylearnedrepresentations/c8fd609c-c85f-449a-bc1c-b5e9a29724b7_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..9a493324de7fa60c6aa7074edcf20fc0bd9d2b9e
--- /dev/null
+++ b/slicedcramersynapticconsolidationforpreservingdeeplylearnedrepresentations/c8fd609c-c85f-449a-bc1c-b5e9a29724b7_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:21a40a6360301f9ad53dab93c82ea476015dd0ddba06a75da6b26a174467f2aa
+size 133831
diff --git a/slicedcramersynapticconsolidationforpreservingdeeplylearnedrepresentations/c8fd609c-c85f-449a-bc1c-b5e9a29724b7_origin.pdf b/slicedcramersynapticconsolidationforpreservingdeeplylearnedrepresentations/c8fd609c-c85f-449a-bc1c-b5e9a29724b7_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..f24383db657fb59c7a62fcbd3dad50f6e959c050
--- /dev/null
+++ b/slicedcramersynapticconsolidationforpreservingdeeplylearnedrepresentations/c8fd609c-c85f-449a-bc1c-b5e9a29724b7_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:96be66c302c0d833c58dfba52b326f62dcfe17741375bc11dfd55bfc73111c41
+size 3640400
diff --git a/slicedcramersynapticconsolidationforpreservingdeeplylearnedrepresentations/full.md b/slicedcramersynapticconsolidationforpreservingdeeplylearnedrepresentations/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..10333dd588e4b4c17b2c0070df73bbfb8c41c1b1
--- /dev/null
+++ b/slicedcramersynapticconsolidationforpreservingdeeplylearnedrepresentations/full.md
@@ -0,0 +1,502 @@
+# SLICED CRAMÉR SYNAPTIC CONSOLIDATION FOR PRESERVING DEEPLY LEARNED REPRESENTATIONS
+
+Soheil Kolouri, Nicholas A. Ketz, & Praveen K. Pilly
+
+HRL Laboratories, LLC
+
+Malibu, CA, 91301, USA
+
+{skolouri, naketz, pkpilly}@hrl.com
+
+# Andrea Soltoggio
+
+School of Computer Science,
+
+Loughborough University,
+
+Leicestershire, UK
+
+a.soltoggio@lboro.ac.uk
+
+# ABSTRACT
+
+Deep neural networks suffer from the inability to preserve the learned data representation (i.e., catastrophic forgetting) in domains where the input data distribution is non-stationary, and it changes during training. Various selective synaptic plasticity approaches have been recently proposed to preserve network parameters, which are crucial for previously learned tasks while learning new tasks. We explore such selective synaptic plasticity approaches through a unifying lens of memory replay and show the close relationship between methods like Elastic Weight Consolidation (EWC) and Memory-Aware-Synapses (MAS). We then propose a fundamentally different class of preservation methods that aim at preserving the distribution of the network's output at an arbitrary layer for previous tasks while learning a new one. We propose the sliced Cramér distance as a suitable choice for such preservation and evaluate our Sliced Cramér Preservation (SCP) algorithm through extensive empirical investigations on various network architectures in both supervised and unsupervised learning settings. We show that SCP consistently utilizes the learning capacity of the network better than online-EWC and MAS methods on various incremental learning tasks.
+
+# 1 INTRODUCTION
+
+Incremental learning without catastrophic forgetting is one of the core characteristics of a lifelong learning machine (L2M) and has recently gained renewed attention from the machine learning community. In real-world applications, the input distribution of the data (e.g., sensory inputs) is prone to constant changes due to environmental variations (e.g., seasonal changes), exposure to new situations (e.g., change in the surface friction), sensory malfunction (e.g., water droplets on a camera), among others. It is therefore desirable to continue to train the base computational model only on the new data/task and incrementally accumulate knowledge to improve the performance of the system over time, as opposed to retraining the model on the composition of old and new data.
+
+The existing computational models, for instance deep convolutional neural networks (CNNs), face two fundamental issues regarding incremental learning, 1) catastrophic forgetting (McCloskey & Cohen, 1989), which refers to the forgetting of previously acquired knowledge when learning new tasks as a result of interference between the old and new tasks, and 2) intransigence, which refers to the inability to acquire new knowledge while trying to preserve old knowledge (e.g., reducing the learning rate) Chaudhry et al. (2018). Note that we use the term 'knowledge' here to indicate the input/output behavior of the computational model as in (Hinton et al., 2015). A successful incremental learner should be able to overcome both forgetting and intransigence. The commonly used strategies to overcome catastrophic forgetting include:
+
+1. selective synaptic plasticity to preserve learned knowledge (Kirkpatrick et al., 2017; Zenke et al., 2017; Aljundi et al., 2018; Chaudhry et al., 2018), which is rooted in the idea of homeostatic plasticity in neuroscience,
+2. additional neural resource allocation to learn new knowledge and preserve old knowledge, (Rusu et al., 2016; Lee et al., 2017; Li & Hoiem, 2017; Rannen et al., 2017; Schwarz et al., 2018; Li et al., 2019), which is similar to neurogenesis in the hippocampus,
+3. memory and experience replay (Rebuffi et al., 2017; Shin et al., 2017; Wu et al., 2018; Hu et al., 2019; Rostami et al., 2019), which is based on the well-established theory of complementary learning system (CLS) (McClelland et al., 1995).
+
+Each framework has its advantages and disadvantages, and Parisi et al. (2019) provide an excellent survey of these methods. We note that the term "synaptic weights" refers to the strength of a connection between two nodes. The term 'plasticity' is used analogously to 'neural plasticity' in the human brain, which refers to the ability of the neurons to change their synaptic weights. The term "selective plasticity" refers to the desired capability of a network to selectively increase or decrease the plasticity of individual synapses throughout the neural architecture.
+
+Our focus in this paper is on selective synaptic plasticity. The standard deep neural network architectures are uniformly plastic; hence, all neurons are prone to changes during training, and this powerful capability is also the demise of these networks and leads to catastrophic forgetting. The idea of selective synaptic plasticity is to partially preserve synapses that are critical for previously learned tasks by rigidifying those synapses (i.e., to enforce critical synapses to change less). Rigidifying the network over time leads to a loss of learning capability for future tasks, which is known as 'intransigence' in the literature. Selective synaptic plasticity, by itself, could not fully overcome intransigence. A combination of strategies like efficient memory replay for reconsolidation, neurogenesis, and selective synaptic plasticity could lead to superior methods that defeat both catastrophic forgetting and intransigence. Chaudhry et al. (2018), for instance, provide such a combination of memory replay and selective synaptic plasticity. Also, there have been various efforts toward making the idea of neural resource allocation scalable, the progress and compress work Schwarz et al. (2018), and the incremental moment matching Lee et al. (2017) work fall under this category.
+
+In this paper, we focus on selective synaptic plasticity to preserve learned representations in a deep neural network. Inspired by (Chaudhry et al., 2018), we take a geometric view and devise a new method for selective synaptic plasticity. The proposed method is fundamentally different from the previous approaches like Elastic Weight Consolidation (EWC) (Kirkpatrick et al., 2017) and Memory Aware Synapses (MAS) (Aljundi et al., 2018), which we indicate as sample-based approaches. Instead, we focus on identifying synaptic importance parameters that preserve the 'distribution' of the latent representation of a task. Focusing on preserving the distribution of the latent representation of a neural network at an arbitrary layer, as opposed to the expected change in network's response for individual samples, enforces a less restrict regularization on the network, and enables a better utilization of the network learning capacity. The primary concept of sample-based versus distribution-based regularizations are visualized in Figure 1. Similar to the MAS framework, our proposed method denoted as Sliced Cramér Preservation (SCP) is also able to preserve a task representation in any layer of a neural network, hence, enabling its application to various unsupervised or self-supervised learning settings.
+
+Our specific contributions in this paper are:
+
+- Introducing a distribution-based regularization using the sliced Cramér distance (aka, Cramér Wold distance (Tabor et al., 2018)) for selective synaptic plasticity that preserves the distributions of the representations of previously seen tasks at an arbitrary layer of a deep neural network while learning a new task.
+- Providing a geometric interpretation for the MAS algorithm (Aljundi et al., 2018) that further gives insight into the otherwise heuristic choices made in the approach.
+- Comparing the proposed method to online-EWC and MAS on the benchmark permuted MNIST dataset, sequential unsupervised learning with auto-encoders, and the more interesting problem of semantic segmentation of driving scenes, and demonstrating significant improvements in overcoming catastrophic forgetting and intransigence over these methods.
+
+
+Figure 1: Sample-based approaches regularize the learning by the expected change, as measured by a dissimilarity measure, of the response of the network for individual samples from Task A, after learning Task A and during learning Task B, $\mathbb{E}_{\boldsymbol{x} \sim p_X^A} [d(\phi(\boldsymbol{x}; \boldsymbol{\theta}), \phi(\boldsymbol{x}; \boldsymbol{\theta}_A^*))]$ , where $d(\cdot, \cdot)$ is a dissimilarity measure between two $K$ -dimensional vectors. Therefore, the regularization is an empirical expected change of the response for samples. EWC and MAS fall under the sample-based category. The proposed distribution-based approach, on the other hand, regularizes the change in the overall distribution of the network's output for input samples from Task A, after learning Task A and during learning Task B, $d_p(p_Z^A(\cdot|\boldsymbol{\theta}), p_Z^A(\cdot|\boldsymbol{\theta}_A^*))$ , where $p_Z^A(\cdot|\boldsymbol{\theta})$ is defined in equation 8 and $d_p(\cdot, \cdot)$ is a distance measure between two probability distributions defined on $\mathcal{Z} \subseteq \mathbb{R}^K$ .
+
+
+
+# 2 PROBLEM SET-UP AND PRELIMINARIES
+
+Consider data from a stream of tasks $\mathcal{X}^t = \{\pmb{x}_i^t\sim p_X^t\}_{i = 1}^{n_t}$ , where $p_X^t$ is the probability density function (PDF) for task $t$ defined on $\mathbb{X}\subset \mathbb{R}^d$ . We consider both supervised and unsupervised tasks, where in the supervised case the input sample, $\pmb{x}_i^t$ , is accompanied with the corresponding label $\pmb{y}_i^t\in \mathbb{R}^K$ . Let $\phi (\cdot ;\pmb {\theta}): \mathbb{R}^d\to \mathbb{R}^K$ denote a parametric function (e.g., a neural network) that is to be optimized to solve the stream of tasks. In the supervised learning setting, we consider $\phi$ to be the mapping to the logits prior to applying the softmax layer.
+
+# 2.1 A GEOMETRIC VIEW OF ELASTIC WEIGHT CONSOLIDATION
+
+In their seminal work, Kirkpatrick et al. (2017) considered the problem of overcoming catastrophic forgetting in supervised and also reinforcement learning scenarios where a supervisory signal $\pmb{y}$ exists, whether in the form of labels/annotations, or environmental rewards, respectively. Here we reiterate the geometric interpretation of the EWC framework following the work of (Chaudhry et al., 2018), which we will then adapt to define our generic consolidation framework. Let $p_{\theta}(\pmb{y}|\pmb{x}) = \mathrm{softmax}(\phi(x;\pmb{\theta}))$ , where $[p_{\theta}(\pmb{y}|\pmb{x})]_j$ is the softmax probability of the j-th class. For simplicity, let us consider the case where we want to learn only two tasks consecutively, i.e., tasks 'A' and 'B.' Then, EWC ensures that while learning task 'B,' the conditional likelihood $p_{\theta}(\pmb{y}|\pmb{x}^A)$ does not drift far from the optimal conditional likelihood $p_{\theta_A^*}(\pmb{y}|\pmb{x}^A)$ , where $\theta_A^*$ are the parameters initially optimized for task A:
+
+$$
+\begin{array}{l} \arg \min _ {\boldsymbol {\theta}} \tilde {\mathcal {L}} ^ {B} (\boldsymbol {\theta}) = \arg \min _ {\boldsymbol {\theta}} \mathcal {L} ^ {B} (\boldsymbol {\theta}) + \lambda \mathbb {E} _ {\boldsymbol {x} \sim p _ {X} ^ {A}} \left[ D _ {\mathrm {K L}} \left(p _ {\boldsymbol {\theta} _ {A} ^ {*}} (\boldsymbol {y} | \boldsymbol {x}) \mid \mid p _ {\boldsymbol {\theta}} (\boldsymbol {y} | \boldsymbol {x})\right) \right] \\ = \arg \min _ {\boldsymbol {\theta}} \mathcal {L} ^ {B} (\boldsymbol {\theta}) + \lambda \mathbb {E} _ {\boldsymbol {x} \sim p _ {X} ^ {A}} \left[ \mathbb {E} _ {y \sim p _ {\theta_ {A} ^ {*}}} \left[ \log \left(\frac {p _ {\boldsymbol {\theta} _ {A} ^ {*}} (y | \boldsymbol {x})}{p _ {\boldsymbol {\theta}} (y | \boldsymbol {x})}\right) \right] \right] \tag {1} \\ \end{array}
+$$
+
+where $\lambda$ is the regularization coefficient. Note that equation 1 is essentially an optimization with a memory replay regularizer. Here, while learning task B, samples from task A (i.e., a memory buffer from this task) are fed through the network and the conditional likelihood is constantly checked against the optimal conditional likelihood for task A, $p_{\theta_A^*}(y|\boldsymbol{x}^A)$ , to ensure a minimal deviation from those parameters.
+
+The key question answered by the EWC framework is on how to avoid memory replay and yet achieve a similar result, i.e., not forget the knowledge from old task (task A). The answer lies in the second-order Taylor expansion of the regularizer around the parameters optimized for the old task, $\theta_A^*$ . It is straightforward to show (Chaudhry et al., 2018) that the second-order Taylor expansion of
+
+the regularizer is of the form:
+
+$$
+\mathbb {E} _ {\boldsymbol {x} \sim p _ {X} ^ {A}} \left[ D _ {\mathrm {K L}} \left(p _ {\boldsymbol {\theta}} (\boldsymbol {y} | \boldsymbol {x}) \mid \mid p _ {\boldsymbol {\theta} + \delta \boldsymbol {\theta}} (\boldsymbol {y} | \boldsymbol {x})\right) \right] \approx \frac {1}{2} \delta \boldsymbol {\theta} ^ {T} F _ {\boldsymbol {\theta}} \delta \boldsymbol {\theta} = \| \delta \boldsymbol {\theta} \| _ {F _ {\boldsymbol {\theta}}} ^ {2} \tag {2}
+$$
+
+where $F_{\theta}$ is the Fisher Information Matrix (FIM) and is defined as:
+
+$$
+F _ {\boldsymbol {\theta}} = \mathbb {E} _ {\boldsymbol {x} \sim p _ {X} ^ {A}} \left[ \mathbb {E} _ {y \sim p _ {\boldsymbol {\theta} _ {A} ^ {*}}} \left[ \left(\frac {\partial \log \left(p _ {\boldsymbol {\theta}} (y \mid \boldsymbol {x})\right)}{\partial \boldsymbol {\theta}}\right) \left(\frac {\partial \log \left(p _ {\boldsymbol {\theta}} (y \mid \boldsymbol {x})\right)}{\partial \boldsymbol {\theta}}\right) ^ {T} \right] \right] \tag {3}
+$$
+
+see supplementary material for complete derivations. Therefore, when $\delta \pmb{\theta} \rightarrow 0$ the KL-divergence regularizer enforces closeness of $\pmb{\theta}$ to $\pmb{\theta}_A^*$ in a Riemannian pseudo-manifold induced by the FIM. Given that the number of parameters could easily reach several million in standard deep neural networks, it is practically infeasible to store and use the FIM matrix, $F_{\pmb{\theta}}$ . Therefore, Kirkpatrick et al. (2017) assume that $F_{\pmb{\theta}}$ is diagonal and further approximate the KL-divergence with:
+
+$$
+\mathbb {E} _ {\boldsymbol {x} \sim p _ {X} ^ {A}} [ D _ {\mathrm {K L}} (p _ {\boldsymbol {\theta}} (\boldsymbol {y} | \boldsymbol {x}) \mid \mid p _ {\boldsymbol {\theta} + \delta \boldsymbol {\theta}} (\boldsymbol {y} | \boldsymbol {x})) ] \approx \frac {1}{2} \sum_ {m = 1} ^ {M} [ F _ {\boldsymbol {\theta}} ] _ {m, m} [ \delta \boldsymbol {\theta} ] _ {m} ^ {2} \tag {4}
+$$
+
+where $M$ is the total number of parameters in the neural network. This leads to the main equation in the EWC framework:
+
+$$
+\underset {\boldsymbol {\theta}} {\arg \min } \tilde {\mathcal {L}} ^ {B} (\boldsymbol {\theta}) = \underset {\boldsymbol {\theta}} {\arg \min } \mathcal {L} ^ {B} (\boldsymbol {\theta}) + \frac {\lambda}{2} \sum_ {m = 1} ^ {M} \left[ F _ {\boldsymbol {\theta} _ {A} ^ {*}} \right] _ {m, m} \left[ \boldsymbol {\theta} - \boldsymbol {\theta} _ {A} ^ {*} \right] _ {m} ^ {2} \tag {5}
+$$
+
+From our point of view, the critical aspect of these derivations is the connection between memory replay and structural plasticity. Note that we started with equation 1, which uses the idea of a memory replay regularizer. Then by assuming $\delta \pmb{\theta} \to 0$ , using the second-order Taylor expansion of the KL-divergence around $\pmb{\theta}_A^*$ , and assuming that FIM is a diagonal matrix we arrived at equation 5, which provides the idea of synaptic importance parameters and is an embodiment of the selective synaptic plasticity framework. Next, we use this critical aspect and develop an analogous regularizer (i.e., based on memory replay) for the MAS algorithm.
+
+# 2.2 GENERALIZING TO UNSUPERVISED LEARNING
+
+The EWC framework as explained in the previous section preserves the softmax probability of samples from Task A while learning Task B. This limits the applicability of the method to networks with outputs living on a K-dimensional simplex, e.g., supervised learning and reinforcement learning where the network outputs a probability over a finite set of actions. More recently, Aljundi et al. (2018) presented their Memory-Aware-Synapses (MAS) framework, which lifts the requirement for EWC outputs to live on a simplex, and enables calculation of the synaptic importance parameters even in unsupervised learning and also during testing. While the method is exciting and practically very useful, there is no geometric motivation behind the algorithm. Here we reverse engineer the importance term used in MAS and show a simple regularizer that leads to the MAS algorithm and more importantly provides a geometric interpretation for the algorithm.
+
+Let the regularizer for Task B, be the expected absolute difference between squared $\ell_2$ norms of the output of the network for samples from Task A, i.e.:
+
+$$
+\underset {\boldsymbol {\theta}} {\arg \min } \tilde {\mathcal {L}} ^ {B} (\boldsymbol {\theta}) = \underset {\boldsymbol {\theta}} {\arg \min } \mathcal {L} ^ {B} (\boldsymbol {\theta}) + \lambda \mathbb {E} _ {\boldsymbol {x} \sim p _ {X} ^ {A}} \left[ \frac {1}{2} \left(\| \phi (\boldsymbol {x}; \boldsymbol {\theta}) \| ^ {2} - \| \phi (\boldsymbol {x}; \boldsymbol {\theta} _ {A} ^ {*}) \| ^ {2}\right) ^ {2} \right] \tag {6}
+$$
+
+It is straightforward (see Supplementary material) to show that using the second-order Taylor expansion of the above regularizer leads to:
+
+$$
+\underset {\boldsymbol {\theta}} {\arg \min } \tilde {\mathcal {L}} ^ {B} (\boldsymbol {\theta}) = \underset {\boldsymbol {\theta}} {\arg \min } \mathcal {L} ^ {B} (\boldsymbol {\theta}) + \lambda \sum_ {m = 1} ^ {M} [ \Omega ] _ {m, m} \left[ \boldsymbol {\theta} - \boldsymbol {\theta} _ {A} ^ {*} \right] _ {m} ^ {2} \tag {7}
+$$
+
+where $[\Omega]_{m,n} = \mathbb{E}_{\boldsymbol{x} \sim p_X^A}\left[(\frac{\partial\|\phi(\boldsymbol{x};\boldsymbol{\theta})\|^2}{\partial[\boldsymbol{\theta}]_m})(\frac{\partial\|\phi(\boldsymbol{x};\boldsymbol{\theta})\|^2}{\partial[\boldsymbol{\theta}]_n})\right]$ , which is the importance parameter used by Aljundi et al. (2018). From a geometric perspective, MAS preserves the norms of the samples from
+
+Task A while learning Task B. In other words; MAS enforces closeness of $\theta$ to $\theta_A^*$ in a Riemannian pseudo-manifold induced by matrix $\Omega$ .
+
+The general idea of using the expected value of a "suitable" distance/divergence between samples, $\mathbb{E}_{\boldsymbol{x} \sim p_X^A} d(\phi(\boldsymbol{x}; \boldsymbol{\theta}), \phi(\boldsymbol{x}; \boldsymbol{\theta}_A^*))$ and leveraging its second-order Taylor expansion to obtain synaptic importance values is crucial here and could lead to various undiscovered algorithms based on new distances/divergences. We refer to these approaches as sample-based regularization methods.
+
+# 2.3 PRESERVING DISTRIBUTION OF AN ARBITRARY LAYER
+
+We approach the problem of overcoming catastrophic forgetting from the angle of preserving Task A's distribution at an arbitrary layer of the neural network, when learning Task B. Let $\boldsymbol{z}_i^A = \phi(\boldsymbol{x}_i^A; \boldsymbol{\theta}) \in \mathbb{R}^K$ be the output of the network, for a sample from Task A, at the target layer (e.g., output logits in a NN classifier, or reconstructed image of an autoencoder). The distribution of the random variable $z^A$ in the target layer follows from the Random Variable Transform (RVT) theorem (Gillespie, 1983):
+
+$$
+p _ {Z} ^ {A} (\boldsymbol {z} | \boldsymbol {\theta}) = \int_ {\mathbb {X}} p _ {X} ^ {A} (\boldsymbol {x}) \delta (\boldsymbol {z} - \phi (\boldsymbol {x}; \boldsymbol {\theta})) d x \tag {8}
+$$
+
+Then we propose the following general regularization to overcome forgetting when learning task B:
+
+$$
+\underset {\boldsymbol {\theta}} {\arg \min } \tilde {\mathcal {L}} ^ {B} (\boldsymbol {\theta}) = \underset {\boldsymbol {\theta}} {\arg \min } \mathcal {L} ^ {B} (\boldsymbol {\theta}) + \lambda d \left(p _ {Z} ^ {A} (\cdot | \boldsymbol {\theta}), p _ {Z} ^ {A} (\cdot | \boldsymbol {\theta} _ {A} ^ {*})\right) \tag {9}
+$$
+
+where $d(\cdot, \cdot)$ is a discrepancy measure between the two probability distributions defined in $\mathbb{R}^K$ . Note that equation 9 could be performed with any discrepancy measure or distance, e.g., the Wasserstein distance (Villani, 2008; Kolouri et al., 2017), using a memory replay strategy. In what follows, we describe a 'suitable' distance $d(\cdot, \cdot)$ that: 1) respects the underlying geometry of the space, and 2) enables a similar strategy to that of the EWC framework to provide importance parameters.
+
+# 3 SLICED-CRAMÉR DISTANCE FOR STRUCTURAL PLASTICITY
+
+# 3.1 CRAMÉR DISTANCE
+
+The p-Cramér distance (Cramér, 1928; Székely & Rizzo, 2013) between two one-dimensional probability density functions $p_0$ and $p_1$ is defined as the $\ell_p$ -norm between their cumulative distribution functions. Note that here we avoid any measure theoretic notations for simplicity. Let $q_i(t) = \int_{-\infty}^t p_i(\tau)d\tau$ denote the cumulative distribution function for $p_i$ , then the p-Cramér distance is defined as:
+
+$$
+C _ {p} \left(p _ {0}, p _ {1}\right) = \left(\int_ {\mathbb {R}} \left| q _ {0} (t) - q _ {1} (t) \right| ^ {p} d t\right) ^ {\frac {1}{p}} \tag {10}
+$$
+
+for $p \geq 1$ . Similar to the Wasserstein distance and unlike the KL-divergence and its symmetric form Jensen-Shannon distance (i.e., the square root of the Jensen-Shannon divergence), the Cramér distance respects the underlying geometry of the space. Moreover, the Cramér distance provides unbiased sample gradients (Bellemare et al., 2017), and for $p = 1$ , $C_1$ is equivalent to the 1-Wasserstein distance, $W_1$ . In addition, and similar to the Wasserstein metric, the dual of the Cramér distance is of the form of an integral probability metric (IPM) (Dedecker & Merlevède, 2007).
+
+To further demonstrate the favorable characteristics of this distance, consider the following parametric distribution matching in one-dimension, where the target distribution, $p$ , is a box distribution defined on $\mathbb{R}$ and $p_{\tau}(t) = p(t - \tau)$ is the shifted version of $p$ and the goal is to optimize $\tau$ to minimize the distance between $p_{\tau}$ and $p$ ( $\tau^{*} = 0$ ). For this simple setting, we calculate the energy landscape (i.e., the distance between $p_{\tau}$ and $p$ ) as a function of $\tau$ for the Jensen-Shannon distance, $W_{p}$ , and $C_p$ for $p = 1, 2$ . Figure 2 shows the distributions $p$ and $p_{\tau}$ on the left and the energy landscape as a function of $\tau$ on the right. It can be clearly seen that the Wasserstein and Cramér distances respect the underlying geometry of the problem, while the Jensen-Shannon (JS) distance fails to do so.
+
+To extend the Cramér distance to higher-dimensional distributions, we utilize the idea of distribution slicing used in various recent publications (Kolouri et al., 2016; 2019; 2018). We note that the sliced-Cramér distance (also known as the Cramér-Wold distance) was recently used in Tabor et al. (2018) for generative modeling. We briefly describe the idea in the following section.
+
+
+Figure 2: The energy landscape of various distances as a function of the translation parameter. It can be seen that both Wasserstein and Cramér distances respect the underlying geometry of the problem while the Jensen-Shannon distance fails to do so.
+
+
+
+# 3.2 SLICED-CRAMER DISTANCE
+
+The idea of slicing a higher-dimensional distribution has roots in the Radon transform that is commonly used in computational tomography. The idea is to represent a high-dimensional distribution via the infinite set of its marginal distributions. In short, let $p_0$ and $p_1$ be d-dimensional probability density functions defined on $\mathbb{X} \subset \mathbb{R}^d$ , then their Radon transform is defined as:
+
+$$
+\mathcal {R} p _ {i} (t, \boldsymbol {\xi}) = \int_ {\mathbb {X}} p _ {i} (\boldsymbol {x}) \delta (t - \boldsymbol {x} \cdot \boldsymbol {\xi}) d x \tag {11}
+$$
+
+for $\forall t\in \mathbb{R}$ and $\forall \pmb {\xi}\in \mathbb{S}^{d - 1}$ where $\mathbb{S}^{d - 1}$ denotes the d-dimensional unit sphere. Note that $\mathcal{R}p_i(\cdot ,\pmb {\xi})$ is a so called slice of $p_i$ , which is a one-dimensional marginal distribution of $p_i$ . Let $\mathcal{R}q_{i}(\cdot ,\pmb {\xi})$ be the corresponding cumulative distribution function of $\mathcal{R}p_i(\cdot ,\pmb {\xi})$ ..
+
+$$
+\mathcal {R} q _ {i} (t, \boldsymbol {\xi}) = \int_ {- \infty} ^ {t} \mathcal {R} p _ {i} (\tau , \boldsymbol {\xi}) d \tau \tag {12}
+$$
+
+then the sliced-Cramér distance between $p_0$ and $p_1$ is the expected value of the Cramér distance between their one-dimensional slices, i.e., $\mathcal{R}p_i(\cdot ,\xi)$ when $\xi \sim \mathcal{U}_{\mathbb{S}^{d - 1}}$ for $\mathcal{U}_{\mathbb{S}^{d - 1}}$ being the uniform distribution on the d-dimensional unit sphere. In other words, the sliced Cramér distance is defined as:
+
+$$
+\begin{array}{l} S C _ {p} (p _ {0}, p _ {1}) = \left(\int_ {\mathbb {S} ^ {d - 1}} C _ {p} ^ {p} (\mathcal {R} p _ {0} (\cdot , \boldsymbol {\xi}), \mathcal {R} p _ {1} (\cdot , \boldsymbol {\xi})) d \boldsymbol {\xi}\right) ^ {\frac {1}{p}} \\ = \left(\int_ {\mathbb {S} ^ {d - 1}} \int_ {\mathbb {R}} | \mathcal {R} q _ {0} (t, \boldsymbol {\xi}) - \mathcal {R} q _ {1} (t, \boldsymbol {\xi}) | ^ {p} d t d \boldsymbol {\xi}\right) ^ {\frac {1}{p}} \tag {13} \\ \end{array}
+$$
+
+Now we are ready to propose our method for overcoming representation forgetting.
+
+# 3.3 OVERCOMING REPRESENTATION FORGETTING
+
+The critical point here is that the sample-based regularizers could over-estimate the importance of synapses, leading to intransigence faster. More importantly, a substantial expected change in the network's output (over individual samples) would not necessarily mean catastrophic forgetting. Changes in the network's output within a mode (e.g., in supervised classification within the distribution of a particular class) are harmless, so long as the representation of the data is not significantly changing. Our proposed regularizer tolerates such changes and therefore has the potential for better utilization of the network's learning capacity. We propose the following regularization for overcoming catastrophic forgetting:
+
+$$
+\underset {\boldsymbol {\theta}} {\arg \min } \tilde {\mathcal {L}} ^ {B} (\boldsymbol {\theta}) = \underset {\boldsymbol {\theta}} {\arg \min } \mathcal {L} ^ {B} (\boldsymbol {\theta}) + \lambda S C _ {2} ^ {2} \left(p _ {Z} ^ {A} \left(\cdot | \boldsymbol {\theta} _ {A} ^ {*}\right), p _ {Z} ^ {A} \left(\cdot | \boldsymbol {\theta}\right)\right) \tag {14}
+$$
+
+equation 14 requires memory replay from the old task(s) while learning the new one. To transition from memory replay to selective synaptic plasticity, we derive the second-order Taylor expansion of the regularizer $SC_2^2$ around the optimal parameters for the previous tasks, $\theta_A^*$ . Assuming that $\pmb{\theta} = \pmb{\theta}_A^* + \delta \pmb{\theta}$ where $\delta \pmb{\theta} \rightarrow 0$ , it is straightforward to show that:
+
+$$
+S C _ {2} ^ {2} \left(p _ {Z} ^ {A} (\cdot | \boldsymbol {\theta} _ {A} ^ {*}), p _ {Z} ^ {A} (\cdot | \boldsymbol {\theta})\right) \approx \left(\delta \boldsymbol {\theta}\right) ^ {T} \Gamma_ {\boldsymbol {\theta} _ {A} ^ {*}} (\delta \boldsymbol {\theta}) = \| \delta \boldsymbol {\theta} \| _ {\Gamma_ {\boldsymbol {\theta} _ {A} ^ {*}}} \tag {15}
+$$
+
+where $\Gamma_{\theta_A}$ is defined as:
+
+$$
+\Gamma_ {\boldsymbol {\theta} _ {A} ^ {*}} := \int_ {\mathbb {S} ^ {d - 1}} \int_ {\mathbb {R}} \left(\frac {d \mathcal {R} q _ {Z} ^ {A} (t , \boldsymbol {\xi} | \boldsymbol {\theta} _ {A} ^ {*})}{d \boldsymbol {\theta}}\right) \left(\frac {d \mathcal {R} q _ {Z} ^ {A} (t , \boldsymbol {\xi} | \boldsymbol {\theta} _ {A} ^ {*})}{d \boldsymbol {\theta}}\right) ^ {T} d t d \boldsymbol {\xi} \tag {16}
+$$
+
+See supplementary materials for the detailed derivations. Note that similar to $F_{\theta_A^*}$ , $\Gamma_{\theta_A^*}$ is also positive-semi-definite (PSD) and therefore our Sliced-Cramér regularizer enforces closeness of $\theta$ and $\theta^*$ in a Riemannian pseudo-manifold induced by the PSD matrix $\Gamma_{\theta}$ .
+
+While the definition of $\Gamma$ in equation 16, regardless of its similarity to equation 3, may seem intimidating, it leads to a straightforward empirical algorithm, which we discuss in the next section. Before that, we point out that similar to the FIM, calculating $\Gamma$ is also practically infeasible, and we approximate $\Gamma$ with a diagonal matrix that simplifies the regularization into:
+
+$$
+\underset {\boldsymbol {\theta}} {\arg \min } \tilde {\mathcal {L}} ^ {B} (\boldsymbol {\theta}) = \underset {\boldsymbol {\theta}} {\arg \min } \mathcal {L} ^ {B} (\boldsymbol {\theta}) + \lambda \sum_ {m = 1} ^ {M} [ \Gamma ] _ {m, m} [ \delta \boldsymbol {\theta} ] _ {m} ^ {2} \tag {17}
+$$
+
+Finally, we emphasize that while equation 17 is similar to equation 5, it enforces a very different constraint on the neural network. equation 5 enforces conditional class likelihoods to be preserved, which is sample-based; however, our proposed formulation in equation 17 preserves the distribution of network's outputs at a particular layer for old tasks, i.e., it preserves the distribution of the previously learned representations.
+
+# 4 PROPOSED ALGORITHM
+
+Here we derive the algorithmic steps required to calculate $\Gamma$ empirically, as shown in Algorithm 1. The empirical distribution at the network's output can be written as, $p_Z^A (\boldsymbol {z}|\boldsymbol {\theta})\approx \frac{1}{N}\sum_{n = 1}^{N}\delta (\boldsymbol {z} - \phi (\boldsymbol{x}_n^A;\boldsymbol {\theta}))$ , and the slices of this empirical distribution are defined as:
+
+$$
+\mathcal {R} p _ {Z} ^ {A} (t, \pmb {\xi} | \pmb {\theta}) \approx \frac {1}{N} \sum_ {n = 1} ^ {N} \delta (t - \pmb {\xi} \cdot \phi (\pmb {x} _ {n} ^ {A}; \pmb {\theta}))
+$$
+
+Let $u(\cdot)$ denote the step function, which is the cumulative distribution of the Dirac delta function. Then the cumulative distribution of $\mathcal{R}p_Z^A (t,\pmb {\xi}|\pmb {\theta})$ can be written as, $\mathcal{R}q_Z^A (t,\pmb {\xi}|\pmb {\theta})\approx \frac{1}{N}\sum_{n = 1}^{N}u(t - \pmb {\xi}\cdot \phi (\pmb{x}_n^A;\pmb {\theta}))$ . Therefore we have:
+
+$$
+\frac {d \mathcal {R} q _ {Z} ^ {A} (t , \boldsymbol {\xi} | \boldsymbol {\theta})}{d \boldsymbol {\theta}} \approx \frac {1}{N} \sum_ {n = 1} ^ {N} \left(\frac {- d \boldsymbol {\xi} \cdot \phi \left(\boldsymbol {x} _ {n} ^ {A} ; \boldsymbol {\theta}\right)}{d \boldsymbol {\theta}}\right) \delta (t - \boldsymbol {\xi} \cdot \phi \left(\boldsymbol {x} _ {n} ^ {A}; \boldsymbol {\theta}\right)) \tag {18}
+$$
+
+substituting equation 18 into equation 16 and using a Monte-Carlo approximation of the integration of $\mathbb{S}^{d - 1}$ , with $L$ samples, leads to:
+
+$$
+\Gamma = \frac {1}{L} \sum_ {l = 1} ^ {L} \left(\frac {d \xi_ {l} \cdot \bar {z}}{d \theta}\right) \left(\frac {d \xi_ {l} \cdot \bar {z}}{d \theta}\right) ^ {T} \tag {19}
+$$
+
+where $\xi_{l}\mathrm{s}$ are randomly drawn from $\mathbb{S}^{K - 1}$ , and $\bar{z} = \frac{1}{N}\sum_{n = 1}^{N}\phi (\pmb{x}_n^A;\pmb{\theta}_A^*)$ . These derivations give birth to our proposed algorithm shown in Algorithm 1. Given that calculation of matrix $\Gamma$ is not practically feasible (due to the large number of parameters of a deep neural network), we follow the work of (Kirkpatrick et al., 2017) and approximate $\Gamma$ to be a diagonal matrix, which simplifies to:
+
+$$
+\left[ \Gamma_ {\boldsymbol {\theta} _ {A} ^ {*}} \right] _ {i, i} = \frac {1}{L} \sum_ {l = 1} ^ {L} \left(\frac {1}{N} \sum_ {n = 1} ^ {N} \frac {d \boldsymbol {\xi} _ {l} \cdot \phi (\boldsymbol {x} _ {n} ^ {A} ; \boldsymbol {\theta} _ {A} ^ {*})}{d \boldsymbol {\theta} _ {i}}\right) ^ {2} = \frac {1}{L} \sum_ {l = 1} ^ {L} \left(\frac {d \boldsymbol {\xi} _ {l} \cdot \bar {\phi} _ {A} ^ {*}}{d \boldsymbol {\theta} _ {i}}\right) ^ {2}
+$$
+
+where $\bar{\phi}_A^* = \frac{1}{N}\sum_{n = 1}^{N}\phi (\pmb{x}_n^A;\pmb{\theta}_A^*)$ .
+
+Algorithm 1: Sliced Cramer Preservation (SCP)
+
+Input: Data, $\mathcal{X}^A = \{\pmb{x}_n^A\sim p_X^A\}_{n = 1}^N$ , and the optimized neural network, $\phi (\cdot ;\pmb {\theta}_A^*)$ , for Task A.
+
+Parameters: Number of random projections, $L$ .
+
+Output: Synaptic importance matrix $\Gamma$
+
+1 Calculate the mean response of the network at the targeted layer: $\bar{\phi}_A^* = \frac{1}{N}\sum_{n = 1}^{N}\phi (\pmb{x}_n^A;\theta_A^*)$
+2 Initialize the synaptic importance matrix, $[\Gamma]_{i,j} = 0$ .
+3 for $l \gets 1$ to $L$ do
+4 Sample $\pmb{\xi}_l$ from $\mathbb{S}^{K - 1}$
+5 Slice the mean response: $\rho = \pmb{\xi}_l\cdot \bar{\phi}_A^*$
+6 Calculate $\nabla_{\theta}\rho$ using auto-differentiation
+7 Update $\Gamma \colon \Gamma + = \frac{1}{L} (\nabla_{\pmb{\theta}}\rho)(\nabla_{\pmb{\theta}}\rho)^T$
+
+
+Figure 3: Comparison among online-EWC, MAS, and SCP on learning ten permuted MNIST tasks (a), and the histogram of $\operatorname{Log}(\lambda \times \cdot)$ of the synaptic importances (i.e., the diagonal values of $F$ , $\Omega$ , and $\Gamma$ , for EWC, MAS, and SCP, respectively) for each method (b).
+
+
+
+
+
+# 4.1 ONLINE EXTENSION OF THE ALGORITHM
+
+To extend the framework into sequential learning of multiple tasks and to avoid memorizing task-specific $\Gamma$ s (or their diagonals), we follow the EWC++ framework proposed by Chaudhry et al. (2018), which is, in essence, identical to the online-EWC proposed by Schwarz et al. (2018). The EWC++ (and online-EWC) methods ameliorate the need for predicting task identities and calculating task-specific FIMs and keep the memory requirement of the method constant (EWC requires linear growth of memory as a function of number of tasks). In EWC++, given $F_{\theta}^{(t-1)}$ at task $(t-1)$ , the accumulated FIM after learning task $t$ is calculated as $F_{\theta}^{(t)} = \alpha F_{\theta_t^*} + (1 - \alpha) F_{\theta}^{(t-1)}$ , where $F_{\theta_t^*}$ is the task specific FIM for task $t$ , and $\alpha \in [0,1)$ is a hyperparameter that indicates the importance of preserving the most recent task over the older ones. Similarly, we use,
+
+$$
+\Gamma_ {\boldsymbol {\theta}} ^ {(t)} = \alpha \Gamma_ {\boldsymbol {\theta} _ {t} ^ {*}} + (1 - \alpha) \Gamma_ {\boldsymbol {\theta}} ^ {(t - 1)} \tag {20}
+$$
+
+to obtain the sliced-Cramér regularizer for task $(t + 1)$ .
+
+# 5 NUMERICAL EXPERIMENTS
+
+# 5.1 PERMUTED MNIST
+
+We first test our proposed algorithm on the benchmark permuted MNIST task and compare the performance with online-EWC and our implementation of the online-MAS algorithm. For this experiment, we used a single head model that learns ten tasks, where each task contains a permuted version of the original MNIST dataset. We note that the reported results are a function of the architecture of the underlying network. Meaning that, while all three methods perform well on this task for larger networks, the true competitiveness of the proposed method emerges for smaller networks where "over-estimation" of the synaptic importances significantly hinders learning of the subsequent tasks and leads to intransigence. For this experiment, we used a fully-connected network (i.e.,
+
+
+Figure 4: Qualitative and quantitative comparison between MAS and SCP on sequential learning of auto-encoders. Columns in Panel (a) show the reconstruction of data after learning consequent tasks in a random permutation of MNIST sequence. Panel (b) shows the average $\ell_1$ -reconstruction loss for each method over all tasks and over 10 runs.
+
+
+Figure 5: A qualitative comparison of the EWC, MAS, and SCP algorithms on semantic segmentation of the SYNTHIA Dataset (Ros et al., 2016). Task 1 (T1) is semantic segmentation in summer, and Task 2 (T2) is semantic segmentation in winter. The first row shows performance after learning T1 on input from T1. Second row, shows performance after learning T2 on input from T2. The third row shows performance on input from T1 after learning T2. The last row, magnifies the last three images in the third row for the ease of comparison.
+
+a multi-layer perceptron) with the following architecture, $784 \rightarrow 1024 \rightarrow 512 \rightarrow 256 \rightarrow 10$ neurons, and for all optimizations we used the ADAM optimizer with learning rate, $lr = 1e - 4$ . For our proposed method, SCP, we used $L = 100$ slices. We repeated each experiment 10 times (with different permutations), and reported the average accuracy over all tasks in Figure 3 (a). We can see that SCP is capable of utilizing the capacity of the network better, which points to the fact that regularizing the distribution as opposed to the samples provides a less restricted regularization for the network and still enables the network to freely move individual samples so long as the overall latent distribution of the data is consistent.
+
+The regularization coefficients for each algorithm was cross-validated on the following grid, $\lambda \in \{1e + i\mid i\in [-3, - 2,\dots ,9]\}$ and the optimal value was used to report the results in Figure 3 (a). Moreover, in Figure 3 (b) we show the histogram of the logarithm of the product of the regularization coefficients with importance parameters for each method (i.e., $\lambda$ times the diagonal values of $F_{\theta},\Omega$ , and $\Gamma$ for EWC, MAS, and SCP, respectively). One can see that the optimal values of the regularization coefficients provide, more or less, scale-consistent synaptic importances for all methods and distinguishing factor between the methods is on the difference between these distributions. Another interesting observation is that the distribution of the synaptic importances are more similar for sample-based methods (i.e., EWC and MAS) compared to the proposed distribution-based method.
+
+# 5.2 SEQUENTIAL LEARNING OF AUTO-ENCODERS
+
+Next, we consider an experiment consisting of unsupervised/self-supervised sequential learning. To that end, we learn an auto-encoder on single digits of the MNIST dataset sequentially. The model is chosen to be a fully connected auto-encoder, with the following encoder $728 \to 1024 \to 1024 \to 1024 \to 256$ , a mirrored decoder $256 \to 1024 \to 1024 \to 1024 \to 784$ , and Rectified Linear Unit (ReLU) activations. For the loss function, we used cross-entropy plus the $\ell_1$ -norm of the reconstruction error. Similar to the previous experiment, we used the ADAM optimizer (Kingma & Ba, 2014) for training the network with $lr = 1e - 4$ . We perform 50 epochs of learning on each digit, before switching to the next digit. For consolidation, we used $L = 100$ slices for SCP. Finally, we permute the order of the digits and run our experiments 10 times, and compare 'No Consolidation,' with MAS, and SCP. Due to the unsupervised nature of the experiment, the EWC framework does not apply here.
+
+Figure 4 demonstrate the results of this experiment. Panel (a) shows the reconstruction of a sample digit from one of our runs with the input digit sequence of $[2,7,4,0,9,1,6,5,8,3]$ . It can be seen that both MAS and SCP can successfully retain the learned knowledge while acquiring new knowledge, while without consolidation the auto-encoder suffers from catastrophic forgetting. Panel (b) shows the average $\ell_1$ -norm of the reconstruction error for all seen tasks over the 10 runs. We can see that SCP and MAS are qualitatively on par, and SCP provides a modest yet statistically significant improvement over MAS for this task.
+
+# 5.3 SEMANTIC SEGMENTATION OF SYNTHIA DATASET
+
+Lastly, we go beyond the benchmark yet less practical MNIST dataset and address catastrophic forgetting in a more interesting/critical application of autonomous vehicles. We specifically consider the problem of learning semantic segmentation of road scenes in a sequential manner, where the input distribution of the data changes over time. Semantic segmentation is the task of assigning a class label to every pixel of an input image. To that end, we use two sequences of the SYNTHIA dataset (Ros et al., 2016), namely 'SYNTHIA-SEQS-01-SUMMER' and 'SYNTHIA-SEQS-01-WINTER' as Task 1 and Task 2, respectively. There are 13 classes in the dataset namely: Miscellaneous, Sky, Building, Road, Sidewalk, Fence, Vegetation, Pole, Car, Sign, Pedestrian, Cyclist, and Lane Marking. We keep the last 100 frames of each sequence as the testing-set and train a deep convolutional U-Net architecture (Ronneberger et al., 2015) on the tasks mentioned above. For the loss function, we used $(1 - Dice)$ (Zou et al., 2004), and each task was learned over 100 epochs. For the optimizer, we used the ADAM optimizer (Kingma & Ba, 2014) with learning rate, $lr = 1e - 4$ . For consolidation, we used $L = 100$ slices for SCP.
+
+We learn the tasks sequentially (summer first and then winter), and a qualitative comparison of online-EWC, MAS, and SCP on a sample test frame is in Figure 5. The first row shows the performance on T1 after learning T1 (base model), the second row shows performance on T2 after learning on T1 and then T2 (indicator of intransigence), and the third row shows performance on T1 after learning on T1 and then T2 (indicator of the catastrophic forgetting). We can see that catastrophic forgetting happens when no synaptic consolidation is leveraged. Moreover, compared to online-EWC and MAS, SCP suffers less from intransigence as fewer artifacts are present in the second row. Lastly, SCP overcomes catastrophic-forgetting more successfully compared to EWC and MAS as it is apparent from the lack of artifacts in the last row. Finally, we provide a quantitative comparison between the methods in Figure 6, where we report the Dice score (Zou et al.,
+
+
+Figure 6: Testing Dice score (Zou et al., 2004) of online-EWC, MAS, and SCP on sequential learning for semantic segmentation of the summer images (Task 1) and winter images (Task 2) from SYNTHIA dataset (Ros et al., 2016). The blue and red shadings on the plots indicate the durations in which the models were trained on summer and winter data, respectively
+
+2004), averaged over ten runs, for each task and each method during the sequential training. As
+
+can be seen, SCP significantly outperforms online-EWC and MAS on this task both in overcoming catastrophic forgetting (left plot) and overcoming intransigence (right plot).
+
+# 6 CONCLUSION
+
+We introduced a new generic approach towards selective synaptic plasticity for preserving the distribution of the network's output, at an arbitrary layer, for previously learned tasks. We started from a memory-replay-based regularization that penalized the change in the distribution of the network's output and showed that a second-order Taylor expansion of such regularization would lead to a selective synaptic plasticity approach that does not require memory of samples from previously seen tasks. Furthermore, we proposed the sliced-Cramér distance as a suitable metric for preserving these distributions, which leads to a straightforward algorithm for selective plasticity. Also, using a similar approach, we reverse-engineered the Memory Aware Synapses (MAS) framework and provided a geometrically meaningful regularization that leads to this algorithm. We then compared the online-EWC, MAS, and SCP methods on a variety of learning tasks, including supervised and unsupervised/self-supervised learning, and consistently showed competitive performance.
+
+# 7 ACKNOWLEDGMENTS
+
+This material is based upon work supported by the United States Air Force and DARPA under Contract No. FA8750-18-C-0103. Any opinions, findings and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the United States Air Force and DARPA.
+
+# REFERENCES
+
+Rahaf Aljundi, Francesca Babiloni, Mohamed Elhoseiny, Marcus Rohrbach, and Tinne Tuytelaars. Memory aware synapses: Learning what (not) to forget. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 139-154, 2018.
+Marc G Bellemare, Ivo Danihelka, Will Dabney, Shakir Mohamed, Balaji Lakshminarayanan, Stephan Hoyer, and Rémi Munos. The Cramér distance as a solution to biased Wasserstein gradients. arXiv preprint arXiv:1705.10743, 2017.
+Arslan Chaudhry, Puneet K Dokania, Thalaiyasingam Ajanthan, and Philip HS Torr. Riemannian walk for incremental learning: Understanding forgetting and intransigence. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 532-547, 2018.
+Harald Cramér. On the composition of elementary errors: First paper: Mathematical deductions. Scandinavian Actuarial Journal, 1928(1):13-74, 1928.
+Jérôme Dedecker and Florence Merlevède. The empirical distribution function for dependent variables: asymptotic and nonasymptotic results in $\mathbb{L}^p$ . ESAIM: Probability and Statistics, 11:102-114, 2007.
+Terrance DeVries and Graham W Taylor. Improved regularization of convolutional neural networks with cutout. arXiv preprint arXiv:1708.04552, 2017.
+Daniel T Gillespie. A theorem for physicists in the theory of random variables. American Journal of Physics, 51(6):520-533, 1983.
+Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015.
+Wenpeng Hu, Zhou Lin, Bing Liu, Chongyang Tao, Zhengwei Tao, Jinwen Ma, Dongyan Zhao, and Rui Yan. Overcoming catastrophic forgetting via model adaptation. In International Conference on Learning Representations, 2019. URL https://openreview.net/forum?id=ryGvcoA5YX.
+
+Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
+James Kirkpatrick, Razvan Pascanu, Neil Rabinowitz, Joel Veness, Guillaume Desjardins, Andrei A. Rusu, Kieran Milan, John Quan, Tiago Ramalho, Agnieszka Grabska-Barwinska, Demis Hassabis, Claudia Clopath, Dharshan Kumaran, and Raia Hadsell. Overcoming catastrophic forgetting in neural networks. Proceedings of the National Academy of Sciences, 114(13):3521-3526, 2017. ISSN 0027-8424. doi: 10.1073/pnas.1611835114. URL https://www.pnas.org/content/114/13/3521.
+Soheil Kolouri, Yang Zou, and Gustavo K Rohde. Sliced Wasserstein kernels for probability distributions. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 5258-5267, 2016.
+Soheil Kolouri, Se Rim Park, Matthew Thorpe, Dejan Slepcev, and Gustavo K Rohde. Optimal mass transport: Signal processing and machine-learning applications. IEEE signal processing magazine, 34(4):43-59, 2017.
+Soheil Kolouri, Gustavo K Rohde, and Heiko Hoffmann. Sliced Wasserstein distance for learning gaussian mixture models. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 3427-3436, 2018.
+Soheil Kolouri, Phillip E. Pope, Charles E. Martin, and Gustavo K. Rohde. Sliced Wasserstein auto-encoders. In International Conference on Learning Representations, 2019. URL https://openreview.net/forum?id=H1xaJn05FQ.
+Alex Krizhevsky, Vinod Nair, and Geoffrey Hinton. Cifar-10 and cifar-100 datasets. URL: https://www.cs.toronto.edu/kriz/cifar.html, 6, 2009.
+Sang-Woo Lee, Jin-Hwa Kim, Jaehyun Jun, Jung-Woo Ha, and Byoung-Tak Zhang. Overcoming catastrophic forgetting by incremental moment matching. In Advances in neural information processing systems, pp. 4652-4662, 2017.
+Xilai Li, Yingbo Zhou, Tianfu Wu, Richard Socher, and Caiming Xiong. Learn to grow: A continual structure learning framework for overcoming catastrophic forgetting. arXiv preprint arXiv:1904.00310, 2019.
+Zhizhong Li and Derek Hoiem. Learning without forgetting. IEEE transactions on pattern analysis and machine intelligence, 40(12):2935-2947, 2017.
+James L McClelland, Bruce L McNaughton, and Randall C O'Reilly. Why there are complementary learning systems in the hippocampus and neocortex: insights from the successes and failures of connectionist models of learning and memory. *Psychological review*, 102(3):419, 1995.
+Michael McCloskey and Neal J Cohen. Catastrophic interference in connectionist networks: The sequential learning problem. In *Psychology of learning and motivation*, volume 24, pp. 109-165. Elsevier, 1989.
+German I Parisi, Ronald Kemker, Jose L Part, Christopher Kanan, and Stefan Wermter. Continual lifelong learning with neural networks: A review. Neural Networks, 2019.
+Amal Rannen, Rahaf Aljundi, Matthew B Blaschko, and Tinne Tuytelaars. Encoder based lifelong learning. In Proceedings of the IEEE International Conference on Computer Vision, pp. 1320-1328, 2017.
+Sylvestre-Alvise Rebuffi, Hakan Bilen, and Andrea Vedaldi. Learning multiple visual domains with residual adapters. In Advances in Neural Information Processing Systems, pp. 506-516, 2017.
+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.
+
+German Ros, Laura Sellart, Joanna Materzynska, David Vazquez, and Antonio M Lopez. The synthia dataset: A large collection of synthetic images for semantic segmentation of urban scenes. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 3234-3243, 2016.
+Mohammad Rostami, Soheil Kolouri, and Praveen K Pilly. Complementary learning for overcoming catastrophic forgetting using experience replay. In Proceedings of the Twenty-Seventh International Joint Conference on Artificial Intelligence, IJCAI-18. International Joint Conferences on Artificial Intelligence Organization, 2019.
+Andrei A Rusu, Neil C Rabinowitz, Guillaume Desjardins, Hubert Soyer, James Kirkpatrick, Koray Kavukcuoglu, Razvan Pascanu, and Raia Hadsell. Progressive neural networks. arXiv preprint arXiv:1606.04671, 2016.
+Jonathan Schwarz, Wojciech Czarnecki, Jelena Luketina, Agnieszka Grabska-Barwinska, Yee Whye Teh, Razvan Pascanu, and Raia Hadsell. Progress & compress: A scalable framework for continual learning. In International Conference on Machine Learning, pp. 4535-4544, 2018.
+Hanul Shin, Jung Kwon Lee, Jaehong Kim, and Jiwon Kim. Continual learning with deep generative replay. In Advances in Neural Information Processing Systems, pp. 2990-2999, 2017.
+Gábor J Székely and Maria L Rizzo. Energy statistics: A class of statistics based on distances. Journal of statistical planning and inference, 143(8):1249-1272, 2013.
+Jacek Tabor, Szymon Knop, Przemysław Spurek, Igor Podolak, Marcin Mazur, and Stanisław Jastrzebski. Cramér-Wold autoencoder. arXiv preprint arXiv:1805.09235, 2018.
+Cédric Villani. Optimal transport: old and new, volume 338. Springer Science & Business Media, 2008.
+Chenshen Wu, Luis Herranz, Xialei Liu, Joost van de Weijer, Bogdan Raducanu, et al. Memory replay gans: Learning to generate new categories without forgetting. In Advances In Neural Information Processing Systems, pp. 5962-5972, 2018.
+Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. arXiv preprint arXiv:1605.07146, 2016.
+Friedemann Zenke, Ben Poole, and Surya Ganguli. Continual learning through synaptic intelligence. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 3987-3995. JMLR.org, 2017.
+Kelly H Zou, Simon K Warfield, Aditya Bharatha, Clare MC Tempany, Michael R Klaus, Steven J Haker, William M Wells III, Ferenc A Jolesz, and Ron Kikinis. Statistical validation of image segmentation quality based on a spatial overlap index1: scientific reports. Academic radiology, 11(2):178-189, 2004.
+
+# 8 SUPPLEMENTARY MATERIALS
+
+# 8.1 TAYLOR EXPANSION OF THE KL-DIVERGENCE
+
+For the sake of completion, here we derive the second-order Taylor expansion of $D_{\mathrm{KL}}$ ,
+
+$$
+D _ {\mathrm {K L}} \left(p _ {\boldsymbol {\theta} _ {0}} \right\lvert \left| p _ {\boldsymbol {\theta}}\right) = \int_ {X} p _ {\boldsymbol {\theta} _ {0}} (x) \log \left(\frac {p _ {\boldsymbol {\theta} _ {0}} (x)}{p _ {\boldsymbol {\theta}} (x)}\right) d x
+$$
+
+around $\theta_0$ where we can write $\pmb {\theta} = \pmb {\theta}_0 + \delta \pmb{\theta}$ . The second-order Taylor expansion is:
+
+$$
+D _ {\mathrm {K L}} (p _ {\pmb {\theta} _ {0}} | | p _ {\pmb {\theta}}) \approx D _ {\mathrm {K L}} (p _ {\pmb {\theta} _ {0}} | | p _ {\pmb {\theta} _ {0}}) + \delta \pmb {\theta} ^ {T} \left(\frac {d D _ {\mathrm {K L}} (p _ {\pmb {\theta} _ {0}} | | p _ {\pmb {\theta}})}{d \pmb {\theta}} | _ {\pmb {\theta} _ {0}}\right) + \frac {1}{2} \delta \pmb {\theta} ^ {T} \left(\frac {d ^ {2} D _ {\mathrm {K L}} (p _ {\pmb {\theta} _ {0}} | | p _ {\pmb {\theta}})}{d \pmb {\theta} ^ {2}} | _ {\pmb {\theta} _ {0}}\right) \delta \pmb {\theta}
+$$
+
+1. Where for the first-order term we have:
+
+$$
+\frac {d D _ {\mathrm {K L}} (p _ {\boldsymbol {\theta} _ {0}} | | p _ {\boldsymbol {\theta}})}{d \boldsymbol {\theta}} = - \int_ {X} p _ {\boldsymbol {\theta} _ {0}} (x) \frac {d \log (p _ {\boldsymbol {\theta}} (x))}{d \boldsymbol {\theta}} d x = - \int_ {X} \frac {p _ {\boldsymbol {\theta} _ {0}} (x)}{p _ {\boldsymbol {\theta}} (x)} \frac {d p _ {\boldsymbol {\theta}} (x)}{d \boldsymbol {\theta}} d x
+$$
+
+Therefore at $\pmb {\theta} = \pmb{\theta}_0$ we have:
+
+$$
+\frac {d D _ {\mathrm {K L}} \left(p _ {\boldsymbol {\theta} _ {0}} \mid \mid p _ {\boldsymbol {\theta}}\right)}{d \boldsymbol {\theta}} \mid_ {\boldsymbol {\theta} _ {0}} = - \int_ {X} \frac {d p _ {\boldsymbol {\theta}} (x)}{d \boldsymbol {\theta}} d x = \frac {d}{d \boldsymbol {\theta}} \left(\int_ {X} p _ {\boldsymbol {\theta} _ {0}} (x) d x\right) = 0
+$$
+
+2. and for the second-order term:
+
+$$
+\begin{array}{l} \frac {d ^ {2} D _ {\mathrm {K L}} \left(p _ {\boldsymbol {\theta} _ {0}} \mid \mid p _ {\boldsymbol {\theta}}\right)}{d \boldsymbol {\theta} ^ {2}} = \frac {d}{d \boldsymbol {\theta}} \left(- \int_ {X} \frac {p _ {\boldsymbol {\theta} _ {0}} (x)}{p _ {\boldsymbol {\theta}} (x)} \frac {d p _ {\boldsymbol {\theta}} (x)}{d \boldsymbol {\theta}} d x\right) \\ { = } { \int _ { X } \frac { p _ { \pmb { \theta } _ { 0 } } ( x ) } { p _ { \pmb { \theta } } ^ { 2 } ( x ) } \left( \frac { d p _ { \pmb { \theta } } ( x ) } { d \pmb { \theta } } \right) \left( \frac { d p _ { \pmb { \theta } } ( x ) } { d \pmb { \theta } } \right) ^ { T } d x - } \\ \int_ {X} \frac {p _ {\boldsymbol {\theta} _ {0}} (x)}{p _ {\boldsymbol {\theta}} (x)} \frac {d ^ {2} p _ {\boldsymbol {\theta}} (x)}{d \boldsymbol {\theta} ^ {2}} d x \\ \end{array}
+$$
+
+Therefore at $\pmb {\theta} = \pmb{\theta}_0$ we have:
+
+$$
+\begin{array}{l} \frac {d ^ {2} D _ {\mathrm {K L}} (p _ {\pmb {\theta} _ {0}} | | p _ {\pmb {\theta}})}{d \pmb {\theta} ^ {2}} | _ {\pmb {\theta} _ {0}} = \int_ {X} p _ {\pmb {\theta} _ {0}} (x) \left(\frac {1}{p _ {\pmb {\theta} _ {0}} (x)} \frac {d p _ {\pmb {\theta} _ {0}} (x)}{d \pmb {\theta}}\right) \left(\frac {1}{p _ {\pmb {\theta} _ {0}} (x)} \frac {d p _ {\pmb {\theta} _ {0}} (x)}{d \pmb {\theta}}\right) ^ {T} d x - \\ \int_ {X} \frac {d ^ {2} p _ {\boldsymbol {\theta} _ {0}} (x)}{d \boldsymbol {\theta} ^ {2}} d x \\ = \int_ {X} p _ {\boldsymbol {\theta} _ {0}} (x) \left(\frac {d \log (p _ {\boldsymbol {\theta} _ {0}} (x))}{d \boldsymbol {\theta}}\right) \left(\frac {d \log (p _ {\boldsymbol {\theta} _ {0}} (x))}{d \boldsymbol {\theta}}\right) ^ {T} d x \\ = \mathbb {E} _ {x \sim p _ {\boldsymbol {\theta} _ {0}}} \left[ \left(\frac {d \log (p _ {\boldsymbol {\theta} _ {0}} (x))}{d \boldsymbol {\theta}}\right) \left(\frac {d \log (p _ {\boldsymbol {\theta} _ {0}} (x))}{d \boldsymbol {\theta}}\right) ^ {T} \right] = F \\ \end{array}
+$$
+
+which is the Fisher Information Matrix (FIM).
+
+Finally, putting everything together we have:
+
+$$
+D _ {\mathrm {K L}} \left(p _ {\boldsymbol {\theta} _ {0}} \right\lvert \left| p _ {\boldsymbol {\theta}}\right) \approx \frac {1}{2} \delta \boldsymbol {\theta} ^ {T} F \delta \boldsymbol {\theta}
+$$
+
+which concludes the derivation.
+
+# 8.2 TAYLOR EXPANSION OF THE MAS REGULARIZER
+
+Here we drive the second-order Taylor expansion of the MAS regularizer in equation 6,
+
+$$
+\begin{array}{l} {M A S _ {r e g}} = {\mathbb {E} _ {\boldsymbol {x} \sim p _ {X}} \left[ \frac {1}{2} (\| \phi (\boldsymbol {x}; \boldsymbol {\theta}) \| ^ {2} - \| \phi (\boldsymbol {x}; \boldsymbol {\theta} _ {0}) \| ^ {2}) ^ {2} \right]} \\ = \frac {1}{2} \int_ {X} p _ {X} (\boldsymbol {x}) \left(\| \phi (\boldsymbol {x}; \boldsymbol {\theta}) \| ^ {2} - \| \phi (\boldsymbol {x}; \boldsymbol {\theta} _ {0}) \| ^ {2}\right) ^ {2} d \boldsymbol {x} \\ \end{array}
+$$
+
+around $\theta_0$ . The second-order Taylor expansion is:
+
+$$
+M A S _ {r e g} \approx \delta \boldsymbol {\theta} ^ {T} \left(\frac {d M A S _ {r e g}}{d \boldsymbol {\theta}} | _ {\boldsymbol {\theta} _ {0}}\right) + \frac {1}{2} \delta \boldsymbol {\theta} ^ {T} \left(\frac {d ^ {2} M A S _ {r e g}}{d \boldsymbol {\theta} ^ {2}} | _ {\boldsymbol {\theta} _ {0}}\right) \delta \boldsymbol {\theta}
+$$
+
+1. Where for the first-order term we have:
+
+$$
+\left[ \frac {d M A S _ {r e g}}{d \pmb {\theta}} \right] _ {m} = \int_ {X} p _ {X} (\pmb {x}) \frac {d \| \phi (\pmb {x} ; \pmb {\theta}) \| ^ {2}}{d [ \pmb {\theta} ] _ {m}} (\| \phi (\pmb {x}; \pmb {\theta}) \| ^ {2} - \| \phi (\pmb {x}; \pmb {\theta} _ {0}) \| ^ {2})
+$$
+
+which for $\theta = \theta_0$ is zero.
+
+2. For the second-order term we have:
+
+$$
+\begin{array}{l} \left[ \frac {d ^ {2} M A S _ {r e g}}{d {\pmb \theta} ^ {2}} \right] _ {m, n} = \int_ {X} p _ {X} ({\pmb x}) \frac {d \| \phi ({\pmb x} ; {\pmb \theta}) \| ^ {2}}{d [ {\pmb \theta} ] _ {m}} \frac {d \| \phi ({\pmb x} ; {\pmb \theta}) \| ^ {2}}{d [ {\pmb \theta} ] _ {n}} d {\pmb x} + \\ \int_ {X} p _ {X} (\boldsymbol {x}) \left[ \frac {d ^ {2} \| \phi (\boldsymbol {x} ; \boldsymbol {\theta}) \| ^ {2}}{d \boldsymbol {\theta} ^ {2}} \right] _ {m, n} (\| \phi (\boldsymbol {x}; \boldsymbol {\theta}) \| ^ {2} - \| \phi (\boldsymbol {x}; \boldsymbol {\theta} _ {0}) \| ^ {2}) d \boldsymbol {x} \\ \end{array}
+$$
+
+where evaluated at $\theta = \theta_0$ the second term on the right-hand-side vanishes.
+
+Finally, putting everything together we have:
+
+$$
+M A S _ {r e g} \approx \delta \pmb {\theta} ^ {T} \underbrace {\mathbb {E} _ {\pmb {x} \sim p _ {X}} \left[ \left(\frac {d \left\| \phi (\pmb {x} ; \pmb {\theta}) \right\| ^ {2}}{d \pmb {\theta}}\right) \left(\frac {d \left\| \phi (\pmb {x} ; \pmb {\theta}) \right\| ^ {2}}{d \pmb {\theta}}\right) ^ {T} \right]} _ {\Omega} \delta \pmb {\theta}
+$$
+
+which is the term reported in the paper.
+
+# 8.3 TAYLOR EXPANSION OF THE SLICED-CRAMER DISTANCE
+
+Here we derive the second-order Taylor expansion of the squared 2-Sliced-Cramér distance,
+
+$$
+S C _ {2} ^ {2} \left(p _ {\boldsymbol {\theta} _ {0}}, p _ {\boldsymbol {\theta}}\right) = \int_ {\mathbb {S} ^ {d - 1}} \int_ {\mathbb {R}} \left| \mathcal {R} q _ {\boldsymbol {\theta} _ {0}} (t, \boldsymbol {\xi}) - \mathcal {R} q _ {\boldsymbol {\theta}} (t, \boldsymbol {\xi}) \right| ^ {2} d t d \boldsymbol {\xi}
+$$
+
+around $\theta_0$ , as reported in equation 16. The second-order Taylor expansion is:
+
+$$
+S C _ {2} ^ {2} (p _ {\pmb {\theta} _ {0}}, p _ {\pmb {\theta}}) \approx S C _ {2} ^ {2} (p _ {\pmb {\theta} _ {0}}, p _ {\pmb {\theta} _ {0}}) + \delta \pmb {\theta} ^ {T} \left(\frac {d S C _ {2} ^ {2} (p _ {\pmb {\theta} _ {0}} , p _ {\pmb {\theta}})}{d \pmb {\theta}} | _ {\pmb {\theta} _ {0}}\right) + \frac {1}{2} \delta \pmb {\theta} ^ {T} \left(\frac {d ^ {2} S C _ {2} ^ {2} (p _ {\pmb {\theta} _ {0}} , p _ {\pmb {\theta}})}{d \pmb {\theta} ^ {2}} | _ {\pmb {\theta} _ {0}}\right) \delta \pmb {\theta}
+$$
+
+1. Where for the first-order term we have:
+
+$$
+\frac {d S C _ {2} ^ {2} \left(p _ {\boldsymbol {\theta} _ {0}} , p _ {\boldsymbol {\theta}}\right)}{d \boldsymbol {\theta}} = 2 \int_ {\mathbb {S} ^ {d - 1}} \int_ {\mathbb {R}} \frac {d \mathcal {R} q _ {\boldsymbol {\theta}} (t , \boldsymbol {\xi})}{d \boldsymbol {\theta}} \left(\mathcal {R} q _ {\boldsymbol {\theta}} (t, \boldsymbol {\xi}) - \mathcal {R} q _ {\boldsymbol {\theta} _ {0}} (t, \boldsymbol {\xi})\right) d t d \boldsymbol {\xi}
+$$
+
+which for $\theta = \theta_0$ is equal to zero.
+
+2. For the second-order term we have:
+
+$$
+\begin{array}{l} \frac {d ^ {2} S C _ {2} ^ {2} (p _ {\boldsymbol {\theta} _ {0}} , p _ {\boldsymbol {\theta}})}{d \boldsymbol {\theta} ^ {2}} = 2 \int_ {\mathbb {S} ^ {d - 1}} \int_ {\mathbb {R}} \frac {d ^ {2} \mathcal {R} q _ {\boldsymbol {\theta}} (t , \boldsymbol {\xi})}{d \boldsymbol {\theta} ^ {2}} (\mathcal {R} q _ {\boldsymbol {\theta}} (t, \boldsymbol {\xi}) - \mathcal {R} q _ {\boldsymbol {\theta} _ {0}} (t, \boldsymbol {\xi})) d t d \boldsymbol {\xi} + \\ 2 \int_ {\mathbb {S} ^ {d - 1}} \int_ {\mathbb {R}} \left(\frac {d \mathcal {R} q _ {\boldsymbol {\theta}} (t , \boldsymbol {\xi})}{d \boldsymbol {\theta}}\right) \left(\frac {d \mathcal {R} q _ {\boldsymbol {\theta}} (t , \boldsymbol {\xi})}{d \boldsymbol {\theta}}\right) ^ {T} d t d \boldsymbol {\xi} \\ \end{array}
+$$
+
+which evaluated at $\pmb {\theta} = \pmb{\theta}_0$ is:
+
+$$
+\begin{array}{l} \frac {d ^ {2} S C _ {2} ^ {2} \left(p _ {\boldsymbol {\theta} _ {0}} , p _ {\boldsymbol {\theta}}\right)}{d \boldsymbol {\theta} ^ {2}} | _ {\boldsymbol {\theta} _ {0}} = 2 \int_ {\mathbb {S} ^ {d - 1}} \int_ {\mathbb {R}} \left(\frac {d \mathcal {R} q _ {\boldsymbol {\theta} _ {0}} (t , \boldsymbol {\xi})}{d \boldsymbol {\theta}}\right) \left(\frac {d \mathcal {R} q _ {\boldsymbol {\theta} _ {0}} (t , \boldsymbol {\xi})}{d \boldsymbol {\theta}}\right) ^ {T} d t d \boldsymbol {\xi} \\ = 2 \Gamma \\ \end{array}
+$$
+
+Finally, putting everything together we have:
+
+$$
+S C _ {2} ^ {2} (p _ {\boldsymbol {\theta} _ {0}}, p _ {\boldsymbol {\theta}}) \approx \delta \boldsymbol {\theta} ^ {T} \Gamma \delta \boldsymbol {\theta}
+$$
+
+
+Figure 7: Sample images from MNIST and SVHN dataset (a), and the testing performance of the Online-EWC, MAS, and SCP on sequential learning starting from MNIST (Task 1) and then SVHN (Task 2) (b). The blue and red shadings on the plots indicate the durations in which the models were trained on the MNIST and SVHN datasets, respectively.
+Figure 8: The model we used in the MNIST-to-SVHN experiment.
+
+```txt
+VGG_like(
+(activation):ReLU(inplace)
+ features):Sequential( (0):Conv2d(1,64,kernel_size=(3,3),stride=(1,1),padding=(2,2)) (1):BatchNorm2d(64,eps=le-05,momentum=0.1,affine=True,trackrunning stats=True) (2):ReLU(inplace) (3):Conv2d(64,64,kernel_size=(3,3),stride=(1,1),padding=(2,2)) (4):BatchNorm2d(64,eps=le-05,momentum=0.1,affine=True,track running stats=True) (5):ReLU(inplace) (6):MaxPool2d(kernel_size=2,stride=2,pading=0,dilation=1,ceil_mode=False) (7):Conv2d(64,128,kernel_size=(3,3),stride=(1,1),padding=(2,2)) (8):BatchNorm2d(128,eps=le-05,momentum=0.1,affine=True,track running stats=True) (9):ReLU(inplace) (10):Conv2d(128,128,kernel_size=(3,3),stride=(1,1),padding=(2,2)) (11):BatchNorm2d(128,eps=le-05,momentum=0.1,affine=True,track running stats=True) (12):ReLU(inplace) (13):MaxPool2d(kernel_size=2,stride=2,pading=0,dilation=1,ceil_mode=False) (14):Conv2d(128,256,kernel_size=(3,3),stride=(1,1),padding=(2,2)) (15):BatchNorm2d(256,eps=le-05,momentum=0.1,affine=True,track running stats=True) (16):ReLU(inplace) (17):Conv2d(256,256,kernel_size=(3,3),stride=(1,1),padding=(2,2)) (18):BatchNorm2d(256,eps=le-05,momentum=0.1,affine=True,track running stats=True) (19):ReLU(inplace) (20):MaxPool2d(kernel_size=2,stride=2,padding=0,dilation=1,ceil_mode=False) ) (fc):Sequential( (0):Linear(in_features $| = 1$ 2544,out_features $| = 2048$ ,bias=True) (1):BatchNormld(2048,eps $| = 1$ -05,momentum $| = 0$ .1,affine=True,track running stats=True) (2):ReLU(inplace) (3):Dropout(p=0.2) (4):Linear(in_features $| = 2048$ ,out_features $| = 1024$ ,bias=True) (5):BatchNormld(1024,eps $| = 1$ -05,momentum $| = 0$ .1,affine=True,track running stats=True) (6):ReLU(inplace) (7):Dropout(p=0.2) ) (classify):Sequential( (0):Linear(in_features $| = 1$ 024,out_features $| = 10$ ,bias $\equiv$ True)
+```
+
+# 8.4 MNIST-TO-SVHN EXPERIMENT
+
+Given the space constraint of the conference, we include our results on the MNIST-to-SVHN experiment in the supplementary material. In this experiment, Task 1 is learning the MNIST digits, and Task 2 is learning the SVHN digits. We show sample images from these two datasets in Figure 7a. In this experiment, we used a VGG-like architecture, for which we include the details in 8.
+
+
+Figure 9: Sample super-classes from the CIFAR100 dataset and visualization of the data augmentation procedure we used in this experiment (a), and the average testing accuracy of the Online-EWC, MAS, and SCP on sequential learning of the tasks (b). We note that we were, unfortunately, only able to run the experiment once, and will update the Figure with the results from multiple runs as soon as they are available.
+
+
+
+We performed incremental learning with no consolidation, Online-EWC, MAS, and SCP. The importance parameters were cross-validated on a coarse grid (due to the computational and time restrictions) of $\{1e + i|i\in [2,3,4,5,6]\}$ , where the optimal parameters for the methods where $1e + 3$ for SCP, $1e + 5$ for MAS, and $1e + 4$ for Online-EWC. We chose 20 epochs per task. Figure 7b shows the results of the experiment. Note that the first plot shows the testing performance of the methods on Task1 (i.e., MNIST dataset), where the blue shade indicates the first 20 epochs (training on the MNIST dataset), and the red shade indicates the second 20 epochs (training on the SVHN dataset). As can be seen, all methods can address catastrophic forgetting, while Online-EWC and SCP outperform MAS (However, a one should perform a finer grid search on the importance-parameters for a definitive evaluation). The middle plot shows the testing performance of the model on the SVHN dataset (Task 2). The MAS and SCP methods outperform online-EWC, and SCP performs slightly better than MAS (i.e., overcomes intransigence better). The third plot shows the average testing performance of the methods on both tasks. Similarly, we can see that SCP outperforms MAS and Online-EWC. We repeated the experiments ten times, and the plots show the average performance.
+
+# 8.5 CIFAR100 EXPERIMENTS
+
+The CIFAR100 (Krizhevsky et al., 2009) dataset contains images from 20 super-classes, where each super-class contains five sub-classes. For this dataset, we considered an experiment in which the tasks are supervised classification of the super-classes. In short, we split the data into five sequential tasks, where each task contains a sub-class from all the 20 super-classes. We used a Wide Residual Network (Wide-ResNet) Zagoruyko & Komodakis (2016) network as our model and utilized the data augmentation suggested by (DeVries & Taylor, 2017). Figure 9a shows sample super-classes together with data augmentation. For each method, we used a coarse grid search for the importance parameters $\{1e + i \mid i \in [2,3,4,5,6]\}$ . Unfortunately, and due to the lack of time, we were able to only run the experiment for each method once. We report the average classification results in Figure 9b. For the final version of the paper, we will complete this experiment with 1) a finer grid search over the importance parameters and 2) multiple runs of the experiments and reporting the average.
\ No newline at end of file
diff --git a/slicedcramersynapticconsolidationforpreservingdeeplylearnedrepresentations/images.zip b/slicedcramersynapticconsolidationforpreservingdeeplylearnedrepresentations/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..dcea1ac4b9f203facb67b15c5a3d21669b9010bb
--- /dev/null
+++ b/slicedcramersynapticconsolidationforpreservingdeeplylearnedrepresentations/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:915f880b56474406d86fc5c29a1297b365812f60d807e2eb25aae6500970b28c
+size 830535
diff --git a/slicedcramersynapticconsolidationforpreservingdeeplylearnedrepresentations/layout.json b/slicedcramersynapticconsolidationforpreservingdeeplylearnedrepresentations/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..467f72b6bcf6a40cf7fbb1e3d2e67cf42f190415
--- /dev/null
+++ b/slicedcramersynapticconsolidationforpreservingdeeplylearnedrepresentations/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:94868c3d09cf403beb8573b22fcaa324047fdd22846e9e6825927cf9620dbf0e
+size 576085
diff --git a/sparsecodingwithgatedlearnedista/61f52a4e-ef3b-4b2b-80ee-6d5ed6c6ce84_content_list.json b/sparsecodingwithgatedlearnedista/61f52a4e-ef3b-4b2b-80ee-6d5ed6c6ce84_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..83121a7d082d46e9945511ffca97385d4ce66db7
--- /dev/null
+++ b/sparsecodingwithgatedlearnedista/61f52a4e-ef3b-4b2b-80ee-6d5ed6c6ce84_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e5d8172d702a4f7f85c89cae10782b4674183534c7d9427ab0a05f95d5bc26b2
+size 210618
diff --git a/sparsecodingwithgatedlearnedista/61f52a4e-ef3b-4b2b-80ee-6d5ed6c6ce84_model.json b/sparsecodingwithgatedlearnedista/61f52a4e-ef3b-4b2b-80ee-6d5ed6c6ce84_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..e93ec16a48cad2ddf05876c9de47b3d5e1b6c6cc
--- /dev/null
+++ b/sparsecodingwithgatedlearnedista/61f52a4e-ef3b-4b2b-80ee-6d5ed6c6ce84_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:07fa64ae032017afab6b5641dccd0c7978291f53b06b4d31060bf442b2c0e4fa
+size 246579
diff --git a/sparsecodingwithgatedlearnedista/61f52a4e-ef3b-4b2b-80ee-6d5ed6c6ce84_origin.pdf b/sparsecodingwithgatedlearnedista/61f52a4e-ef3b-4b2b-80ee-6d5ed6c6ce84_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..351f5f0d02f9fa30c69c942d3076c505b164d5db
--- /dev/null
+++ b/sparsecodingwithgatedlearnedista/61f52a4e-ef3b-4b2b-80ee-6d5ed6c6ce84_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b8e2b6c3d440050a29a39e3af305c64b94c8aad3adeb8c114dd36b88e6cdd8a9
+size 4382742
diff --git a/sparsecodingwithgatedlearnedista/full.md b/sparsecodingwithgatedlearnedista/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..803f197bc9d5de13f49fc2b4c83e3aba35ebdcb0
--- /dev/null
+++ b/sparsecodingwithgatedlearnedista/full.md
@@ -0,0 +1,1129 @@
+# SPARSE CODING WITH GATED LEARNED ISTA
+
+Kailun Wu *†
+
+Department of Automation,
+
+Tsinghua University
+
+Beijing, P.R.China
+
+wukl14@mails.tsinghua.edu.cn
+
+&kailun.wukailun@alibaba-inc.com
+
+Yiwen Guo *
+
+Bytedance AI Lab
+
+Beijing, P.R.China
+
+guoyiwen.ai@bytedance.com
+
+Ziang Li
+
+Department of Automation,
+
+Tsinghua University
+
+Beijing, P.R.China
+
+liza19@mails.tsinghua.edu.cn
+
+Changshui Zhang
+
+Department of Automation,
+
+Tsinghua University
+
+Beijing, P.R.China
+
+zcs@mail.tsinghua.edu.cn
+
+# ABSTRACT
+
+In this paper, we study the learned iterative shrinkage thresholding algorithm (LISTA) for solving sparse coding problems. Following assumptions made by prior works, we first discover that the code components in its estimations may be lower than expected, i.e., require gains, and to address this problem, a gated mechanism amenable to theoretical analysis is then introduced. Specific design of the gates is inspired by convergence analyses of the mechanism and hence its effectiveness can be formally guaranteed. In addition to the gain gates, we further introduce overshoot gates for compensating insufficient step size in LISTA. Extensive empirical results confirm our theoretical findings and verify the effectiveness of our method.
+
+# 1 INTRODUCTION
+
+Sparse coding serves as the foundation of many machine learning applications, e.g., the direction-of-arrival estimation (Xu et al., 2012), signal denoising (Elad & Aharon, 2006), and super resolution imaging (Yang et al., 2010). In general, it aims to recover an inherently sparse vector $x_{s} \in \mathbb{R}^{n}$ from an observation $y \in \mathbb{R}^{m}$ corrupted by a noise vector $\varepsilon \in \mathbb{R}^{m}$ . That is,
+
+$$
+y = A x _ {s} + \varepsilon , \tag {1}
+$$
+
+in which $A \in \mathbb{R}^{m \times n}$ is an over-complete basis matrix. The problem of recovering $x_{s}$ , however, is a challenging task, in which the main difficulties are to incorporate the sparse constraint which is nonconvex and to further determine the indices of its non-zero elements, i.e., the support of the vector. A reasonable solution to the problem is to use convex functions as surrogates to relax the constraint of sparsity, among which the most classical one probably is the $l_{1}$ -norm penalty. Such a problem is carefully studied in Lasso (Tibshirani, 1996), and it can be solved via least angle regression (Efron et al., 2004), the iterative shrinkage and thresholding algorithm (ISTA) (Daubechies et al., 2004), etc.
+
+Despite the simplicity, these conventional solvers suffer from critical shortcomings. Taking ISTA as an example, we know that 1) it converges very slowly with only a sublinear rate (Beck & Teboulle, 2009), 2) the correlation between each of the two columns of $A$ should be relatively low. In recent years, deep learning (LeCun et al., 2015) methods have achieved remarkable successes. Deep neural
+
+networks (DNNs) have been proven both effective and efficient in dealing with many tasks, including image classification (He et al., 2016), object detection (Girshick, 2015), speech recognition (Hinton et al., 2012), and also sparse coding (Gregor & LeCun, 2010; Wang et al., 2016; Borgerding et al., 2017; He et al., 2017; Zhang & Ghanem, 2018; Chen et al., 2018; Liu et al., 2019; Sulam et al., 2019). The core idea behind deep learning-based sparse coding is to train DNNs to approximate the optimal sparse code. For instance, an initial work of Gregor and LeCun's (2010) takes the inspiration from ISTA and develops an approximator named learned ISTA (LISTA), which is structurally similar to a recurrent neural network (RNN).
+
+It has been demonstrated both empirically and theoretically that LISTA is superior to ISTA (Wang et al., 2016; Moreau & Bruna, 2017; Giryes et al., 2018; Chen et al., 2018). Nevertheless, it is also uncontroversial that there exists much room for further enhancing it. In this paper, we delve deeply into the foundation of (L)ISTA and discover possible weaknesses of LISTA. First and foremost, we know from prior arts (Chen et al., 2018; Liu et al., 2019) that LISTA tends to learn large enough biases to achieve no "false positive" in the support of generated codes and further ensure linear convergence, and we prove that this tendency, however, also makes the magnitude of the code components being lower than that of the ground-truth. That said, there probably exists a requirement of gains in the code estimations. Second, regarding the optimization procedure of ISTA as to minimize an upper bound of its objective function at each step, we conjecture that the element-wise update of (L)ISTA normally "lags behind" the optimal solution, which suggests that it requires overshoots to reach the optimum, just like what has been suggested in fast ISTA (FISTA) (Beck & Teboulle, 2009) and learned FISTA (LFISTA) (Moreau & Bruna, 2017).
+
+In this paper, our main contributions are summarized as follows:
+
+- We discover weaknesses of LISTA by theoretically analyzing its optimization procedure, for mitigating which we introduce gain gates and overshoot gates, akin to update gate and reset gate mechanisms in the gated recurrent unit (GRU) Cho et al. (2014).
+- We provide convergence analyses for LISTA (with or without gates), which further give rise to conditions on which the performance of our method with gain gates can be guaranteed. A practical case is considered, where the assumption of no "false positive" is relaxed.
+- Insightful expressions for the gates are presented. In comparison with state-of-the-art sparse coding networks (not limited to previous extensions to LISTA), our method achieves superior performance. It also applies to variants of LISTA, e.g., LFSITA (Moreau & Bruna, 2017) and ALISTA (Liu et al., 2019).
+
+Notations: In this paper, unless otherwise clarified, vectors and matrices are denoted by lowercase and uppercase characters, respectively. For vectors/matrices originally introduced without any subscript, adding a subscript (e.g., $i$ ) indicates its element/column at the corresponding position. For instance, for $x \in \mathbb{R}^n$ , $x_i$ represents the $i$ -th element of the vector, and $W_{:,i}$ and $W_{i,\cdot}$ denote the $i$ -th column and row of a matrix $W$ respectively. While for vectors introduced with subscripts already, e.g., $x_s$ , we use $(x_s)_i$ to denote its $i$ -th element. The operator $\odot$ is used to indicate element-wise multiplication of two vectors. The support of a vector is denoted as $\operatorname{supp}(x) \coloneqq \{i | x_i \neq 0\}$ . We use $\sup_{x_s}$ as the simplified form of $\sup_{x_s \in \mathcal{X}(B,s,0)}$ , see Assumption 1 for the definition of $\mathcal{X}(B,s,0)$ .
+
+# 2 BACKGROUND
+
+In general, sparse coding solves the problem that can be formulated as
+
+$$
+\min _ {x} f (x, y) + \lambda r (x), \tag {2}
+$$
+
+in which $f(x, y)$ calculates the residual of approximating $y$ using a linear combination of column-wise features in $A$ . The function $f(x, y)$ is convex with respect to $x$ in general. In particular, if $\varepsilon$ is a Gaussian vector, then it should be $f(x, y) = \| Ax - y\|_2^2$ . The term $\lambda r(x)$ serves as a regularizer for sparsity and we have $r(x) = \| x\|_1$ in Lasso. As mentioned, a variety of algorithms can be applied to solve the problem and our focus in the paper is (L)ISTA. We first revisit the optimization procedure of ISTA, which is the foundation of LISTA as well. Given $y$ , let us introduce a scalar $\gamma > 0$ that fulfills $\gamma I - \nabla_x^2 f(x, y) \succ 0, \forall x$ , then it can be considered as optimizing an upper bound of the objective
+
+function obtained via Taylor expansion. To be more specific, for any presumed $x^{(t)}$ , we have
+
+$$
+f (x, y) + \lambda r (x) \leq f \left(x ^ {(t)}, y\right) + \left(x - x ^ {(t)}\right) \nabla_ {x} f \left(x ^ {(t)}\right) + \frac {\gamma}{2} \| x - x ^ {(t)} \| ^ {2} + \lambda r (x). \tag {3}
+$$
+
+By substituting $r(x)$ with $\| x\| _1$ and optimizing the bound in an element-wise manner, we can easily get the one-step update rule that zeros the gradient based on $x^{(t)}$ . It is, $x^{(0)} = 0$ and
+
+$$
+x ^ {(t + 1)} = s _ {\lambda / \gamma} \left(x ^ {(t)} - \nabla_ {x} f \left(x ^ {(t)}\right) / \gamma\right), \quad \forall t \geq 0, \tag {4}
+$$
+
+in which $s_b(x) \coloneqq \mathrm{sign}(x)(|x| - b)_+$ is a shrinking function and $(\cdot)_+$ is a rectified linear unit (ReLU) calculating $\max \{0, \cdot\}$ . For Gaussian noises, the formulation reduces to
+
+$$
+x ^ {(t + 1)} = s _ {\lambda / \gamma} \left(\left(I - \frac {A ^ {T} A}{\gamma}\right) x ^ {(t)} + \frac {A ^ {T}}{\gamma} y\right). \tag {5}
+$$
+
+The update as shown in Eq. (4) and (5) can be performed iteratively until convergence. However, the convergence of ISTA (along with some other conventional solvers) is known to be slow, and it has been shown that DNNs can be utilized to accelerate the procedure. Many researchers have explored the idea since the initial work of Gregor and LeCun's (i.e., LISTA). For LISTA, they design deep architectures following the main procedure of ISTA yet to learn parameters in an end-to-end manner from data (Gregor & LeCun, 2010; Hershey et al., 2014). The inference process of LISTA is similar to that of an RNN and can be formulated as $x^{(0)} = \mathbf{0}$ and
+
+$$
+x ^ {(t + 1)} = s _ {b ^ {(t)}} \left(W ^ {(t)} x ^ {(t)} + U ^ {(t)} y\right), \quad t = 0, \dots , d - 1, \tag {6}
+$$
+
+where $\Theta = \{U^{(t)}, W^{(t)}, b^{(t)}\}_{t=0,1,\ldots,d-1}$ , is learnable parameters set. Some works (Xin et al., 2016; Chen et al., 2018) have proved that $W^{(t)}$ and $U^{(t)}$ should satisfy the constraint $W^{(t)} = I - U^{(t)}A$ , such that
+
+$$
+x ^ {(t + 1)} = s _ {b ^ {(t)}} \left(x ^ {(t)} + U ^ {(t)} \left(A x ^ {(t)} - y\right)\right), \quad t = 0, \dots , d - 1. \tag {7}
+$$
+
+The parameters in $\Theta$ are normally learned from a set of training samples by minimizing the difference between the final code estimations and ground-truth. In this paper, our main assumption for theoretical analyses follows those of prior works (Chen et al., 2018; Liu et al., 2019) in a noiseless case, and noisy cases will be considered in the experiments.
+
+Assumption 1. The sparse vector $x_{s}$ and noise vector $\varepsilon$ are sampled from a set $\mathcal{X}(B,s,0)$ fulfilling:
+
+$$
+\mathcal {X} (B, s, 0) := \{x | \| x \| _ {\infty} \leq B, \varepsilon = \mathbf {0}, \| x \| _ {0} \leq s \}.
+$$
+
+# 3 SPARSE CODING WITH GAIN GATES AND OVERSHOOT GATES
+
+In this section, we will introduce the advocated gain gates and overshoot gates. Along with thorough discussions for the motivations, their formulations are provided in Section 3.1 and 3.2, respectively. Figure 1 summarizes the inference process of the standard LISTA and two evolved versions with our gates incorporated. Proofs of all our theoretical results are deferred to the appendix.
+
+
+Figure 1: The inference process of the standard LISTA and evolved versions with our gates
+
+
+
+
+
+# 3.1 SPARSE CODING WITH GAIN GATES
+
+Recent works have shown linear convergence of LISTA (Chen et al., 2018; Liu et al., 2019). In order to guarantee the convergence, it is also demonstrated that the value of bias terms should be large enough to eliminate all "false positive" in the support of the generated codes. However, this may lead to an issue that the magnitude of the generated code components in LISTA must be smaller than or at most equal to those of the ground-truth. Our result in Proposition 1 makes this formal. For clarity of the result, we would like to introduce the following definition first.
+
+Definition 1. (Liu et al., 2019) Given a matrix $A \in \mathbb{R}^{m \times n}$ , its generalized mutual coherence is:
+
+$$
+\mu (A) := \inf _ {W \in \mathbb {R} ^ {n \times m}, W _ {i,: A _ {:, i}} = 1, \forall i} \left\{\max _ {i \neq j, 1 \leq i, j \leq n} W _ {i,: A _ {:, j}} \right\}. \tag {8}
+$$
+
+We let $\mathcal{W}(A)$ denote a set of all matrices that can achieve the generalized mutual coherence $\mu(A)$ , which means:
+
+$$
+\mathcal {W} (A) := \left\{W \mid \max _ {i \neq j, 1 \leq i, j \leq n} W _ {i,:} A _ {:, j} = \mu (A), W _ {i,:} A _ {:, i} = 1, \forall i \right\}. \tag {9}
+$$
+
+Proposition 1. (Requirement of gains). With $U^{(t)} \in \mathcal{W}(A)$ and $W^{(t)} = I - U^{(t)}A$ , if $b^{(t)} = \mu(A)\sup_{x_s} \| x^{(t)} - x_s\|_1$ is achieved in LISTA to guarantee no "false positive" (i.e., $\text{supp}(x^{(t)}) \subset \text{supp}(x_s)$ ) and further linear convergence (i.e., $\| x^{(t)} - x_s\|_2 \leq sB\exp(ct)$ , in which $c = \log((2s - 1)\mu(A))$ ), then we have for the estimation $|x_i^{(t)}| \leq |(x_s)_i|$ and $x_i^{(t)}(x_s)_i \geq 0, \forall i \in \text{supp}(x_s)$ .
+
+Provided Proposition 1 as the evidence of a potential weakness of LISTA, we believe that if the code components can be enlarged appropriately, then the estimation at each step would be closer to $x_{s}$ , and the convergence of LISTA will be further improved, which inspires us to design a gate to enlarge the generated code components. Such a gate is named as a gain gate and it acts on the input to the current estimation, akin to a reset gate in GRU (Cho et al., 2014), which is
+
+$$
+x ^ {(t + 1)} = s _ {b ^ {(t)}} \left(W ^ {(t)} \left(g _ {t} \left(x ^ {(t)}, y \mid \Lambda_ {g} ^ {(t)}\right) \odot x ^ {(t)}\right) + U ^ {(t)} y\right), \tag {10}
+$$
+
+in which the gate function $g_{t}(\cdot ,\cdot |\Lambda_{g}^{(t)})$ outputs an $n$ -dimensions vector, and $\Lambda_g^{(t)}$ is the set of its learnable parameters. In the original implementation of LISTA, the output of each layer is obtained by calculating Eq. (4) iteratively. It has been proven that the estimation $x^{(t)}$ ultimately converges to the ground-truth $x_{s}$ (as $t\to \infty$ ), only if the condition of $(W^{(t)} - (I - U^{(t)}A))\rightarrow 0$ holds. That said, it is suggested that $U^{(t)}$ and $W^{(t)}$ are entangled to the end. Yet, with our gated mechanism, the update rule in neural networks has been modified into Eq. (10), making it unclear whether the convergence is guaranteed similarly or not. To figure it out, we perform theoretical analyses in depth, which will further provide guidance for the gate design. We are going to explore: whether the learnable matrices are still entangled as in LISTA, and to encourage fast convergence, what properties should the gate function satisfy? Theorem 1 and 2 give some answers to these questions and they are based on the same assumptions as for Proposition 1.
+
+Theorem 1. If the $s$ -th principal minor of $W^{(t)}$ have full rank, then for the gate function bounded from both above and below, we have $x_{s}$ as the fixed point of Eq. (10) only if
+
+$$
+\operatorname {d i a g} \left(g _ {t} \left(x ^ {(t)}, y \mid \Lambda_ {g} ^ {(t)}\right)\right)\rightarrow D \quad \text {a n d} \quad W ^ {(t)} D - (I - U ^ {(t)} A) \rightarrow 0, \quad \text {a s} t \rightarrow \infty , \tag {11}
+$$
+
+in which $D$ is an $n \times n$ constant diagonal matrix and the function $\mathrm{diag}(\cdot)$ creates a diagonal matrix with the elements of its input on the main diagonal.
+
+From Theorem 1 we can equivalently have $(\tilde{W}^{(t)} - (I - U^{(t)}A))\to 0$ by defining $\tilde{W}^{(t)}\coloneqq W^{(t)}D$ which means the learnable matrices are similarly entangled as in the standard LISTA. Besides, we know that as the number of layers increases, each introduced gain gate should ultimately converge to a constant (diagonal) matrix $D$ to guarantee performance. Then if $W^{(t)}\rightarrow I - U^{(t)}A$ , the gain gate function converges to an identical mapping as $t\to \infty$ , and vice versa. This inspires us to "split" the gate function into an identical one and a residual one, and we thus advocate, for each index $i$ of the vector, the $i$ -th element of gain gate is
+
+$$
+g _ {t} \left(x ^ {(t)}, y \mid \Lambda_ {g} ^ {(t)}\right) _ {i} = 1 + \kappa_ {t} \left(x ^ {(t)}, y \mid \Lambda_ {g} ^ {(t)}\right) _ {i} \quad \text {a n d} \quad \kappa_ {t} \left(x ^ {(t)}, y \mid \Lambda_ {g} ^ {(t)}\right) _ {i} \geq 0, \tag {12}
+$$
+
+in which $\kappa_{t}(x^{(t)},y|\Lambda_{g}^{(t)})_{i}$ is the $i$ -th element of $\kappa_{t}(x^{(t)},y|\Lambda_{g}^{(t)})$ , and it should decrease as $t$ increases, in order to guarantee convergence in Eq. (11). Let us further study the convergence rate of "LISTA" equipped with such gain gates. For clarity, we introduce another condition for the function before moving to more details:
+
+$$
+\kappa_ {t} \left(x ^ {(t)}, y \mid \Lambda_ {g} ^ {(t)}\right) _ {i} < 2 b _ {i} ^ {(t - 1)} / \left| x _ {i} ^ {(t)} \right|. \tag {13}
+$$
+
+We present theoretical results as follows on the basis of Proposition 1, i.e., we still have $U^{(t)} \in \mathcal{W}(A)$ , $W^{(t)} = I - U^{(t)}A$ and Assumption 1, but the requirement for $b^{(t)}$ is different.
+
+Theorem 2. If $b^{(t)} = \mu(A) \sup_{x_s} \| x_s - x^{(t)} \odot g_t(x^{(t)}, y|\Lambda_g^{(t)}) \|_1$ is achieved, following the update rule in Eq. (10), if the conditions in Eq. (12) and (13) hold for the gate function, there will be
+
+$$
+\left\| x ^ {(t)} - x _ {s} \right\| _ {2} \leq s B \exp \left(\sum_ {i = 1} ^ {t - 1} c _ {i} + c\right), \tag {14}
+$$
+
+in which $c = \log((2s - 1)\mu(A))$ , $c_i = c$ if $i \leq \lceil \log(\frac{sB}{\|x_s\|_1}) / \log(\frac{1}{(2s - 1)\mu(A)}) \rceil$ , and $c_i < c$ otherwise.
+
+Theorem 2 presents an upper bound of $\| x^{(t)} - x_s\| _2$ for LISTA with gain gates, and it shows that so long as the gates satisfying conditions in Eq. (12) and (13) are introduced, the "convergence factor" $c + \sum c_{i}$ of our gated LISTA would be smaller in comparison with that of the standard LISTA (which is $ct$ , see Proposition 1 and Chen et al.'s work 2018).
+
+By consolidating all these theoretical cues, we further give principled expressions for the gate function. One may expect to endow the gates some learning capacities, thus we let
+
+$$
+g _ {t} \left(x ^ {(t)}, y \mid \Lambda_ {g} ^ {(t)}\right) = 1 + \kappa_ {t} \left(x ^ {(t)}, y \mid \Lambda_ {g} ^ {(t)}\right) = 1 + \mu_ {t} b ^ {(t - 1)} f _ {t} \left(x ^ {(t)} \mid \nu_ {t}\right), \tag {15}
+$$
+
+in which $\mu_t \in \mathbb{R}$ is a parameter to be learned, $b^{(t-1)}$ is the threshold parameter of the $(t-1)$ -th layer, and $f_t(x^{(t)}|\nu_t)$ is a newly introduced function constrained not to be greater than $2/|x^{(t)}|$ . We are going to evaluate different choices for the function $f_t(x^{(t)})$ in experiments, e.g.,
+
+the piece-wise linear function: $f_{t}(x^{(t)}|\nu_{t}) = \mathrm{ReLU}(1 - \mathrm{ReLU}(\nu_{t}|x^{(t)}|))$
+
+the inverse proportional function: $f_{t}(x^{(t)}|\nu_{t}) = 1 / (\nu_{t}|x^{(t)}| + \epsilon),$ (16)
+
+the exponential function: $f_{t}(x^{(t)}|\nu_{t}) = \exp (-\nu_{t}|x^{(t)}|)$ ,
+
+in which $\nu_{t} \in \mathbb{R}$ is a parameter to be learned, and $\epsilon$ is a tiny positive scalar introduced to avoid zero being divided. All the learnable parameters in a gain gate are thus collected as $\Lambda_{g}^{(t)} = \{\mu_{t}, \nu_{t}\}$ .
+
+# 3.1.1 NO FALSE POSITIVE?
+
+Our previous theoretical results show that the performance of LISTA can be improved by using a gain gate, as long as the gate function satisfies conditions in Eq. (12) and (13), and no "false positive" is encountered. However, it is not always true in practice. Our experimental results also show that when the inverse proportional function is adopted as gain gates in lower layer for LISTA, the performance of our gated LISTA may even degrade. We conjecture that such contradiction to the theoretical results may be owing to impractical assumptions. In this subsection, we try to relax the assumption about no "false positive", and we further found that a tighter bound can be achieved with a more reasonable assumption instead. Through theoretical analyses as follows, we also demonstrate that the inverse proportional gain function should better be only adopted in higher layers. For clarity of the results, we would like to introduce the following definition first.
+
+Definition 2. Given a model with $\Theta$ , in which $b^{(t)} = \Gamma \mu(A) \sup_{x_s} \| x^{(t)} \odot g_t(x^{(t)}, y|\Lambda_g^{(t)}) - x_s \|_1$ , we introduce $\omega_{t+1}(k|\Theta)$ to characterize its relationship with the false positive rate, which is
+
+$\omega_{t + 1}(k_{t + 1}|\Theta) = \sup_{\forall x_s, |supp(\tilde{x}^{(t + 1)}) \cup supp(x_s)| \leq |supp(x_s)| + k_{t + 1}} \Gamma,$
+
+in which $\check{x}^{(t + 1)}\coloneqq s_{b^{(t)}}(W^{(t)}(x^{(t)}\odot g_t(x^{(t)},y|\Lambda_g^{(t)}) - x_s))$ , and $k_{t + 1}\geq 0$ is the desired maximal number of "false positive" of $x^{(t + 1)}$ .
+
+The above definition applies to both the standard LISTA and LISTA with gain gates (we can let the gate function be an identity function to achieve a standard LISTA). We first analyze the convergence of LISTA without gates. We present theoretical results as follows on the basis of similar assumptions (including Assumption 1, $U^{(t)} \in \mathcal{W}(A)$ , and $W^{(t)} = I - U^{(t)}A$ ), but with a different requirement for $b^{(t)}$ from Proposition 1.
+
+Theorem 3. If $b^{(t)} = \omega_{t + 1}(k_{t + 1}|\Theta)\mu (A)\sup_{x_s}\| x^{(t)} - x_s\| _1$ is achieved, and $\exists 0 < k_0^{(t)} < s$ such that $\omega_t(k_0^{(t)}|\Theta) < 1 - 1 / (s - k_0^{(t)})$ , then there exists "false positive" with $0 < k_{t} < s$ and
+
+$$
+\| x ^ {(t)} - x _ {s} \| _ {2} \leq s B \exp (\sum_ {i = 1} ^ {t} c _ {i} ^ {*}),
+$$
+
+in which $c_i^* < \log((2s - 1)\mu(A))$ .
+
+It can be seen that when we relax the assumption about no "false positive" and further reduce the value of the threshold $b^{(t)}$ , the error bound of LISTA becomes even lower. Obviously, the previous bound of LISTA with gain gates in Theorem 2 is not necessarily lower than the tighter bound of a standard LISTA in Theorem 3, which well explains the contradiction of theoretical and empirical results. Here we re-deduce the error bound of our gated LISTA with the inverse proportional function in the following theorem. Note that we still have $U^{(t)} \in \mathcal{W}(A)$ , $W^{(t)} = I - U^{(t)}A$ and Assumption 1.
+
+Theorem 4. Suppose that $\min_{i\in supp(x_s)}|(x_s)_i|\geq \sigma >0$ , if $b^{(t)} = \omega_{t + 1}(k_{t + 1}|\Theta)\mu (A)\sup_{x_s}\| x^{(t)}\odot g_t(x^{(t)},y|\Lambda_g^{(t)}) - x_s\| _1$ is achieved and $\exists 0 < k_0^{(t)} < s$ such that $\omega_{t}(k_{0}^{(t)}|\Theta) < 1 - 1 / (s - k_{0}^{(t)})$ , then
+
+$$
+\| x ^ {(t)} - x _ {s} \| _ {2} \leq s B \exp (\sum_ {i = 1} ^ {t - 1} c _ {i} ^ {\prime} + c _ {t} ^ {\prime *}),
+$$
+
+in which $c_t^{\prime *} < \log ((2s - 1)\mu (A))$ . $\exists t_0 = \lceil \log (\frac{sB}{\sigma}) / \log (\frac{1}{(2s - 1)\mu(A)}) \rceil$ if the scaling factor $\mu_{i}$ of the gate has $\mu_{i} = 0$ for $i \leq t_0$ , $0 < k_{i} < s$ , then $c_i^\prime = c_i^*$ , and if $1 - \omega_{i}(s|\Theta) < \mu_{i} \leq 1$ for $i > t_0$ , $k_{i} = 0$ , then $c_i^\prime < c_i^*$ .
+
+We can conclude from Theorem 4 that, a) a gain gate expressed by the inverse proportional function should be applied to deeper layers in LISTA, rather than lower layers, b) when using the function, there indeed exists no "false positive" (i.e., $k_{i} = 0$ ) in deeper layer. We follow such guidelines in the implementation of our gated LISTA. In addition, we observe that unlike the inverse proportional function, other considered functions show consistent performance gains on both lower and higher layers, hence we attempt to utilize them on lower layers in alliance with the inverse proportional function powered gain gates on the other layers. In practice, we choose the ReLU-based piece-wise linear function, and it is uniformly applied to the first 10 layers. We will empirically compare different choices between the gain gate functions in Section 4.1.
+
+# 3.2 SPARSE CODING WITH OVERSHOOT GATES
+
+Unlike the gain gates that are incorporated before performing estimation at each step, the overshoot gates act more like adjustments to the outputs, which can be viewed as learnable boosts:
+
+$$
+\begin{array}{l} \tilde {x} ^ {(t + 1)} = s _ {b ^ {(t)}} \left(W ^ {(t)} x ^ {(t)} + U ^ {(t)} y\right), \\ x ^ {(t + 1)} = o _ {t} \left(x ^ {(t)}, y \mid \Lambda_ {o} ^ {(t)}\right) \odot \tilde {x} ^ {(t + 1)} + \left(1 - o _ {t} \left(x ^ {(t)}, y \mid \Lambda_ {o} ^ {(t)}\right)\right) \odot x ^ {(t)}. \tag {17} \\ \end{array}
+$$
+
+The gate function $o_{t}(\cdot, \cdot|\Lambda_{o}^{(t)}) : \{\mathbb{R}^{n},\mathbb{R}^{m}\} \to \mathbb{R}^{n}$ outputs an $n$ -dimensional vector and $\Lambda_{o}^{(t)}$ collects all the trainable parameters in the function, akin to a dedicated update GRU gate (Cho et al., 2014).
+
+Our motivation comes from analyses of ISTA, whose update can be viewed as $x^{(t)} + \eta (x^{(t + 1)} - x^{(t)})$ in which $\eta = 1$ is a constant step size. We argue that $\eta = 1$ may not be the most suitable choice and the following proposition makes this formal. We have it to theoretically analyze the update rule of ISTA and $\eta^* \coloneqq \arg \min_{\eta} f(\eta (x^{(t + 1)} - x^{(t)}) + x^{(t)}, y) + \lambda \| \eta (x^{(t + 1)} - x^{(t)}) + x^{(t)} \|_1$ .
+
+Proposition 2. (Requirement of overshoots) For $\min_x f(x,y) + \lambda \| x\| _1$ , in which $f(x,y)$ is convex with respect to $x$ and $\gamma I - \nabla_{x}^{2}f(x)\succ 0$ holds for all $x$ , if the update rule in Eq. (4) is adopted, then we have $\eta^{*}\geq 1$ . In addition, if $\operatorname {supp}(x^{(t)})\subset \operatorname {supp}(x^{(t + 1)})$ , then we further have $\eta^{*} > 1$ .
+
+See also Figure 2 for an illustration of the issue with $\eta = 1$ as concerned. Since the optimization procedure of ISTA inspires the network architecture in LISTA, the theoretical result in Proposition 2 that requires a boost in $\eta$ for superior performance also inspires us to design specific overshoot gates for LISTA. Having noticed that an essential principle we have obtained is to let $\eta \geq 1$ (or $\eta > 1$ ), we may expect the output of the gate function to be greater than or at least equal to 1. To achieve the goal, we can try different expressions for it, e.g.,
+
+$$
+\begin{array}{l} \text {t h e s i g m o i d - b a s e d f u n c t i o n :} o _ {t} \left(x ^ {(t)}, y \mid \Lambda_ {o} ^ {(t)}\right) = 1 + a _ {o} \sigma \left(W _ {o} x ^ {(t)} + U _ {o} y\right) \left| \sum_ {i} y _ {i} \right|, \\ \text {t h e i n v e r s e - p r o p o r t i o n a l - b a s e d f u n c t i o n :} o _ {t} \left(x ^ {(t)}, y \mid \Lambda_ {o} ^ {(t)}\right) = 1 + \frac {a _ {o}}{\left| \tilde {x} ^ {(t + 1)} - x ^ {(t)} \right| + \epsilon}, \tag {18} \\ \end{array}
+$$
+
+with $\sigma (\cdot)$ being the sigmoid function, $\Lambda_o^{(t)} = \{a_o,W_o,U_o\}$ and $\Lambda_o^{(t)} = \{a_o\}$ for the two types of functions respectively, and $\epsilon$ being a tiny positive constant introduced to avoid zero being divided. The principle of our overshoot gate is similar to that of some momentum-based methods, e.g., FISTA (Beck & Teboulle, 2009) and LFISTA (Moreau & Bruna, 2017). The fundamental difference between these methods and ours is that, (L)FISTA considers that the scaling factor in a momentum term should be independent of the current inputs (including the previous estimation and $y$ ), i.e., being time or at least input invariant, while the output of the overshoot gate is a function of both the previous estimation and $y$ , hence being time-and-input-varying. The design of our overshoot gate may endow the sparse coding network higher capability to learn from its inputs. Experimental comparisons in Section 7 in the Appendix confirm the superiority of our method.
+
+We also note that our convergence analyses in Section 3.1 generalize to $\eta > 1$ cases with a constant $\eta$ , i.e., linear convergence can still be guaranteed, but the asymptotic behavior with learnable and adaptive overshoots should be further explored in future studies.
+
+
+Figure 2: The derivative function (illustrated in blue) of $f(x,y) + \lambda r(x)$ , in which $r(x) = \| x\|_1$ , is monotonic owing to the convexity of $f(x,y)$ and $r(x)$ , and its output should be consistently smaller than the derivative (illustrated in orange) of the upper bound in absolute value. Let $x^*$ be the optimal solution to the problem, then we know from the figure that the estimation with a standard ISTA update (i.e., $\eta = 1$ ) normally "lags behind".
+
+# 4 EXPERIMENTS
+
+In this section, we perform experiments to confirm our theoretical results and evaluate the performance of our gated sparse coding networks. Validations of our theoretical results are performed on synthetic data, and the performance of our method in sparse coding is tested on both synthetic and real data. We set $m = 250$ , $n = 500$ , and sample the elements of the dictionary matrix $A$ randomly from a standard Gaussian distribution in simulations. The position of non-zero elements of the sparse vector $x_{s}$ is determined by a Bernoulli sampling with a probability of 0.1 (which means approximately 90% of the elements are set to be zero). Different noise levels and condition numbers are considered in the sparse coding simulations. We randomly synthesize in-stream $x_{s}$ and $\varepsilon$ to obtain $y$ for training, and we let two extra sets consisting of 1000 samples each as the validation and test sets, just like in prior works1. (Chen et al., 2018; Liu et al., 2019; Borgerding et al., 2017).
+
+For the proposed gated LISTA and other deep learning-based methods, we set $d = 16$ and let $\{b^{(t)}\}$ not be shared between different layers under all circumstances. The weight matrices $\{W^{(t)},U^{(t)}\}$ are not shared either in our method and the coupled constraints $W^{(t)} = I - U^{(t)}A$ , $\forall t$ , are imposed. For all gates, $\nu_{t}$ is initialized as 1.0, and then we let the initial value of $\mu_t$ in the inverse proportional function powered gain gate be 1.0 too, since Eq. (12) and (13) indicate $0\leq \mu_t\leq 2$ . Other learnable parameters in our gates are uniformly initialized as 5.0 according to their suggested range of the gates. The training batch size is 64. We use Adam (Cho et al., 2014) and let $\beta_{1} = 0.9$ and $\beta_{2} = 0.999$ . The hyper-parameters are tuned on the validation set and fixed for all our experiments in the sequel. Our training follows it of Chen et al.'s (2018). That said, the sparse coding network is trained progressively to update more layers, and we cut the learning rate for currently optimized layers when no decrease in the validation loss can be observed for 4000 iterations, with a base learning rate of 0.0005. Training on current layers stops when the validation loss does not decrease any more with the learning rate being cut to 0.00001. More details are explained in Section 8 in the appendix.
+
+Our training objective for a network with $d$ intermediate update steps is
+
+$$
+\min _ {\Theta} \mathbb {E} \| x ^ {(d)} - x _ {s} \| _ {2} ^ {2}, \tag {19}
+$$
+
+
+(a) FPR vs index of layers
+
+
+(b) Ratio of lower components
+
+
+(c) NMSE vs # of layers
+
+
+Figure 3: Average results confirming our Proposition 1 and Theorem 2, in which intermediate outputs of a single network over five runs are reported in (a) and (b) while networks with varying depth are evaluated in (c), over five runs as well. It is plotted from layer indices of 1 in (a) and (b), since the two metrics (i.e., false positive rate and ratio of generated non-zero code components that require gains) do not make much sense with an initial code estimation (i.e., 0).
+(a)
+
+
+(b)
+Figure 4: Average results over the whole test set confirm our Theorem 1, in which intermediate outputs of a single network is reported. It can be seen that: (a) the gate output converges to 1, and (b) LISTA with our gain gates converges as expected. It is plotted from layer index 1 in (a) since no gain is imposed on the initial code estimation (i.e., $\mathbf{0}$ .
+
+in which $\Theta = \{W^{(t)}, U^{(t)}, b^{(t)}\}_{t=0,\dots,d-1} \cup \Lambda^{(0)} \cup \dots \Lambda^{(d-1)}$ is the set of all learnable parameters in the sparse coding network that generates $x^{(d)}$ given $y$ . Note that in comparison with the parameter set in a standard LISTA, it also contains the parameters in gate functions. In practice, we are given a set of training samples and opt to minimize an empirical loss instead of the one in Eq. (19).
+
+Our evaluation metric for sparse coding is the normalized MSE (NMSE) (Chen et al., 2018):
+
+$$
+\operatorname {N M S E} \left(x, x _ {s}\right) = 1 0 \log_ {1 0} \left(\left\| x - x _ {s} \right\| _ {2} ^ {2} / \left\| x _ {s} \right\| _ {2} ^ {2}\right). \tag {20}
+$$
+
+# 4.1 SIMULATION EXPERIMENTS
+
+# 4.1.1 VALIDATION OF THEORETICAL RESULTS
+
+Validation of Proposition 1: We first confirm Proposition 1. In order to ensure that LISTA fulfills the assumption about no "false positive", we introduce an auxiliary loss into the learning object as:
+
+$$
+\lambda \sum_ {t} \sum_ {j \notin \operatorname {s u p p} \left(x _ {s}\right)} | x _ {j} ^ {(t)} |. \tag {21}
+$$
+
+We formally introduce the false positive rate (FPR) as $\mathrm{FPR} = \frac{|\operatorname{supp}(x^{(t)})\cup\operatorname{supp}(x_s)| - |\operatorname{supp}(x_s)|}{|\operatorname{supp}(x^{(t)})|}$ and try to approach no "false positive" (i.e., LISTA-nfp) by setting $\lambda = 5.0$ in the experiment. Check Figure 3 for an illustrative comparison between different models, we see LISTA-nfp achieves almost no "false positive" in practice in Figure 3(a), but its convergence is slower as demonstrated in Figure 3(c), which is consistent with our result in Theorem 3. In addition, we also see in Figure 3(b) that without "false positive", the code components in LISTA estimations are almost always less than those of the ground-truth, which confirms our Proposition 1.
+
+Validation of Theorem 1: We aim to calculate $\| W^{(t)}D - (I - U^{(t)}A)\| _2$ using a gated LISTA with the introduced ReLU-based piece-wise linear gain gate function. To accomplish this task, we need to first evaluate the output of our gate function, which is expected to converge to 1 as shown in the theorem. We show such a trend indeed exists in Figure 4(a). Consequently, the matrix $D$ is supposed
+
+
+(a)
+
+
+(b)
+Figure 5: Comparison of different (a) overshoot gate functions, (b) gain gate functions, and (c) their combination over five runs. The experiment is performed with $\mathrm{SNR} = 40\mathrm{dB}$ .
+
+
+(c)
+
+to be an identity matrix in the end and we can calculate $\| W^{(t)} - (I - U^{(t)}A)\| _2$ as a surrogate. In Figure 4(b), it converges to zero in the end and the results confirm the theorem.
+
+Validation of Theorem 2: We apply three kinds of gated LISTA with an alliance of gain gate functions (i.e., what has been introduced in Section 3.1.1), the exponential function, and the inverse proportional function respectively to verify our theoretical results. They were named as GLISTA (which is the abbreviation of gated LISTA), GLISTA-exp, GLISTA-inv, respectively. From Figure 3(c), we see that when the models with such gain gates has no "false positive", all of them are superior to the standard LISTA without "false positive" as well, which is consistent with the conclusion of Theorem 2. In addition, from Figure 3(a), we can also see that there actually exist "false positives" in lower layers of GLISTA, but even without the auxiliary loss term, the evaluated FPR of our GLISTA and it variants approach zero in higher layers, which is in good agreement with Theorem 4.
+
+# 4.1.2 COMPARISON WITH COMPETITORS
+
+Empirical analyses for the gate functions: It should be interesting to compare the performance of our gates with different expressions. We test LISTA with different overshoot gate functions introduced in Section 3.2 in Figure 5(a). Both of them are incorporated with their learnable parameters being shared among layers. It can be seen from Figure 5(a) that the accelerations in convergence and gain in final performance are obvious, just as expected. For LISTA with gain gates, one can check Figure 5(b). It can be seen that the performance degrades a lot if either the bias term or the $\mu_t$ term is removed. We also try different $f_t(\cdot)$ functions, including the ReLU-based piece-wise linear one and some possibly more nonlinear ones as mentioned in Section 3.1. We confirm that gate functions whose outputs are relatively closer to the boundary condition may perform better. Yet, it is worth noting that when the outputs of inverse proportional function reach that boundary condition and being applied uniformly to all layers, the performance degrades (see LISTA-inv- $\epsilon$ in Figure 5(b)). These results suggest an alliance of gain gate functions in practice. We further test a combination of gain gates and overshoot gates, despite the mechanism with solely gain gates is already good enough. See Figure 5(c), when overshoots are further incorporated, the convergence on lower layers becomes faster while the overall convergence is not affected much, leading to similar final performance when the model is very deep and superior performance when the model is relatively shallow.
+
+Compared with other state-of-the-art methods: We consider four state-of-the-arts: LISTA with support selections (namely LISTA-C-S and LISTA-S, with and without the coupled constraint) (Chen et al., 2018), analytic LISTA with support selections (ALISTA-S) (Liu et al., 2019), and learned AMP (LAMP) (Borgerding et al., 2017) for comparison, and their official implementations are directly used. The hyper-parameters are set following the papers (Borgerding et al., 2017; Chen et al., 2018). We compare our GLISTA with these competitive methods under different levels of noises (including the signal-to-noise ratios (SNRs) being equal to 40dB, 20dB, and 10dB) and different condition numbers (including 3, 30, and 100, with $\mathrm{SNR} = 40\mathrm{dB}$ ). See Figure 6 for comparisons between LISTA, LAMP, LISTA-S, LISTA-C-S, ALISTA-S, and our GLISTA in some of the settings. Obviously, the introduced gates facilitate LISTA significantly, and the concerned NMSE diminishes the fastest using GLISTA. See our Appendix for comparisons of final performance after multiple runs and the results in other settings (i.e., SNR: 20dB, 40dB, and condition number: 3). We know from these results that using the gain gates solely can already outperforms existing state-of-the-arts, while incorporating the overshoot gates additionally may further boost the performance, as testified.
+
+Applying our method to variants of LISTA: We also try adopting the introduced gates into some variants of LISTA to verify their "generalization ability". Specifically, we incorporate the gain gates to LFISTA (Moreau & Bruna, 2017) and ALISTA (Liu et al., 2019) to obtain GFLISTA and AGLISTA, respectively. Since ALISTA is suggested to be implemented with support set selection in the original
+
+
+(a) $\mathrm{SNR} = 10\mathrm{dB}$
+
+
+(b) condition number $= 30$
+Figure 6: Comparison of sparse coding methods in different settings over five runs. Our GLISTA consistently outperforms the competitors in almost all test cases with different numbers of layers.
+
+
+(c) condition number $= 100$
+
+paper, i.e. ALISTA-S, we also compare with it. The experiment is performed under different levels of noises (40dB, 20dB, and 10dB). As can be seen in Table 1 in which average results along with their standard deviations calculated over five runs are reported, models with our gain gates perform significantly better, which verifies that our method generalizes well.
+
+Table 1: Comparison of LISTA and its variants (with and without gates) under different noise levels.
+
+| SNR | LISTA | GLISTA | LFISTA | GLFISTA | ALISTA | AGLISTA | ALISTA-S |
| 40 | -38.72±0.09 | -45.22±0.02 | -37.84±0.32 | -38.30±0.10 | -37.86±0.35 | -42.30±0.13 | -41.86±0.04 |
| 20 | -18.65±0.09 | -23.08±0.03 | -20.90±0.02 | -22.00±0.07 | -17.38±0.05 | -20.13±0.03 | -20.00±0.05 |
| 10 | -9.42±0.08 | -11.41±0.02 | -10.67±0.04 | -11.20±0.01 | -8.39±0.04 | -9.13±0.02 | -9.04±0.02 |
+
+# 4.2 PHOTOMETRIC STEREO ANALYSIS
+
+We now test on a more practical task, i.e., photometric stereo analysis, using sparse coding. For a 3D object with Lambertian surface, if there are $q$ different light conditions, a camera or some other kinds of sensors can obtain $q$ different observations, all with noises caused by shadows and specularities. The observations can be represented as a vector $o \in \mathbb{R}^q$ for estimating the norm vector $v \in \mathbb{R}^3$ at any position on the surface. It is generally formulated as $o = \rho Lv + e$ , in which $L \in \mathbb{R}^{q \times 3}$ represents the normalized light directions ( $q$ directions), $e \in \mathbb{R}^q$ is a noise which is often sparse, $\rho \in \mathbb{R}$ represents the albedo reflectivity. Our task is to obtain $v$ from $o$ and $L$ which is also known. The estimation of $e$ can be considered as a sparse coding problem, and one can use $L^\dagger (o - e)$ to recover $v$ given the estimation. More detailed descriptions of the task can be found in Xin et al.'s paper (2016).
+
+In the sparse coding problem, we have $Q \in \mathbb{R}^{(q - 3) \times q}$ (the orthogonal complement of $L$ ) as the dictionary matrix (i.e., $A$ in Eq. (1)), $e$ as the sparse code to be estimated, and $Qo$ as the observation (i.e., $y$ in Eq. (1)). We mainly follow settings in Xin et al.'s work, e.g. the vectors of $L$ are randomly selected from the hemispherical surface, except that we test with $q = 15, 25, 35$ , and let $40\%$ of the elements of $e$ be non-zero. We use GLISTA here to estimate $e$ and the final result for $v$ is calculated as $L^{\dagger}(o - e^{*})$ , where $L^{\dagger} \in \mathbb{R}^{3 \times q}$ is the pseudo-inverse of $L$ and $e^{*}$ is the estimation. Our method is compared with LISTA and two traditional methods where no explicit training is introduced, i.e. the original least square (LS) and least L1, in Table 2. Our evaluation metric is the mean (± standard deviation) error in degree and it is calculated using the bunny picture (Xin et al., 2016).
+
+Table 2: Mean (± standard derivation) error in degree with different number of observations over five runs.
+
+| q | LS | L1 | LISTA | GLISTA |
| 35 | 5.37 | 1.39 | 0.0237±0.0026 | 0.00210±0.00044 |
| 25 | 5.60 | 2.03 | 0.0429±0.0068 | 0.00524±0.00024 |
| 15 | 6.09 | 4.25 | 0.371±0.046 | 0.0255±0.0054 |
+
+# 5 CONCLUSION
+
+In this paper, we study LISTA for solving sparse coding problems. We discover its potential weaknesses and introduce gated mechanisms to address them accordingly. In particular, we theoretically prove that LISTA with gain gates can achieve faster convergence than the standard LISTA. We also discover that LISTA (with or without gates) can obtain lower reconstruction errors under a weaker assumption of "false positive" in its code estimations. It helps us improve the convergence analyses to achieve more solid theoretical results, which have been perfectly confirmed in simulation experiments. The effectiveness of our introduced gates is verified in a variety of sparse coding experiments and the state-of-the-art performance is achieved. In the future, we aim to extend the method to convolutional neural networks to deal with more complex tasks.
+
+# REFERENCES
+
+Amir Beck and Marc Teboulle. A fast iterative shrinkage-thresholding algorithm for linear inverse problems. SIAM journal on imaging sciences, 2(1):183-202, 2009.
+Mark Borgerding, Philip Schniter, and Sundeep Rangan. Amp-inspired deep networks for sparse linear inverse problems. IEEE Transactions on Signal Processing, 65(16):4293-4308, 2017.
+Xiaohan Chen, Jialin Liu, Zhangyang Wang, and Wotao Yin. Theoretical linear convergence of unfolded ista and its practical weights and thresholds. In Advances in Neural Information Processing Systems, pp. 9061-9071, 2018.
+Kyunghyun Cho, Bart Van Merrienboer, Caglar Gulcehre, Dzmitry Bahdanau, Fethi Bougares, Holger Schwenk, and Yoshua Bengio. Learning phrase representations using rn encoder-decoder for statistical machine translation. In EMNLP, 2014.
+Ingrid Daubechies, Michel Defrise, and Christine De Mol. An iterative thresholding algorithm for linear inverse problems with a sparsity constraint. Communications on Pure and Applied Mathematics: A Journal Issued by the Courant Institute of Mathematical Sciences, 57(11):1413-1457, 2004.
+Bradley Efron, Trevor Hastie, Iain Johnstone, Robert Tibshirani, et al. Least angle regression. The Annals of statistics, 32(2):407-499, 2004.
+Michael Elad and Michal Aharon. Image denoising via sparse and redundant representations over learned dictionaries. IEEE Transactions on Image processing, 15(12):3736-3745, 2006.
+Ross Girshick. Fast r-cnn. In Proceedings of the IEEE international conference on computer vision, pp. 1440-1448, 2015.
+Raja Giryes, Yonina C Eldar, Alex M Bronstein, and Guillermo Sapiro. Tradeoffs between convergence speed and reconstruction accuracy in inverse problems. IEEE Transactions on Signal Processing, 66(7):1676-1690, 2018.
+Karol Gregor and Yann LeCun. Learning fast approximations of sparse coding. In Proceedings of the 27th International Conference on International Conference on Machine Learning, pp. 399-406. Omnipress, 2010.
+Hao He, Bo Xin, Satoshi Ikehata, and David Wipf. From bayesian sparsity to gated recurrent nets. In Advances in Neural Information Processing Systems, pp. 5554-5564, 2017.
+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.
+John R Hershey, Jonathan Le Roux, and Felix Weninger. Deep unfolding: Model-based inspiration of novel deep architectures. arXiv preprint arXiv:1409.2574, 2014.
+Geoffrey Hinton, Li Deng, Dong Yu, George Dahl, Abdel-rahman Mohamed, Navdeep Jaitly, Andrew Senior, Vincent Vanhoucke, Patrick Nguyen, Brian Kingsbury, et al. Deep neural networks for acoustic modeling in speech recognition. IEEE Signal processing magazine, 29, 2012.
+Yann LeCun, Yoshua Bengio, and Geoffrey Hinton. Deep learning. nature, 521(7553):436, 2015.
+Jialin Liu, Xiaohan Chen, Zhangyang Wang, and Wotao Yin. Alist: Analytic weights are as good as learned weights in listia. In Proceedings of the International Conference on Learning Representations, 2019.
+Thomas Moreau and Joan Bruna. Understanding trainable sparse coding via factorization. In Proceedings of the International Conference on Learning Representations, 2017.
+Jeremias Sulam, Aviad Aberdam, Amir Beck, and Michael Elad. On multi-layer basis pursuit, efficient algorithms and convolutional neural networks. IEEE transactions on pattern analysis and machine intelligence, 2019.
+Robert Tibshirani. Regression shrinkage and selection via the lasso. Journal of the Royal Statistical Society: Series B (Methodological), 58(1):267-288, 1996.
+Zhangyang Wang, Qing Ling, and Thomas S Huang. Learning deep 10 encoders. In Thirtieth AAAI Conference on Artificial Intelligence, 2016.
+Bo Xin, Yizhou Wang, Wen Gao, David Wipf, and Baoyuan Wang. Maximal sparsity with deep networks? In Advances in Neural Information Processing Systems, pp. 4340-4348, 2016.
+
+Xu Xu, Xiaohan Wei, and Zhongfu Ye. Doa estimation based on sparse signal recovery utilizing weighted 11-norm penalty. IEEE signal processing letters, 19(3):155-158, 2012.
+
+Jianchao Yang, John Wright, Thomas S Huang, and Yi Ma. Image super-resolution via sparse representation. IEEE transactions on image processing, 19(11):2861-2873, 2010.
+
+Jian Zhang and Bernard Ghanem. Ista-net: Interpretable optimization-inspired deep network for image compressive sensing. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 1828-1837, 2018.
+
+# APPENDIX
+
+# 6 PROOF OF THEOREMS AND PROPOSITIONS
+
+Before we delve deeply into the proof, we first give some importance notations. We define $S$ as the support of the vector $x_{s}$ , i.e. $S = \mathrm{supp}(x_s)$ , and let $|S|$ denote the number of elements in the set $S$ . For a vector that shares the same size with $x_{s}$ , say $z$ , we denote by $z_{S} \in \mathbb{R}^{|S|}$ a vector that keeps the elements with indices of $z$ in $S$ and removes the others. If the vectors have been introduced with subscripts already, e.g. $x_{s}$ , we use $(x_{s})_{S}$ to denote vectors obtained in such a manner. For a square matrix with the same number of row and column as the size of $x_{s}$ , say $M$ , $M(S,S)$ is its principal minor with the index set formed by removing rows and columns whose indices are not in $S$ . Assume a vector $x$ with no zero elements, $\mathrm{sign}(\cdot)$ is defined as $(\mathrm{sign}(x))_i = x_i / |x_i|$ , i.e. $(\mathrm{sign}(x))_i = 1$ when $x_{i} > 0$ , and $(\mathrm{sign}(x))_i = -1$ when $x_{i} < 0$ .
+
+# 6.1 PROOF OF PROPOSITION 1
+
+Recall that the update rule of LISTA is $x^{(0)} = 0$ and
+
+$$
+x ^ {(t + 1)} = s _ {b ^ {(t)}} \left(W ^ {(t)} x ^ {(t)} + U ^ {(t)} y\right), \quad t = 0, \dots , d - 1. \tag {22}
+$$
+
+Proof. Recall the definition of $S$ is $S = \operatorname{supp}(x_s)$ . For the shrinking function $z = s_{b^{(t)}}(x) = \operatorname{sign}(x)(|x| - b^{(t)})_+ = x - b^{(t)}h(z)$ , where $h(z) = 1$ if $z > 0$ , $h(z) = -1$ if $z < 0$ , and $h(z) \in [-1,1]$ if $z = 0$ .
+
+We use Mathematical Induction to prove $\operatorname{supp}(x^{(t)}) \subset S, \forall t = 0,1,\ldots,d-1$ . We assume $\operatorname{supp}(x^{(t)}) \subset S$ . From the calculation of $x_{i}^{(t+1)}$ , as $W^{(t)} = I - U^{(t)}A$ there is
+
+$$
+\begin{array}{l} x _ {i} ^ {(t + 1)} = s _ {b (t)} ((W ^ {(t)} x ^ {(t)} + U ^ {(t)} y) _ {i}) \\ = s _ {b ^ {(t)}} \left(\left(W ^ {(t)} x ^ {(t)} + U ^ {(t)} A x _ {s}\right) _ {i}\right) \\ = s _ {b ^ {(t)}} \left(\left(\left(I - U ^ {(t)} A\right) \left(x ^ {(t)} - x _ {s}\right)\right) _ {i} + \left(x _ {s}\right) _ {i}\right) \tag {23} \\ = \left(\left(I - U ^ {(t)} A\right) \left(x ^ {(t)} - x _ {s}\right)\right) _ {i} + \left(x _ {s}\right) _ {i} - b ^ {(t)} h \left(x _ {i} ^ {(t + 1)}\right). \\ \end{array}
+$$
+
+For $\forall i \notin S$ , $(x_{s})_{i} = 0$ . Let's assume $x_{i}^{(t + 1)} \neq 0$ , then $h(x_{i}^{(t + 1)}) = \mathrm{sign}(x_{i}^{(t + 1)})$ . Multiply the two sides of the Eq. (23) by $\mathrm{sign}(x_{i}^{(t + 1)})$ , as the $b^{(t)} = \mu(A)\sup_{x_{s}} \| x^{(t)} - x_{s}\|_{1}$ , there will be
+
+$$
+\begin{array}{l} \left| x _ {i} ^ {(t + 1)} \right| = \left(\left(I - U ^ {(t)} A\right) \left(x ^ {(t)} - x _ {s}\right)\right) _ {i} \operatorname {s i g n} \left(x _ {i} ^ {(t + 1)}\right) - b ^ {(t)} \\ = \left(\left(I - U ^ {(t)} A\right) \left(x ^ {(t)} - x _ {s}\right)\right) _ {i} \operatorname {s i g n} \left(x _ {i} ^ {(t + 1)}\right) - \mu (A) \sup _ {x _ {s}} \| x ^ {(t)} - x _ {s} \| _ {1} \tag {24} \\ \leq \mu (A) \| x ^ {(t)} - x _ {s} \| _ {1} - \mu (A) \sup _ {x _ {s}} \| x ^ {(t)} - x _ {s} \| _ {1} \leq 0, \\ \end{array}
+$$
+
+the inequality holds for $\vec{a} \cdot \vec{b} \leq \| \vec{a} \|_{\infty} \| \vec{b} \|_1$ and $\| I - U^{(t)}A \|_{\infty} \leq \mu(A)$ (because of $U^{(t)} \in \mathcal{W}(A)$ ). From Eq. (24), we know $|x_i^{(t + 1)}| \leq 0$ actually is $|x_i^{(t + 1)}| = 0$ which is in conflict with $x_i^{(t + 1)} \neq 0$ . Therefore, the $x_i^{(t + 1)} = 0$ , when $i \notin S$ , i.e., $\operatorname{supp}(x^{(t + 1)}) \subset S$ . As $x^{(0)} = 0 \subset S$ , the $\operatorname{supp}(x^{(t)}) \subset S, \forall t$ . The no "false positive" property has been proved.
+
+According to Eq. (23), as support set of $x_{s}$ and $x^{(t)}$ are the subsets of $S$ , there is
+
+$$
+\begin{array}{l} x _ {i} ^ {(t + 1)} - \left(x _ {s}\right) _ {i} = \left(\left(I - U ^ {(t)} A\right) \left(x ^ {(t)} - x _ {s}\right)\right) _ {i} - b ^ {(t)} h \left(x _ {i} ^ {(t + 1)}\right) \\ = \sum_ {j \in \mathcal {S}} (I - U ^ {(t)} A) _ {i j} \left(x _ {j} ^ {(t)} - \left(x _ {s}\right) _ {j}\right) - b ^ {(t)} h \left(x _ {i} ^ {(t + 1)}\right) \tag {25} \\ \end{array}
+$$
+
+$$
+| x _ {i} ^ {(t + 1)} - (x _ {s}) _ {i} | \leq | \sum_ {j \in \mathcal {S}} (I - U ^ {(t)} A) _ {i j} (x _ {j} ^ {(t)} - (x _ {s}) _ {j}) | + b ^ {(t)}.
+$$
+
+As $\operatorname{supp}(x^{(t + 1)})\subset S$ , accumulate all $|x_i^{(t + 1)} - (x_s)_i|$ in Eq. (25) with $i\in S$ , there is
+
+$$
+\begin{array}{l} \left\| x ^ {(t + 1)} - x _ {s} \right\| _ {1} \leq \sum_ {i \in \mathcal {S}} \sum_ {j \in \mathcal {S}} (I - U ^ {(t)} A) _ {i j} \left(x _ {j} ^ {(t)} - \left(x _ {s}\right) _ {j}\right) + | \mathcal {S} | b ^ {(t)} \\ \leq \sum_ {i \in \mathcal {S}} \sum_ {j \in \mathcal {S}, i \neq j} | (I - U ^ {(t)} A) _ {i j} | | x _ {j} ^ {(t)} - \left(x _ {s}\right) _ {j} | + | \mathcal {S} | b ^ {(t)} \tag {26} \\ \leq \left(| \mathcal {S} | - 1\right) \mu (A) \| x ^ {(t)} - x _ {s} \| _ {1} + | \mathcal {S} | b ^ {(t)}. \\ \end{array}
+$$
+
+The second equation is because of $U^{(t)} \in \mathcal{W}(A)$ , so that $|W_{i,:}A_{:,j}| \leq \mu(A)$ when $i \neq j$ and $|W_{i,:}A_{:,j}| = 1$ when $i = j$ . Substitute $b^{(t)} = \mu(A)\sup_{x_s}\| x^{(t)} - x_s\|_1$ into Eq. (26), and take the supremum of Eq. (26). As $|S| \leq s$ there is
+
+$$
+\begin{array}{l} \sup _ {x _ {s}} \| x ^ {(t + 1)} - x _ {s} \| _ {1} \leq (s - 1) \mu (A) \sup _ {x _ {s}} \| x ^ {(t)} - x _ {s} \| _ {1} + s \mu (A) \sup _ {x _ {s}} \| x ^ {(t)} - x _ {s} \| _ {1} \\ \leq (2 s - 1) \mu (A) \sup _ {x _ {s}} \| x ^ {(t)} - x _ {s} \| _ {1} \tag {27} \\ \leq ((2 s - 1) \mu (A)) ^ {t + 1} \sup _ {x _ {s}} \| x ^ {(0)} - x _ {s} \| _ {1}. \\ \end{array}
+$$
+
+Let $c = \log ((2s - 1)\mu (A))$ , the $l_{2}$ error bound of $t$ -th layer in LISTA should be calculated as
+
+$$
+\begin{array}{l} \left\| x ^ {(t)} - x _ {s} \right\| _ {2} \leq \left\| x ^ {(t)} - x _ {s} \right\| _ {1} \leq \sup _ {x _ {s}} \left\| x ^ {(t)} - x _ {s} \right\| _ {1} \\ \leq \left((2 s - 1) \mu (A)\right) ^ {t} \sup _ {x _ {s}} \| x ^ {(0)} - x _ {s} \| _ {1} \tag {28} \\ = \exp (c t) \sup _ {x _ {s}} \| x ^ {(0)} - x _ {s} \| _ {1} \\ \leq s B \exp (c t), \\ \end{array}
+$$
+
+where the last inequality is deduced since $(x_{s})_{i}\leq B$ , and $\| x_{s}\|_{0}\leq s$ . The linear convergence has been proved.
+
+Refer to the Eq. (25), as $x_{i}^{(t + 1)} = 0$ when $i \notin S$ , $|x_{i}^{(t + 1)}| \leq |(x_{s})_{i}|$ and $x^{(t + 1)}(x_s)_i \geq 0$ hold certainly. We only concentrate on $i \in S$
+
+$$
+x _ {i} ^ {(t + 1)} - \left(x _ {s}\right) _ {i} = \left(\left(I - U ^ {(t)} A\right) \left(x ^ {(t)} - x _ {s}\right)\right) _ {i} - b ^ {(t)} h \left(x _ {i} ^ {(t + 1)}\right). \tag {29}
+$$
+
+If $x_{i}^{(t + 1)} = 0$ , there must be $|x_{i}^{(t + 1)}| = 0 \leq (x_{s})_{i}$ , and $x_{i}^{(t + 1)}(x_{s})_{i} = 0$ .
+
+If $x_{i}^{(t + 1)} > 0$ , the according to Eq. (29), $x_{i}^{(t + 1)} - (x_{s})_{i} = ((I - U^{(t)}A)(x^{(t)} - x_{s}))_{i} - b^{(t)} = ((I - U^{(t)}A)(x^{(t)} - x_{s}))_{i} - \mu (A)\sup_{x_{s}}\| x^{(t)} - x_{s}\|_{1}\leq 0$ , i.e., $0 < x_{i}^{(t + 1)}\leq (x_{s})_{i}, |x_{i}^{(t + 1)}|\leq |(x_{s})_{i}|$ and $x_{i}^{(t + 1)}(x_{s})_{i} > 0$ .
+
+If $x_{i}^{(t + 1)} < 0$ , the according to Eq. (29), $x_{i}^{(t + 1)} - (x_{s})_{i} = ((I - U^{(t)}A)(x^{(t)} - x_{s}))_{i} + b^{(t)} = ((I - U^{(t)}A)(x^{(t)} - x_{s}))_{i} + \mu (A)\sup_{x_{s}}\| x^{(t)} - x_{s}\|_{1}\geq 0$ , i.e., $0 > x_{i}^{(t + 1)}\geq (x_{s})_{i}, |x_{i}^{(t + 1)}|\leq |(x_{s})_{i}|$ and $x_{i}^{(t + 1)}(x_{s})_{i} > 0$ .
+
+In conclusion, we can obtain $|x_i^{(t + 1)}| \leq |(x_s)_i|$ and $x^{(t + 1)}(x_s)_i \geq 0$ for all the situations.
+
+# 6.2 PROOF OF THEOREM 1
+
+Recall that the update rule of LISTA with gain gates is $x^{(0)} = 0$ and
+
+$$
+x ^ {(t + 1)} = s _ {b ^ {(t)}} \left(W ^ {(t)} \left(g _ {t} \left(x ^ {(t)}, y \mid \Lambda_ {g} ^ {(t)}\right) \odot x ^ {(t)}\right) + U ^ {(t)} y\right). \tag {30}
+$$
+
+Proof. We assume that $b^{(t)}$ is a vector, i.e., $b^{(t)} \in \mathbb{R}^n$ , in our proof to make it more general.
+
+According to definition of the shrinking function $s_{b(t)}(\cdot)$ and $y = Ax_s$ , Eq. (10) is
+
+$$
+\begin{array}{l} x ^ {(t + 1)} = s _ {b ^ {(t)}} \left(W ^ {(t)} \left(g _ {t} \left(x ^ {(t)}, y \mid \Lambda_ {g} ^ {(t)}\right) \odot x ^ {(t)}\right) + U ^ {(t)} y\right) \\ = W ^ {(t)} g _ {t} \left(x ^ {(t)}, y \mid \Lambda_ {g} ^ {(t)}\right) \odot x ^ {(t)} + U ^ {(t)} y - b ^ {(t)} \odot h \left(x ^ {(t + 1)}\right) \\ = W ^ {(t)} \operatorname {d i a g} \left(g _ {t} \left(x ^ {(t)}, y \mid \Lambda_ {g} ^ {(t)}\right)\right) x ^ {(t)} + U ^ {(t)} A x _ {s} - b ^ {(t)} \odot h \left(x ^ {(t + 1)}\right) \tag {31} \\ = W ^ {(t)} \operatorname {d i a g} \left(g _ {t} \left(x ^ {(t)}, y \mid \Lambda_ {g} ^ {(t)}\right)\right) x ^ {(t)} + U ^ {(t)} A x _ {s} - b ^ {(t)} \odot h \left(x ^ {(t + 1)}\right). \\ \end{array}
+$$
+
+Concentrate on the situation of $t \to \infty$ . Define $g_{\kappa}(x_s) = g_t(x_s, y|\Lambda_g^{(t)})$ when $t \to \infty$ . In the main body of Theorem 1, $\forall x_s$ satisfying $\| x_s \|_0 \leq s$ is the fixed point of Eq. (10) when $t \to \infty$ . Eq. (31) is
+
+$$
+x _ {s} = W ^ {(t)} \operatorname {d i a g} \left(g _ {\kappa} \left(x _ {s}\right)\right) x _ {s} + U ^ {(t)} A x _ {s} - b ^ {(t)} \odot h \left(x _ {s}\right). \tag {32}
+$$
+
+The equation group of the indices in $S$ in Eq. (32) is
+
+$$
+\begin{array}{l} \left(x _ {s}\right) _ {\mathcal {S}} = \left(\left(\left(W ^ {(t)} \operatorname {d i a g} \left(g _ {\kappa} \left(x _ {s}\right)\right) + U ^ {(t)} A\right) x _ {s}\right) _ {\mathcal {S}} - b _ {\mathcal {S}} ^ {(t)} \odot h \left(\left(x _ {s}\right) _ {\mathcal {S}}\right) \right. \\ \begin{array}{l}= \left( \right.\left(W ^ {(t)} (\mathcal {S}, \mathcal {S}) \operatorname {d i a g} \left(g _ {\kappa} \left(\left(x _ {s}\right) _ {\mathcal {S}}\right)\right) + \left(U ^ {(t)} A\right) (\mathcal {S}, \mathcal {S})\right)\left(x _ {s}\right) _ {\mathcal {S}} - b _ {\mathcal {S}} ^ {(t)} \odot h \left(\left(x _ {s}\right) _ {\mathcal {S}}\right).\end{array}\tag {33} \\ \end{array}
+$$
+
+Let $(x_{s})_{\mathcal{S}}\to 0$ but $(x_{s})_{\mathcal{S}}\neq 0$ so that $h((x_s)_S) = \mathrm{sign}((x_s)_S)$ . As $W^{(t)}$ , $U^{(t)}$ , $A$ and $g_{\kappa}(x_s) = g_t(x_s,y|\Lambda_g^{(t)})$ are bounded, the right hand side of Eq. (33) is also tend to 0, which is
+
+$$
+b _ {S} ^ {(t)} \rightarrow 0, \quad \text {a s} \quad t \rightarrow \infty . \tag {34}
+$$
+
+As the $S$ can be selected arbitrarily as long as $|\mathcal{S}|\leq s$ , $b^{(t)}$ also satisfies
+
+$$
+b ^ {(t)} \rightarrow 0, \quad \text {a s} \quad t \rightarrow \infty . \tag {35}
+$$
+
+Substitute the $b_{S}^{(t)}$ of Eq. (34) into Eq. (33), $(x_{s})_{S}$ is
+
+$$
+\left(x _ {s}\right) _ {\mathcal {S}} = \left(W ^ {(t)} (\mathcal {S}, \mathcal {S}) \operatorname {d i a g} \left(g _ {\kappa} \left(\left(x _ {s}\right) _ {\mathcal {S}}\right)\right) _ {\mathcal {S}} + \left(U ^ {(t)} A\right) (\mathcal {S}, \mathcal {S})\right) \left(x _ {s}\right) _ {\mathcal {S}}, \tag {36}
+$$
+
+where the $W^{(t)}(\mathcal{S},\mathcal{S})$ is defined at start of this section. Eq. (36) is
+
+$$
+\begin{array}{l} (I - U ^ {(t)} A) (\mathcal {S}, \mathcal {S}) (x _ {s}) _ {\mathcal {S}} = W ^ {(t)} (\mathcal {S}, \mathcal {S}) \mathrm {d i a g} \left(g _ {\kappa} \left(\left(x _ {s}\right) _ {\mathcal {S}}\right)\right) \left(x _ {s}\right) _ {\mathcal {S}}, \\ (I - U ^ {(t)} A) (\mathcal {S}, \mathcal {S}) (x _ {s}) _ {\mathcal {S}} = W ^ {(t)} (\mathcal {S}, \mathcal {S}) \mathrm {d i a g} ((x _ {s}) _ {\mathcal {S}}) g _ {\kappa} ((x _ {s}) _ {\mathcal {S}}), \\ g _ {\kappa} \left(\left(x _ {s}\right) _ {\mathcal {S}}\right) = \operatorname {d i a g} \left(\left(\left(x _ {s}\right) _ {\mathcal {S}}\right) ^ {- 1}\right) \left(W ^ {(t)} (\mathcal {S}, \mathcal {S})\right) ^ {- 1} \left(I - U ^ {(t)} A\right) \left(\mathcal {S}, \mathcal {S}\right) \left(x _ {s}\right) _ {\mathcal {S}}, \tag {37} \\ \end{array}
+$$
+
+$$
+\operatorname {d i a g} \left(\left(\left(x _ {s}\right) _ {\mathcal {S}}\right) ^ {- 1}\right) M \left(x _ {s}\right) _ {\mathcal {S}} = g _ {\kappa} \left(\left(x _ {s}\right) _ {\mathcal {S}}\right),
+$$
+
+where $M = (W^{(t)}(\mathcal{S},\mathcal{S}))^{-1}(I - U^{(t)}A)(\mathcal{S},\mathcal{S})$ . The $i$ -th row and $j$ -th column element in $M$ is denoted as $m_{ij}$ . From Eq. (37), $(g_{\kappa}(x_s))_{\mathcal{S}}$ is
+
+$$
+\begin{array}{l} (g _ {\kappa} (x _ {s})) _ {\mathcal {S}} = \left[ \begin{array}{c c c c} ((x _ {s}) _ {\mathcal {S}}) _ {1} ^ {- 1} & & & \\ & ((x _ {s}) _ {\mathcal {S}}) _ {2} ^ {- 1} & & \\ & & \dots & \\ & & & ((x _ {s}) _ {\mathcal {S}}) _ {| \mathcal {S} |} ^ {- 1} \end{array} \right] \left[ \begin{array}{c c c c} m _ {1 1} & m _ {1 2} & \ldots & m _ {1 | \mathcal {S} |} \\ m _ {2 1} & m _ {2 2} & \ldots & m _ {2 | \mathcal {S} |} \\ \ldots & \ldots & \ldots & \ldots \\ m _ {| \mathcal {S} | 1} & m _ {| \mathcal {S} | 2} & \ldots & m _ {| \mathcal {S} | | \mathcal {S} |} \end{array} \right] \\ \left[ \begin{array}{c} \left((x _ {s}) _ {\mathcal {S}}\right) _ {1} \\ \left((x _ {s}) _ {\mathcal {S}}\right) _ {2} \\ \dots \\ \left((x _ {s}) _ {\mathcal {S}}\right) _ {| \mathcal {S} |} \end{array} \right] \\ = \left[ \begin{array}{c} \frac {\sum_ {i = 1} ^ {| \mathcal {S} |} m _ {1 i} ((x _ {s}) _ {\mathcal {S}}) _ {i}}{((x _ {s}) _ {\mathcal {S}}) _ {1}} \\ \frac {\sum_ {i = 1} ^ {| \mathcal {S} |} m _ {2 i} ((x _ {s}) _ {\mathcal {S}}) _ {i}}{((x _ {s}) _ {\mathcal {S}}) _ {2}} \\ \dots \\ \frac {\sum_ {i = 1} ^ {| \mathcal {S} |} m _ {| \mathcal {S} | i} ((x _ {s}) _ {\mathcal {S}}) _ {i}}{((x _ {s}) _ {\mathcal {S}}) _ {| \mathcal {S} |}} \end{array} \right], \\ \end{array}
+$$
+
+where this equation should hold for all $x_{s}$ in Assumption 1. Assume $(x_{s})_{\mathcal{S}}\to 0$ , for $g_{\kappa}(x_s)$ is bounded, we can conclude that $m_{ij} = 0$ , if $i\neq j$ . From Eq. (38), the final form of $g_{\kappa}((x_{s})_{\mathcal{S}})$ is formulated as
+
+$$
+g _ {\kappa} \left(\left(x _ {s}\right) _ {\mathcal {S}}\right) = \left[ \begin{array}{c} m _ {1 1} \\ m _ {2 2} \\ \dots \\ m _ {| \mathcal {S} | | \mathcal {S} |} \end{array} \right]. \tag {38}
+$$
+
+From Eq. (38), we can conclude that $g_{\kappa}(x_s)_i$ is a constant if $i \in S$ , as the $S$ could be arbitrary subset of $\{1, \dots, n\}$ as long as $|S| \leq s$ . We could deduce that $g_{\kappa}(x_s)_i$ is constant $\forall i \in \{1, \dots, n\}$ and $g_{\kappa}(x_s)$ must be constant vector, i.e.
+
+$$
+\operatorname {d i a g} \left(g _ {\kappa} \left(x _ {s}\right)\right) = D, \tag {39}
+$$
+
+where $D$ is an $n \times n$ constant diagonal matrix. The first part of conclusion of Theorem 1 has been proved.
+
+Substitute $b^{(t)}$ in Eq. (34) and $\mathrm{diag}(g_{\kappa}(x_s))$ in Eq. (39) into Eq. (32), Eq. (32) is.
+
+$$
+x _ {s} = \left(W ^ {(t)} D + U ^ {(t)} A\right) x _ {s}, \tag {40}
+$$
+
+$$
+x _ {s} = Z x _ {s},
+$$
+
+where $Z = W^{(t)}D + U^{(t)}A = [Z_1, Z_2, \ldots, Z_n]$ and the $Z_i$ is the $i$ -th column of $Z$ .
+
+Give a $x_{s}$ satisfying only the $i$ -th element of $x_{s}$ is non-zero and all the other elements are equal to zero, i.e., $x_{s} = [0,0,\dots ,\omega ,\dots ,0]^{T} = \omega e_{i}$ , in which $e_i$ is basis vector with only the $i$ -th element being 1 and $\omega \neq 0$ . Substitute the $x_{s} = \omega e_{i}$ into Eq. (40), there is
+
+$$
+x _ {s} = Z x _ {s},
+$$
+
+$$
+\omega e _ {i} = \left[ Z _ {1}, Z _ {2}, \dots , Z _ {n} \right] \left[ 0, 0, \dots , \omega , \dots , 0 \right] ^ {T}, \tag {41}
+$$
+
+$$
+\omega e _ {i} = \omega Z _ {i},
+$$
+
+$$
+\omega \left(e _ {i} - Z _ {i}\right) = \mathbf {0}.
+$$
+
+As the Eq. (41) should hold for $\forall \omega \neq 0$ , we can deduce that $Z_{i} = e_{i}$ . As the $i$ is selected arbitrarily, $Z = W^{(t)}D + U^{(t)}A = [Z_1,Z_2,\ldots ,Z_n] = [e_1,e_2,\ldots ,e_n] = I$ . Thus we have completed the proof and get
+
+$$
+W ^ {(t)} D = \left(I - U ^ {(t)} A\right) \quad \text {a s} \quad t \rightarrow \infty . \tag {42}
+$$
+
+
+
+# 6.3 PROOF OF THEOREM 2
+
+Recall that the update rule of LISTA with gain gates is $x^{(0)} = 0$ and
+
+$$
+x ^ {(t + 1)} = s _ {b ^ {(t)}} \left(W ^ {(t)} \left(g _ {t} \left(x ^ {(t)}, y \mid \Lambda_ {g} ^ {(t)}\right) \odot x ^ {(t)}\right) + U ^ {(t)} y\right). \tag {43}
+$$
+
+Proof. We simplify the $g_{t}(x^{(t)},y|\Lambda_{g}^{(t)})$ as $g_{t}(x^{(t)})$ , and $\kappa_t(x^{(t)},y|\Lambda_g^{(t)})$ as $\kappa_t(x^{(t)})$ . According to the definition of gain gate in Eq. (43), we have
+
+$$
+\begin{array}{l} x ^ {(t + 1)} = s _ {b ^ {(t)}} \left(W ^ {(t)} \left(x ^ {(t)} \odot g _ {t} \left(x ^ {(t)}\right) + U ^ {(t)} y\right) \right. \\ = s _ {b ^ {(t)}} \left(W ^ {(t)} \left(x ^ {(t)} \odot g _ {t} \left(x ^ {(t)}\right) + U ^ {(t)} A x _ {s}\right) \right. \tag {44} \\ = s _ {b ^ {(t)}} \left(\left(I - U ^ {(t)} A\right) \left(x ^ {(t)} \odot g \left(x ^ {(t)}\right) - x _ {s}\right) + x _ {s}\right) \\ = (I - U ^ {(t)} A) \left(x ^ {(t)} \odot g \left(x ^ {(t)}\right) - x _ {s}\right) + x _ {s} - b ^ {(t)} h \left(x ^ {(t + 1)}\right). \\ \end{array}
+$$
+
+Simplify the $x^{(t)} \odot g(x^{(t)}) - x_s$ as $\Delta_g x^{(t)}$ . For the $i$ -th equation in Eq. (44), and $i \notin S$ , give the value of $b^{(t)} = \mu(A) \sup_{x_s} \|x^{(t)} \odot g(x^{(t)}) - x_s\|_1$ , there is
+
+$$
+\begin{array}{l} x _ {i} ^ {(t + 1)} = \left(\left(I - U ^ {(t)} A\right) \left(\Delta_ {g} x ^ {(t)}\right)\right) _ {i} - b ^ {(t)} h \left(x _ {i} ^ {(t + 1)}\right) \\ = \left(\left(I - U ^ {(t)} A\right) \left(\Delta_ {g} x ^ {(t)}\right)\right) _ {i} - \mu (A) \sup _ {x _ {s}} \| \Delta_ {g} x ^ {(t)} \| _ {1} h \left(x _ {i} ^ {(t + 1)}\right). \tag {45} \\ \end{array}
+$$
+
+With almost the same proof process in Proposition 1, we could deduce that
+
+$$
+\operatorname {s u p p} \left(x ^ {(t + 1)}\right) \subset x _ {s}, \tag {46}
+$$
+
+which is the no "false positive" property.
+
+Recall the Eq. (44) and substitute the $1 + \kappa_{t + 1}(x^{(t + 1)}) = g_{t + 1}(x^{(t + 1)})$ into it:
+
+$$
+x ^ {(t + 1)} = \left(\left(I - U ^ {(t)} A\right) \left(\Delta_ {g} x ^ {(t)}\right)\right) - b ^ {(t)} h \left(x ^ {(t + 1)}\right) + x _ {s},
+$$
+
+$$
+\begin{array}{l} x ^ {(t + 1)} \left(1 + \kappa_ {t + 1} \left(x ^ {(t + 1)}\right)\right) = \left(I - U ^ {(t)} A\right) \left(\Delta_ {g} x ^ {(t)}\right) - b ^ {(t)} h \left(x ^ {(t + 1)}\right) \tag {47} \\ + x _ {s} + x ^ {(t + 1)} \odot \kappa_ {t} (x ^ {(t + 1)}), \\ \end{array}
+$$
+
+$$
+\Delta_ {g} x ^ {(t + 1)} = (I - U ^ {(t)} A) (\Delta_ {g} x ^ {(t)}) - b ^ {(t)} h (x ^ {(t + 1)}) + x ^ {(t + 1)} \odot \kappa_ {t} (x ^ {(t + 1)}).
+$$
+
+We shall calculate the non-zero $|\Delta_g x_i^{(t + 1)}|$ with the index $i$ . The $i$ could be seperated to two parts. One is $i \in S$ but $i \notin \operatorname{supp}(x^{(t + 1)})$ , another one part is $i \in S$ and $i \in \operatorname{supp}(x^{(t + 1)})$ . Two kinds of $i$ are discussed respectively.
+
+For $i \in S$ but $i \notin \operatorname{supp}(x^{(t + 1)})$ , there must be $x_{i}^{(t + 1)} = 0$ and $-1 \leq h(x_{i}^{(t + 1)}) \leq 1$ . Select the $i$ -th equation in Eq. (47), there is
+
+$$
+\begin{array}{l} | \Delta_ {g} x _ {i} ^ {(t + 1)} | = | ((I - U ^ {(t)} A) (\Delta_ {g} x ^ {(t)})) _ {i} - b ^ {(t)} h (x _ {i} ^ {(t + 1)}) | \\ \leq \mu (A) \sum_ {j \in \mathcal {S}, j \neq i} \left| \Delta_ {g} x _ {j} ^ {(t)} \right| + \left| b ^ {(t)} \right|. \tag {48} \\ \end{array}
+$$
+
+For $i \in S$ and $i \in \operatorname{supp}(x^{(t+1)})$ , there must be $x^{(t+1)} \neq 0$ and $h(x^{(t+1)}) = \operatorname{sign}(x^{(t+1)})$ . Select the $i$ -th equation in Eq. (47), there is
+
+$$
+\begin{array}{l} \left| \Delta_ {g} x _ {i} ^ {(t + 1)} \right| = \left(\left(I - U ^ {(t)} A\right) \left(\Delta_ {g} x ^ {(t)}\right)\right) _ {i} - b ^ {(t)} h \left(x _ {i} ^ {(t + 1)}\right) + x _ {i} ^ {(t + 1)} \kappa_ {t + 1} \left(x _ {i} ^ {(t + 1)}\right) \\ \leq \mu (A) \sum_ {j \in \mathcal {S}, j \neq i} | \Delta_ {g} x _ {j} ^ {(t)} | - b ^ {(t)} \mathrm {s i g n} (x _ {i} ^ {(t + 1)}) \\ + \operatorname {s i g n} \left(x _ {i} ^ {(t + 1)}\right) \left(\left| x _ {i} ^ {(t + 1)} \right| \kappa_ {t + 1} \left(x _ {i} ^ {(t + 1)}\right)\right) \tag {49} \\ = \mu (A) \sum_ {j \in \mathcal {S}, j \neq i} | \Delta_ {g} x _ {j} ^ {(t)} | + (| x _ {i} ^ {(t + 1)} | \kappa_ {t + 1} (x _ {i} ^ {(t + 1)}) - b ^ {(t)}) \mathrm {s i g n} (x _ {i} ^ {(t + 1)}). \\ \end{array}
+$$
+
+According to the condition in Eq. (12) and (13), the $0 < \kappa_{t}(x)\odot |x| < 2b^{(t - 1)}$ . Then, $|\kappa_t(x)\odot |x| - b^{(t - 1)}| < b^{(t - 1)}$ , there must $\exists \eta < 1$ , so that $|\kappa_t(x)\odot |x| - b^{(t - 1)}|\leq \eta b^{(t - 1)} < b^{(t - 1)}$ . Substituting it to Eq. (49), there is
+
+$$
+\begin{array}{l} \left| \Delta_ {g} x _ {i} ^ {(t + 1)} \right| \leq \mu (A) \sum_ {j \in \mathcal {S}, j \neq i} \left| \Delta_ {g} x _ {i} ^ {(t)} \right| + \left(\left| x _ {i} ^ {(t + 1)} \right| \kappa_ {t + 1} \left(x _ {i} ^ {(t + 1)}\right) - b ^ {(t)}\right) \operatorname {s i g n} \left(x _ {i} ^ {(t + 1)}\right) \\ \leq \mu (A) \sum_ {j \in \mathcal {S}, j \neq i} \left| \Delta_ {g} x _ {i} ^ {(t)} \right| + \left| \left| x _ {i} ^ {(t + 1)} \right| \kappa_ {t + 1} \left(x _ {i} ^ {(t + 1)}\right) - b ^ {(t)} \right| \tag {50} \\ \leq \mu (A) \sum_ {j \in \mathcal {S}, j \neq i} | \Delta_ {g} x _ {i} ^ {(t)} | + \eta b ^ {(t)}. \\ \end{array}
+$$
+
+Accumulate all the $|\Delta_g x_i^{(t + 1)}|$ with all $i \in S$ , and define $s^{(t)} = |\operatorname{supp}(x^{(t)})|$ as the number of non-zeros elements in $x^{(t)}$ there is
+
+$$
+\begin{array}{l} \| \Delta_ {g} x ^ {(t + 1)} \| _ {1} \leq \sum_ {i \in \mathcal {S}} \mu (A) \sum_ {j \in \mathcal {S}, j = i} | \Delta_ {g} x _ {i} ^ {(t)} | + (s ^ {(t + 1)} \eta + (| \mathcal {S} | - s ^ {(t + 1)})) b ^ {(t)} \\ \leq \sum_ {i \in \mathcal {S}} \mu (A) \sum_ {j \in \mathcal {S}, j = i} | \Delta_ {g} x _ {i} ^ {(t)} | + \left(s ^ {(t + 1)} \eta + \left(| \mathcal {S} | - s ^ {(t + 1)}\right)\right) b ^ {(t)} \tag {51} \\ \leq (| \mathcal {S} | - 1) \mu (A) \| \Delta_ {g} x ^ {(t)} \| _ {1} \\ + \left(s ^ {(t + 1)} \eta + \left(\left| \mathcal {S} \right| - s ^ {(t + 1)}\right)\right) \mu (A) \sup _ {x _ {s}} \| \Delta_ {g} x ^ {(t)} \| _ {1}. \\ \end{array}
+$$
+
+Take the supremum of Eq. (51), let $s_{*}^{(t)}$ denote the infimum of $s^{(t)}$ with all of the $x_{s} \in \mathcal{X}(B,s,0)$ and $c_{t} = \log ((2s - 1 - s_{*}^{(t)}(1 - \eta))\mu (A))$ , there is
+
+$$
+\begin{array}{l} \sup _ {x _ {s}} \| \Delta_ {g} x ^ {(t + 1)} \| _ {1} \leq (s - 1) \mu (A) \sup _ {x _ {s}} \| \Delta_ {g} x ^ {(t)} \| _ {1} \\ + \left(s _ {*} ^ {(t + 1)} \eta + \left(s - s _ {*} ^ {(t + 1)}\right)\right) \mu (A) \sup _ {x _ {s}} \| \Delta_ {g} x ^ {(t)} \| _ {1} \\ \leq \left(2 s - 1 + s _ {*} ^ {(t + 1)} (1 - \eta)\right) \sup _ {x _ {s}} \| \Delta_ {g} x ^ {(t)} \| _ {1} \tag {52} \\ \leq \exp (c _ {t + 1}) \sup _ {x _ {s}} \| \Delta_ {g} x ^ {(t)} \| _ {1} \\ \leq \exp (\sum_ {i = 1} ^ {t + 1} c _ {i}) \sup _ {x _ {s}} \| \Delta_ {g} x ^ {(0)} \| _ {1} \leq \exp (\sum_ {i = 1} ^ {t + 1} c _ {i}) s B. \\ \end{array}
+$$
+
+Eq. (52) gives the upper bound of $\sup_{x_s} \| \Delta_g x^{(t+1)} \|_1$ , next we shall deduce the relationship between $\| x^{(t)} - x_s \|_1$ and it. For the last layer (t-th layer), from Eq. (44), we have
+
+$$
+x _ {i} ^ {(t + 1)} = \left(\left(I - U ^ {(t)} A\right) \left(\Delta_ {g} x ^ {(t)}\right)\right) _ {i} - \mu (A) \sup _ {x _ {s}} \| \Delta_ {g} x ^ {(t)} \| _ {1} h \left(x _ {i} ^ {(t + 1)}\right) + \left(x _ {s}\right) _ {i},
+$$
+
+$$
+x _ {i} ^ {(t + 1)} - \left(x _ {s}\right) _ {i} = \left(\left(I - U ^ {(t)} A\right) \left(\Delta_ {g} x ^ {(t)}\right)\right) _ {i} - \mu (A) h \left(x _ {i} ^ {(t + 1)}\right) \sup _ {x _ {s}} \| \Delta_ {g} x ^ {(t)} \| _ {1}, \tag {53}
+$$
+
+$$
+| x _ {i} ^ {(t + 1)} - (x _ {s}) _ {i} | \leq | ((I - U ^ {(t)} A) (\Delta_ {g} x ^ {(t)})) _ {i} | + \mu (A) \sup _ {x _ {s}} \| \Delta_ {g} x ^ {(t)} \| _ {1}.
+$$
+
+Using almost the same process in Eq. (26) and Eq. (27), we could deduce Eq. (53) that
+
+$$
+\begin{array}{l} \left\| x ^ {(t + 1)} - x _ {s} \right\| _ {1} \leq (2 s - 1) \mu (A) \sup _ {x _ {s}} \| \Delta_ {g} x ^ {(t)} \| _ {1}, \\ \| x ^ {(t)} - x _ {s} \| _ {1} \leq (2 s - 1) \mu (A) \sup _ {x _ {s}} \| \Delta_ {g} x ^ {(t - 1)} \| _ {1} \\ \leq (2 s - 1) \mu (A) \exp \left(\sum_ {i = 1} ^ {t - 1} c _ {i}\right) s B \tag {54} \\ = \exp (\sum_ {i = 1} ^ {t - 1} c _ {i} + c) s B, \\ \end{array}
+$$
+
+where the third inequality sign holds because of Eq. (52) and the last equation holds because of $c = \log ((2s - 1)\mu (A))$ .
+
+As at least $c_t \leq c$ satisfies, there will be $\sup_{x_s} \| x^{(t)} - x_s \|_1 \leq \exp(ct)sB$ . Set $t_0 = \lceil \log(\frac{sB}{\|x_s\|_1}) / \log(\frac{1}{(2s-1)\mu(A)}) \rceil$ . When $i > t_0$ , $\sup_{x_s} \| x^{(i)} - x_s \|_1 \leq \exp(ci)sB < \| x_s \|_1$ , $\| x^{(i)} - x_s \|_1 < \| x_s \|_1$ , then the $s_*^{(i)} = |\operatorname{supp}(x^{(i)})| > 0$ , $c_i = \log(2s - 1 + s_*^{(i)}(1 - \eta))\mu(A) < \log((2s - 1)\mu(A)) = c$ .
+
+In conclusion, from Eq. (54), there is
+
+$$
+\left\| x ^ {(t)} - x _ {s} \right\| _ {2} \leq \left\| x ^ {(t)} - x _ {s} \right\| _ {1} \leq \exp \left(\sum_ {i = 1} ^ {t - 1} c _ {i} + c\right) s B, \tag {55}
+$$
+
+where $c = \log ((2s - 1)\mu (A))$ , $c_{i} = c$ when $i\leq t_0$ , and $c_{i} < c$ when $i > t_0$ .
+
+# 6.4 PROOF OF THEOREM 3
+
+Proof. For the $t$ -th layer of the LISTA, according to the Eq. (23), we have
+
+$$
+x _ {i} ^ {(t + 1)} = \left(\left(I - U ^ {(t)} A\right) \left(x ^ {(t)} - x _ {s}\right)\right) _ {i} + \left(x _ {s}\right) _ {i} - b ^ {(t)} h \left(x _ {i} ^ {(t + 1)}\right). \tag {56}
+$$
+
+As we have removed the no false positive assumption, $\operatorname{supp}(x_i^{(t)}) \not\subset S$ . Define $S^{(t)}$ as $\forall i \in S^{(t)}$ satisfies $i \in \operatorname{supp}(x^{(t)})$ but $i \notin S$ . In order to calculate all of non-zero $x_i^{(t+1)} - (x_s)_i$ with index $i$ , we divide the $i$ into two kinds, $i \in S$ and $i \in S^{(t+1)}$ .
+
+If $i\in S$ , from Eq. (56), we can deduce the same formulation as Eq. (25):
+
+$$
+\begin{array}{l} \left| x _ {i} ^ {(t + 1)} - \left(x _ {s}\right) _ {i} \right| \leq \sum_ {j \in \operatorname {s u p p} \left(x ^ {(t)}\right)} \left(I - U ^ {(t)} A\right) _ {i j} \left(x _ {j} ^ {(t)} - \left(x _ {s}\right) _ {j}\right) + b ^ {(t)} \\ \leq \sum_ {j \in \operatorname {s u p p} (x ^ {(t)})} | (I - U ^ {(t)} A) _ {i j} \left(x _ {j} ^ {(t)} - \left(x _ {s}\right) _ {j}\right) | + b ^ {(t)}. \tag {57} \\ \end{array}
+$$
+
+If $i \in S^{(t+1)}$ , then the $(x_s)_i = 0$ but $x_i^{(t+1)}$ , then $h(x_i^{(t+1)}) = \mathrm{sign}(x_i^{(t+1)})$ . From Eq. (56), there is
+
+$$
+\begin{array}{l} x _ {i} ^ {(t + 1)} = \left(\left(I - U ^ {(t)} A\right) \left(x ^ {(t)} - x _ {s}\right)\right) _ {i} - b ^ {(t)} h \left(x _ {i} ^ {(t + 1)}\right) \tag {58} \\ = \left(\left(I - U ^ {(t)} A\right) \left(x ^ {(t)} - x _ {s}\right)\right) _ {i} - b ^ {(t)} \operatorname {s i g n} \left(x _ {i} ^ {(t + 1)}\right). \\ \end{array}
+$$
+
+Multiply $\mathrm{sign}(x_i^{(t + 1)})$ on Eq. (58), we have
+
+$$
+\left| x _ {i} ^ {(t + 1)} \right| = \left(\left(I - U ^ {(t)} A\right) \left(x ^ {(t)} - x _ {s}\right)\right) _ {i} \operatorname {s i g n} \left(x _ {i} ^ {(t + 1)}\right) - b ^ {(t)},
+$$
+
+$$
+\left| x _ {i} ^ {(t + 1)} \right| + b ^ {(t)} = \left(\left(I - U ^ {(t)} A\right) \left(x ^ {(t)} - x _ {s}\right)\right) _ {i} \operatorname {s i g n} \left(x _ {i} ^ {(t + 1)}\right), \tag {59}
+$$
+
+$$
+\left(\left| x _ {i} ^ {(t + 1)} \right| + b ^ {(t)}\right) \operatorname {s i g n} \left(x _ {i} ^ {(t + 1)}\right) = \left(\left(I - U ^ {(t)} A\right) \left(x ^ {(t)} - x _ {s}\right)\right) _ {i},
+$$
+
+which means $((I - U^{(t)}A)(x^{(t)} - x_s))_i$ have the same sign with $\mathrm{sign}(x_i^{(t + 1)})$ because $|x_{i}^{(t + 1)}| > 0$ and $b^{(t)} > 0$ , i.e.,
+
+$$
+\left(\left(I - U ^ {(t)} A\right) \left(x ^ {(t)} - x _ {s}\right)\right) _ {i} = | \left(\left(I - U ^ {(t)} A\right) \left(x ^ {(t)} - x _ {s}\right)\right) _ {i} \mid \operatorname {s i g n} \left(x _ {i} ^ {(t + 1)}\right). \tag {60}
+$$
+
+From the Eq. (58), substitute Eq. (60) into Eq. (58), there is
+
+$$
+\begin{array}{l} x _ {i} ^ {(t + 1)} - (x _ {s}) _ {i} = x _ {i} ^ {(t + 1)} \\ = \operatorname {sign} (x _ {i} ^ {(t + 1)}) (\left| \sum_ {j \in \operatorname {s u p p} (x ^ {(t)})} (I - U ^ {(t)} A) _ {i j} (x _ {j} ^ {(t)} - (x _ {s}) _ {j}) \right| \\ - b ^ {(t)}), \\ \end{array}
+$$
+
+$$
+\begin{array}{l} \left| x _ {i} ^ {(t + 1)} - \left(x _ {s}\right) _ {i} \right| = \left| x _ {i} ^ {(t + 1)} \right| = x _ {i} ^ {(t + 1)} \operatorname {s i g n} \left(x _ {i} ^ {(t + 1)}\right) \tag {61} \\ = \left| \sum_ {j \in \operatorname {s u p p} (x ^ {(t)})} (I - U ^ {(t)} A) _ {i j} (x _ {j} ^ {(t)} - (x _ {s}) _ {j}) \right| - b ^ {(t)} \\ \leq \sum_ {j \in \operatorname {s u p p} (x ^ {(t)})} | (I - U ^ {(t)} A) _ {i j} (x _ {j} ^ {(t)} - (x _ {s}) _ {j}) | - b ^ {(t)} \\ \end{array}
+$$
+
+Accumulate all the $|x_i^{(t + 1)} - (x_s)_i|$ with $i \in \operatorname{supp}(x^{(t + 1)}) \cup \operatorname{supp}(x_s) = S^{(t + 1)} + S$ , there is
+
+$$
+\begin{array}{l} \| x ^ {(t + 1)} - x _ {s} \| _ {1} \leq \sum_ {i \in \mathcal {S} ^ {(t + 1)} + \mathcal {S}} \sum_ {j \in \operatorname {s u p p} (x ^ {(t)})} | (I - U ^ {(t)} A) _ {i j} (x _ {j} ^ {(t)} - (x _ {s}) _ {j}) | \\ + \left(| \mathcal {S} | - | \mathcal {S} ^ {(t + 1)} |\right) | b ^ {(t)} |, \tag {62} \\ \leq \left(| \mathcal {S} ^ {(t + 1)} | + | \mathcal {S} |\right) \mu (A) \| x ^ {(t)} - x _ {s} \| _ {1} + \left(| \mathcal {S} | - | \mathcal {S} ^ {(t + 1)} |\right) b ^ {(t)}. \\ \end{array}
+$$
+
+Substitute the $b^{(t)} = \omega_{t + 1}(k_{t + 1}|\Theta)\mu (A)\sup_{x_s}\| x^{(t)} - x_s\| _1$ into Eq. (62), and take its supremum of right part:
+
+$$
+\begin{array}{l} \| x ^ {(t + 1)} - x _ {s} \| _ {1} \leq \left(| \mathcal {S} ^ {(t + 1)} | + | \mathcal {S} |\right) \mu (A) \sup _ {x _ {s}} \| x ^ {(t)} - x _ {s} \| _ {1} \\ + \left(| \mathcal {S} | - \left| \mathcal {S} ^ {(t + 1)} \right|\right) \omega_ {t + 1} \left(k _ {t + 1} \mid \Theta\right) \mu (A) \sup _ {x _ {s}} \| x ^ {(t)} - x _ {s} \| _ {1} \tag {63} \\ \leq \left(\left| \mathcal {S} ^ {(t + 1)} \right| + \left| \mathcal {S} \right| + \left(\left| \mathcal {S} \right| - \left| \mathcal {S} ^ {(t + 1)} \right|\right) \omega_ {t + 1} \left(k _ {t + 1} | \Theta\right)\right) \\ \mu (A) \sup _ {x _ {s}} \| x ^ {(t)} - x _ {s} \| _ {1}. \\ \end{array}
+$$
+
+Take the supremum of left part of (63), there is
+
+$$
+\sup _ {x _ {s}} \| x ^ {(t + 1)} - x _ {s} \| _ {1} \leq \exp \left(c _ {t + 1} ^ {*}\right) \sup _ {x _ {s}} \| x ^ {(t)} - x _ {s} \| _ {1}, \tag {64}
+$$
+
+where $c_{t+1}^* = \sup_{x_s} \log((|S^{(t+1)}| + |S| + (|S| - |S^{(t+1)})\omega_{t+1}(k_{t+1}|\Theta))\mu(A))$ . According to the definition of $\omega_t(\cdot)$ , $b^{(t)} = \omega_{t+1}(k_{t+1}|\Theta)\mu(A) \sup_{x_s} \|x^{(t)} - x_s\|_1$ , so that the number of false positive is less or equal than $k_{t+1}$ , i.e. $|S^{(t+1)}| \leq k_{t+1}$ . According to the previous proof, when $b^{(t)} = \mu(A) \sup_{x_s} \|x^{(t)} - x_s\|_1$ , the number of false positive satisfies $k_{t+1} = 0$ . That means that $\omega(0|\Theta) \leq 1$ and $\omega(k|\Theta) \leq 1$ when $k > 0^4$ . The $c_{t+1}^*$ should be
+
+$$
+\begin{array}{l} c _ {t + 1} ^ {*} = \sup _ {x _ {s}} \log \left(\left(| \mathcal {S} ^ {(t + 1)} | + | \mathcal {S} | + \left(| \mathcal {S} | - | \mathcal {S} ^ {(t + 1)} |\right) \omega_ {t + 1} \left(k _ {t + 1} | \Theta\right)\right) \mu (A)\right) \tag {65} \\ = \log ((s + k _ {t + 1} + (s - k _ {t + 1}) \omega_ {t + 1} (k _ {t + 1} | \Theta)) \mu (A)). \\ \end{array}
+$$
+
+As assumption of $\omega_{t + 1}(\cdot |\Theta)$ , $\exists k_0^{t + 1}$ , s.t. $0 < k_0^{t + 1} < s$ , and $\omega_{t + 1}(k_0^{t + 1}|\Theta) < 1 - 1 / (s - k_0^{t + 1})$ . Select the value of $b^{(t)}$ so that $k_{t + 1} = k_0^{t + 1}$ , we substitute it to Eq. (65), there will be
+
+$$
+\begin{array}{l} c _ {t + 1} ^ {*} = \log ((s + k _ {t + 1} + (s - k _ {t + 1}) \omega_ {t + 1} (k _ {t + 1} | \Theta)) \mu (A)) \\ < \log ((s + k _ {t + 1} + (s - k _ {t + 1}) (1 - \frac {1}{s - k _ {t + 1}})) \mu (A)) \tag {66} \\ = \log ((2 s - 1) \mu (A)). \\ \end{array}
+$$
+
+Recall the Eq. (64), we have
+
+$$
+\begin{array}{l} \sup _ {x _ {s}} \| x ^ {(t + 1)} - x _ {s} \| _ {1} \leq \exp (c _ {t + 1} ^ {*}) \sup _ {x _ {s}} \| x ^ {(t)} - x _ {s} \| _ {1} \\ \leq \exp \left(\sum_ {i = 1} ^ {t + 1} c _ {i} ^ {*}\right) \sup _ {x _ {s}} \| x ^ {(0)} - x _ {s} \| _ {1} \tag {67} \\ \leq \exp (\sum_ {i = 1} ^ {t + 1} c _ {i} ^ {*}) s B. \\ \end{array}
+$$
+
+The $l_{2}$ error bound of the $t$ -th layer of LISTA is
+
+$$
+\left\| x ^ {(t)} - x _ {s} \right\| _ {2} \leq \left\| x ^ {(t)} - x _ {s} \right\| _ {1} \leq \sup _ {x _ {s}} \left\| x ^ {(t)} - x _ {s} \right\| _ {1} \leq s B \exp \left(\sum_ {i = 1} ^ {t} c _ {i} ^ {*}\right), \tag {68}
+$$
+
+where $c_{i}^{*} < \log ((2s - 1)\mu (A))$
+
+
+
+# 6.5 PROOF OF THEOREM 4
+
+Proof. For the $t$ -th layer given in Eq. (10), according to Eq. (47),
+
+$$
+x ^ {(t + 1)} = \left(\left(I - U ^ {(t)} A\right) \left(\Delta_ {g} x ^ {(t)}\right)\right) - b ^ {(t)} h \left(x ^ {(t + 1)}\right) + x _ {s}, \tag {69}
+$$
+
+and
+
+$$
+\Delta_ {g} x ^ {(t + 1)} = (I - U ^ {(t)} A) \left(\Delta_ {g} x ^ {(t)}\right) - b ^ {(t)} h \left(x ^ {(t + 1)}\right) + x ^ {(t + 1)} \odot \kappa_ {t} \left(x ^ {(t + 1)}\right). \tag {70}
+$$
+
+As the no false positive is not fit for $x^{(t)}$ , $x^{(t)} \not\subset S$ . We still define $S^{(t)}$ as $\forall i \in S^{(t)}$ satisfies $i \in \operatorname{supp}(x_i^{(t)})$ but $i \notin S$ and define $\mathbb{S}^{(t)}$ as $\forall i \in \mathbb{S}^{(t)}$ satisfies $i \in S$ and $i \in \operatorname{supp}(x_i^{(t)})$ . In order to calculate the non-zero $\Delta_g x_i^{(t+1)}$ , we divide the $i$ into three situations: $i \in \mathbb{S}^{(t+1)}$ , $i \notin \mathbb{S}^{(t+1)}$ but $i \in S$ , and $i \in S^{(t+1)}$ .
+
+For $i \in \mathbb{S}^{(t+1)}$ , there must be $x_i^{(t+1)} \neq 0$ , and $(x_s)_i \neq 0$ . Substitute the form of $\kappa_t$ into $i$ -th equation of Eq. (70):
+
+$$
+\begin{array}{l} \Delta_ {g} x _ {i} ^ {(t + 1)} = ((I - U ^ {(t)} A) (\Delta_ {g} x ^ {(t)})) _ {i} - b ^ {(t)} \mathrm {s i g n} (x ^ {(t + 1)}) + \mu_ {t + 1} b ^ {(t)} \mathrm {s i g n} (x _ {i} ^ {(t + 1)}) \\ = \left(\left(I - U ^ {(t)} A\right) \left(\Delta_ {g} x ^ {(t)}\right)\right) _ {i} - \left(1 - \mu_ {t + 1}\right) b ^ {(t)} \operatorname {s i g n} \left(x ^ {(t + 1)}\right), \tag {71} \\ \end{array}
+$$
+
+$$
+| \Delta_ {g} x _ {i} ^ {(t + 1)} | \leq | ((I - U ^ {(t)} A) (\Delta_ {g} x ^ {(t)})) _ {i} | + (1 - \mu_ {t + 1}) b ^ {(t)},
+$$
+
+we have assume $\mu_t\leq 1$
+
+For $i \notin \mathbb{S}^{(t + 1)}$ but $i \in S$ , $x_{i}^{(t + 1)} = 0$ , and $(x_{s})_{i} \neq 0$ . The $i$ -th equation of Eq. (70) is
+
+$$
+\Delta_ {g} x _ {i} ^ {(t + 1)} = \left(\left(I - U ^ {(t)} A\right) \left(\Delta_ {g} x ^ {(t)}\right)\right) _ {i} - b ^ {(t)} \operatorname {s i g n} \left(x _ {i} ^ {(t + 1)}\right), \tag {72}
+$$
+
+$$
+| \Delta_ {g} x _ {i} ^ {(t + 1)} | \leq | ((I - U ^ {(t)} A) (\Delta_ {g} x ^ {(t)})) _ {i} | + b ^ {(t)}.
+$$
+
+For $i\in S^{(t + 1)}$ $(x_{s})_{i} = 0$
+
+$$
+\Delta_ {g} x _ {i} ^ {(t + 1)} = x _ {i} ^ {(t + 1)} g _ {t} \left(x _ {i} ^ {(t + 1)}\right) = \left(\left(I - U ^ {(t)} A\right) \left(\Delta_ {g} x ^ {(t)}\right)\right) _ {i} - \left(1 - \mu_ {t + 1}\right) b ^ {(t)} \operatorname {s i g n} \left(x ^ {(t + 1)}\right), \tag {73}
+$$
+
+As $g_{t}(x_{i}^{(t + 1)}) \geq 1$ , the sign of $x_{i}^{(t + 1)}g_{t}(x_{i}^{(t + 1)})$ is the same as that of $x_{i}^{(t + 1)}$ . Multiply $\mathrm{sign}(x_i^{(t + 1)})$ on Eq. (73), there is
+
+$$
+\begin{array}{l} | x _ {i} ^ {(t + 1)} g _ {t} (x _ {i} ^ {(t + 1)}) | = ((I - U ^ {(t)} A) (\Delta_ {g} x ^ {(t)})) _ {i} \mathrm {s i g n} (x ^ {(t + 1)}) - (1 - \mu_ {t + 1}) b ^ {(t)}, \\ \left. \left| x _ {i} ^ {(t + 1)} g _ {t} \left(x _ {i} ^ {(t + 1)}\right) \right| + (1 - \mu_ {t + 1}) b ^ {(t)} = \left(\left(I - U ^ {(t)} A\right) \left(\Delta_ {g} x ^ {(t)}\right)\right) _ {i} \operatorname {s i g n} \left(x ^ {(t + 1)}\right), \right. \tag {74} \\ \end{array}
+$$
+
+which means the $((I - U^{(t)}A)(\Delta_gx^{(t)}))_i$ should have the same sign with $\mathrm{sign}(x^{(t + 1)})$ , i.e.
+
+$$
+\begin{array}{l} \Delta_ {g} x _ {i} ^ {(t + 1)} = \mathrm {s i g n} (x ^ {(t + 1)}) (| ((I - U ^ {(t)} A) (\Delta_ {g} x ^ {(t)})) _ {i} | - | (1 - \mu_ {t + 1}) b ^ {(t)} |), \\ \left| \Delta_ {g} x _ {i} ^ {(t + 1)} \right| \leq \left| \left(\left(I - U ^ {(t)} A\right) \left(\Delta_ {g} x ^ {(t)}\right)\right) _ {i} \right| - (1 - \mu_ {t + 1}) b ^ {(t)}. \\ \end{array}
+$$
+
+Accumulate all the $|\Delta_g x_i^{(t + 1)}|$ with $i \in \operatorname{supp}(x^{(t + 1)}) \cup \operatorname{supp}(x_s)$ , there is
+
+$$
+\begin{array}{l} \| \Delta_{g}x^{(t + 1)}\|_{1} = \sum_{\substack{i\in \mathcal{S}^{(t + 1)},i\in \mathbb{S}^{(t + 1)},i\in \{\mathcal{S} - \mathbb{S}^{(t + 1)}\}}}|\Delta_{g}x_{i}^{(t + 1)}| \\ \leq \sum \quad | ((I - U ^ {(t)} A) (\Delta_ {g} x ^ {(t)})) _ {i} | + ((| \mathbb {S} ^ {(t + 1)} | - | \mathcal {S} ^ {(t + 1)} |) (1 - \mu_ {t + 1}) \\ i \in \operatorname {s u p p} (x ^ {(t + 1)}) \tag {76} \\ + \left(| \mathcal {S} | - | \mathbb {S} ^ {(t + 1)} |\right)) b ^ {(t)} \\ \leq \left(| \mathcal {S} | + | \mathcal {S} ^ {(t + 1)} |\right) \mu (A) \| \Delta_ {g} x ^ {(t)} \| _ {1} + \left(\left(| \mathbb {S} ^ {(t + 1)} | - | \mathcal {S} ^ {(t + 1)} |\right) \left(1 - \mu_ {t + 1}\right) \right. \\ + \left(| \mathcal {S} | - | \mathbb {S} ^ {(t + 1)} |\right)) b ^ {(t)}. \\ \end{array}
+$$
+
+Substitute the $b^{(t)} = \omega_{t + 1}(k_{t + 1}|\Theta)\mu (A)\sup_{x_s}\| \Delta_gx^{(t)}\| _1$ into Eq. (76). Take the supremum of the right part of Eq. (76):
+
+$$
+\begin{array}{l} \| \Delta_ {g} x ^ {(t + 1)} \| _ {1} \leq (| \mathcal {S} | + | \mathcal {S} ^ {(t + 1)} |) \mu (A) \| \sup _ {x _ {s}} \Delta_ {g} x ^ {(t)} \| _ {1} + ((| \mathbb {S} ^ {(t + 1)} | - | \mathcal {S} ^ {(t + 1)} |) (1 - \mu_ {t + 1}) \\ + \left(| \mathcal {S} | - | \mathbb {S} ^ {(t + 1)} |\right)) \omega_ {t + 1} \left(k _ {t + 1} | \Theta\right) \mu (A) \sup _ {x _ {s}} \| \Delta_ {g} x ^ {(t)} \| _ {1} \tag {77} \\ \leq \left(| \mathcal {S} | + | \mathcal {S} ^ {(t + 1)} | + \left(\left(| \mathbb {S} ^ {(t + 1)} | - | \mathcal {S} ^ {(t + 1)} |\right) (1 - \mu_ {t + 1}) \right. \right. \\ + \left(| \mathcal {S} | - | \mathbb {S} ^ {(t + 1)} |\right)) \omega_ {t + 1} \left(k _ {t + 1} | \Theta)\right) \mu (A) \sup _ {x _ {s}} \| \Delta_ {g} x ^ {(t)} \| _ {1}. \\ \end{array}
+$$
+
+Let
+
+$$
+\begin{array}{l} c _ {t + 1} ^ {\prime} = \sup _ {x _ {s}} \log \left(\left| \mathcal {S} \right| + \left| \mathcal {S} ^ {(t + 1)} \right| + \left(\left| \mathbb {S} ^ {(t + 1)} \right| - \left| \mathcal {S} ^ {(t + 1)} \right|\right) \left(1 - \mu_ {t + 1}\right) \right. \tag {78} \\ + \left(| \mathcal {S} | - | \mathbb {S} ^ {(t + 1)} |\right)) \omega_ {t + 1} \left(k _ {t + 1} | \Theta)\right) \mu (A)). \\ \end{array}
+$$
+
+Take the supremum of the left part of Eq. (77), the $\sup_{x_s}\| \Delta_g x^{(t + 1)}\| _1$ satisfies
+
+$$
+\begin{array}{l} \sup _ {x _ {s}} \| \Delta_ {g} x ^ {(t + 1)} \| _ {1} \leq \exp (c _ {t + 1} ^ {\prime}) \sup _ {x _ {s}} \| \Delta_ {g} x ^ {(t)} \| _ {1} \\ \leq \exp \left(\sum_ {i = 1} ^ {t + 1} c _ {i} ^ {\prime}\right) \sup _ {x _ {s}} \| \Delta_ {g} x ^ {(0)} \| _ {1} \tag {79} \\ \leq \exp (\sum_ {i = 1} ^ {t + 1} c _ {i} ^ {\prime}) s B. \\ \end{array}
+$$
+
+After the upper bound of $\| \Delta_g x^{(t)} \|_1$ is deduced, we shall consider about the relationship between $x^{(t+1)} - x_s$ and $\Delta_g x^{(t)}$ :
+
+If $i \in S^{(t + 1)}$ , $(x_{s})_{i} = 0$ , and $x_{i}^{(t + 1)} \neq 0$ . The $i$ -th equation in Eq. (69) is
+
+$$
+x _ {i} ^ {(t + 1)} - \left(x _ {s}\right) _ {i} = \left(\left(I - U ^ {(t)} A\right) \left(\Delta_ {g} x ^ {(t)}\right)\right) _ {i} - b ^ {(t)} \operatorname {s i g n} \left(x _ {i} ^ {(t + 1)}\right). \tag {80}
+$$
+
+According to the similar analyses in previous, the sign of $((I - U^{(t)}A)(\Delta_gx^{(t)}))_i$ is the same as $\mathrm{sign}(x_i^{(t + 1)}), x_i^{(t + 1)} - (x_s)_i$ satisfies
+
+$$
+\begin{array}{l} x _ {i} ^ {(t + 1)} - \left(x _ {s}\right) _ {i} = x _ {i} ^ {(t + 1)} = \left(\left| \left(\left(I - U ^ {(t)} A\right) \left(\Delta_ {g} x ^ {(t)}\right)\right) _ {i} \right| - b ^ {(t)}\right) \operatorname {s i g n} \left(x _ {i} ^ {(t + 1)}\right), \tag {81} \\ | x _ {i} ^ {(t + 1)} - (x _ {s}) _ {i} | = | x _ {i} ^ {(t + 1)} | = | ((I - U ^ {(t)} A) (\Delta_ {g} x ^ {(t)})) _ {i} | - b ^ {(t)}. \\ \end{array}
+$$
+
+If $i\in \mathcal{S}$ , the $x_{i}^{(t + 1)} - (x_{s})_{i}$ satisfies
+
+$$
+\left| x _ {i} ^ {(t + 1)} - \left(x _ {s}\right) _ {i} \right| \leq \left| \left(\left(I - U ^ {(t)} A\right) \left(\Delta_ {g} x ^ {(t)}\right)\right) _ {i} \right| + b ^ {(t)}. \tag {82}
+$$
+
+Accumulate all the $|x_i^{(t + 1)} - (x_s)_i|$ with $i\in \mathrm{supp}(x^{(t + 1)})\cup \mathrm{supp}(x_s)$ , there is
+
+$$
+\begin{array}{l} \left\| x ^ {(t + 1)} - x _ {s} \right\| _ {1} \leq \sum_ {i \in \operatorname {s u p p} \left(x ^ {(t + 1)}\right)} | \left(\left(I - U ^ {(t)} A\right) \left(\Delta_ {g} x ^ {(t)}\right)\right) _ {i} | + \left(| S | - | S ^ {(t + 1)} |\right) | b ^ {(t)} | \tag {83} \\ \leq \left(| \mathcal {S} | + | \mathcal {S} ^ {(t + 1)} |\right) \mu (A) \| \Delta_ {g} x ^ {(t)} \| _ {1} + \left(| \mathcal {S} | - | \mathcal {S} ^ {(t + 1)} |\right) b ^ {(t)}. \\ \end{array}
+$$
+
+Substitute the $b^{(t)} = \omega_{t + 1}(k_{t + 1}|\Theta)\mu (A)\sup_{x_s}\| \Delta_gx^{(t)}\| _1$ into Eq. (83), take the supremum of $\| \Delta_gx^{(t)}\| _1$ :
+
+$$
+\begin{array}{l} \| x ^ {(t + 1)} - x _ {s} \| _ {1} \leq (| \mathcal {S} | + | \mathcal {S} ^ {(t + 1)} |) \mu (A) \sup _ {x _ {s}} \| \Delta_ {g} x ^ {(t)} \| _ {1} \\ + \left(| \mathcal {S} | - | \mathcal {S} ^ {(t + 1)} |\right) \omega_ {t + 1} \left(k _ {t + 1} | \Theta\right) \sup _ {x _ {s}} \| \Delta_ {g} x ^ {(t)} \| _ {1} \tag {84} \\ \leq \left(| \mathcal {S} | + | \mathcal {S} ^ {(t + 1)} | + (| \mathcal {S} | - | \mathcal {S} ^ {(t + 1)} |\right) \omega_ {t + 1} \left(k _ {t + 1} | \Theta)\right) \mu (A) \sup _ {x _ {s}} \| \Delta_ {g} x ^ {(t)} \| _ {1}. \\ \end{array}
+$$
+
+Let $c'^*$ be
+
+$$
+c ^ {\prime *} = \log \left(\left(| \mathcal {S} | + \left| \mathcal {S} ^ {(t)} \right|\right) + \left(\left| \mathcal {S} \right| - \left| \mathcal {S} ^ {(t)} \right|\right) \omega_ {t} \left(k _ {t} | \Theta\right)\right) \mu (A)). \tag {85}
+$$
+
+Substitute Eq. (79) and (85) into Eq. (84), the $l_{2}$ error bound of LISTA with gain gate should be
+
+$$
+\begin{array}{l} \| x ^ {(t)} - x _ {s} \| _ {2} \leq \| x ^ {(t)} - x _ {s} \| _ {1} \leq \exp \left(c ^ {\prime *}\right) \sup _ {x _ {s}} \| \Delta_ {g} x ^ {(t - 1)} \| _ {1} \\ \leq \exp \left(\sum_ {i = 1} ^ {t - 1} c _ {i} ^ {\prime} + c ^ {\prime *}\right) s B. \tag {86} \\ \end{array}
+$$
+
+Then we shall discuss the value of $c_i'$ and $c_i'^*$ . Let $t_0 = \left\lceil \log \left(\frac{sB}{\sigma}\right) / \log \left(\frac{1}{(2s - 1)\mu(A)}\right) \right\rceil$ .
+
+When $i \leq t_0$ , as $\mu_i = 0$ , which means the gain gate does not exist, there is
+
+$$
+\begin{array}{l} c _ {i} ^ {\prime} = \sup _ {x _ {s}} \log \left(\left(| \mathcal {S} | + \left| \mathcal {S} ^ {(i)} \right|\right) + \left(\left| \mathcal {S} \right| - \left| \mathcal {S} ^ {(i)} \right|\right) \omega_ {i + 1} \left(k _ {i + 1} \mid \Theta\right)\right) \mu (A)) \tag {87} \\ = \log ((s + k _ {i + 1} + (s - k _ {i + 1}) \omega_ {i + 1} (k _ {i + 1} | \Theta)) \mu (A)). \\ \end{array}
+$$
+
+$\exists k_0^i$ , s.t. $0 < k_0^i < s$ and $\omega_{i}(k_{0}^{i}|\Theta) < 1 - 1 / (s - k_{0}^{i})$ . According to main process in the proof Theorem 3, let $k_{i} = k_{0}^{i}$ $0 < k_{i} < s$ , and $c_{i}^{\prime} = c_{i}^{*} < \log ((2s - 1)\mu (A))$
+
+When $i > t_0$ , $\sup_{x_s} \| x^{(i)} - x_s \|_1 < sB \exp(ci) \leq \sigma \leq \min_{i \in \operatorname{supp}(x_s)} |(x_s)_i|$ . As the minimal absolute value of $x_s$ is less or equal than $\sigma$ , $\mathbb{S}^{(t)} = \mathcal{S}$ . Select the $b^{(i)}$ so that $k_i = 0$ , $\omega_i(k_i | \Theta) \leq 1$ . Recall the form in Eq. (78), As $\sup_{x_s} |S^i| = k^i = 0$ , and $c_i'$ is
+
+$$
+\begin{array}{l} c _ {i} ^ {\prime} = \sup _ {x _ {s}} \log \left(\left(| \mathcal {S} | + \left| \mathcal {S} ^ {(i)} \right|\right) + \left(\left| \mathcal {S} \right| - \left| \mathcal {S} ^ {(i)} \right|\right) \omega_ {i} \left(k _ {i} \mid \Theta\right) \mu (A)\right) \tag {88} \\ \leq \log ((s + s (1 - \mu_ {i})) \mu (A)). \\ \end{array}
+$$
+
+As $1 - \omega_{i}(s|\Theta) < \mu_{i}\leq 1$
+
+$$
+\begin{array}{l} c _ {i} ^ {\prime} = \log \left(\left(s + s \left(1 - \mu_ {i}\right)\right) \mu (A)\right) \\ < \log ((s + s \omega_ {i} (s | \Theta)) \mu (A)) \\ < \log ((s + s \omega_ {i} (k _ {0} ^ {i} | \Theta)) \mu (A)) \tag {89} \\ < \log ((s + k _ {0} ^ {i} + (s - k _ {0} ^ {i}) \omega_ {i} (k _ {0} ^ {i} | \Theta)) \mu (A)) = c _ {i} ^ {*}, \\ \end{array}
+$$
+
+i.e., $c_{i}^{\prime} < c_{i}^{*}$ . As $\omega_{i}(\cdot |\Theta)$ is the monotone decreasing function, the second “<” in Eq. (89) holds since $k_0^i < s$ and the last “<” holds since $k_0^i > 0$ .
+
+$|S| \leq s$ , and $|\mathcal{S}^{(t)}| \leq k_t$ . According to the assumption of $\omega_t(\cdot |\Theta)$ , $\exists k_0^i$ , s.t. $0 < k_0^i < s$ and $\omega_i(k_0^i |\Theta) < 1 - 1 / (s - k_0^i)$ . Select $b^{(t)}$ to let $k_{t} = k_{0}^{t}$ . According to the similar derivation in Theorem 3, $c^{\prime *}$ in Eq. (85) should satisfy $c^{\prime *} \leq \log ((s + k_t + (s - k_t)\omega_t(k_t|\Theta))\mu (A)) < \log ((2s - 1)\mu (A))$ . All of the conclusions in Theorem 4 have been proven.
+
+
+
+# 6.6 PROOF OF PROPOSITION 2
+
+Recall that the update rule of ISTA is $x^{(0)} = 0$ and
+
+$$
+x ^ {(t + 1)} = s _ {\lambda / \gamma} \left(x ^ {(t)} - \nabla_ {x} f \left(x ^ {(t)}\right) / \gamma\right). \tag {90}
+$$
+
+We have the following theorem which analyzes the update rule of ISTA and
+
+$$
+\eta^ {*} := \arg \min _ {\eta} f \left(\eta \left(x ^ {(t + 1)} - x ^ {(t)}\right) + x ^ {(t)}, y\right) + \lambda \| \eta \left(x ^ {(t + 1)} - x ^ {(t)}\right) + x ^ {(t)} \| _ {1}. \tag {91}
+$$
+
+Proof. According to the analysis in Section 2 in the main paper, $x^{(t + 1)}$ is the solution of minimizing the upper bound $U(x)$ ,
+
+$$
+U (x) := f \left(x ^ {(t)}, y\right) + \left(x - x ^ {(t)}\right) \nabla_ {x} f \left(x ^ {(t)}\right) + \frac {\gamma}{2} \| x - x ^ {(t)} \| ^ {2} + \lambda r (x). \tag {92}
+$$
+
+The sub-gradient of $U(x)$ is
+
+$$
+\partial_ {x} U (x) = \nabla_ {x} f \left(x ^ {(t)}\right) + \gamma \left(x - x ^ {(t)}\right) + \lambda \partial_ {x} r (x). \tag {93}
+$$
+
+As the $x^{(t + 1)}$ is the optimal solution to minimizing Eq. (92), $\partial_x U(x^{(t + 1)})$ satisfies
+
+$$
+0 \in \partial_ {x} U (x ^ {(t + 1)}) = \nabla_ {x} f (x ^ {(t)}) + \gamma \left(x ^ {(t + 1)} - x ^ {(t)}\right) + \lambda \partial_ {x} r \left(x ^ {(t + 1)}\right), \tag {94}
+$$
+
+where $r(x) = \| x\| _1$ . According to the definition of the sub-gradient, $(\partial_{x}r(x))_{i}\in [-1,1]$ when $x_{i} = 0$ , $(\partial_x r(x))_i = -1$ when $x_{i} < 0$ , and $(\partial_x r(x))_i = 1$ when $x_{i} > 0$ .
+
+From the Eq. (94), there must exists $r_1 \in r(x)$ such that
+
+$$
+\nabla_ {x} f (x ^ {(t)}) + \gamma (x ^ {(t + 1)} - x ^ {(t)}) + \lambda r _ {1} = 0, \tag {95}
+$$
+
+where $(r_1)_i = 1$ if $x_i^{(t + 1)} > 0$ , $(r_1)_i = -1$ if $x_i^{(t + 1)} < 0$ , and $-1 \leq (r_1)_i \leq 1$ if $x_i^{(t + 1)} < 0$ .
+
+According to the definition of $\eta^{*}$ in Eq. (91), we define a new function $\theta (\eta)$ as
+
+$$
+\theta (\eta) = f \left(\eta \left(x ^ {(t + 1)} - x ^ {(t)}\right) + x ^ {(t)}, y\right) + \lambda \| \eta \left(x ^ {(t + 1)} - x ^ {(t)}\right) + x ^ {(t)} \| _ {1}. \tag {96}
+$$
+
+Notice that $\theta (\eta)$ is the line search function of $f(x,y) + \lambda \| x\| _1$ . According to the law of convex optimization, as $f(x,y) + \lambda \| x\| _1$ is a convex function, the $\theta (\eta)$ must be also a convex function about $\eta$ . The sub-gradient of $\theta (\eta)$ is
+
+$$
+\partial_ {x} \theta (\eta) = (x ^ {(t + 1)} - x ^ {(t)}) ^ {T} \nabla_ {x} f (\eta (x ^ {(t + 1)} - x ^ {(t)}) + x ^ {(t)}) +
+$$
+
+$$
+\lambda \left(x ^ {(t + 1)} - x ^ {(t)}\right) ^ {T} \partial_ {x} r \left(\eta \left(x ^ {(t + 1)} - x ^ {(t)}\right) + x ^ {(t)}\right). \tag {97}
+$$
+
+The $\eta^{*}$ actually is the value to minimize $\theta (\eta)$ in Eq. (96). There must be
+
+$$
+0 \in \partial_ {x} \theta \left(\eta^ {*}\right). \tag {98}
+$$
+
+From Eq. (97), the sub-gradient function of $\theta (\eta)$ when $\eta = 1$ is
+
+$$
+\begin{array}{l} \partial_ {\eta} \theta (1) \\ = \left(x ^ {(t + 1)} - x ^ {(t)}\right) ^ {T} \left(\nabla_ {x} f \left(x ^ {(t + 1)}\right) + \lambda \partial_ {x} r \left(x ^ {(t + 1)}\right)\right) \\ = \left(x ^ {(t + 1)} - x ^ {(t)}\right) ^ {T} \left(\nabla_ {x} f \left(x ^ {(t + 1)}\right) - \nabla_ {x} f \left(x ^ {(t)}\right) + \nabla_ {x} f \left(x ^ {(t)}\right)\right) + \lambda \partial_ {x} r \left(x ^ {(t + 1)}\right)) \tag {99} \\ = \left(x ^ {(t + 1)} - x ^ {(t)}\right) ^ {T} \left(\nabla_ {x} ^ {2} f (\zeta) \left(x ^ {(t + 1)} - x ^ {(t)}\right) + \nabla_ {x} f \left(x ^ {(t)}\right) + \lambda \partial_ {x} r \left(x ^ {(t + 1)}\right)\right), \\ \end{array}
+$$
+
+where the last equation holds for Lagrange's mean value theorem and $\zeta \in \mathbb{R}^n$ . Substitute $\nabla_x f(x^{(t)})$ in Eq. (95) into Eq. (99), the $\partial_{\eta}\theta(1)$ is
+
+$$
+\begin{array}{l} \partial_ {\eta} \theta (1) \\ = (x ^ {(t + 1)} - x ^ {(t)}) ^ {T} \left(\nabla_ {x} ^ {2} f (\zeta) \left(x ^ {(t + 1)} - x ^ {(t)}\right) - \gamma \left(x ^ {(t + 1)} - x ^ {(t)}\right) - \lambda r _ {1} + \lambda \partial_ {x} r \left(x ^ {(t + 1)}\right) \right. \\ = \left(x ^ {(t + 1)} - x ^ {(t)}\right) ^ {T} \left(\left(\nabla_ {x} ^ {2} f (\zeta) - \gamma I\right) \left(x ^ {(t + 1)} - x ^ {(t)}\right) + \lambda \left(\partial r \left(x ^ {(t + 1)} - r _ {1}\right)\right) \right. \tag {100} \\ = (x ^ {(t + 1)} - x ^ {(t)}) ^ {T} \left(\nabla_ {x} ^ {2} f (\zeta) - \gamma I\right) \left(x ^ {(t + 1)} - x ^ {(t)}\right) + \\ \lambda \sum_ {i} (x _ {i} ^ {(t + 1)} - x _ {i} ^ {(t)}) ((\partial r (x ^ {(t + 1)})) _ {i} - (r _ {1}) _ {i}), \\ \end{array}
+$$
+
+where the sub-gradient $\partial r(x^{(t + 1)})$ is a set. For all $r^* \in \partial r(x^{(t + 1)})$ ,
+
+$$
+\begin{array}{l} \left(x ^ {(t + 1)} - x ^ {(t)}\right) ^ {T} \left(\nabla_ {x} ^ {2} f (\zeta) - \gamma I\right) \left(x ^ {(t + 1)} - x ^ {(t)}\right) + \\ \lambda \sum_ {i} \left(x _ {i} ^ {(t + 1)} - x _ {i} ^ {(t)}\right) \left(\left(r ^ {*}\right) _ {i} - \left(r _ {1}\right) _ {i}\right) \in \partial_ {\eta} \theta (1). \tag {101} \\ \end{array}
+$$
+
+We prove $\eta^{*}\geq 1$ according to the counter-evidence. According to the properties of convex function and the sub-gradient, assume $\eta^{*} < 1$ , s.t. $0\in \partial_{\eta}\theta (\eta^{*}),\forall r_{\theta}\in \partial_{\eta}\theta (1)$ , there will be
+
+$$
+r _ {\theta} > 0.
+$$
+
+However, as $r_1 \in \partial r(x^{(t+1)})$ , substitute $r = r_1 \in \partial r(x^{(t+1)})$ into Eq. (100). The corresponding element in sub-gradient when $r = r_1$ is $r_\theta = (x^{(t+1)} - x^{(t)})^T (\nabla_x^2 f(\zeta) - \gamma I)(x^{(t+1)} - x^{(t)}) \in \partial_\eta \theta(1)$ . According to given condition $\gamma I - \nabla_x^2 f(x) \succ 0$ , $r_\theta < 0$ , which is in contrast to $r_\theta > 0$ . Therefore, the conclusion $\eta^* \geq 1$ is obtained.
+
+Moreover, consider about the last term of Eq. (100), i.e.
+
+$$
+\sum_ {i} \left(x _ {i} ^ {(t + 1)} - x _ {i} ^ {(t)}\right) \left(\left(\partial r \left(x ^ {(t + 1)}\right)\right) _ {i} - \left(r _ {1}\right) _ {i}\right). \tag {102}
+$$
+
+If $\operatorname{supp}(x^{(t)}) \subset \operatorname{supp}(x^{(t+1)})$ , there are two situations about index $i$ . 1) $i \in \operatorname{supp}(x^{(t+1)})$ , there will be $x_i^{(t+1)} \neq 0$ and $(\partial r(x^{(t+1)}))_i = (r_1)_i = \operatorname{sign}(x_i^{(t+1)})$ . 2) $i \notin \operatorname{supp}(x^{(t+1)})$ and $i \notin \operatorname{supp}(x^{(t)})$ , there will be $x_i^{(t+1)} = x_i^{(t)} = 0$ . Both conditions will make the term $(x_i^{(t+1)} - x_i^{(t)})((\partial r(x^{(t+1)}))_i - (r_1)_i)$ in Eq. (102) be 0. Therefore, Eq. (102) is
+
+$$
+\sum_ {i} \left(x _ {i} ^ {(t + 1)} - x _ {i} ^ {(t)}\right) \left(\left(\partial r \left(x ^ {(t + 1)}\right)\right) _ {i} - \left(r _ {1}\right) _ {i}\right) = 0. \tag {103}
+$$
+
+According to the given condition $\gamma I - \nabla_x^2 f(x) \succ 0$ , $\partial_\eta \theta(1)$ should be a number but not a set and $\partial_\eta \theta(1) = (x^{(t+1)} - x^{(t)})^T (\nabla_x^2 f(\zeta) - \gamma I)(x^{(t+1)} - x^{(t)}) < 0$ . As the $\theta(\eta)$ is convex function, there must be $\eta^* > 1$ because of $0 \in \partial_\eta \theta(\eta^*)$ . The conclusion $\eta^* > 1$ is derived.
+
+
+Figure 7: Experimental results validating our Proposition 2. It can be observed that the update of ISTA "lags behind".
+
+
+(a)
+
+
+(b)
+
+
+Figure 8: Comparison of overshoot and gain gate with similar methods over five runs.
+(a) $\mathrm{SNR} = 20\mathrm{dB}$
+Figure 9: Comparison of sparse coding methods under different settings over five runs. Our GLISTA consistently outperforms the competitors in almost all test cases with different numbers of layers.
+
+
+(b) $\mathrm{SNR} = 40\mathrm{dB}$
+
+
+(c) condition number $= 3$
+
+# 7 MORE SIMULATION EXPERIMENTS
+
+Validation of Proposition 2: Some more experimental results are given here due to the length limit of the main body of our paper. One might also be interested in our Proposition 2, hence we first conduct an experiment to confirm it. We adopt ISTA with an adaptive overshoot and compare it with the standard ISTA for sparse coding. The adaptation is obtained via enlarging the step size from 1.0 through backtracking line search (see section 7 for more details). Figure 7 demonstrates that our overshoot mechanism facilitates ISTA optimization, and such a result confirms Proposition 2.
+
+Comparison with similar methods: As mentioned in the main body of the paper, the overshoot gates is proposed to address insufficient step size, which is similar to the motivation of (L)FISTA. LIHT and support select can also be considered as special cases of our gain gates (by letting $\mu_t = 1$ in the inverse proportional function). We compare these similar methods with our overshoot and gain gates in Figure 8. It can be seen that when compared with LISTA, LFISTA converges faster in lower layers, and our overshoot gates also show such advantage. When applying to deeper layers, LFISTA converges quite slow while the overshoot gates still perform well, which indicates that the time-varying property is beneficial in practice. LISTA with our gain gates is obviously better than LIHT as shown in Figure 8(b), and sufficient experimental results in the paper also prove that the gain gate outperforms support select (e.g., in LISTA-C-S and LISTA-S).
+
+Comparison under less challenging settings: Now we also give sparse coding results under the described less challenging settings on the noise level and the condition number in Figure 9. Compared with LISTA-CP, LAMP, LISTA-SS, and LISTA-CP-SS, our gated LISTA (GLISTA) performs remarkably better with less ill-posed dictionary matrices and less noises. Table 3 and 4 report the statistical means and standard deviations of five runs using different methods. It can be seen that the improvement achieved by our GLISTA is significant.
+
+Table 3: Comparison of the final NMSEs under different noise levels with $d = 16$ . The condition number of the dictionary is not specifically constrained.
+
+| SNR | LISTA | LAMP | LISTA-S | LISTA-C-S | ALISTA-S | GLISTA (ours) |
| 40 | -38.72±0.09 | -36.77±0.60 | -41.99±0.09 | -44.85±0.02 | -41.86±0.04 | -45.22±0.02 |
| 20 | -18.65±0.09 | -18.66±0.09 | -20.64±0.06 | -22.84±0.02 | -20.00±0.05 | -23.08±0.03 |
| 10 | -9.42±0.08 | -9.46±0.66 | -9.84±0.02 | -11.06±0.01 | -9.04±0.02 | -11.41±0.02 |
+
+Table 4: Comparison of the final NMSEs under different condition numbers with $d = 16$ . The noise level is chosen as $\mathrm{SNR} = 40\mathrm{dB}$ for all the tested condition numbers.
+
+| Con. num. | LISTA | LAMP | LISTA-S | LISTA-C-S | ALISTA-S | GLISTA (ours) |
| 3 | -39.03±0.54 | -37.26±0.13 | -43.12±0.06 | -44.90±0.03 | -43.88±0.26 | -45.33±0.04 |
| 30 | -29.65±0.89 | -28.44±0.31 | -32.30±0.17 | -38.36±0.57 | -31.50±0.15 | -39.61±0.64 |
| 100 | -21.39±0.75 | -22.23±0.18 | -27.08±0.57 | -27.94±0.34 | -27.10±0.02 | -34.07±0.64 |
+
+# 8 PROGRESSIVE TRAINING AND ADAPTIVE OVERSHOOT
+
+Our training mostly follows it of Chen et al.'s (2018), and some key steps are listed here: 1) The model is trained progressively to include more layers during the training phase. At the very beginning, only learnable parameters in the first layer is considered, and parameters in the second layer is only included once training on the first update converges, so as the third and higher layers. 2) Training after including the $t$ -th layer is split into three stages, with an initial learning rate of 0.0005 to optimize its own learnable parameters first, and learning rates of 0.0001 and 0.00001 to jointly optimize all learnable parameters from the 0-th to $t$ -th layers in the second and third stages, respectively. We move to the next stage once no performance gain is observed on the validation set for 4000 iterations. 3) With the three stages done on the $t$ -th layer, training moves to include the $(t + 1)$ -th and the same three stages of training are performed.
+
+We perform an adaptive overshoot in the experiment to confirm Proposition 2. The algorithm is summarized in Algorithm 1. Most of input variables are introduced in the main body of our paper and $\tau$ is given as the step size for performing line search. The whole algorithm procedure is very similar to the famous backtracking line search. The step size $\eta$ for sparse coding is updated by $\tau$ until the objective function $f(x,y) + \lambda r(x)$ does not decrease any more.
+
+# Algorithm 1 ISTA with adaptive overshoot.
+
+Input: The dictionary matrix $A$ , an observation $y$ , an initial step size $\eta_0 = 1.0$ for sparse coding, a step size $\tau = 1.05$ for line search, and a maximal number of iteration.
+
+Output: output result
+
+1: $x^{(0)} = 0$
+2: for $t = 0, \dots, K - 1$ do
+3: $\tilde{x}^{(t)} = s_{\lambda /\gamma}((I - A^T A / \gamma)x^{(t - 1)} + A^T y / \gamma);$
+4: $x_{p} = \tilde{x}^{(t)},\eta = \eta_{0}\tau ;$
+5: $x_{c} = \tau (\tilde{x}^{(t)} - x^{(t)}) - x^{(t)};$
+6: while $f_{o}(x_{p},y)\geq f_{o}(x_{c},y)$ do
+7: $x_{p} = x_{c},\eta = \tau \eta ;$
+8: $x_{c} = \eta (\tilde{x}^{(t)} - x^{(t)}) - x^{(t)};$
+9: $x^{(t)} = x_p;$
+10: return $x^{(K - 1)}$
+
+# REFERENCES
+
+Amir Beck and Marc Teboulle. A fast iterative shrinkage-thresholding algorithm for linear inverse problems. SIAM journal on imaging sciences, 2(1):183-202, 2009.
+Mark Borgerding, Philip Schniter, and Sundeep Rangan. Amp-inspired deep networks for sparse linear inverse problems. IEEE Transactions on Signal Processing, 65(16):4293-4308, 2017.
+Xiaohan Chen, Jialin Liu, Zhangyang Wang, and Wotao Yin. Theoretical linear convergence of unfolded ista and its practical weights and thresholds. In Advances in Neural Information Processing Systems, pp. 9061-9071, 2018.
+Kyunghyun Cho, Bart Van Merrienboer, Caglar Gulcehre, Dzmitry Bahdanau, Fethi Bougares, Holger Schwenk, and Yoshua Bengio. Learning phrase representations using rn encoder-decoder for statistical machine translation. In EMNLP, 2014.
+Ingrid Daubechies, Michel Defrise, and Christine De Mol. An iterative thresholding algorithm for linear inverse problems with a sparsity constraint. Communications on Pure and Applied Mathematics: A Journal Issued by the Courant Institute of Mathematical Sciences, 57(11):1413-1457, 2004.
+Bradley Efron, Trevor Hastie, Iain Johnstone, Robert Tibshirani, et al. Least angle regression. The Annals of statistics, 32(2):407-499, 2004.
+Michael Elad and Michal Aharon. Image denoising via sparse and redundant representations over learned dictionaries. IEEE Transactions on Image processing, 15(12):3736-3745, 2006.
+Ross Girshick. Fast r-cnn. In Proceedings of the IEEE international conference on computer vision, pp. 1440-1448, 2015.
+Raja Giryes, Yonina C Eldar, Alex M Bronstein, and Guillermo Sapiro. Tradeoffs between convergence speed and reconstruction accuracy in inverse problems. IEEE Transactions on Signal Processing, 66(7):1676-1690, 2018.
+Karol Gregor and Yann LeCun. Learning fast approximations of sparse coding. In Proceedings of the 27th International Conference on International Conference on Machine Learning, pp. 399-406. Omnipress, 2010.
+Hao He, Bo Xin, Satoshi Ikehata, and David Wipf. From bayesian sparsity to gated recurrent nets. In Advances in Neural Information Processing Systems, pp. 5554-5564, 2017.
+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.
+John R Hershey, Jonathan Le Roux, and Felix Weninger. Deep unfolding: Model-based inspiration of novel deep architectures. arXiv preprint arXiv:1409.2574, 2014.
+Geoffrey Hinton, Li Deng, Dong Yu, George Dahl, Abdel-rahman Mohamed, Navdeep Jaitly, Andrew Senior, Vincent Vanhoucke, Patrick Nguyen, Brian Kingsbury, et al. Deep neural networks for acoustic modeling in speech recognition. IEEE Signal processing magazine, 29, 2012.
+Yann LeCun, Yoshua Bengio, and Geoffrey Hinton. Deep learning. nature, 521(7553):436, 2015.
+Jialin Liu, Xiaohan Chen, Zhangyang Wang, and Wotao Yin. Alist: Analytic weights are as good as learned weights in listia. In Proceedings of the International Conference on Learning Representations, 2019.
+Thomas Moreau and Joan Bruna. Understanding trainable sparse coding via factorization. In Proceedings of the International Conference on Learning Representations, 2017.
+Jeremias Sulam, Aviad Aberdam, Amir Beck, and Michael Elad. On multi-layer basis pursuit, efficient algorithms and convolutional neural networks. IEEE transactions on pattern analysis and machine intelligence, 2019.
+Robert Tibshirani. Regression shrinkage and selection via the lasso. Journal of the Royal Statistical Society: Series B (Methodological), 58(1):267-288, 1996.
+Zhangyang Wang, Qing Ling, and Thomas S Huang. Learning deep 10 encoders. In Thirtieth AAAI Conference on Artificial Intelligence, 2016.
+Bo Xin, Yizhou Wang, Wen Gao, David Wipf, and Baoyuan Wang. Maximal sparsity with deep networks? In Advances in Neural Information Processing Systems, pp. 4340-4348, 2016.
+
+Xu Xu, Xiaohan Wei, and Zhongfu Ye. Doa estimation based on sparse signal recovery utilizing weighted 11-norm penalty. IEEE signal processing letters, 19(3):155-158, 2012.
+Jianchao Yang, John Wright, Thomas S Huang, and Yi Ma. Image super-resolution via sparse representation. IEEE transactions on image processing, 19(11):2861-2873, 2010.
+Jian Zhang and Bernard Ghanem. Ista-net: Interpretable optimization-inspired deep network for image compressive sensing. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 1828-1837, 2018.
\ No newline at end of file
diff --git a/sparsecodingwithgatedlearnedista/images.zip b/sparsecodingwithgatedlearnedista/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..3a9d9e504adb92f6fe39bbf3bdc57c2a3e6f608d
--- /dev/null
+++ b/sparsecodingwithgatedlearnedista/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:daf7b973128ce2feac60cc67f0f603d34b729ddae5edc2ab3d883c33bb1b1197
+size 1731790
diff --git a/sparsecodingwithgatedlearnedista/layout.json b/sparsecodingwithgatedlearnedista/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..d8a50e877e7a2ffeda7047d9814e4e2a386aef72
--- /dev/null
+++ b/sparsecodingwithgatedlearnedista/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0c60af07518630a03729ad803007563dc1075bf6b8a62a81aa4ee82bae22ba27
+size 1394738
diff --git a/spectralembeddingofregularizedblockmodels/301d1328-9a82-44f4-9719-9642092cf921_content_list.json b/spectralembeddingofregularizedblockmodels/301d1328-9a82-44f4-9719-9642092cf921_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..5c44e12769bcbeab383e061de591c0e5db7f3605
--- /dev/null
+++ b/spectralembeddingofregularizedblockmodels/301d1328-9a82-44f4-9719-9642092cf921_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:bfe17f490e8f94c831371de52ea395caa1e0e365af9323039b33c15a36deb244
+size 92278
diff --git a/spectralembeddingofregularizedblockmodels/301d1328-9a82-44f4-9719-9642092cf921_model.json b/spectralembeddingofregularizedblockmodels/301d1328-9a82-44f4-9719-9642092cf921_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..3b3cbb278a84372c56b7d3e37ab90a52d791e66d
--- /dev/null
+++ b/spectralembeddingofregularizedblockmodels/301d1328-9a82-44f4-9719-9642092cf921_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a892aa6a9bce7321b2f7c9d179a21d847de4fe69f29e33ea84c33a8f211f518a
+size 109058
diff --git a/spectralembeddingofregularizedblockmodels/301d1328-9a82-44f4-9719-9642092cf921_origin.pdf b/spectralembeddingofregularizedblockmodels/301d1328-9a82-44f4-9719-9642092cf921_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..c0589b278201e6fe4fb5e2ebc8ce9edebb9de3c0
--- /dev/null
+++ b/spectralembeddingofregularizedblockmodels/301d1328-9a82-44f4-9719-9642092cf921_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:680260ac643b934551915e3b6f226bb312992905b8e6994a1934c4dcd34245e7
+size 227739
diff --git a/spectralembeddingofregularizedblockmodels/full.md b/spectralembeddingofregularizedblockmodels/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..0609772a5e9d730adea54939ccca546821390d40
--- /dev/null
+++ b/spectralembeddingofregularizedblockmodels/full.md
@@ -0,0 +1,537 @@
+# SPECTRAL EMBEDDING OF REGULARIZED BLOCK MODELS
+
+Nathan De Lara & Thomas Donald
+
+Institut Polytechnique de Paris
+
+Paris, France
+
+{nathan.delara, thomas.bonald}@telecom-paris.fr
+
+# ABSTRACT
+
+Spectral embedding is a popular technique for the representation of graph data. Several regularization techniques have been proposed to improve the quality of the embedding with respect to downstream tasks like clustering. In this paper, we explain on a simple block model the impact of the complete graph regularization, whereby a constant is added to all entries of the adjacency matrix. Specifically, we show that the regularization forces the spectral embedding to focus on the largest blocks, making the representation less sensitive to noise or outliers. We illustrate these results on both on both synthetic and real data, showing how regularization improves standard clustering scores.
+
+# 1 INTRODUCTION
+
+Spectral embedding is a standard technique for the representation of graph data (Ng et al., 2002; Belkin & Niyogi, 2002). Given the adjacency matrix $A \in \mathbb{R}_+^{n \times n}$ of the graph, it is obtained by solving either the eigenvalue problem:
+
+$$
+L X = X \Lambda , \text {w i t h} X ^ {T} X = I, \tag {1}
+$$
+
+or the generalized eigenvalue problem:
+
+$$
+L X = D X \Lambda , \text {w i t h} X ^ {T} D X = I, \tag {2}
+$$
+
+where $D = \mathrm{diag}(A1_{n})$ is the degree matrix, with $1_{n}$ the all-ones vector of dimension $n$ , $L = D - A$ is the Laplacian matrix of the graph, $\Lambda \in \mathbb{R}^{k\times k}$ is the diagonal matrix of the $k$ smallest (generalized) eigenvalues of $L$ and $X\in \mathbb{R}^{n\times k}$ is the corresponding matrix of (generalized) eigenvectors. In this paper, we only consider the generalized eigenvalue problem, whose solution is given by the spectral decomposition of the normalized Laplacian matrix $L_{\mathrm{norm}} = I - D^{-1 / 2}AD^{-1 / 2}$ (Luxburg, 2007).
+
+The spectral embedding can be interpreted as equilibrium states of some physical systems (Snell & Doyle, 2000; Spielman, 2007; Donald et al., 2018), a desirable property in modern machine learning. However, it tends to produce poor results on real datasets if applied directly on the graph (Amini et al., 2013). One reason is that real graphs are most often disconnected due to noise or outliers in the dataset.
+
+In order to improve the quality of the embedding, two main types of regularization have been proposed. The first artificially increases the degree of each node by a constant factor (Chaudhuri et al., 2012; Qin & Rohe, 2013), while the second adds a constant to all entries of the original adjacency matrix (Amini et al., 2013; Joseph et al., 2016; Zhang & Rohe, 2018). In the practically interesting case where the original adjacency matrix $A$ is sparse, the regularized adjacency matrix is dense but has a so-called sparse + low rank structure, enabling the computation of the spectral embedding on very large graphs (Lara, 2019).
+
+While (Zhang & Rohe, 2018) explains the effects of regularization through graph conductance and (Joseph et al., 2016) through eigenvector perturbation on the Stochastic Block Model, there is no simple interpretation of the benefits of graph regularization. In this paper, we show on a simple block model that the complete graph regularization forces the spectral embedding to separate the blocks in decreasing order of size, making the embedding less sensitive to noise or outliers in the data.
+
+Indeed, (Zhang & Rohe, 2018) identified that, without regularization, the cuts corresponding to the first dimensions of the spectral embedding tend to separate small sets of nodes, so-called dangling sets, loosely connected to the rest of the graph. Our work shows more explicitly that regularization forces the spectral embedding to focus on the largest clusters. Moreover, our analysis involves some explicit characterization of the eigenvalues, allowing us to quantify the impact of the regularization parameter.
+
+The rest of this paper is organized as follows. Section 2 presents block models and an important preliminary result about their aggregation. Section 3 presents the main result of the paper, about the regularization of block models, while Section 4 extends this result to bipartite graphs. Section 5 presents the experiments and Section 6 concludes the paper.
+
+# 2 AGGREGATION OF BLOCK MODELS
+
+Let $A \in \mathbb{R}_+^{n \times n}$ be the adjacency matrix of an undirected, weight graph, that is a symmetric matrix such that $A_{ij} > 0$ if and only if there is an edge between nodes $i$ and $j$ , with weight $A_{ij}$ . Assume that the $n$ nodes of the graph can be partitioned into $K$ blocks of respective sizes $n_1, \ldots, n_K$ so that any two nodes of the same block have the same neighborhood, i.e., the corresponding rows (or columns) of $A$ are the same. Without any loss of generality, we assume that the matrix $A$ has rank $K$ . We refer to such a graph as a block model.
+
+Let $Z \in \mathbb{R}^{n \times K}$ be the associated membership matrix, with $Z_{ij} = 1$ if index $i$ belongs to block $j$ and 0 otherwise. We denote by $W = Z^T Z \in \mathbb{R}^{K \times K}$ the diagonal matrix of block sizes.
+
+Now define $\bar{A} = Z^T AZ \in \mathbb{R}^{K \times K}$ . This is the adjacency matrix of the aggregate graph, where each block of the initial graph is replaced by a single node; two nodes in this graph are connected by an edge of weight equal to the total weight of edges between the corresponding blocks in the original graph. We denote by $\bar{D} = \mathrm{diag}(\bar{A}1_K)$ the degree matrix and by $\bar{L} = \bar{D} - \bar{A}$ the Laplacian matrix of the aggregate graph.
+
+The following result shows that the solution to the generalized eigenvalue problem (2) follows from that of the aggregate graph:
+
+Proposition 1. Let $x$ be a solution to the generalized eigenvalue problem:
+
+$$
+L x = \lambda D x. \tag {3}
+$$
+
+Then either $Z^T x = 0$ and $\lambda = 1$ or $x = Zy$ where $y$ is a solution to the generalized eigenvalue problem:
+
+$$
+\bar {L} y = \lambda \bar {D} y. \tag {4}
+$$
+
+Proof. Consider the following reformulation of the generalized eigenvalue problem (3):
+
+$$
+A x = D x (1 - \lambda). \tag {5}
+$$
+
+Since the rank of $A$ is equal to $K$ , there are $n - K$ eigenvectors $x$ associated with the eigenvalue $\lambda = 1$ , each satisfying $Z^T x = 0$ . By orthogonality, the other eigenvectors satisfy $x = Zy$ for some vector $y \in \mathbb{R}^K$ . We get:
+
+$$
+A Z y = D Z y (1 - \lambda),
+$$
+
+so that
+
+$$
+\bar {A} y = \bar {D} y (1 - \lambda).
+$$
+
+Thus $y$ is a solution to the generalized eigenvalue problem (4).
+
+# 3 REGULARIZATION OF BLOCK MODELS
+
+Let $A$ be the adjacency matrix of some undirected graph. We consider a regularized version of the graph where an edge of weight $\alpha$ is added between all pairs of nodes, for some constant $\alpha > 0$ . The corresponding adjacency matrix is given by:
+
+$$
+A _ {\alpha} = A + \alpha J,
+$$
+
+where $J = 1_{n}1_{n}^{T}$ is the all-ones matrix of same dimension as $A$ . We denote by $D_{\alpha} = \mathrm{diag}(A_{\alpha}1_{n})$ the corresponding degree matrix and by $L_{\alpha} = D_{\alpha} - A_{\alpha}$ the Laplacian matrix.
+
+We first consider a simple block model where the graph consists of $K$ disjoint cliques of respective sizes $n_1 > n_2 > \dots > n_K$ nodes, with $n_K \geq 1$ . In this case, we have $A = ZZ^T$ , where $Z$ is the membership matrix.
+
+The objective of this section is to demonstrate that, in this setting, the $k$ -th dimension of the spectral embedding isolates the $k - 1$ largest cliques from the rest of the graph, for any $k \in \{2, \ldots, K\}$
+
+Lemma 1. Let $\lambda_1 \leq \lambda_2 \leq \ldots \leq \lambda_n$ be the eigenvalues associated with the generalized eigenvalue problem:
+
+$$
+L _ {\alpha} x = \lambda D _ {\alpha} x. \tag {6}
+$$
+
+We have $\lambda_1 = 0 < \lambda_2 \leq \ldots \leq \lambda_K < \lambda_{K+1} = \ldots = \lambda_n = 1$ .
+
+Proof. Since the Laplacian matrix $L_{\alpha}$ is positive semi-definite, all eigenvalues are non-negative (Chung, 1997). We know that the eigenvalue 0 has multiplicity 1 on observing that the regularized graph is connected. Now for any vector $x$ ,
+
+$$
+x ^ {T} A _ {\alpha} x = x ^ {T} A x + \alpha x ^ {T} J x = | | Z ^ {T} x | | ^ {2} + \alpha (1 _ {n} ^ {T} x) ^ {2} \geq 0,
+$$
+
+so that the matrix $A_{\alpha}$ is positive semi-definite. In view of (5), this shows that $\lambda \leq 1$ for any eigenvalue $\lambda$ . The proof then follows from Proposition 1, on observing that the eigenvalue 1 has multiplicity $n - K$ .
+
+Lemma 2. Let $x$ be a solution to the generalized eigenvalue problem (6) with $\lambda \in (0,1)$ . There exists some $s \in \{+1, -1\}$ such that for each node $i$ in block $j$ ,
+
+$$
+\mathrm {s i g n} (x _ {i}) = s \quad \Longleftrightarrow \quad n _ {j} \geq \alpha \frac {1 - \lambda}{\lambda} n.
+$$
+
+Proof. In view of Proposition 1, we have $x = Zy$ where $y$ is a solution to the generalized eigenvalue problem of the aggregate graph, with adjacency matrix:
+
+$$
+\bar {A} _ {\alpha} = Z ^ {T} A _ {\alpha} Z = Z ^ {T} (A + \alpha J) Z.
+$$
+
+Since $A = ZZ^T$ and $W = Z^T Z$ , we have $\bar{A}_{\alpha} = W^{2} + \alpha Z^{T}JZ$ . Using the fact that $Z1_{K} = 1_{n}$ we get $J = 1_{n}1_{n}^{T} = ZJ_{K}Z^{T}$ with $J_{K} = 1_{K}1_{K}^{T}$ the all-ones matrix of dimension $K\times K$ , so that:
+
+$$
+\bar {A} _ {\alpha} = W \left(I _ {K} + \alpha J _ {K}\right) W,
+$$
+
+where $I_K$ is the identity matrix of dimension $K \times K$ . We deduce the degree matrix:
+
+$$
+\bar {D} _ {\alpha} = W (W + \alpha n I _ {K}),
+$$
+
+and the Laplacian matrix:
+
+$$
+\bar {L} _ {\alpha} = \bar {D} _ {\alpha} - \bar {A} _ {\alpha} = \alpha W (n I _ {K} - J _ {K} W).
+$$
+
+The generalized eigenvalue problem associated with the aggregate graph is:
+
+$$
+\bar {L} _ {\alpha} y = \lambda \bar {D} _ {\alpha} y.
+$$
+
+After multiplication by $W^{-1}$ , we get:
+
+$$
+\alpha (n I _ {K} - J _ {K} W) y = \lambda (W + \alpha n I _ {K}) y.
+$$
+
+Observing that $J_{K}Wy = 1_{K}1_{K}^{T}Wy = (1_{K}^{T}Wy)1_{K}\propto 1_{K}$ , we conclude that:
+
+$$
+(\alpha n (1 - \lambda) - \lambda W) y \propto 1 _ {K}, \tag {7}
+$$
+
+and since $W = \mathrm{diag}(n_1,\ldots ,n_K)$
+
+$$
+\forall j = 1, \dots , K, \quad y _ {j} \propto \frac {1}{\lambda n _ {j} - \alpha (1 - \lambda) n}. \tag {8}
+$$
+
+The result then follows from the fact that $x = Zy$ .
+
+Lemma 3. The $K$ smallest eigenvalues satisfy:
+
+$$
+0 = \lambda_ {1} < \mu_ {1} < \lambda_ {2} < \mu_ {2} < \dots < \lambda_ {K} < \mu_ {K},
+$$
+
+where for all $j = 1,\ldots ,K$
+
+$$
+\mu_ {j} = \frac {\alpha n}{\alpha n + n _ {j}}.
+$$
+
+Proof. We know from Lemma 1 that the $K$ smallest eigenvalues are in $[0,1)$ . Let $x$ be a solution to the generalized eigenvalue problem (6) with $\lambda \in (0,1)$ . We know that $x = Zy$ where $y$ is an eigenvector associated with the same eigenvalue $\lambda$ for the aggregate graph. Since $1_K$ is an eigenvector for the eigenvalue 0, we have $y^T\bar{D}_\alpha 1_K = 0$ . Using the fact that $\bar{D}_{\alpha} = W(W + \alpha nI_K)$ , we get:
+
+$$
+\sum_ {j = 1} ^ {K} n _ {j} (n _ {j} + \alpha n) y _ {j} = 0.
+$$
+
+We then deduce from (7) and (8) that $\lambda \notin \{\mu_1,\dots ,\mu_K\}$ and
+
+$$
+\sum_ {j = 1} ^ {K} n _ {j} \left(n _ {j} + \alpha n\right) \frac {1}{\lambda / \mu_ {j} - 1} = 0.
+$$
+
+This condition cannot be satisfied if $\lambda < \mu_1$ or $\lambda > \mu_K$ as the terms of the sum would be either all positive or all negative.
+
+Now let $y^\prime$ be another eigenvector for the aggregate graph, with $y^{T}\bar{D}_{\alpha}y^{\prime} = 0$ , for the eigenvalue $\lambda^{\prime}\in (0,1)$ . By the same argument, we get:
+
+$$
+\sum_ {j = 1} ^ {K} n _ {j} \left(n _ {j} + \alpha n\right) y _ {j} y _ {j} ^ {\prime} = 0,
+$$
+
+and
+
+$$
+\sum_ {j = 1} ^ {K} n _ {j} (n _ {j} + \alpha n) \frac {1}{\lambda / \mu_ {j} - 1} \frac {1}{\lambda^ {\prime} / \mu_ {j} - 1} = 0.
+$$
+
+with $\lambda' \notin \{\mu_1, \dots, \mu_K\}$ . This condition cannot be satisfied if $\lambda$ and $\lambda'$ are in the same interval $(\mu_j, \mu_{j+1})$ for some $j$ as the terms in the sum would be all positive. There are $K-1$ eigenvalues in $(0,1)$ for $K-1$ such intervals, that is one eigenvalue per interval.
+
+The main result of the paper is the following, showing that the $k - 1$ largest cliques of the original graph can be recovered from the spectral embedding of the regularized graph in dimension $k$ .
+
+Theorem 1. Let $X$ be the spectral embedding of dimension $k$ , as defined by (2), for some $k$ in the set $\{2, \ldots, K\}$ . Then $\operatorname{sign}(X)$ gives the $k - 1$ largest blocks of the graph.
+
+Proof. Let $x$ be the $j$ -th column of the matrix $X$ , for some $j \in \{2, \ldots, k\}$ . In view of Lemma 3, this is the eigenvector associated with eigenvalue $\lambda_j \in (\mu_{j-1}, \mu_j)$ , so that
+
+$$
+\alpha \frac {1 - \lambda_ {j}}{\lambda_ {j}} n \in (n _ {j - 1}, n _ {j}).
+$$
+
+In view of Lemma 2, all entries of $x$ corresponding to blocks of size $n_1, n_2, \ldots, n_{j-1}$ have the same sign, the other having the opposite sign.
+
+Theorem 1 can be extended in several ways. First, the assumption of distinct block sizes can easily be relaxed. If there are $L$ distinct values of block sizes, say $m_1, \ldots, m_L$ blocks of sizes $n_1 > \ldots > n_L$ , there are $L$ distinct values for the thresholds $\mu_j$ and thus $L$ distinct values for the eigenvalues $\lambda_j$ in [0, 1), the multiplicity of the $j$ -th smallest eigenvalue being equal to $m_j$ . The spectral embedding in dimension $k$ still gives $k - 1$ cliques of the largest sizes.
+
+Second, the graph may have edges between blocks. Taking $A = ZZ^T + \varepsilon J$ for instance, for some parameter $\varepsilon \geq 0$ , the results are exactly the same, with $\alpha$ replaced by $\epsilon + \alpha$ . A key observation is that regularization really matters when $\varepsilon \to 0$ , in which case the initial graph becomes disconnected and, in the absence of regularization, the spectral embedding may isolate small connected components of the graph. In particular, the regularization makes the spectral embedding much less sensitive to noise, as will be demonstrated in the experiments.
+
+Finally, degree correction can be added by varying the node degrees within blocks. Taking $A = \theta ZZ^T\theta$ , for some arbitrary diagonal matrix $\theta$ with positive entries, similar results can be obtained under the regularization $A_{\alpha} = A + \alpha \theta J\theta$ . Interestingly, the spectral embedding in dimension $k$ then recovers the $k - 1$ largest blocks in terms of normalized weight, the ratio of the total weight of the block to the number of nodes in the block.
+
+# 4 REGULARIZATION OF BIPARTITE GRAPHS
+
+Let $B = \mathbb{R}_+^{n\times m}$ be the biadjacency matrix of some bipartite graph with respectively $n, m$ nodes in each part, i.e., $B_{ij} > 0$ if and only if there is an edge between node $i$ in the first part of the graph and node $j$ in the second part of the graph, with weight $B_{ij}$ . This is an undirected graph of $n + m$ nodes with adjacency matrix:
+
+$$
+A = \left[ \begin{array}{c c} 0 & B \\ B ^ {T} & 0 \end{array} \right]
+$$
+
+The spectral embedding of the graph (2) can be written in terms of the biadjacency matrix as follows:
+
+$$
+\left\{ \begin{array}{l} B X _ {2} = D _ {1} X _ {1} (I - \Lambda) \\ B ^ {T} X _ {1} = D _ {2} X _ {2} (I - \Lambda) \end{array} \right. \tag {9}
+$$
+
+where $X_{1}, X_{2}$ are the embeddings of each part of the graph, with respective dimensions $n \times k$ and $m \times k$ , $D_{1} = \mathrm{diag}(B1_{m})$ and $D_{2} = \mathrm{diag}(B^{T}1_{n})$ . In particular, the spectral embedding of the graph follows from the generalized SVD of the biadjacency matrix $B$ .
+
+The complete regularization adds edges between all pairs of nodes, breaking the bipartite structure of the graph. Another approach consists in applying the regularization to the biadjacency matrix, i.e., in considering the regularized bipartite graph with biadjacency matrix:
+
+$$
+B _ {\alpha} = B + \alpha J,
+$$
+
+where $J = 1_{n}1_{m}^{T}$ is here the all-ones matrix of same dimension as $B$ . The spectral embedding of the regularized graph is that associated with the adjacency matrix:
+
+$$
+A _ {\alpha} = \left[ \begin{array}{l l} 0 & B _ {\alpha} \\ B _ {\alpha} ^ {T} & 0 \end{array} \right] \tag {10}
+$$
+
+As in Section 3, we consider a block model so that the biadjacency matrix $B$ is block-diagonal with all-ones block matrices on the diagonal. Each part of the graph consists of $K$ groups of nodes of respective sizes $n_1 > \ldots > n_K$ and $m_1 > \ldots > m_K$ , with nodes of block $j$ in the first part connected only to nodes of block $j$ in the second part, for all $j = 1, \ldots, K$ .
+
+We consider the generalized eigenvalue problem (6) associated with the above matrix $A_{\alpha}$ . In view of (9), this is equivalent to the generalized SVD of the regularized biadjacency matrix $B_{\alpha}$ . We have the following results, whose proofs are deferred to the appendix:
+
+Lemma 4. Let $\lambda_1 \leq \lambda_2 \leq \ldots \leq \lambda_n$ be the eigenvalues associated with the generalized eigenvalue problem (6). We have $\lambda_1 = 0 < \lambda_2 \leq \ldots \leq \lambda_K < \lambda_{K+1} = \ldots = \lambda_{n-2K} < \ldots < \lambda_n = 2$ .
+
+Lemma 5. Let $x$ be a solution to the generalized eigenvalue problem (6) with $\lambda \in (0,1)$ . There exists $s_1, s_2 \in \{+1, -1\}$ such that for each node $i$ in block $j$ of part $p \in \{1,2\}$ ,
+
+$$
+\operatorname {s i g n} (x _ {i}) = s _ {p} \quad \Longleftrightarrow \quad \frac {n _ {j} m _ {j}}{(n _ {j} + \alpha n) (m _ {j} + \alpha m)} \geq 1 - \lambda .
+$$
+
+Lemma 6. The $K$ smallest eigenvalues satisfy:
+
+$$
+0 = \lambda_ {1} < \mu_ {1} < \lambda_ {2} < \mu_ {2} < \dots < \lambda_ {K} < \mu_ {K},
+$$
+
+where for all $j = 1,\ldots ,K$
+
+$$
+\mu_ {j} = 1 - \frac {n _ {j} m _ {j}}{(n _ {j} + \alpha n) (m _ {j} + \alpha m)}.
+$$
+
+Theorem 2. Let $X$ be the spectral embedding of dimension $k$ , as defined by (2), for some $k$ in the set $\{2, \ldots, K\}$ . Then $\operatorname{sign}(X)$ gives the $k - 1$ largest blocks of each part of the graph.
+
+Like Theorem 1, the assumption of decreasing block sizes can easily be relaxed. Assume that block pairs are indexed in decreasing order of $\mu_{j}$ . Then the spectral embedding of dimension $k$ gives the $k - 1$ first block pairs for that order. It is interesting to notice that the order now depends on $\alpha$ : when $\alpha \to 0^{+}$ , the block pairs $j$ of highest value $\left(\frac{n}{n_j} + \frac{m}{m_j}\right)^{-1}$ (equivalently, highest harmonic mean of proportions of nodes in each part of the graph) are isolated first; when $\alpha \to +\infty$ , the block pairs $j$ of highest value $\frac{n_j m_j}{nm}$ (equivalently, the highest geometric mean of proportions of nodes in each part of the graph) are isolated first.
+
+The results also extend to non-block diagonal biadjacency matrices $B$ and degree-corrected models, as for Theorem 1.
+
+# 5 EXPERIMENTS
+
+We now illustrate the impact of regularization on the quality of spectral embedding. We focus on a clustering task, using both synthetic and real datasets where the ground-truth clusters are known. In all experiments, we skip the first dimension of the spectral embedding as it is not informative (the corresponding eigenvector is the all-ones vector, up to some multiplicative constant). The code to reproduce these experiments is available online1.
+
+# 5.1 TOY GRAPH
+
+We first illustrate the theoretical results of the paper with a toy graph consisting of 3 cliques of respective sizes 5, 3, 2. We compute the spectral embeddings in dimension 1, using the second smallest eigenvalue. Denoting by $Z$ the membership matrix, we get $X \approx Z(-0.08, 0.11, 0.05)^T$ for $\alpha = 1$ , showing that the embedding isolates the largest cluster; this is not the case in the absence of regularization, where $X \approx Z(0.1, -0.1, 0.41)^T$ .
+
+# 5.2 DATASETS
+
+This section describes the datasets used in our experiments. All graphs are considered as undirected. Table 1 presents the main features of the graphs.
+
+Stochastic Block-Model (SBM) We generate 100 instances of the same stochastic block model (Holland et al., 1983). There are 100 blocks of size 20, with intra-block edge probability set to 0.5 for the first 50 blocks and 0.05 for the other blocks. The inter-block edge probability is set to 0.001. Other sets of parameters can be tested using the code available online. The ground-truth cluster of each node corresponds to its block.
+
+20newsgroup (NG) This dataset consists of around 18000 newsgroups posts on 20 topics. This defines a weighted bipartite graph between documents and words. The label of each document corresponds to the topic.
+
+Wikipedia for Schools (WS) (Haruechaiyasak & Damrongrat, 2008). This is the graph of hyperlinks between a subset of Wikipedia pages. The label of each page is its category (e.g., countries, mammals, physics).
+
+Table 1: Main features of the graphs.
+
+| dataset | SBM | NG | WS |
| # nodes (n) | 2000 | 10723 | 4591 |
| # edges | ≈ 5.103 | ≈ 2.106 | ≈ 2.105 |
| # clusters in ground truth | 100 | 20 | 14 |
+
+# 5.3 METRICS
+
+We consider a large set of metrics from the clustering literature. All metrics are upper-bounded by 1 and the higher the score the better.
+
+Homogeneity (H), Completeness (C) and V-measure score (V) (Rosenberg & Hirschberg, 2007). Supervised metrics. A cluster is homogeneous if all its data points are members of a single class in the ground truth. A clustering is complete if all the members of a class in the ground truth belong to the same cluster in the prediction. Harmonic mean of homogeneity and completeness.
+
+Adjusted Rand Index (ARI) (Hubert & Arabie, 1985). Supervised metric. This is the corrected for chance version of the Rand Index which is itself an accuracy on pairs of samples.
+
+Adjusted Mutual Information (AMI) (Vinh et al., 2010) Supervised metric. Adjusted for chance version of the mutual information.
+
+Fowlkes-Mallows Index (FMI) (Fowlkes & Mallows, 1983). Supervised metric. Geometric mean between precision and recall on the edge classification task, as described for the ARI.
+
+Modularity (Q) (Newman, 2006). Unsupervised metric. Fraction of edges within clusters compared to that is some null model where edges are shuffled at random.
+
+Normalized Standard Deviation (NSD) Unsupervised metric. 1 minus normalized standard deviation in cluster size.
+
+# 5.4 EXPERIMENTAL SETUP
+
+All graphs are embedded in dimension 20, with different regularization parameters. To compare the impact of this parameter across different datasets, we use a relative regularization parameter $(w / n^2)\alpha$ , where $w = 1_n^T A1_n$ is the total weight of the graph.
+
+We use the K-Means algorithm with to cluster the nodes in the embedding space. The parameter $K$ is set to the ground-truth number of clusters (other experiments with different values of $K$ are reported in the Appendix). We use the Scikit-learn (Pedregosa et al., 2011) implementation of K-Means and the metrics, when available. The spectral embedding and the modularity are computed with the Scikit-network package, see the documentation for more details2.
+
+# 5.5 RESULTS
+
+We report the results in Table 2 for relative regularization parameter $\alpha = 0, 0.1, 1, 10$ . We see that the regularization generally improves performance, the optimal value of $\alpha$ depending on both the dataset and the score function. As suggested by Lemma 3, the optimal value of the regularization parameter should depend on the distribution of cluster sizes, on which we do not have any prior knowledge.
+
+To test the impact of noise on the spectral embedding, we add isolated nodes with self loop to the graph and compare the clustering performance with and without regularization. The number of isolated nodes is given as a fraction of the initial number of nodes in the graph. Scores are computed only on the initial nodes. The results are reported in Table 3 for the Wikipedia for Schools dataset. We observe that, in the absence of regularization, the scores drop even with only $1\%$ noise. The computed clustering is a trivial partition with all initial nodes in the same cluster. This means that the 20 first dimensions of the spectral embedding focus on the isolated nodes. On the other hand, the scores remain approximately constant in the regularized case, which suggests that regularization makes the embedding robust to this type of noise.
+
+Table 2: Impact of regularization on clustering performance.
+SBM
+
+| α | H | C | V | ARI | AMI | FMI | Q | NSD |
| 0 | 0.19 | 0.27 | 0.22 | 0.0 | 0.01 | 0.03 | 0.45 | 0.76 |
| 0.1 | 0.33 | 0.35 | 0.34 | 0.0 | 0.01 | 0.01 | 0.52 | 0.91 |
| 1 | 0.36 | 0.37 | 0.36 | 0.0 | 0.01 | 0.01 | 0.50 | 0.92 |
| 10 | 0.28 | 0.34 | 0.30 | 0.0 | 0.00 | 0.02 | 0.36 | 0.78 |
+
+NG
+
+| α | H | C | V | ARI | AMI | FMI | Q | NSD |
| 0 | 0.40 | 0.70 | 0.51 | 0.19 | 0.50 | 0.34 | 0.21 | 0.55 |
| 0.1 | 0.44 | 0.70 | 0.54 | 0.22 | 0.54 | 0.35 | 0.21 | 0.59 |
| 1 | 0.46 | 0.67 | 0.54 | 0.20 | 0.54 | 0.33 | 0.20 | 0.60 |
| 10 | 0.37 | 0.55 | 0.45 | 0.13 | 0.44 | 0.26 | 0.17 | 0.56 |
+
+WS
+
+| α | H | C | V | ARI | AMI | FMI | Q | NSD |
| 0 | 0.23 | 0.29 | 0.25 | 0.05 | 0.25 | 0.26 | 0.25 | 0.49 |
| 0.1 | 0.26 | 0.29 | 0.28 | 0.10 | 0.27 | 0.26 | 0.29 | 0.61 |
| 1 | 0.23 | 0.24 | 0.23 | 0.04 | 0.23 | 0.20 | 0.30 | 0.65 |
| 10 | 0.19 | 0.22 | 0.20 | 0.00 | 0.19 | 0.20 | 0.23 | 0.53 |
+
+Table 3: Impact of noise on clustering performance (WS dataset).
+$\alpha = 0$
+
+| noise | H | C | V | ARI | AMI | FMI | Q | std |
| 0 % | 0.23 | 0.29 | 0.25 | 0.05 | 0.25 | 0.26 | 0.25 | 0.49 |
| 1 % | 0.00 | 0.49 | 0.00 | 0.00 | 0.00 | 0.39 | 0.00 | 0 |
| 5 % | 0.00 | 0.49 | 0.00 | 0.00 | 0.00 | 0.39 | 0.00 | 0 |
| 10 % | 0.00 | 0.49 | 0.00 | 0.00 | 0.00 | 0.39 | 0.00 | 0 |
+
+$\alpha = 1$
+
+| noise | H | C | V | ARI | AMI | FMI | Q | std |
| 0 % | 0.23 | 0.24 | 0.23 | 0.04 | 0.23 | 0.2 | 0.3 | 0.65 |
| 1 % | 0.24 | 0.24 | 0.24 | 0.04 | 0.23 | 0.2 | 0.3 | 0.66 |
| 5 % | 0.23 | 0.23 | 0.23 | 0.05 | 0.22 | 0.2 | 0.3 | 0.67 |
| 10 % | 0.24 | 0.23 | 0.23 | 0.05 | 0.23 | 0.2 | 0.3 | 0.67 |
+
+# 6 CONCLUSION AND PERSPECTIVES
+
+In this paper, we have provided a simple explanation for the well-known benefits of regularization on spectral embedding. Specifically, regularization forces the embedding to focus on the largest clusters, making the embedding more robust to noise. This result was obtained through the explicit characterization of the embedding for a simple block model, and extended to bipartite graphs.
+
+An interesting perspective of our work is the extension to stochastic block models, using for instance the concentration results proved in (Lei et al., 2015; Le et al., 2017). Another problem of interest is the impact of regularization on other downstream tasks, like link prediction. Finally, we would like to further explore the impact of the regularization parameter, exploiting the theoretical results presented in this paper.
+
+# REFERENCES
+
+Arash A Amini, Aiyou Chen, Peter J Bickel, Elizaveta Levina, et al. Pseudo-likelihood methods for community detection in large sparse networks. The Annals of Statistics, 41(4):2097-2122, 2013.
+Mikhail Belkin and Partha Niyogi. Laplacian eigenmaps and spectral techniques for embedding and clustering. In Advances in neural information processing systems, pp. 585-591, 2002.
+Thomas Bonald, Alexandre Hollocou, and Marc Lelarge. Weighted spectral embedding of graphs. In 2018 56th Annual Allerton Conference on Communication, Control, and Computing (Allerton), pp. 494-501. IEEE, 2018.
+Kamalika Chaudhuri, Fan Chung, and Alexander Tsiatas. Spectral clustering of graphs with general degrees in the extended planted partition model. In Conference on Learning Theory, pp. 35-1, 2012.
+Fan RK Chung. Spectral graph theory. American Mathematical Soc., 1997.
+Edward B Fowlkes and Colin L Mallows. A method for comparing two hierarchical clusterings. Journal of the American statistical association, 78(383):553-569, 1983.
+Choochart Haruechaiyasak and Chaianun Damrongrat. Article recommendation based on a topic model for wikipedia selection for schools. In International Conference on Asian Digital Libraries, pp. 339-342. Springer, 2008.
+Paul W Holland, Kathryn Blackmond Laskey, and Samuel Leinhardt. Stochastic blockmodels: First steps. Social networks, 5(2):109-137, 1983.
+Lawrence Hubert and Phipps Arabie. Comparing partitions. Journal of classification, 2(1):193-218, 1985.
+Antony Joseph, Bin Yu, et al. Impact of regularization on spectral clustering. The Annals of Statistics, 44(4):1765-1791, 2016.
+Nathan De Lara. The sparse + low rank trick for matrix factorization-based graph algorithms. In Proceedings of the 15th International Workshop on Mining and Learning with Graphs (MLG), 2019.
+Can M Le, Elizaveta Levina, and Roman Vershynin. Concentration and regularization of random graphs. *Random Structures & Algorithms*, 51(3):538-561, 2017.
+Jing Lei, Alessandro Rinaldo, et al. Consistency of spectral clustering in stochastic block models. The Annals of Statistics, 43(1):215-237, 2015.
+Ulrike Luxburg. A tutorial on spectral clustering. Statistics and Computing, 17(4):395-416, December 2007. ISSN 0960-3174. doi: 10.1007/s11222-007-9033-z. URL http://dx.doi.org/10.1007/s11222-007-9033-z.
+Mark EJ Newman. Modularity and community structure in networks. Proceedings of the national academy of sciences, 103(23):8577-8582, 2006.
+Andrew Y Ng, Michael I Jordan, and Yair Weiss. On spectral clustering: Analysis and an algorithm. In Advances in neural information processing systems, pp. 849-856, 2002.
+F. Pedregosa, G. Varoquaux, A. Gramfort, V. Michel, B. Thirion, O. Grisel, M. Blondel, P. Prettenhofer, R. Weiss, V. Dubourg, J. Vanderplas, A. Passos, D. Cournaepau, M. Brucher, M. Perrot, and E. Duchesnay. Scikit-learn: Machine learning in Python. Journal of Machine Learning Research, 12:2825-2830, 2011.
+Tai Qin and Karl Rohe. Regularized spectral clustering under the degree-corrected stochastic block-model. In Advances in Neural Information Processing Systems, pp. 3120-3128, 2013.
+Andrew Rosenberg and Julia Hirschberg. V-measure: A conditional entropy-based external cluster evaluation measure. In Proceedings of the 2007 joint conference on empirical methods in natural language processing and computational natural language learning (EMNLP-CoNLL), pp. 410-420, 2007.
+
+P Snell and Peter Doyle. Random walks and electric networks. Free Software Foundation, 2000.
+
+Daniel A Spielman. Spectral graph theory and its applications. In Foundations of Computer Science, 2007. FOCS'07. 48th Annual IEEE Symposium on, pp. 29-38. IEEE, 2007.
+
+Nguyen Xuan Vinh, Julien Epps, and James Bailey. Information theoretic measures for clusterings comparison: Variants, properties, normalization and correction for chance. Journal of Machine Learning Research, 11(Oct):2837-2854, 2010.
+
+Yilin Zhang and Karl Rohe. Understanding regularized spectral clustering via graph conductance. In Advances in Neural Information Processing Systems, pp. 10631-10640, 2018.
+
+# APPENDIX
+
+We provide of proof of Theorem 2 as well as a complete set of experimental results.
+
+# A REGULARIZATION OF BIPARTITE GRAPHS
+
+The proof of Theorem 2 follows the same workflow as that of Theorem 1. Let $Z_{1} \in \mathbb{R}^{n \times K}$ and $Z_{2} \in \mathbb{R}^{m \times K}$ be the left and right membership matrices for the block matrix $B \in \mathbb{R}^{n \times m}$ . The aggregated matrix is $\bar{B} = Z_{1}^{T} B Z_{2} \in \mathbb{R}^{K \times K}$ . The diagonal matrices of block sizes are $W_{1} = Z_{1}^{T} Z_{1}$ and $W_{2} = Z_{2}^{T} Z_{2}$ . We have the equivalent of Proposition 1:
+
+Proposition 2. Let $x_{1}, x_{2}$ be a solution to the generalized singular value problem:
+
+$$
+\left\{ \begin{array}{l} B x _ {2} = \sigma D _ {1} x _ {1} \\ B ^ {T} x _ {1} = \sigma D _ {2} x _ {2} \end{array} \right.
+$$
+
+Then either $Z_1^T x_1 = Z_2^T x_2 = 0$ and $\sigma = 0$ or $x_1 = Z_1 y_1$ and $x_2 = Z_2 y_2$ where $y_1, y_2$ is a solution to the generalized singular value problem:
+
+$$
+\left\{ \begin{array}{l} \bar {B} y _ {2} = \sigma \bar {D} _ {1} y _ {1}, \\ \bar {B} ^ {T} y _ {1} = \sigma \bar {D} _ {2} y _ {2}. \end{array} \right.
+$$
+
+Proof. Since the rank of $B$ is equal to $K$ , there are $n - K$ pairs of singular vectors $(x_{1}, x_{2})$ associated with the singular values 0, each satisfying $Z_{1}^{T}x_{1} = 0$ and $Z_{2}^{T}x_{2} = 0$ . By orthogonality, the other pairs of singular vectors satisfy $x_{1} = Z_{1}y_{1}$ and $x_{2} = Z_{2}y_{2}$ for some vectors $y_{1}, y_{2} \in \mathbb{R}^{K}$ . By replacing these in the original generalized singular value problem, we get that $(y_{1}, y_{2})$ is a solution to the generalized singular value problem for the aggregate graph.
+
+In the following, we focus on the block model described in Section 4, where $B = Z_{1}Z_{2}^{T}$ .
+
+Proof of Lemma 4. The generalized eigenvalue problem (6) associated with the regularized matrix $A_{\alpha}$ is equivalent to the generalized SVD of the regularized biadjacency matrix $B_{\alpha}$ :
+
+$$
+\left\{ \begin{array}{l l} B _ {\alpha} x _ {2} = \sigma D _ {\alpha , 1} x _ {1} \\ B _ {\alpha} ^ {T} x _ {1} = \sigma D _ {\alpha , 2} x _ {2}, \end{array} \right.
+$$
+
+with $\sigma = 1 - \lambda$
+
+In view of Proposition 2, the singular value $\sigma = 0$ has multiplicity $n - K$ , meaning that the eigenvalue $\lambda = 1$ has multiplicity $n - K$ . Since the graph is connected, the eigenvalue 0 has multiplicity 1. The proof then follows from the observation that if $(x_{1}, x_{2})$ is a pair of singular vectors for the singular value $\sigma$ , then the vectors $x = (x_{1}, \pm x_{2})^{T}$ are eigenvectors for the eigenvalues $1 - \sigma, 1 + \sigma$ .
+
+Proof of Lemma 5. By Proposition 2, we can focus on the generalized singular value problem for the aggregate graph:
+
+$$
+\left\{ \begin{array}{l} \bar {B} _ {\alpha} y _ {2} = \sigma \bar {D} _ {\alpha , 1} y _ {1} \\ \bar {B} _ {\alpha} ^ {T} y _ {1} = \sigma \bar {D} _ {\alpha , 2} y _ {2}, \end{array} \right.
+$$
+
+Since
+
+$$
+\bar {B} _ {\alpha} = W _ {1} (I _ {K} + \alpha J _ {K}) W _ {2},
+$$
+
+and
+
+$$
+\left\{ \begin{array}{l} \bar {D} _ {\alpha , 1} = W _ {1} (W _ {2} + \alpha n I), \\ \bar {D} _ {\alpha , 2} = W _ {2} (W _ {1} + \alpha m I), \end{array} \right.
+$$
+
+we have:
+
+$$
+\left\{ \begin{array}{l l} W _ {1} (I _ {K} + \alpha J _ {K}) W _ {2} y _ {2} = W _ {1} (W _ {2} + \alpha n I) y _ {1} \sigma , \\ W _ {2} (I _ {K} + \alpha J _ {K}) W _ {1} y _ {1} = W _ {2} (W _ {1} + \alpha m I) y _ {2} \sigma . \end{array} \right.
+$$
+
+Observing that $J_{K}W_{1}y_{1}\propto 1_{K}$ and $J_{K}W_{2}y_{2}\propto 1_{K}$ , we get:
+
+$$
+\left\{ \begin{array}{l l} (W _ {2} + \alpha m I _ {K}) y _ {1} \sigma - W _ {2} y _ {2} \propto 1 _ {K}, \\ (W _ {1} + \alpha n I _ {K}) y _ {2} \sigma - W _ {1} y _ {1} \propto 1 _ {K}. \end{array} \right.
+$$
+
+As two diagonal matrices commute, we obtain:
+
+$$
+\left\{ \begin{array}{l} (W _ {1} + \alpha n I _ {K}) (W _ {2} + \alpha m I _ {K}) y _ {1} \sigma - W _ {1} W _ {2} y _ {1} = \big (\eta_ {1} (W _ {1} + \alpha n I _ {K}) + \eta_ {2} W _ {2} \big) 1 _ {K}, \\ (W _ {1} + \alpha n I _ {K}) (W _ {2} + \alpha m I _ {K}) y _ {2} \sigma - W _ {1} W _ {2} y _ {2} = \big (\eta_ {1} W _ {1} + \eta_ {2} (W _ {2} + \alpha m I _ {K}) \big) 1 _ {K}, \end{array} \right.
+$$
+
+for some constants $\eta_1, \eta_2$ , and
+
+$$
+\left\{ \begin{array}{l} y _ {1, j} = \frac {\eta_ {1} (n _ {j} + \alpha n) + \eta_ {2} m _ {j}}{(n _ {j} + \alpha n) (m _ {j} + \alpha m) \sigma - n _ {j} m _ {j}}, \\ y _ {2, j} = \frac {\eta_ {1} n _ {j} + \eta_ {2} (m _ {j} + \alpha m)}{(n _ {j} + \alpha n) (m _ {j} + \alpha m) \sigma - n _ {j} m _ {j}}. \end{array} \right.
+$$
+
+Letting $s_1 = -\mathrm{sign}(\eta_1(n_j + \alpha n) + \eta_2m_j)$ and $s_2 = -\mathrm{sign}(\eta_1n_j + \eta_2(m_j + \alpha m))$ , we get:
+
+$$
+\operatorname {s i g n} (y _ {1, j}) = s _ {1} \quad \Longleftrightarrow \quad \operatorname {s i g n} (y _ {2, j}) = s _ {2} \quad \Longleftrightarrow \quad \frac {n _ {j} m _ {j}}{(n _ {j} + \alpha n) (m _ {j} + \alpha m)} \geq \sigma = 1 - \lambda ,
+$$
+
+and the result follows from the fact that $x_{1} = Z_{1}y_{1}$ and $x_{2} = Z_{2}y_{2}$ .
+
+Proof of Lemma 6. The proof is the same as that of Lemma 3, where the threshold values follow from Lemma 5:
+
+$$
+\mu_ {j} = 1 - \frac {n _ {j} m _ {j}}{(n _ {j} + \alpha n) (m _ {j} + \alpha m)}.
+$$
+
+Proof of Theorem 2. Let $x$ be the $j$ -th column of the matrix $X$ , for some $j \in \{2, \dots, k\}$ . In view of Lemma 6, this is the eigenvector associated with eigenvalue $\lambda_j \in (\mu_{j-1}, \mu_j)$ . In view of Lemma 4, all entries of $x$ corresponding to blocks of size $n_1, n_2, \dots, n_{j-1}$ have the same sign, the other having the opposite sign.
+
+# B EXPERIMENTAL RESULTS
+
+In this section, we present more extensive experimental results.
+
+Tables 4 and 5 present results for the same experiment as in Table 2 but for different values of $K$ , namely $K = 2$ (bisection of the graph) and $K = K_{\mathrm{truth}} / 2$ (half of the ground-truth value). As for $K = K_{\mathrm{true}}$ , regularization generally improves clustering performance. However, the optimal value of $\alpha$ remains both dataset dependent and metric dependent. Note that, for the NG and WS datasets, the clustering remains trivial in the case $K = 2$ , one cluster containing all the nodes, until a certain amount of regularization.
+
+Table 6 presents the different scores for both types of regularization on the NG dataset. As we can see, preserving the bipartite structure of the graph leads to slightly better performance.
+
+Finally, Table 7 shows the impact of regularization in the presence of noise for the NG dataset. The conclusions are similar as for the WS dataset: regularization makes the spectral embedding much more robust to noise.
+
+Table 4: Impact of regularization on clustering performance. $K = 2$
+SBM
+
+| α | H | C | V | ARI | AMI | FMI | Q | NSD |
| 0 | 0.00 | 0.43 | 0.00 | 0.0 | 0.0 | 0.10 | 0.00 | 0.01 |
| 0.1 | 0.00 | 0.47 | 0.00 | 0.0 | 0.0 | 0.10 | 0.00 | 0.00 |
| 1 | 0.01 | 0.04 | 0.01 | 0.0 | 0.0 | 0.07 | 0.34 | 0.83 |
| 10 | 0.01 | 0.09 | 0.01 | 0.0 | 0.0 | 0.09 | 0.13 | 0.22 |
+
+NG
+
+| α | H | C | V | ARI | AMI | FMI | Q | NSD |
| 0 | 0.00 | 0.36 | 0.00 | 0.00 | 0.00 | 0.23 | 0.00 | 0.00 |
| 0.1 | 0.00 | 0.36 | 0.00 | 0.00 | 0.00 | 0.23 | 0.00 | 0.00 |
| 1 | 0.15 | 0.72 | 0.25 | 0.06 | 0.25 | 0.28 | 0.16 | 0.63 |
| 10 | 0.12 | 0.61 | 0.20 | 0.04 | 0.20 | 0.26 | 0.13 | 0.51 |
+
+WS
+
+| α | H | C | V | ARI | AMI | FMI | Q | NSD |
| 0 | 0.00 | 0.49 | 0.00 | 0.00 | 0.00 | 0.39 | 0.00 | 0.00 |
| 0.1 | 0.07 | 0.42 | 0.13 | 0.00 | 0.12 | 0.34 | 0.09 | 0.26 |
| 1 | 0.03 | 0.27 | 0.05 | -0.01 | 0.05 | 0.35 | 0.09 | 0.13 |
| 10 | 0.02 | 0.16 | 0.04 | -0.02 | 0.03 | 0.34 | 0.10 | 0.16 |
+
+Table 5: Impact of regularization on clustering performance. $K = {K}_{\text{true }}/2$ .
+SBM
+
+| α | H | C | V | ARI | AMI | FMI | Q | NSD |
| 0 | 0.08 | 0.21 | 0.11 | 0.0 | 0.00 | 0.05 | 0.41 | 0.47 |
| 0.1 | 0.20 | 0.27 | 0.23 | 0.0 | 0.01 | 0.02 | 0.55 | 0.84 |
| 1 | 0.24 | 0.29 | 0.26 | 0.0 | 0.00 | 0.02 | 0.54 | 0.90 |
| 10 | 0.19 | 0.28 | 0.23 | 0.0 | 0.00 | 0.03 | 0.40 | 0.70 |
+
+NG
+
+| α | H | C | V | ARI | AMI | FMI | Q | NSD |
| 0 | 0.27 | 0.76 | 0.40 | 0.11 | 0.39 | 0.31 | 0.20 | 0.41 |
| 0.1 | 0.28 | 0.73 | 0.41 | 0.11 | 0.40 | 0.30 | 0.18 | 0.43 |
| 1 | 0.38 | 0.72 | 0.50 | 0.18 | 0.50 | 0.34 | 0.21 | 0.57 |
| 10 | 0.31 | 0.62 | 0.42 | 0.11 | 0.42 | 0.27 | 0.17 | 0.51 |
+
+WS
+
+| α | H | C | V | ARI | AMI | FMI | Q | NSD |
| 0 | 0.23 | 0.29 | 0.25 | 0.05 | 0.25 | 0.26 | 0.25 | 0.49 |
| 0.1 | 0.26 | 0.29 | 0.28 | 0.10 | 0.27 | 0.26 | 0.29 | 0.61 |
| 1 | 0.23 | 0.24 | 0.23 | 0.04 | 0.23 | 0.20 | 0.30 | 0.65 |
| 10 | 0.19 | 0.22 | 0.20 | -0.00 | 0.19 | 0.20 | 0.23 | 0.53 |
+
+Table 6: Regularization of the adjacency vs. biadjacency matrix on the NG dataset $(\alpha = 1)$
+$K = K_{\mathrm{true}} / 2$
+
+ | H | C | V | ARI | AMI | FMI | Q | std |
| Adj. | 0.38 | 0.72 | 0.50 | 0.18 | 0.50 | 0.34 | 0.21 | 0.57 |
| Biadj. | 0.41 | 0.72 | 0.52 | 0.19 | 0.52 | 0.35 | 0.21 | 0.61 |
+
+$K = K_{\mathrm{true}}$
+
+ | H | C | V | ARI | AMI | FMI | Q | std |
| Adj. | 0.46 | 0.67 | 0.54 | 0.20 | 0.54 | 0.33 | 0.2 | 0.60 |
| Biadj. | 0.47 | 0.68 | 0.56 | 0.21 | 0.55 | 0.34 | 0.2 | 0.61 |
+
+Table 7: Impact of noise on clustering performance (NG dataset).
+$\alpha = 0$
+
+| noise | H | C | V | ARI | AMI | FMI | Q | std |
| 0 % | 0.40 | 0.70 | 0.51 | 0.19 | 0.50 | 0.34 | 0.21 | 0.55 |
| 1 % | 0.00 | 1.00 | 0.00 | 0.00 | 0.00 | 0.23 | 0.00 | 0 |
| 5 % | 0.14 | 0.65 | 0.23 | 0.06 | 0.23 | 0.27 | 0.13 | 0.30 |
| 10 % | 0.00 | 0.36 | 0.01 | 0.00 | 0.00 | 0.23 | 0.00 | 0.00 |
+
+$\alpha = 1$
+
+| noise | H | C | V | ARI | AMI | FMI | Q | std |
| 0 % | 0.46 | 0.67 | 0.54 | 0.20 | 0.54 | 0.33 | 0.2 | 0.60 |
| 1 % | 0.48 | 0.66 | 0.56 | 0.21 | 0.56 | 0.33 | 0.2 | 0.64 |
| 5 % | 0.49 | 0.66 | 0.56 | 0.23 | 0.56 | 0.34 | 0.2 | 0.66 |
| 10 % | 0.45 | 0.66 | 0.54 | 0.20 | 0.54 | 0.33 | 0.2 | 0.59 |
\ No newline at end of file
diff --git a/spectralembeddingofregularizedblockmodels/images.zip b/spectralembeddingofregularizedblockmodels/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..67bbe4c37180a33e137c444fc3657639bac70f7f
--- /dev/null
+++ b/spectralembeddingofregularizedblockmodels/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:daeb1a302d27c992e566bc7d40bb3db2c9083a0d42e7aae6813a30e22769b2fc
+size 585471
diff --git a/spectralembeddingofregularizedblockmodels/layout.json b/spectralembeddingofregularizedblockmodels/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..5e755b9239896cd906b366507757ebc6a13abce9
--- /dev/null
+++ b/spectralembeddingofregularizedblockmodels/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d6340a13956a0ac293f1f55fd6aea9f44b3f3eb5d91691d7d0bb7c9284c96b86
+size 610679
diff --git a/stableranknormalizationforimprovedgeneralizationinneuralnetworksandgans/1578383e-0ad6-4a63-9a2d-dae7e17b1382_content_list.json b/stableranknormalizationforimprovedgeneralizationinneuralnetworksandgans/1578383e-0ad6-4a63-9a2d-dae7e17b1382_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..35d4ecf853591d2da093f66a41cc20d5c63cdf22
--- /dev/null
+++ b/stableranknormalizationforimprovedgeneralizationinneuralnetworksandgans/1578383e-0ad6-4a63-9a2d-dae7e17b1382_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:70f964b1192b214b3d6599294167ca5fcb3a74e41a2e138d232ac6908c51c17a
+size 194539
diff --git a/stableranknormalizationforimprovedgeneralizationinneuralnetworksandgans/1578383e-0ad6-4a63-9a2d-dae7e17b1382_model.json b/stableranknormalizationforimprovedgeneralizationinneuralnetworksandgans/1578383e-0ad6-4a63-9a2d-dae7e17b1382_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..e2f7a27f384b43971da85658fcafd6a21935cac8
--- /dev/null
+++ b/stableranknormalizationforimprovedgeneralizationinneuralnetworksandgans/1578383e-0ad6-4a63-9a2d-dae7e17b1382_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:8c35de06eb348a33b682a776d9b45776f0cf010fb056be71e1df71ac94e42874
+size 235685
diff --git a/stableranknormalizationforimprovedgeneralizationinneuralnetworksandgans/1578383e-0ad6-4a63-9a2d-dae7e17b1382_origin.pdf b/stableranknormalizationforimprovedgeneralizationinneuralnetworksandgans/1578383e-0ad6-4a63-9a2d-dae7e17b1382_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..1d54a7a3d3b716077b9ab3acee4877b53e0df16b
--- /dev/null
+++ b/stableranknormalizationforimprovedgeneralizationinneuralnetworksandgans/1578383e-0ad6-4a63-9a2d-dae7e17b1382_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:9d710dbbb23a42e1e48acec2accea7551cf90ed518356a6337c9190197301a9c
+size 20617369
diff --git a/stableranknormalizationforimprovedgeneralizationinneuralnetworksandgans/full.md b/stableranknormalizationforimprovedgeneralizationinneuralnetworksandgans/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..6e34778e956fd55be4e19fc4b65f0d7223d04447
--- /dev/null
+++ b/stableranknormalizationforimprovedgeneralizationinneuralnetworksandgans/full.md
@@ -0,0 +1,908 @@
+# STABLE RANK NORMALIZATION FOR IMPROVED GENERALIZATION IN NEURAL NETWORKS AND GANS
+
+Amartya Sanyal
+
+Department of Computer Science
+
+University of Oxford,
+
+The Alan Turing Institute
+
+amartya.sanyal@cs.ox.ac.uk
+
+Philip H. Torr
+
+Department of Engineering Science
+
+University of Oxford
+
+philip.torr@eng.ox.ac.uk
+
+Puneet K. Dokania
+
+Department of Engineering Science
+
+University of Oxford
+
+puneet@robots.ox.ac.uk
+
+# ABSTRACT
+
+Exciting new work on generalization bounds for neural networks (NN) given by Bartlett et al. (2017); Neyshabur et al. (2018) closely depend on two parameter-dependent quantities a) the Lipschitz constant upper bound and b) the stable rank (a softer version of rank). Even though these bounds typically have minimal practical utility, they facilitate questions on whether controlling such quantities together could improve the generalization behaviour of NNs in practice. To this end, we propose stable rank normalization (SRN), a novel, provably optimal, and computationally efficient weight-normalization scheme which minimizes the stable rank of a linear operator. Surprisingly we find that SRN, despite being non-convex, can be shown to have a unique optimal solution. We provide extensive analyses across a wide variety of NNs (DenseNet, WideResNet, ResNet, Alexnet, VGG), where applying SRN to their linear layers leads to improved classification accuracy, while simultaneously showing improvements in generalization, evaluated empirically using shattering experiments (Zhang et al., 2016); and three measures of sample complexity by Bartlett et al. (2017), Neyshabur et al. (2018), & Wei & Ma. Additionally, we show that, when applied to the discriminator of GANs, it improves Inception, FID, and Neural divergence scores, while learning mappings with a low empirical Lipschitz constant.
+
+# 1 INTRODUCTION
+
+Deep neural networks have shown astonishing ability in tackling a wide variety of machine learning problems including a great ability to generalize under extreme over-parameterization. Within this work we leverage very recent, and important, theoretical results on the generalization bounds of deep networks to yield a practical low cost method to normalize the weights within a network using a scheme - which we call Stable Rank Normalization (SRN). The motivation for SRN comes from the generalization bound for NNs given by Neyshabur et al. (2018) and Bartlett et al. (2017), $\mathcal{O}\sqrt{\prod_{i}^{d}\|\mathbf{W}_{i}\|_{2}^{2}\sum_{i = 1}^{d}\mathrm{srank}(\mathbf{W}_{i})}$ $^1$ , that depend on two parameter-dependent quantities: a) the scale-dependent Lipschitz constant upper-bound $\prod_{i}^{d}\| \mathbf{W}_{i}\|_{2}$ (product of spectral norms) and b) the sum of scale-independent stable ranks (srank(W)). Stable rank is a softer version of the rank operator and is defined as the squared ratio of the Frobenius norm to the spectral norm. Although these two terms appear frequently in these bounds, the empirical impact of simultaneously controlling them on the generalization behaviour of NNs has not been explored yet possibly because of the difficulties associated with optimizing stable rank. This is precisely the goal of this work and based on extensive experiments across a wide variety of NN architectures, we show that, indeed, controlling them
+
+simultaneously improves the generalization behaviour, while improving the classification performance of NNs. We observe improved training of Generative Adversarial Networks (GAN) Goodfellow et al. (2014) as well.
+
+To this end, we propose Stable Rank Normalization (SRN) which allows us to simultaneously control the Lipschitz constant and the stable rank of a linear operator. Note that the widely used Spectral Normalization (SN) (Miyato et al., 2018) allows explicit control over the Lipschitz constant, however, as will be discussed in the paper, it does not have any impact on the stable rank. We would like to emphasize that, as opposed to SN, the SRN solution is optimal and unique even in situations when it is non-convex. It is one of those rare cases where an optimal solution to a provably non-convex problem could be obtained. Computationally, our proposed SRN for NNs is no more complicated than SN, just requiring computation of the largest singular value which can be efficiently obtained using the power iteration method (Mises & Pollaczek-Geiringer, 1929).
+
+Experiments Although SRN is in principle applicable to any problem involving a sequence of affine transformations, considering recent interests, we show its effectiveness when applied to the linear layers of deep neural networks. We perform extensive experiments on a wide variety of NN architectures (DenseNet, WideResNet, ResNet, Alexnet, VGG) for the analyses and show that, SRN, while providing the best classification accuracy (compared against standard, or vanilla, training and SN), consistently shows improvement on the generalization behaviour. We also experiment with GANs and show that, SRN prefers learning discriminators with low empirical Lipschitz while providing improved Inception, FID and Neural Divergence scores (Gulrajani et al., 2019).
+
+We would like to note that although SN is being widely used for the training of GANs, its effect on the generalization behaviour over a wide variety of NNs has not yet been explored. To the best of our knowledge, we are the first to do so.
+
+# Contributions
+
+- We propose SRN—a novel normalization scheme for simultaneously controlling the Lipschitz constant and the stable rank of a linear operator.
+- Optimal and unique solution to the provably non-convex stable rank normalization problem.
+- Efficient and easy to implement SRN algorithm for NNs.
+
+# 2 BACKGROUND AND INTUITIONS
+
+Neural Networks Consider $f_{\theta} : \mathbb{R}^{m} \to \mathbb{R}^{k}$ to be a feed-forward multilayer NN parameterized by $\theta \in \mathbb{R}^n$ , each layer of which consists of a linear followed by a non-linear mapping. Let $\mathbf{a}_{l-1} \in \mathbb{R}^{n_{l-1}}$ be the input (or pre-activations) to the $l$ -th layer, then the output (or activations) of this layer is represented as $\mathbf{a}_l = \phi_l(\mathbf{z}_l)$ , where $\mathbf{z}_l = \mathbf{W}_l \mathbf{a}_{l-1} + \mathbf{b}_l$ is the output of the linear (affine) layer parameterized by the weights $\mathbf{W}_l \in \mathbb{R}^{n_{l-1} \times n_l}$ and biases $\mathbf{b}_l \in \mathbb{R}^{n_l}$ , and $\phi_l(.)$ is the element-wise non-linear function applied to $\mathbf{z}_l$ . For classification tasks, given a dataset with input-output pairs denoted as $(\mathbf{x} \in \mathbb{R}^m, \mathbf{y} \in \{0, 1\}^k; \sum_j y_j = 1)^3$ , the parameter vector $\theta$ is learned using back-propagation to optimize the classification loss (e.g., cross-entropy).
+
+Singular Value Decomposition (SVD) Given $\mathbf{W} \in \mathbb{R}^{s \times r}$ with rank $k \leq \min(s, r)$ , we denote $\{\sigma_i\}_{i=1}^k$ , $\{\mathbf{u}_i\}_{i=1}^k$ , and $\{\mathbf{v}_i\}_{i=1}^k$ as its singular values, left singular vectors, and right singular vectors, respectively. Throughout this work, a set of singular values is assumed to be sorted $\sigma_1 \geq \dots \geq \sigma_k$ . $\sigma_i(\mathbf{W})$ denotes the $i$ -th singular value of the matrix $\mathbf{W}$ . Using singular values, the matrix 2-norm $\| \mathbf{W} \|_2$ and the Frobenius norm $\| \mathbf{W} \|_{\mathrm{F}}$ can be computed as $\sigma_1$ and $\sqrt{\sum_i \sigma_i^2}$ , respectively.
+
+Stable Rank Below we provide the formal definition and some properties of stable rank.
+
+Definition 2.1. The Stable Rank (Rudelson & Vershynin, 2007) of an arbitrary matrix $\mathbf{W}$ is defined as $\mathrm{srank}(\mathbf{W}) = \frac{\|\mathbf{W}\|_{\mathrm{F}}^{2}}{\|\mathbf{W}\|_{2}^{2}} = \frac{\sum_{i=1}^{k} \sigma_{i}^{2}(\mathbf{W})}{\sigma_{1}^{2}(\mathbf{W})}$ , where $k$ is the rank of the matrix. Stable rank is
+
+- a soft version of the rank operator and, unlike rank, is less sensitive to small perturbations.
+
+- differentiable as both Frobenius and Spectral norms are almost always differentiable.
+- upper-bounded by the rank: $\operatorname{srank}(\mathbf{W}) = \frac{\sum_{i=1}^{k} \sigma_i^2(\mathbf{W})}{\sigma_1^2(\mathbf{W})} \leq \frac{\sum_{i=1}^{k} \sigma_i^2(\mathbf{W})}{\sigma_1^2(\mathbf{W})} = k.$
+- invariant to scaling, implying, $\operatorname{srank}(\mathbf{W}) = \operatorname{srank}\left(\frac{\mathbf{W}}{\eta}\right)$ , for any $\eta \in \mathbb{R} \setminus \{0\}$ .
+
+Lipschitz Constant Here we describe the global and the local Lipschitz constants. Briefly, the Lipschitz constant is a quantification of the sensitivity of the output with respect to the change in the input. A function $f: \mathbb{R}^m \mapsto \mathbb{R}^k$ is globally $L$ -Lipschitz continuous if $\exists L \in \mathbb{R}_+ : \| f(\mathbf{x}_i) - f(\mathbf{x}_j) \|_q \leq L \| \mathbf{x}_i - \mathbf{x}_j \|_p, \forall (\mathbf{x}_i, \mathbf{x}_j) \in \mathbb{R}^m$ , where $\| \cdot \|_p$ and $\| \cdot \|_q$ represent the norms in the input and the output metric spaces, respectively. The global Lipschitz constant $L_g$ is:
+
+$$
+L _ {g} = \max _ {\substack {\mathbf {x} _ {i}, \mathbf {x} _ {j} \in \mathbb {R} ^ {m} \\ \mathbf {x} _ {i} \neq \mathbf {x} _ {j}}} \frac {\left\| f (\mathbf {x} _ {i}) - f (\mathbf {x} _ {j}) \right\| _ {q}}{\left\| \mathbf {x} _ {i} - \mathbf {x} _ {j} \right\| _ {p}}. \tag{1}
+$$
+
+The above definition of the Lipschitz constant depends on all pairs of inputs in the domain $\mathbb{R}^m\times \mathbb{R}^m$ , (thus, global). However, one can define the local Lipschitz constant based on the sensitivity of $f$ in the vicinity of a given point $\mathbf{x}$ . Precisely, at $\mathbf{x}$ , for an arbitrarily small $\delta >0$ , the local Lipschitz constant is computed on the open ball of radius $\delta$ centered at $\mathbf{x}$ . Let $\mathbf{h}\in \mathbb{R}^m$ , $\| \mathbf{h}\| _p < \delta$ , then, similar to $L_{g}$ , the local Lipschitz constant of $f$ at $\mathbf{x}$ , $L_{l}(\mathbf{x})$ , is greater than or equal to $\sup_{\mathbf{h}\neq 0,\| \mathbf{h}\| _p < \delta}\frac{\|f(\mathbf{x} + \mathbf{h}) - f(\mathbf{x})\|_q}{\|\mathbf{h}\|_p}$ . Assuming $f$ to be Fréchet differentiable, as $\mathbf{h}\to 0$ , using $f(\mathbf{x} + \mathbf{h}) - f(\mathbf{x})\approx J_f(\mathbf{x})\mathbf{h}$ , $L_{l}(\mathbf{x})$ is the matrix (operator) norm of the Jacobian $\left(J_{f}(\mathbf{x}) = \frac{\partial f(\mathbf{z})}{\partial\mathbf{z}}\big|_{\mathbf{x}}\in \mathbb{R}^{k\times m}\right)$ as follows:4
+
+$$
+L _ {l} (\mathbf {x}) \stackrel {(a)} {=} \lim _ {\delta \rightarrow 0} \sup _ {\substack {\mathbf {h} \neq 0\\\| \mathbf {h} \| _ {p} < \delta}} \frac {\| J _ {f} (\mathbf {x}) \mathbf {h} \| _ {q}}{\| \mathbf {h} \| _ {p}} \stackrel {(b)} {=} \sup _ {\substack {\mathbf {h} \neq 0\\\mathbf {h} \in \mathbb {R} ^ {m}}} \frac {\| J _ {f} (\mathbf {x}) \mathbf {h} \| _ {q}}{\| \mathbf {h} \| _ {p}} = \| J _ {f} (\mathbf {x}) \| _ {p, q}. \tag{2}
+$$
+
+A function is said to be locally Lipschitz with local Lipschitz constant $L_{l}$ if for all $\mathbf{x} \in \mathbb{R}^{m}$ he function is $L_{l}$ locally-Lipschitz at $\mathbf{x}$ . Thus, $L_{l} = \sup_{\mathbf{x} \in \mathbb{R}^{m}} L_{l}(\mathbf{x})$ . Notice that the Lipschitz constant (global or local), greatly depends on the chosen norms. When $p = q = 2$ , the upperbound on the local Lipschitz constant at $\mathbf{x}$ boils down to the 2-matrix norm (maximum singular value) of the Jacobian $J_{f}(\mathbf{x})$ (see last equality of (2)). With these preliminary definitions, in Section 3, we discuss more optimistic (or empirical) estimates of $L_{l}$ and $L_{g}$ , its link with generalization and then in Section 5, we show empirically the effect of SRN on them and on generalization.
+
+The local Lipschitz upper-bound for Neural Networks As mentioned earlier (2), $L_{l}(\mathbf{x}) = \| J_{f}(\mathbf{x})\|_{p,q}$ , where, in the case of NNs (proof along with why it is loose in Appendix C)
+
+$$
+L _ {l} (\mathbf {x}) = \left\| J _ {f} (\mathbf {x}) \right\| _ {p, q} \leq \left\| \mathbf {W} _ {l} \right\| _ {p, q} \dots \left\| \mathbf {W} _ {1} \right\| _ {p, q} \quad \text {a n d} \quad L _ {l} = L _ {l} (\mathbf {x}) \tag {3}
+$$
+
+# 3 WHY STABLE RANK NORMALIZATION?
+
+Lipschitz alone is not sufficient Although learning low Lipschitz functions has been shown to provide better generalization (Anthony & Bartlett, 2009; Bartlett et al., 2017; Neyshabur et al., 2018; 2015; Yoshida & Miyato, 2017; Gouk et al., 2018), enable stable training of GANs (Arjovsky et al., 2017; Gulrajani et al., 2017; Miyato et al., 2018) and help provide robustness against adversarial attacks (Cisse et al., 2017), controlling Lipschitz upper bound alone is not sufficient to provide assurance on the generalization error. One of the reasons is that it is scale-dependent, implying, for example, even though scaling an entire ReLU network would not alter the classification behaviour, it can massively increase the Lipschitz constant and thus the theoretical generalization bounds. This suggests that either the bound is of no practical utility, or at least one should regulate both—the Lipschitz constant, and the stable rank (scale-independent)—in a hope to see improved generalization in practice.
+
+Stable rank controls the noise-sensitivity As shown by Arora et al. (2018), one of the critical properties of generalizable NNs is low noise sensitivity—the ability of a network to preferentially carry over the true signal in the data. For a given noise distribution $\mathcal{N}$ , it can be quantified as
+
+$$
+\Phi_ {f _ {\theta}, \mathcal {N}} = \max _ {\mathbf {x} \in \mathcal {D}} \Phi_ {f _ {\theta}, \mathcal {N}} (\mathbf {x}), \quad w h e r e \quad \Phi_ {f _ {\theta}, \mathcal {N}} (\mathbf {x}) := \mathbb {E} _ {\eta \sim \mathcal {N}} \left[ \frac {\| f _ {\theta} (\mathbf {x} + \eta \| \mathbf {x} \|) - f _ {\theta} (\mathbf {x}) \| ^ {2}}{\| f _ {\theta} (\mathbf {x}) \| ^ {2}} \right].
+$$
+
+For a linear mapping with parameters $\mathbf{W}$ and the noise distribution being normal- $\mathcal{N}(0,\mathbf{I})$ , it can be shown that $\Phi_{f\mathbf{w},\mathcal{N}} \geq \mathrm{srank}(\mathbf{W})$ (c.f. Proposition 3.1 in Arora et al. (2018)). Thus, decreasing the stable rank directly decreases the lower bound of the noise sensitivity. In Figure 1, we show $\Phi_{f\theta ,\mathcal{N}}$ of a ResNet110 trained on CIFAR100. Note that although the Lipschitz upper bound of SRN and SN are the same, SRN (algorithmic details in Section 4) is much less sensitive to noise as the constraints imposed enforce the stable rank to decrease to $30\%$ of its original value, which in effect reduces the noise sensitivity.
+
+Stable rank impacts empirical Lipschitz constant It is apparent that the Lipschitz constant upper bound $(\prod_{i}^{d}\| \mathbf{W}_{i}\|_{2})$ , along with being scale-dependent, also is data-independent and hence, provides a pessimistic estimate of the behaviour of a model on a particular task or dataset. Considering this, a relatively optimistic estimate of the model's behaviour would be an empirical estimate of the Lipschitz constant $(L_{e})$ on a task-specific dataset. Note that local $L_{e}$ is just the norm of the Jacobian at a given point. Empirically, Novak et al. (2018) provided results showing how local $L_{e}$ (in the vicinity of train data) is correlated with the generalization error of NNs. This observation is further supported by the work of Wei & Ma; Nagarajan & Kolter (2019); Arora et al. (2018) whereby the variants of $L_{e}$ are used to derive generalization bounds. Thus, a tool that favours low $L_{e}$ is likely to provide better generalization behaviour in practice. To this end, we first consider a simple two layer linear-NN example in Appendix B.2 and show that low rank mappings do favour low $L_{e}$ . Since direct minimization of rank for NNs is non-trivial, the stable rank (softer version of rank) might induce similar behaviour. A hypothesis by showing that, as we decrease the stable rank, the emp shows SRN indeed prefers mappings with a low empirical Lipschitz constant.
+
+
+Figure 1: Noise Sensitivity (lower the better). Test accuracy: SRN $(73.1\%)$ , SN $(71.5\%)$ , and Vanilla $(72.4\%)$ .
+
+# 4 STABLE RANK NORMALIZATION
+
+Here we provide a theoretically sound procedure to do SRN. A big challenge in stable rank normalization comes from the fact that it is scale-invariant (refer Definition 2.1), thus, any normalization scheme that modifies $\mathbf{W} = \sum_{i}\sigma_{i}\mathbf{u}_{i}\mathbf{v}_{i}^{\top}$ to $\widehat{\mathbf{W}} = \sum_{i}\frac{\sigma_i}{\eta}\mathbf{u}_i\mathbf{v}_i^\top$ will have no effect on the stable rank, making SRN non-trivial. Examples of such schemes are SN (Miyato et al., 2018) where $\eta = \sigma_1$ , and Frobenius normalization where $\eta = \| \mathbf{W}\|_{\mathrm{F}}$ . As will be shown, our approach to stable rank normalization is optimal and efficient. Note, the widely used SN (Miyato et al., 2018) is not optimal (proof in Appendix A.2).
+
+The SRN Problem Statement Given a matrix $\mathbf{W} \in \mathbb{R}^{m \times n}$ with rank $p$ and spectral partitioning index $k$ ( $0 \leq k < p$ ), we formulate the SRN problem as:
+
+$$
+\underset {\widehat {\mathbf {W}} _ {k} \in \mathbb {R} ^ {m \times n}} {\arg \min } \left\| \mathbf {W} - \widehat {\mathbf {W}} _ {k} \right\| _ {\mathrm {F}} ^ {2} \quad s. t. \quad \underbrace {\operatorname {s r a n k} \left(\widehat {\mathbf {W}} _ {k}\right) = r} _ {\text {s t a b l e r a n k c o n s t a i n t}} \underbrace {\lambda_ {i} = \sigma_ {i} , \forall i \in \{1 , \cdots , k \}} _ {\text {s p e c t r u m p r e s e r v a t i o n c o n s t a i n t s}}. \tag {4}
+$$
+
+where, $1 \leq r < \operatorname{rank}(\mathbf{W})$ is the desired stable rank, $\lambda_{i}$ s and $\sigma_{i}$ s are the singular values of $\widehat{\mathbf{W}}_k$ and $\mathbf{W}$ , respectively. The partitioning index $k$ is used for the singular value (or the spectrum) preservation
+
+constraint. It gives us the flexibility to obtain $\widehat{\mathbf{W}}_k$ such that its top $k$ singular values are exactly the same as that of the original matrix. Note, the problem statement is more general in the sense that putting $k = 0$ removes the spectrum preservation constraint.
+
+The Solution to SRN The optimal unique solution to the above problem is provided in Theorem 1 and proved in Appendix A.1. Note, at $k = 0$ , the problem (4) is non-convex, otherwise convex.
+
+Theorem 1. Given a real matrix $\mathbf{W} \in \mathbb{R}^{m \times n}$ with rank $p$ , a target spectrum (or singular value) preservation index $k$ ( $0 \leq k < p$ ), and a target stable rank of $r$ ( $1 \leq r < \mathrm{rank}(\mathbf{W})$ ), the optimal solution $\widehat{\mathbf{W}}_k$ to problem (4) is $\widehat{\mathbf{W}}_k = \gamma_1 \mathbf{S}_1 + \gamma_2 \mathbf{S}_2$ , where $\mathbf{S}_1 = \sum_{i=1}^{\max(1,k)} \sigma_i \mathbf{u}_i \mathbf{v}_i^\top$ and $\mathbf{S}_2 = \mathbf{W} - \mathbf{S}_1$ . $\{\sigma_i\}_{i=1}^k$ , $\{\mathbf{u}_i\}_{i=1}^k$ and $\{\mathbf{v}_i\}_{i=1}^k$ are the top $k$ singular values and vectors of $\mathbf{W}$ , and, depending on $k$ , $\gamma_1$ and $\gamma_2$ are defined below. For simplicity, we first define $\gamma = \frac{\sqrt{r \sigma_1^2 - \|S_1\|_F^2}}{\|S_2\|_F}$ , then
+
+a) If $k = 0$ (no spectrum preservation), the problem becomes non-convex, the optimal solution to which is obtained for $\gamma_{2} = \frac{\gamma + r - 1}{r}$ and $\gamma_{1} = \frac{\gamma_{2}}{\gamma}$ , when $r > 1$ . If $r = 1$ , then $\gamma_{2} = 0$ and $\gamma_{1} = 1$ . Since, in this case, $\| \mathbf{S}_1\|_{\mathrm{F}}^2 = \sigma_1^2$ , $\gamma = \frac{\sqrt{r - 1}\sigma_1}{\|\mathbf{S}_2\|_{\mathrm{F}}}$ .
+b) If $k \geq 1$ , the problem is convex. If $r \geq \frac{\|\mathbf{S}_1\|_F^2}{\sigma_1^2}$ the optimal solution is obtained for $\gamma_1 = 1$ and $\gamma_2 = \gamma$ and if not, the problem is not feasible.
+c) Also, $\left\| \widehat{\mathbf{W}}_k - \mathbf{W}\right\|_{\mathrm{F}}$ monotonically increases with $k$ for $k\geq 1$
+
+Intuitively, Theorem 1 partitions the given matrix into two parts, depending on $k$ , and then scales them differently in order to obtain the optimal solution. The value of the partitioning index $k$ is a design choice. If there is no particular preference to $k$ , then $k = 0$ provides the most optimal solution. We provide a simple example to better understand this. Given $\mathbf{W} = \mathbb{I}_3$ (rank $= \operatorname{srank}(\mathbf{W}) = 3$ ), the objective is to project it to a new matrix with stable rank of 2. Solutions to this problem are:
+
+$$
+\widehat {\mathbf {W}} _ {1} = \left[ \begin{array}{l l l} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 0 \end{array} \right], \widehat {\mathbf {W}} _ {2} = \left[ \begin{array}{c c c} 1 & 0 & 0 \\ 0 & \frac {1}{\sqrt {2}} & 0 \\ 0 & 0 & \frac {1}{\sqrt {2}} \end{array} \right], \widehat {\mathbf {W}} _ {3} = \left[ \begin{array}{c c c} \frac {\sqrt {2} + 1}{2} & 0 & 0 \\ 0 & \frac {\sqrt {2} + 1}{2 \sqrt {2}} & 0 \\ 0 & 0 & \frac {\sqrt {2} + 1}{2 \sqrt {2}} \end{array} \right] \tag {5}
+$$
+
+Here, $\widehat{\mathbf{W}}_1$ is obtained using the standard rank minimization (Eckart-Young-Mirsky (Eckart & Young, 1936)) while $\widehat{\mathbf{W}}_2$ and $\widehat{\mathbf{W}}_2$ are the solutions of Theorem 1 with $k = 1$ and $k = 0$ , respectively. It is easy to verify that the stable rank of all the above solutions is 2. However, the Frobenius distance (lower the better) of these solutions from the original matrix follows the order $\left\| \mathbf{W} - \widehat{\mathbf{W}}_1 \right\|_{\mathrm{F}} > \left\| \mathbf{W} - \widehat{\mathbf{W}}_2 \right\|_{\mathrm{F}} > \left\| \mathbf{W} - \widehat{\mathbf{W}}_3 \right\|_{\mathrm{F}}$ . As evident from the example, the solution to SRN, instead of completely removing a particular singular value, scales them (depending on $k$ ) such that the new matrix has the desired stable rank. Note that for $\widehat{\mathbf{W}}_1$ (true for any $k \geq 1$ ), the spectral norm of the original and the normalized matrices are the same, implying, $\gamma_1 = 1$ . However, for $k = 0$ , the spectral norm of the optimal solution is greater than that of the original matrix. It is easy to verify from Theorem 1 that as $k$ increases, $\gamma_2$ decreases. Thus, the amount of scaling required for the second partition $\mathbf{S}_2$ is more aggressive. In all situations, the following inequality holds: $\gamma_2 \leq 1 \leq \gamma_1$ .
+
+Algorithm 1 Stable Rank Normalization
+Require: $\mathbf{W}\in \mathbb{R}^{m\times n},r,k\geq 1$
+1: $\mathbf{S}_1\gets \mathbf{0},\beta \gets \| \mathbf{W}\|_{\mathrm{F}}^2,\eta \gets 0,l\gets 0$
+2: for $i\in \{1,\dots ,k\}$ do
+3: $\{\mathbf{u}_i,\mathbf{v}_i,\sigma_i\} \gets SVD(\mathbf{W},i)$
+4: $\triangleright$ Power method to get $i$ -th singular value
+5: if $r\geq (\sigma_i^2 +\eta) / \sigma_1^2$ then
+6: $\mathbf{S}_1\gets \mathbf{S}_1 + \sigma_i\mathbf{u}_i\mathbf{v}_i^\top$
+7: $\eta \leftarrow \eta +\sigma_i^2,\beta \leftarrow \beta -\sigma_i^2$
+8: $l\gets l + 1$
+9: else
+10: break
+11: end if
+12: end for
+13: $\eta \gets r\sigma_1^2 -\eta$
+14: return $\widehat{\mathbf{W}}_l\gets \mathbf{S}_1 + \sqrt{\frac{\eta}{\beta}} (\mathbf{W} - \mathbf{S}_1),l$
+
+Algorithm 2 SRN for a Linear Layer in NN
+Require: $\mathbf{W} \in \mathbb{R}^{m \times n}$ , $r$ , learning rate $\alpha$ , mini-batch dataset $\mathcal{D}$
+1: Initialize $\mathbf{u} \in \mathbb{R}^m$ with a random vector.
+2: $\mathbf{v} \gets \frac{\mathbf{W}^\top \mathbf{u}}{\|\mathbf{W}^\top \mathbf{u}\|}, \mathbf{u} \gets \frac{\mathbf{W}^\top \mathbf{v}}{\|\mathbf{W}^\top \mathbf{v}\|}$
+3: Perform power iteration
+4: $\sigma(\mathbf{W}) = \mathbf{u}^\top \mathbf{W} \mathbf{v}$
+5: $\mathbf{W}_f = \mathbf{W} / \sigma(\mathbf{W}) \triangleright$ Spectral Normalization
+6: $\widehat{\mathbf{W}} = \mathbf{W}_f - \mathbf{u} \mathbf{v}^\top$
+7: if $\left\| \widehat{\mathbf{W}} \right\|_{\mathrm{F}} \leq \sqrt{r-1}$ then
+8: return $\mathbf{W}_f$
+9: end if
+10: $\mathbf{W}_f = \mathbf{u} \mathbf{v}^\top + \widehat{\mathbf{W}} \frac{\sqrt{r-1}}{\|\widehat{\mathbf{w}}\|_{\mathrm{F}}} \triangleright$ Stable Rank Normalization
+11: return $\mathbf{W} \gets \mathbf{W} - \alpha \nabla_{\mathbf{W}} L(\mathbf{W}_f, \mathcal{D})$
+
+Algorithm for Stable Rank Normalization We provide a general procedure in Algorithm 1 to solve the stable rank normalization problem for $k \geq 1$ (the solution for $k = 0$ is straightforward from Theorem 1). Claim 2 provides the properties of the algorithm. The algorithm is constructed so that the prior knowledge of the rank of the matrix is not necessary.
+
+Claim 2. Given a matrix $\mathbf{W}$ , the desired stable rank $r$ , and the partitioning index $k \geq 1$ , Algorithm 1 requires computing the top $l$ ( $l \leq k$ ) singular values and vectors of $\mathbf{W}$ . It returns $\widehat{\mathbf{W}}_l$ and the scalar $l$ such that $\mathrm{srank}(\widehat{\mathbf{W}}_l) = r$ , and the top $l$ singular values of $\mathbf{W}$ and $\widehat{\mathbf{W}}_l$ are the same. If $l = k$ , then the solution provided is the optimal solution to the problem (4) with all the constraints satisfied, otherwise, it returns the largest $l$ up to which the spectrum is preserved.
+
+Combining Stable Rank and Spectral Normalization for NNs Following the arguments provided in Section 1 and 3, for better generalizability, we propose to normalize both the stable rank and the spectral norm of each linear layer of a NN simultaneously. To do so, we first perform approximate SN (Miyato et al., 2018), and then perform optimal SRN (using Algorithm 1). We use $k = 1$ to ensure that the first singular value (which is now normalized) is preserved. Algorithm 2 provides a simplified procedure for the same for a given linear layer of a NN. Note, the computational cost of this algorithm is exactly the same as that of SN, which is to compute the top singular value using the power iteration method.
+
+# 5 EXPERIMENTS
+
+Dataset and Architectures For classification, we perform experiments on ResNet-110 (He et al., 2016), WideResNet-28-10 (Zagoruyko & Komodakis, 2016), DenseNet-100 (Huang et al., 2017), VGG-19 (Simonyan & Zisserman, 2014), and AlexNet (Krizhevsky & Hinton, 2009) using the CIFAR100 (Krizhevsky & Hinton, 2009) dataset. We present further experiments with CIFAR10 in Appendix D.1 in Figure 10 and 11. We train them using standard training recipes with SGD, using a learning rate of 0.1 (except AlexNet where we use a learning rate of 0.01), and a momentum of 0.9 with a batch size of 128 (further details in Appendix D). In addition to training for a fixed number of epochs, we also present results in the Appendix in Figure 8 and 9 where the training accuracy (as opposed to number of iterations) is used as a stopping criterion to show that our regularizer performs well with a range of stopping criterions.
+
+For GAN experiments, we use CIFAR100, CIFAR10, and CelebA (Liu et al., 2015) datasets. We show results on both, conditional and unconditional GANs. Please refer to Appendix E.1 for further details about the training setup.
+
+Choosing stable rank Given a matrix $\mathbf{W} \in \mathbb{R}^{m \times n}$ , the desired stable rank $r$ is controlled using a single hyperparameter $c$ as $r = c \min(m, n)$ , where $c \in (0, 1]$ . For simplicity, we use the same $c$ for
+
+
+(a) Resnet110
+
+
+(b) WideResnet-28
+
+
+(c) Alexnet
+
+
+(d) Densenet-100
+
+
+(e) VGG-19
+Figure 2: Test accuracies on CIFAR100 for clean data. Higher is better.
+
+all the linear layers. It is trivial to note that if $c = 1$ , or for a given $c$ , if $\operatorname{srank}(\mathbf{W}) \leq r$ , then SRN boils down to SN. For classification, we choose $c = \{0.3, 0.5\}$ , and compare SRN against standard training (Vanilla) and training with SN. For GAN experiments, we choose $c = \{0.1, 0.3, 0.5, 0.7, 0.9\}$ , and compare SRN-GAN against SN-GAN (Miyato et al., 2018), WGAN-GP (Gulrajani et al., 2017), and orthonormal regularization GAN (Ortho-GAN) (Brock et al., 2016).
+
+# Result Overview
+
+- SRN improves classification accuracy on a wide variety of architectures.
+- Normalizing stable rank improves the learning capacity of spectrally normalized networks.
+- SRN shows remarkably less memorization, even on settings very hard to generalize.
+- SRN shows much improved generalization behaviour evaluated using recently proposed sample complexity measures.
+- As we decrease the stable rank, the empirical Lipschitz of SRN-GAN decreases. Proving our arguments provided in Section 3.
+- SRN-GAN provides much improved Neural divergence score (ND) (Gulrajani et al., 2019) compared to SN-GAN, proving that it is robust to memorization in GANs as well.
+- SRN-GAN also provide improved Inception and FID scores in all our experiments (except one where SN-GAN is better).
+
+# 5.1 CLASSIFICATION EXPERIMENTS
+
+We perform each experiment 5 times using a new random seed each time and report the mean, and the $75\%$ confidence interval for the test error in Figure 2. These experiments show that the test accuracy of SRN, on a wide variety NNs, is always higher than the Vanilla and SN (except for SRN-50 on Alexnet where SRN and SN are almost equal). However, SN performs slightly worse than Vanilla for WideResNet-28 and ResNet110. The fact that SRN does involve SN, combined with the above statement, indicate that even though SN reduced the learning capability of these networks, normalizing stable rank must have improved it significantly in order for SRN to outperform Vanilla. For example, in the case of ResNet110, SN is $71.5\%$ accurate whereas SRN provides an accuracy of $73.2\%$ . In addition to this, we would like to note that even though SN is being used extensively for the training of GANs, it is not a popular choice when it comes to training standard NNs for classification. We suspect that this is because of the decrease in the capacity, which we have shown to be increased by the stable rank normalization, proving the worth of SRN for classification tasks as well.
+
+# 5.2 STUDY OF GENERALIZATION BEHAVIOUR
+
+Our last set of experiments established that SRN provides improved classification accuracies on various NNs. Here we study the generalization behaviour of these models. Quantifying generalization behaviour is non-trivial and there is no clear answer to it. However, we utilize recent efforts that explore the theoretical understanding of generalization and use them to study it in practice.
+
+Shattering Experiments To inspect the generalization behaviour in NNs we begin with the shattering experiment (Zhang et al., 2016). It is a test of whether the network can fit the training data well but not a label-randomized version of it (each image of the dataset is assigned a random label). As there is no correlation of the labels with the data points $P(y|\mathbf{x})$ is essentially uninformative because it is uniformly random. Thus, the test accuracy on this task is almost $1\%$ . A high training accuracy — which indicates a high generalization gap (difference between train and test accuracy) can be achieved
+
+
+(a) Resnet110
+
+
+(b) WideResNet-28
+
+
+(c) Alexnet
+
+
+(d) Densenet-100
+
+
+(e) VGG-19
+
+
+Figure 3: Train accuracies on CIFAR100 for shattering experiment. Lower indicate less memorization, thus, better.
+
+
+(b) R110-Spec- $L_{1}$
+
+
+(c) R110-Spec-Fro
+
+
+(a) R110-Jac-Norm
+
+
+
+
+(f) WRN-Spec-Fro
+
+
+(d) WRN-Jac-Norm
+(g) D100-Jac-Norm
+Figure 4: (log) Sample complexity ( $C_{\mathrm{alg}}$ ) of ResNet-110 (Figure 4a to 4c), WideResNet-28-10 (Figure 4d to 4f), and Densenet-100 (Figure 4g to 4i) quantified using the three measures discussed in the paper. Left is better. Vanilla is omitted from Figure 4b, 4c, 4h and 4i as it is too far to the right. Also, in situations where SRN-50 and SN performed the same, we removed the histogram to avoid clutter.
+
+
+(e) WRN-Spec- $L_{1}$
+(h) D100-Spec- $L_{1}$
+
+
+(i) D100-Spec-Fro
+
+only by memorizing the train data $^{7}$ . Figure 3 shows that SRN reduces memorization on random labels (thus, reduces the estimate of the Rademacher complexity (Zhang et al., 2016)). Note, as shown in the classification experiments, the same model was able to achieve the highest training accuracy when the labels were not randomized.
+
+ | SRN-50 | SRN-30 | Spectral (SN) | Vanilla |
| WD | 12.02 ± 1.77 | 11.87 ± 0.57 | 11.13 ± 2.56 | 10.56 ± 2.32 |
| w/o WD | 17.71 ± 2.30 | 19.04 ± 4.53 | 17.22 ± 1.94 | 13.49 ± 1.93 |
+
+Table 1: Highly non-generalizable setting. Training error for ResNet-110 on CIFAR100 with randomized labels, low $\mathrm{lr} = {0.01}$ ,and with and without weight decay. (Higher is better.) The clean test accuracy for this setting is shown in Appendix D.1.
+
+We also look specifically at highly non-generalizable settings — low learning rate and without weight decay. As shown in Table 1, SRN consistently achieves lower generalization error (by achieving a low train error) both in the presence and the absence of weight decay $^{8}$ . Similar results are reported for Alexnet and WideResNet in Appendix D.1.
+
+
+(a) Varying stable rank constraints
+
+
+(b) Comparison against different approaches
+Figure 5: eLhist for unconditional GAN on CIFAR10. Dashed vertical lines represent $95th$ percentile. Solid circles and crosses represent the inception score for each histogram. Figure 5a shows SRN-GAN for different stable rank constraints (e.g. 90 implies $c = 0.9$ ). Figure 5b compares various approaches. Random-GAN represents random initialization (no training). For SRN-GAN, we use $c = 0.7$ .
+
+Empirical Evaluation of Generalization Behaviour When all the factors in training (eg. architecture, dataset, optimizer, among other) as in SRN vs SN vs Vanilla, are fixed, and the only variability is in the normalization, the generalization error can be written as $|\mathrm{Train~Err} - \mathrm{Test~Err}| \leq \widetilde{\mathcal{O}}\left(\sqrt{C_{\mathrm{alg}} / m}\right)$ where $\widetilde{\mathcal{O}}(\cdot)$ ignores the logarithmic terms, $m$ is the number of samples in the dataset, and $C_{\mathrm{alg}}$ denotes a measure of sample complexity for a given algorithm. Lower the value of $C_{\mathrm{alg}}$ , the better is the generalization. Before we give various expressions for $C_{\mathrm{alg}}$ , we first define a common quantity in all these expressions, called the margin $\gamma = f_{\theta}(\mathbf{x}) [y] - \max_{j \neq y} f_{\theta}(\mathbf{x}) [j]$ . It measures the gap between the output of the network on the correct label and the other labels. Now we define three recently proposed sample complexity measures useful to quantify the generalization behaviour with further descriptions in Appendix D.1:
+
+- Spec-Fro: $\prod_{i=1}^{L}\|\mathbf{W}_{i}\|_{2}^{2}\sum_{i=1}^{L}\operatorname{srank}(\mathbf{W}_{i}) / \gamma^{2}$ (Neyshabur et al., 2018).
+- Spec-L1: $\Pi_{i=1}^{L} \| \mathbf{W}_{i} \|_{2}^{2} \left( \sum_{i=1}^{L} \frac{\|\mathbf{w}_{i}\|_{2,1}^{2/3}}{\|\mathbf{w}_{i}\|_{2}^{2/3}} \right)^{3} / \gamma^{2}$ (Bartlett et al., 2017), $\|\cdot\|_{2,1}$ is the matrix 2-1 norm.
+- Jac-Norm: $\sum_{i=1}^{L}\|\mathbf{h}_{i}\|_{2}\|\mathbf{J}_{i}\|_{2}\bigg/ \gamma$ (Wei & Ma), where $\mathbf{h}_{i}$ is the $i^{th}$ hidden layer and $\mathbf{J}_{i} = \frac{\partial\gamma}{\partial h_{i}}$
+
+Histogram of the Empirical Lipschitz Constant (eLhist) We evaluate above mentioned sample complexity measures on 10,000 points from the dataset and plot the distribution of the log using a histogram shown in Figure 4. The more to the left the histogram, the better is the generalization capacity of the network.
+
+For better clarity, we provide the 90 percentile for each of these histograms in Table 5 in Appendix D.1. As the plots and the table show, both SRN and SN produces a much smaller quantity than a Vanilla network and in 7 out of the 9 cases, SRN is better than SN. The difference between SRN and SN is much more significant in the case of Jac-Norm. As this depends on the empirical lipschitzness, it provides the empirical validation of our arguments in Section 3.
+
+Above experiments indicate that SRN, while providing enough capacity for the standard classification task, is remarkably less prone to memorization and provides improved generalization.
+
+5.3 TRAINING OF GENERATIVE ADVERSARIAL NETWORKS (SRN-GAN)
+
+In GANs, there is a natural tension between the capacity and the generalizability of the discriminator. The capacity ensures that if the generated distribution and the data distribution are different, the discriminator has the ability to distinguish them. At the same time, the discriminator has to be generalizable, implying, the class of hypothesis should be small enough to ensure that it is not just memorizing the dataset. Based on these arguments, we use SRN in the discriminator of GAN which we call SRN-GAN, and compare it against SN-GAN, WGAN-GP, and orthonormal regularization based GAN (Ortho-GAN).
+
+Along with providing results using evaluation metrics such as Inception score (IS) (Salimans et al., 2016), FID (Heusel et al., 2017), and Neural divergence score (ND) (Gulrajani et al., 2019), we use histograms of the empirical Lipschitz constant, referred to as eLhist from now onwards,
+
+for the purpose of analyses. For a given trained GAN (unconditional), we create 2,000 pairs of samples, where each pair $(\mathbf{x}_i,\mathbf{x}_j)$ consists of $\mathbf{x}_i$ (randomly sampled from the 'real' dataset) and $\mathbf{x}_j$ (randomly sampled from the generator). Each pair is then passed through the discriminator to compute $\| f(\mathbf{x}_i) - f(\mathbf{x}_j)\| _2 / \| \mathbf{x}_i - \mathbf{x}_j\| _2$ , which we then use to create the histogram. In the conditional setting, we sample a class from a discrete uniform distribution, and then follow the same approach as described for the unconditional setting.
+
+# Effect of Stable Rank on eLhist and
+
+Inception Score As shown in Figure 5a, lowering the value of $c$ (aggressive reduction in the stable rank) moves the histogram towards zero, implying, lower empirical Lipschitz constant. This validates our arguments provided in Section 3. Lowering $c$ also improves inception score, however, extreme reduction in the stable rank $(c = 0.1)$ dramatically collapses the histogram to zero and also drops the inception score significantly. This is due to the fact that at $c = 0.1$ , the
+
+ | Algorithm | Inception Score | FID | Intra-FID |
| Uncond. | Orthonormal1 | 7.92 ± .04 | 23.8 | - |
| WGAN-GP | 7.86 ± .07 | 21.7 | - |
| SN-GAN1 | 8.22 ± .04 | 20.67 | - |
| SRN-70-GAN | 8.53 ± 0.04 | 19.83 | - |
| SRN-50-GAN | 8.33 ± 0.06 | 19.57 | - |
| Cond. | SN-GAN | 8.71 ± .04 | 16.049 | 26.24 |
| SRN-70-GAN | 8.93 ± 0.12 | 15.92 | 24.01 |
| SRN-50-GAN | 8.76 ± 0.09 | 16.89 | 27.3 |
+
+capacity of the discriminator is reduced to the point that it is not able to learn to differentiate between the real and the fake samples anymore.
+
+Table 2 and 3 show that SRN-GAN consistently provide better FID score and an extremely competitive inception score on CIFAR10 (both conditional and unconditional setting) and CIFAR100 (unconditional setting). In Table 4, we compare the ND loss on CIFAR10 and CelebA datasets. Note, ND has been looked as a metric more robust to memorization than FID and IS in recent works (Gulrajani et al., 2019; Arora & Zhang, 2017). We report our exact setting to compute ND in Appendix E.1. We essentially report the loss incurred by a fresh classifier trained to discriminate the generator distribution and the data distribution. Thus higher the loss, the better the generated images. As evident, SRN-GAN provides better ND scores on both datasets. For a qualitative analysis of the images, we compare generations in both conditional and unconditional setting in Appendix F.
+
+Comparing different approaches In addition, in Figure 5b, we provide eLhist for comparing different approaches. Random-GAN, as expected, has a low empirical Lipschitz constant and extremely poor inception score. Unsurprisingly, WGAN-GP has a lower $L_{e}$ than Random-GAN, due to its explicit constraint on the Lipschitz constant, while providing a higher inception score. On the other hand, SRNGAN, by virtue of its softer constraints on the Lipschitz constant, trades off a higher Lipschitz constant for a better inception score—highlighting the flexibility provided by SRN. Additional experiments in Appendix E.2 show more detailed behaviour of GANs in regards to empirical lipschitz in a variety of settings.
+
+Table 2: Inception and FID score on CIFAR10.
+
+| Model | IS | FID |
| SN-GAN | 9.04 | 23.2 |
| SRN-GAN (Our) | 8.85 | 19.55 |
+
+Table 3: CIFAR100 experiments.
+
+| Model | CIFAR10 | CelebA |
| SN-GAN | 10.69 | 0.36 |
| SRN-GAN (Our) | 11.97 | 0.64 |
+
+Table 4: Neural Discriminator Loss (Higher the better).
+
+# 6 CONCLUSION
+
+We proposed a new normalization (SRN) that allows us to constrain the stable rank of each affine layer of a NN, which in turn learns a mapping with low empirical Lipschitz constant. We also provide optimality guarantees of SRN. On a variety of neural network architectures, we showed that SRN improves the generalization and memorization properties of a standard classifier. In addition, we show that SRN improves the training of GANs and provide better inception, FID, and ND scores.
+
+# 7 ACKNOWLEDGEMENTS
+
+The authors would like to thank Leonard Berrada and Pawan Kumar for helpful discussions. AS acknowledges support from The Alan Turing Institute under the Turing Doctoral Studentship grant TU/C/000023. PHS and PD are supported by the ERC grant ERC-2012-AdG 321162-HELIOS, EPSRC grant Seebibyte EP/M013774/1 and EPSRC/MURI grant EP/N019474/1. PHS and PD also acknowledges the Royal Academy of Engineering and FiveAI.
+
+# REFERENCES
+
+Martin Anthony and Peter L Bartlett. Neural network learning: Theoretical foundations. Cambridge university press, 2009.
+Martin Arjovsky, Soumith Chintala, and Léon Bottou. Wasserstein gan. 2017.
+Sanjeev Arora and Yi Zhang. Do gans actually learn the distribution? an empirical study. arXiv preprint arXiv:1706.08224, 2017.
+Sanjeev Arora, Rong Ge, Behnam Neyshabur, and Yi Zhang. Stronger generalization bounds for deep nets via a compression approach. In Jennifer Dy and Andreas Krause (eds.), Proceedings of the 35th International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pp. 254-263, Stockholm, Sweden, 10-15 Jul 2018. PMLR. URL http://proceedings.mlr.press/v80/arora18b.html.
+Peter L Bartlett, Dylan J Foster, and Matus J Telgarsky. Spectrally-normalized margin bounds for neural networks. In Advances in Neural Information Processing Systems, pp. 6240-6249, 2017.
+Andrew Brock, Theodore Lim, J. M. Ritchie, and Nick Weston. Neural photo editing with introspective adversarial networks. International Conference on Learning Representations, 2016.
+Moustapha Cisse, Piotr Bojanowski, Edouard Grave, Yann Dauphin, and Nicolas Usunier. Parseval networks: Improving robustness to adversarial examples. In Doina Precup and Yee Whye Teh (eds.), Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pp. 854-863, International Convention Centre, Sydney, Australia, 06-11 Aug 2017. PMLR. URL http://proceedings.mlr.press/v70/cisse17a.html.
+Vincent Dumoulin, Jonathon Shlens, and Manjunath Kudlur. A learned representation for artistic style. Proc. of ICLR, 2017.
+Carl Eckart and Gale Young. The approximation of one matrix by another of lower rank. Psychometrika, 1(3):211-218, sep 1936. ISSN 0033-3123. doi: 10.1007/BF02288367. URL http://link.springer.com/10.1007/BF02288367.
+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.
+Henry Gouk, Eibe Frank, Bernhard Pfahringer, and Michael Cree. Regularisation of neural networks by enforcing lipschitz continuity. arXiv preprint arXiv:1804.04368, 2018.
+Ishaan Gulrajani, Faruk Ahmed, Martin Arjovsky, Vincent Dumoulin, and Aaron Courville. Improved training of wasserstein gans. 2017.
+Ishaan Gulrajani, Colin Raffel, and Luke Metz. Towards GAN benchmarks which require generalization. In International Conference on Learning Representations, 2019. URL https://openreview.net/forum?id=HkxKH2AcFm.
+Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep Residual Learning for Image Recognition. In 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 770-778. IEEE, jun 2016. ISBN 978-1-4673-8851-1. doi: 10.1109/CVPR.2016.90. URL http://ieeexplore.ieee.org/document/7780459/.
+Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, and Sepp Hochreiter. Gans trained by a two time-scale update rule converge to a local nash equilibrium. In Advances in Neural Information Processing Systems, pp. 6626-6637, 2017.
+Gao Huang, Zhuang Liu, Laurens van der Maaten, and Kilian Q. Weinberger. Densely connected convolutional networks. In 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR). IEEE, jul 2017. doi: 10.1109/cvpr.2017.243.
+Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
+
+Naveen Kodali, James Hays, Jacob Abernethy, and Zsolt Kira. On convergence and stability of GANs, 2018. URL https://openreview.net/forum?id=ryepFJbA-.
+Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. Technical report, Citeseer, 2009.
+Mingchen Li, Mahdi Soltanolkotabi, and Samet Oymak. Gradient descent with early stopping is provably robust to label noise for overparameterized neural networks.
+Jae Hyun Lim and Jong Chul Ye. Geometric gan. 2017.
+Ziwei Liu, Ping Luo, Xiaogang Wang, and Xiaou Tang. Deep learning face attributes in the wild. In Proceedings of International Conference on Computer Vision (ICCV), 2015.
+Leon Mirsky. Symmetric gauge functions and unitarily invariant norms. The quarterly journal of mathematics, 11(1):50-59, 1960.
+Mehdi Mirza and Simon Osindero. Conditional generative adversarial nets. arXiv preprint arXiv:1411.1784, 2014.
+R. V. Mises and H. Pollaczek-Geiringer. Praktische verfahren der gleichungsauflösung. ZAMM - Zeitschrift für Angewandte Mathematik und Mechanik, 9(2):152-164, 1929. doi: 10.1002/zamm.19290090206.
+Takeru Miyato and Masanori Koyama. cgans with projection discriminator. International Conference on learning Representations, 2018.
+Takeru Miyato, Toshiki Kataoka, Masanori Koyama, and Yuichi Yoshida. Spectral normalization for generative adversarial networks. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id=B1QRgziT-.
+Vaishnavh Nagarajan and Zico Kolter. Deterministic PAC-bayesian generalization bounds for deep networks via generalizing noise-resilience. In International Conference on Learning Representations, 2019. URL https://openreview.net/forum?id=Hygn2o0qKX.
+Behnam Neyshabur, Ryota Tomioka, and Nathan Srebro. Norm-based capacity control in neural networks. In Conference on Learning Theory, pp. 1376-1401, 2015.
+Behnam Neyshabur, Srinadh Bhojanapalli, and Nathan Srebro. A PAC-bayesian approach to spectrally-normalized margin bounds for neural networks. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id=Skz_WfbCZ.
+Roman Novak, Yasaman Bahri, Daniel A Abolafia, Jeffrey Pennington, and Jascha Sohl-Dickstein. Sensitivity and generalization in neural networks: an empirical study. arXiv preprint arXiv:1802.08760, 2018.
+Henning Petzka, Asja Fischer, and Denis Lukovnikov. On the regularization of wasserstein GANs. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id=B1hYRMbCW.
+Prajit Ramachandran, Barret Zoph, and Quoc V. Le. Searching for activation functions, 2018. URL: https://openreview.net/forum?id=SkBYyZRZ.
+Mark Rudelson and Roman Vershynin. Sampling from large matrices. Journal of the ACM, 54(4): 21-es, jul 2007. doi: 10.1145/1255443.1255449.
+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.
+Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014.
+Dustin Tran, Rajesh Ranganath, and David M. Blei. Hierarchical implicit models and likelihood-free variational inference. 2017.
+
+Colin Wei and Tengyu Ma. Data-dependent sample complexity of deep neural networks via lipschitz augmentation.
+Helmut Wielandt. An extremum property of sums of eigenvalues. Proceedings of the American Mathematical Society, 6(1):106-106, jan 1955. doi: 10.1090/s0002-9939-1955-0067842-9.
+Yuichi Yoshida and Takeru Miyato. Spectral norm regularization for improving the generalizability of deep learning. arXiv preprint arXiv:1705.10941, 2017., 2017.
+Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. In Proceedings of the British Machine Vision Conference 2016. British Machine Vision Association, 2016. doi: 10.5244/c.30.87.
+Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning requires rethinking generalization. International Conference on Learning Representations (ICLR), nov 2016. URL http://arxiv.org/abs/1611.03530.
+Han Zhang, Ian Goodfellow, Dimitris Metaxas, and Augustus Odena. Self-attention generative adversarial networks. 2018.
+
+# A TECHNICAL PROOFS
+
+Here we provide an extensive proof of Theorem 1 (Appendix A.1). We also provide the optimal solution to the spectral norm problem in Appendix A.2. Auxiliary lemmas on which our proof depends are provided in Appendix A.3.
+
+# A.1 PROOF FOR OPTIMAL STABLE RANK NORMALIZATION. (MAIN THEOREM)
+
+Theorem 1. Given a real matrix $\mathbf{W} \in \mathbb{R}^{m \times n}$ with rank $p$ , a target spectrum (or singular value) preservation index $k$ ( $0 \leq k < p$ ), and a target stable rank of $r$ ( $1 \leq r < \operatorname{srank}(\mathbf{W})$ ), the optimal solution $\widehat{\mathbf{W}}_k$ to problem (4) is $\widehat{\mathbf{W}}_k = \gamma_1 \mathbf{S}_1 + \gamma_2 \mathbf{S}_2$ , where $\mathbf{S}_1 = \sum_{i=1}^{\max(1, k)} \sigma_i \mathbf{u}_i \mathbf{v}_i^\top$ and $\mathbf{S}_2 = \mathbf{W} - \mathbf{S}_1$ . $\{\sigma_i\}_{i=1}^k$ , $\{\mathbf{u}_i\}_{i=1}^k$ and $\{\mathbf{v}_i\}_{i=1}^k$ are the top $k$ singular values and vectors of $\mathbf{W}$ , and, depending on $k$ , $\gamma_1$ and $\gamma_2$ are defined below. For simplicity, we first define $\gamma = \frac{\sqrt{r \sigma_1^2 - \|S_1\|_F^2}}{\|S_2\|_F}$ , then
+
+a) If $k = 0$ (no spectrum preservation), the problem becomes non-convex, the optimal solution to which is obtained for $\gamma_{2} = \frac{\gamma + r - 1}{r}$ and $\gamma_{1} = \frac{\gamma_{2}}{\gamma}$ , when $r > 1$ . If $r = 1$ , then $\gamma_{2} = 0$ and $\gamma_{1} = 1$ . Since, in this case, $\| \mathbf{S}_1\|_{\mathrm{F}}^2 = \sigma_1^2$ , $\gamma = \frac{\sqrt{r - 1}\sigma_1}{\|\mathbf{S}_2\|_{\mathrm{F}}}$ .
+b) If $k \geq 1$ , the problem is convex. If $r \geq \frac{\|\mathbf{S}_1\|_F^2}{\sigma_1^2}$ the optimal solution is obtained for $\gamma_1 = 1$ and $\gamma_2 = \gamma$ and if not, the problem is not feasible.
+c) Also, $\left\| \widehat{\mathbf{W}}_k - \mathbf{W}\right\|_{\mathrm{F}}$ monotonically increases with $k$ for $k\geq 1$
+
+Proof. Here we provide the proof of Theorem 1 (in the main paper) for all the three cases with optimality and uniqueness guarantees. Let $\widehat{\mathbf{W}}_k$ be the optimal solution to the problem for any of the two cases. From Lemma 5, the SVD of $\mathbf{W}$ and $\widehat{\mathbf{W}}_k$ can be written as $\mathbf{W} = \mathbf{U}\boldsymbol{\Sigma}\mathbf{V}^{\top}$ and $\widehat{\mathbf{W}}_k = \mathbf{U}\boldsymbol{\Lambda}\mathbf{V}^{\top}$ , respectively. Then, $L = \left\| \mathbf{W} - \widehat{\mathbf{W}}_k \right\|_{\mathrm{F}}^2 = \langle \boldsymbol{\Sigma} - \boldsymbol{\Lambda}, \boldsymbol{\Sigma} - \boldsymbol{\Lambda} \rangle_{\mathrm{F}}$ . From now onwards, we denote $\boldsymbol{\Sigma}$ and $\boldsymbol{\Lambda}$ as vectors consisting of the diagonal entries, and $\langle ., . \rangle$ as the vector inner product
+
+Proof for Case (a): In this case, there is no constraint enforced to preserve any of the singular values of the given matrix while obtaining the new one. The only constraint is that the new matrix should have the stable rank of $r$ . Let us assume $\Sigma = (\sigma_1, \dots, \sigma_p)$ , $\Sigma_2 = (\sigma_2, \dots, \sigma_p)$ , $\Lambda = (\lambda_1, \dots, \lambda_p)$ and $\Lambda_2 = (\lambda_2, \dots, \lambda_p)$ . Using these notations, we can write $L$ as:
+
+$$
+\begin{array}{l} L = \langle \Sigma , \Sigma \rangle + \langle \Lambda , \Lambda \rangle - 2 \langle \Sigma , \Lambda \rangle \\ = \left\langle \Sigma , \Sigma \right\rangle + \lambda_ {1} ^ {2} + \left\langle \Lambda_ {2}, \Lambda_ {2} \right\rangle - 2 \sigma_ {1} \lambda_ {1} - 2 \left\langle \Sigma_ {2}, \Lambda_ {2} \right\rangle \tag {6} \\ \end{array}
+$$
+
+Using the stable rank constraint $\operatorname{srank}(\widehat{\mathbf{W}}_k) = r$ , which is $r = 1 + \frac{\sum_{j=2}^{p} \lambda_j^2}{\lambda_1^2}$ .
+
+Case for $r > 1$ If $r > 1$ we obtain the following equality constraint, making the problem nonconvex.
+
+$$
+\lambda_ {1} ^ {2} = \frac {\left\langle \Lambda_ {2} , \Lambda_ {2} \right\rangle}{r - 1} \tag {7}
+$$
+
+However, we will show that the solution we obtain is optimal and unique. Substituting (7) into (6) we get
+
+$$
+L = \left\langle \Sigma , \Sigma \right\rangle + \frac {\left\langle \Lambda_ {2} , \Lambda_ {2} \right\rangle}{r - 1} + \left\langle \Lambda_ {2}, \Lambda_ {2} \right\rangle - 2 \sigma_ {1} \sqrt {\frac {\left\langle \Lambda_ {2} , \Lambda_ {2} \right\rangle}{r - 1}} - 2 \left\langle \Sigma_ {2}, \Lambda_ {2} \right\rangle \tag {8}
+$$
+
+Setting $\frac{\partial L}{\partial \Lambda_2} = 0$ to get the family of critical points
+
+$$
+\begin{array}{l} \frac {2 \Lambda_ {2}}{r - 1} + 2 \Lambda_ {2} - \frac {4 \sigma_ {1} \Lambda_ {2}}{2 \sqrt {(r - 1) \langle \Lambda_ {2} , \Lambda_ {2} \rangle}} - 2 \Sigma_ {2} = 0 \\ \Rightarrow \Sigma_ {2} = \Lambda_ {2} \left(\frac {1}{r - 1} + 1 - \frac {\sigma_ {1}}{1 \sqrt {(r - 1) \langle \Lambda_ {2} , \Lambda_ {2} \rangle}}\right) (9) \\ \Rightarrow \frac {\Sigma_ {2} [ i ]}{\lambda_ {2} [ i ]} = \left(\frac {1}{r - 1} + 1 - \frac {\sigma_ {1}}{1 \sqrt {(r - 1) \langle \Lambda_ {2} , \Lambda_ {2} \rangle}}\right) = \frac {1}{\gamma_ {2}} \quad \forall 1 \leq i \leq p (10) \\ \end{array}
+$$
+
+As the R.H.S. of 10 is independent of $i$ , the above equality implies that all the critical points of (8) are a scalar multiple of $\Sigma_{2}$ , implying, $\Lambda_{2} = \gamma_{2}\Sigma_{2}$ . Note that the domain of $\Lambda_{2}$ are all strictly positive vectors and thus, we can ignore the critical point at $\Lambda_{2} = \mathbf{0}$ . Substituting this into (9) we obtain
+
+$$
+\Sigma_ {2} = \gamma_ {2} \Sigma_ {2} \left(\frac {1}{r - 1} + 1 - \frac {\sigma_ {1}}{\gamma_ {2} \sqrt {(r - 1) \langle \Sigma_ {2} , \Sigma_ {2} \rangle}}\right)
+$$
+
+Using the fact that $\langle \Sigma_2, \Sigma_2 \rangle = \| \mathbf{S}_2 \|_{\mathrm{F}}^2$ in the above equality and with some algebraic manipulations, we obtain $\gamma_2 = \frac{\gamma + r - 1}{r}$ where, $\gamma = \frac{\sqrt{r - 1} \sigma_1}{\|\mathbf{S}_2\|_{\mathrm{F}}}$ . Note, $r \geq 1$ , $\gamma \geq 0$ , and $\Sigma \geq 0$ , implying, $\Lambda_2 = \gamma_2 \Sigma_2 \geq 0$ .
+
+Local minima: Now, we will show that $\Lambda_{2}$ is indeed a minima of (8). To show this, we compute the hessian of $L$ . Recall that
+
+$$
+\frac {\partial L}{\partial \Lambda} = \frac {2 r}{r - 1} \Lambda - \frac {2 \sigma_ {1} \Lambda}{\sqrt {(r - 1) \| \Lambda \| _ {2} ^ {2}}} - 2 \Sigma_ {2}
+$$
+
+$$
+\begin{array}{l} \mathbf {H} = \frac {\partial^ {2} L}{\partial^ {2} \Lambda} = \frac {2 r}{r - 1} \mathbf {I} - \frac {2 \sigma_ {1}}{\sqrt {(r - 1)} \| \boldsymbol {\Lambda} \| _ {2} ^ {2}} \left(\| \boldsymbol {\Lambda} \| _ {2} \mathbf {I} - \frac {1}{\| \boldsymbol {\Lambda} \| _ {2}} \boldsymbol {\Lambda} \boldsymbol {\Lambda} ^ {\top}\right) \\ = 2 \left(\frac {r}{r - 1} - \frac {\sigma_ {1} \| \Lambda \| _ {2}}{\sqrt {(r - 1)} \| \Lambda \| _ {2} ^ {2}}\right) \mathbf {I} + \frac {2 \sigma_ {1}}{\sqrt {r - 1} \| \Lambda \| _ {2} ^ {3}} \left(\Lambda \Lambda^ {\top}\right) \\ \end{array}
+$$
+
+Now we need to show that $\mathbf{H}$ at the solution $\Lambda_{2}$ is PSD i.e. $\forall \mathbf{x} \in \mathbb{R}^{p-1}$ , $\mathbf{x}^{\top} \mathbf{H}(\mathbf{\Lambda}_{2}) \mathbf{x} \geq 0$
+
+$$
+\begin{array}{l} \mathbf {x} ^ {\top} \mathbf {H} \mathbf {x} = 2 \left(\frac {r}{r - 1} - \frac {\sigma_ {1} \| \Lambda \| _ {2}}{\sqrt {(r - 1)} \| \Lambda \| _ {2} ^ {2}}\right) \| \mathbf {x} _ {2} ^ {2} \| + \frac {2 \sigma_ {1}}{\sqrt {r - 1} \| \Lambda \| _ {2} ^ {3}} \mathbf {x} ^ {\top} (\Lambda \Lambda^ {\top}) \mathbf {x} \\ \stackrel {(a)} {\geq} 2 \left(\frac {r}{r - 1} - \frac {\sigma_ {1} \| \Lambda \| _ {2}}{\sqrt {(r - 1)} \| \Lambda \| _ {2} ^ {2}}\right) \| \mathbf {x} \| _ {2} ^ {2} \\ \stackrel {(b)} {\geq} 2 \left(\frac {r}{r - 1} - \frac {\sigma_ {1}}{(r - 1) \lambda_ {1}}\right) \| \mathbf {x} \| _ {2} ^ {2} \stackrel {(c)} {=} \frac {2 r}{r - 1} \left(1 - \frac {\gamma}{(\gamma + r - 1)}\right) \| \mathbf {x} \| _ {2} ^ {2} \\ \stackrel {(d)} {\geq} \frac {2 r}{r - 1} \left(1 - \frac {1}{(1 + r - 1)}\right) \| \mathbf {x} \| _ {2} ^ {2} = 2 \| \mathbf {x} \| _ {2} ^ {2} \geq 0 \\ \end{array}
+$$
+
+Here $(a)$ is due to the fact that the matrix $\Lambda \Lambda^{\top}$ is an outer product matrix and is hence PSD. $(b)$ follows due to (7) and $(c)$ follows by substituting $\lambda_{1} = \gamma_{1}\sigma_{1}$ and then the value of $\gamma_{1}$ . Finally $(d)$ follows as $\left(1 - \frac{\gamma}{(\gamma + r - 1)}\right)$ is decreasing with respect to $\gamma$ and we know that $\gamma < 1$ due to the assumption that $\operatorname{srank}(\mathbf{W}) < r$ . Thus, we can substitute $\gamma = 1$ to find the minimum value of the expression. This concludes our proof that $\Lambda_{2}$ is indeed a local minima of $L$ .
+
+Uniqueness: The uniqueness of $\Lambda_{2}$ as a solution to (8) is shown in Lemma 6 and is also guaranteed by the fact that $\gamma_{2}$ has a unique value. Using $\Lambda_{2} = \gamma_{2}\Sigma_{2}$ and $\lambda_{1} = \gamma_{1}\sigma_{1}$ in (7), we obtain a unique solution $\gamma_{1} = \frac{\gamma_{2}}{\gamma}$ .
+
+Now, we need to show that it is also an unique solution to Theorem 1.
+
+For all solutions to Theorem 1 that have singular vectors which are different than that of $\mathbf{W}$ , by Lemma 5, the matrix formed by replacing the singular vectors of the solution with that of $\mathbf{W}$ is also a solution. Thus, if there were a solution with different singular values than $\widehat{\mathbf{W}}_k$ , it should have appeared as a solution to (8). However, we have shown that (8) has a unique solution.
+
+Now, we need to show that among all matrices with the same singular values as that of $\widehat{\mathbf{W}}_k$ , $\widehat{\mathbf{W}}_k$ is strictly better in terms of $\left\| \mathbf{W} - \widehat{\mathbf{W}}_k \right\|$ . This requires a further assumption that every non-zero singular value of $\Lambda_2$ has a multiplicity of 1 i.e. they are all distinctly unique. Intuitively, this doesn't allow to create a different matrix by simply interchanging the singular vectors associated with the equal singular values. As the elements of $\Sigma_2$ are distinct, the elements of $\Lambda_2 = \gamma_2 \Sigma_2$ are also distinct and thus by the second part of Lemma 5, $\widehat{\mathbf{W}}_k$ is strictly better, in terms of $\left\| \mathbf{W} - \widehat{\mathbf{W}}_k \right\|$ , than all matrices which have the same singular values as that of $\widehat{\mathbf{W}}_k$ . This concludes our discussion on the uniqueness of the solution.
+
+Case for $r = 1$ : Substituting $r = 1$ in the constraint $r = 1 + \frac{\sum_{j=2}^{p} \lambda_j^2}{\lambda_1^2}$ we get
+
+$$
+r - 1 = \frac {\sum_ {j = 2} ^ {p} \lambda_ {j} ^ {2}}{\lambda_ {1} ^ {2}} = 0 \Rightarrow \sum_ {j = 2} ^ {p} \lambda_ {j} ^ {2} = 0
+$$
+
+As it is a sum of squares, each of the individual elements is also zero i.e. $\lambda_{j} = 0\forall 2\leq j\leq p$ Substituting this into (6), we get the following quadratic equation in $\lambda_{1}$
+
+$$
+L = \left\langle \Sigma , \Sigma \right\rangle + \lambda_ {1} ^ {2} - 2 \sigma_ {1} \lambda_ {1} \tag {11}
+$$
+
+which is minimized at $\lambda_1 = \sigma_1$ , thus proving that $\gamma_{1} = 1$ and $\gamma_{2} = 0$ .
+
+Proof for Case (b): In this case, the constraints are meant to preserve the top $k$ singular values of the given matrix while obtaining the new one. Let $\Sigma_1 = (\sigma_1,\dots ,\sigma_k)$ , $\Sigma_{2} = (\sigma_{k + 1},\dots ,\sigma_{p})$ , $\Lambda_{1} = (\lambda_{1},\dots ,\lambda_{k})$ , $\Lambda_{2} = (\lambda_{k + 1},\dots ,\lambda_{p})$ . Since satisfying all the constraints imply $\Sigma_{1} = \Lambda_{1}$ , thus, $L\coloneqq \left\| \mathbf{W} - \widehat{\mathbf{W}}_k\right\| _F^2 = \langle \Sigma_2 - \Lambda_2,\Sigma_2 - \Lambda_2\rangle$ . From the stable rank constraint $\mathrm{srank}(\widehat{\mathbf{W}}_k) = r$ , we have
+
+$$
+r = \frac {\left\langle \Lambda_ {1} , \Lambda_ {1} \right\rangle + \left\langle \Lambda_ {2} , \Lambda_ {2} \right\rangle}{\lambda_ {1} ^ {2}}
+$$
+
+$$
+\therefore \langle \Lambda_ {2}, \Lambda_ {2} \rangle = r \lambda_ {1} ^ {2} - \langle \Lambda_ {1}, \Lambda_ {1} \rangle = r \sigma_ {1} ^ {2} - \langle \Sigma_ {1}, \Sigma_ {1} \rangle \tag {12}
+$$
+
+The above equality constraint makes the problem non-convex. Thus, we relax it to $\operatorname{srank}(\widehat{\mathbf{W}}_k) \leq r$ to make it a convex problem and show that the optimality is achieved with equality. Let $r\sigma_1^2 - \langle \Sigma_1, \Sigma_1 \rangle = \eta$ . Then, the relaxed problem can be written as
+
+$$
+\min _ {\Lambda_ {2} \in \mathbb {R} ^ {p - k}} L := \left\langle \Sigma_ {2} - \Lambda_ {2}, \Sigma_ {2} - \Lambda_ {2} \right\rangle
+$$
+
+$$
+\begin{array}{r l} \mathrm {s . t .} & \Lambda_ {2} \geq 0, \langle \Lambda_ {2}, \Lambda_ {2} \rangle \leq \eta . \end{array}
+$$
+
+We introduce the Lagrangian dual variables $\Gamma \in \mathbb{R}^{p - k}$ and $\mu$ corresponding to the positivity and the stable rank constraints, respectively. The Lagrangian can then be written as
+
+$$
+\mathcal {L} \left(\Lambda_ {2}, \Gamma , \mu\right) _ {\Gamma \geq 0, \mu \geq 0} = \left\langle \Sigma_ {2} - \Lambda_ {2}, \Sigma_ {2} - \Lambda_ {2} \right\rangle + \mu \left(\left\langle \Lambda_ {2}, \Lambda_ {2} \right\rangle - \eta\right) - \left\langle \Gamma , \Lambda_ {2} \right\rangle \tag {13}
+$$
+
+Using the primal optimality condition $\frac{\partial\mathcal{L}}{\partial\Lambda_2} = 0$ , we obtain
+
+$$
+\begin{array}{l} 2 \Lambda_ {2} - 2 \Sigma_ {2} + 2 \mu \Lambda_ {2} - \Gamma = \mathbf {0} \\ \Rightarrow \Lambda_ {2} = \frac {\Gamma + 2 \Sigma_ {2}}{2 (1 + \mu)} \tag {14} \\ \end{array}
+$$
+
+Using the above condition on $\Lambda_{2}$ with the constraint $\langle \Lambda_2,\Lambda_2\rangle \leq \eta$ , combined with the stable rank constraint of the given matrix $\mathbf{W}$ that comes with the problem definition, $\operatorname{rank}(\mathbf{W}) > r$ (which implies $\langle \Sigma_2,\Sigma_2\rangle >\eta$ ), the following inequality must be satisfied for any $\Gamma \geq 0$
+
+$$
+1 < \frac {\left\langle \Sigma_ {2} , \Sigma_ {2} \right\rangle}{\eta} \leq \frac {\left\langle \Gamma + \Sigma_ {2} , \Gamma + \Sigma_ {2} \right\rangle}{\eta} \leq (1 + \mu) ^ {2} \tag {15}
+$$
+
+For the above inequality to satisfy, the dual variable $\mu$ must be greater than zero, implying, $\langle \Lambda_2,\Lambda_2\rangle -\eta$ must be zero for the complementary slackness to satisfy. Using this with the optimality condition (14) we obtain
+
+$$
+(1 + \mu) ^ {2} = \frac {\left\langle \Gamma + 2 \Sigma_ {2} , \Gamma + 2 \Sigma_ {2} \right\rangle}{4 \eta}
+$$
+
+Substituting the above solution back into the primal optimality condition we get
+
+$$
+\Lambda_ {2} = \left(\Gamma + 2 \Sigma_ {2}\right) \frac {\sqrt {\eta}}{\sqrt {\left\langle \Gamma + 2 \Sigma_ {2} , \Gamma + 2 \Sigma_ {2} \right\rangle}} \tag {16}
+$$
+
+Finally, we use the complimentary slackness condition $\Gamma \odot \Lambda_2 = 0^{11}$ to get rid of the dual variable $\Gamma$ as follows
+
+$$
+\Gamma \odot (\Gamma + 2 \Sigma_ {2}) \frac {\sqrt {\eta}}{\sqrt {\langle \Gamma + 2 \Sigma_ {2} , \Gamma + 2 \Sigma_ {2} \rangle}} = 0
+$$
+
+It is easy to see that the above condition is satisfied only when $\Gamma = \mathbf{0}$ as $\Sigma_2 \geq \mathbf{0}$ and $\eta > 0$ . Therefore, using $\Gamma = \mathbf{0}$ in (16) we obtain the optimal solution of $\Lambda_2$ as
+
+$$
+\Lambda_ {2} = \frac {\sqrt {\eta}}{\sqrt {\left\langle \Sigma_ {2} , \Sigma_ {2} \right\rangle}} \Sigma_ {2} = \frac {\sqrt {r \sigma_ {1} ^ {2} - \left\| \mathbf {S} _ {1} \right\| _ {\mathrm {F}} ^ {2}}}{\left\| \mathbf {S} _ {2} \right\| _ {\mathrm {F}} ^ {2}} \Sigma_ {2} = \gamma \Sigma_ {2} \tag {17}
+$$
+
+Proof for Case (c): The monotonicity of $\left\| \widehat{\mathbf{W}}_k - \mathbf{W}\right\|_{\mathrm{F}}$ for $k\geq 1$ is shown in Lemma 3.
+
+
+
+Note that by the assumption that $\mathrm{rank}(\mathbf{W}) < r$ , we can say that $\gamma < 1$ . Therefore in all the cases $\gamma_2 < 1$ . Let us look at the required conditions for $\gamma_1 \geq 1$ to hold. When $k \geq 1$ , $\gamma_1 = 1$ holds. When $k = 0$ , for $\gamma_1 > 1$ to be true, $\gamma_2 < \gamma$ should hold, implying, $(\gamma - 1) < r(\gamma - 1)$ , which is always true as $r > 1$ (by the definition of stable rank).
+
+Lemma 3. For $k \geq 1$ , the solution to the optimization problem (4) obtained using Theorem 1 is closest to the original matrix $\mathbf{W}$ in terms of Frobenius norm when only the spectral norm is preserved, implying, $k = 1$ .
+
+Proof. For a given matrix $\mathbf{W}$ and a partitioning index $k\in \{1,\dots ,p\}$ , let $\widehat{\mathbf{W}}_k = \mathbf{S}_1^k +\gamma \mathbf{S}_2^k$ be the matrix obtained using Theorem 1. We use the superscript $k$ along with $\mathbf{S}_1$ and $\mathbf{S}_2$ to denote that this refers to the particular solution of $\widehat{\mathbf{W}}_k$ . Plugging the value of $\gamma$ and using the fact that $\left\| \mathbf{S}_2^k\right\|_{\mathrm{F}}\neq 0$ , we can write
+
+$$
+\begin{array}{l} \left\| \mathbf {W} - \widehat {\mathbf {W}} _ {k} \right\| _ {\mathrm {F}} = (1 - \gamma) \left\| \mathbf {S} _ {2} ^ {k} \right\| _ {\mathrm {F}} \\ = \left\| \mathbf {S} _ {2} ^ {k} \right\| _ {\mathrm {F}} - \sqrt {r \sigma_ {1} ^ {2} - \left\| \mathbf {S} _ {1} ^ {k} \right\| _ {\mathrm {F}} ^ {2}} \\ = \left\| \mathbf {S} _ {2} ^ {k} \right\| _ {\mathrm {F}} - \sqrt {r \sigma_ {1} ^ {2} - \left\| \mathbf {W} \right\| _ {\mathrm {F}} ^ {2} + \left\| \mathbf {S} _ {2} ^ {k} \right\| _ {\mathrm {F}} ^ {2}}. \\ \end{array}
+$$
+
+Thus, $\left\| \mathbf{W} - \widehat{\mathbf{W}}_k\right\|_{\mathrm{F}}$ can be written in a simplified form as $f(x) = x - \sqrt{a + x^2}$ , where $x = \left\| \mathbf{S}_2^k\right\|_{\mathrm{F}}$ and $a = r\sigma_1^2 -\| \mathbf{W}\|_{\mathrm{F}}^2$ . Note, $a\leq 0$ as $1\leq r\leq \operatorname {srank}(\mathbf{W})$ , and $a + x^{2}\geq 0$ because of the condition in Theorem 1. Under these settings, it is trivial to verify that $f$ is a monotonically decreasing function of $x$ . Using the fact that as the partition index $k$ increases, $x$ decreases, it is straightforward to conclude that the minimum of $f(x)$ is obtained at $k = 1$ .
+
+# A.2 PROOF FOR OPTIMAL SPECTRAL NORMALIZATION
+
+The widely used spectral normalization (Miyato et al., 2018) where the given matrix $\mathbf{W} \in \mathbb{R}^{m \times n}$ is divided by the maximum singular value is an approximation to the optimal solution of the spectral normalization problem defined as
+
+$$
+\underset {\widehat {\mathbf {W}}} {\arg \min } \left\| \mathbf {W} - \widehat {\mathbf {W}} \right\| _ {\mathrm {F}} ^ {2} \tag {18}
+$$
+
+$$
+s. t. \quad \sigma (\widehat {\mathbf {W}}) \leq s,
+$$
+
+where $\sigma (\widehat{\mathbf{W}})$ denotes the maximum singular value and $s > 0$ is a hyperparameter. The optimal solution to this problem is shown in Algorithm 3. In what follows we provide the optimality proof
+
+Algorithm 3 Spectral Normalization
+Require: $\mathbf{W}\in \mathbb{R}^{m\times n},s$
+1: $\mathbf{W}_1\gets 0,p\gets \min (m,n)$
+2: for $k\in \{1,\dots ,p\}$ do
+3: $\{\mathbf{u}_k,\mathbf{v}_k,\sigma_k\} \leftarrow SVD(\mathbf{W},k)$ perform power method to get $k$ -th singular value
+4: if $\sigma_{k}\geq s$ then
+5: $\mathbf{W}_1\gets \mathbf{W}_1 + s\mathbf{u}_k\mathbf{v}_k^\top$
+6: $\mathbf{W}\gets \mathbf{W} - \sigma_k\mathbf{u}_k\mathbf{v}_k^\top$
+7: else
+8: break exit for loop
+9: end if
+10: end for
+11: return $\mathbf{W}\gets \mathbf{W}_1 + \mathbf{W}$
+
+of Algorithm 3 for the sake of completeness. Let SVD $(\mathbf{W}) = \mathbf{U}\Sigma \mathbf{V}^{\top}$ and let us assume that $\mathbf{Z} = \mathbf{S}\Lambda \mathbf{T}^{\top}$ is a solution to the problem 18. Trivially, $\mathbf{X} = \mathbf{U}\Lambda \mathbf{V}^{\top}$ also satisfies $\sigma (\mathbf{X})\leq s$ . Now, $\| \mathbf{W} - \mathbf{X}\|_{\mathrm{F}}^{2} = \| \mathbf{U}(\Sigma -\Lambda)\mathbf{V}^{\top}\|_{\mathrm{F}}^{2} = \| (\Sigma -\Lambda)\|_{\mathrm{F}}^{2}\leq \| \mathbf{W} - \mathbf{Z}\|_{\mathrm{F}}^{2}$ , where the last inequality directly comes from Lemma 4. Thus the singular vectors of the optimal solution must be the same as that of $\mathbf{W}$ . This boils down to solving the following problem
+
+$$
+\underset {\Lambda \in \mathbb {R} _ {+} ^ {\min (m, n)}} {\arg \min } \| \Lambda - \Sigma \| _ {\mathrm {F}} ^ {2} s. t. \Lambda [ i ] \leq s \forall i \in \{0, \min (m, n) \}. \tag {19}
+$$
+
+Here, without loss of generality, we abuse notations by considering $\Lambda$ and $\Sigma$ to represent the diagonal vectors of the original diagonal matrices $\Lambda$ and $\Sigma$ , and $\Lambda [i]$ as its $i$ -th index. It is trivial to see that the optimal solution with minimum Frobenius norm is achieved when
+
+$$
+\Lambda \left[ i \right] = \left\{ \begin{array}{l l} \Sigma \left[ i \right], & \text {i f} \Sigma \left[ i \right] \leq s \\ s, & \text {o t h e r w i s e .} \end{array} \right.
+$$
+
+This is exactly what Algorithm 3 implements.
+
+# A.3 AUXILIARY LEMMAS
+
+Lemma 4. [Reproduced from Theorem 5 in Mirsky (1960)] For any two matrices $\mathbf{A},\mathbf{B}\in \mathbb{R}^{m\times n}$ with singular values as $\sigma_{1}\geq \dots \geq \sigma_{n}$ and $\rho_{1}\geq \dots \geq \rho_{n}$ , respectively
+
+$$
+\left\| \mathbf {A} - \mathbf {B} \right\| _ {\mathrm {F}} ^ {2} \geq \sum_ {i = 1} ^ {n} \left(\sigma_ {i} - \rho_ {i}\right) ^ {2}
+$$
+
+Proof. Consider the following symmetric matrices
+
+$$
+\mathbf {X} = \left[ \begin{array}{c c} \mathbf {0} & \mathbf {A} \\ \mathbf {A} ^ {\top} & \mathbf {0} \end{array} \right], \mathbf {Y} = \left[ \begin{array}{c c} \mathbf {0} & \mathbf {B} \\ \mathbf {B} ^ {\top} & \mathbf {0} \end{array} \right], \mathbf {Z} = \left[ \begin{array}{c c} \mathbf {0} & \mathbf {A} - \mathbf {B} \\ (\mathbf {A} - \mathbf {B}) ^ {\top} & \mathbf {0} \end{array} \right]
+$$
+
+Let $\tau_{1} \geq \dots \geq \tau_{n}$ be the singular values of $\mathbf{Z}$ . Then the set of characteristic roots of $\mathbf{X}, \mathbf{Y}$ and $\mathbf{Z}$ in descending order are $\{\rho_{1}, \dots, \rho_{n}, -\rho_{n}, \dots, -\rho_{1}\}$ , $\{\sigma_{1}, \dots, \sigma_{n}, -\sigma_{n}, \dots, -\sigma_{1}\}$ , and $\{\tau_{1}, \dots, \tau_{n}, -\tau_{n}, \dots, -\tau_{1}\}$ , respectively. By Lemma 2 in Wielandt (1955)
+
+$$
+\left[ \sigma_ {1} - \rho_ {1}, \dots , \sigma_ {n} - \rho_ {n}, \rho_ {n} - \sigma_ {n}, \dots , \rho_ {1} - \sigma_ {1} \right] \preceq \left[ \tau_ {1}, \dots \tau_ {n}, - \tau_ {n}, - \tau_ {1} \right],
+$$
+
+which implies that
+
+$$
+\sum_ {i = 1} ^ {n} \left(\sigma_ {i} - \rho_ {i}\right) ^ {2} \leq \sum_ {i = 1} ^ {n} \tau_ {i} ^ {2} = \| \mathbf {A} - \mathbf {B} \| _ {\mathrm {F}} ^ {2} \tag {20}
+$$
+
+
+
+Lemma 5. Let $\mathbf{A},\mathbf{B}\in \mathbb{R}^{m\times n}$ where $\mathrm{SVD}(\mathbf{A}) = \mathbf{U}\Sigma \mathbf{V}^{\top}$ and $\mathbf{B}$ is the solution to the following problem
+
+$$
+\mathbf {B} = \underset {\operatorname {s r a n k} (\mathbf {W}) = r} {\arg \min } \| \mathbf {W} - \mathbf {A} \| _ {\mathrm {F}} ^ {2}. \tag {21}
+$$
+
+Then, $\operatorname{SVD}(\mathbf{B}) = \mathbf{U}\Lambda \mathbf{V}^{\top}$ where $\Lambda$ is a diagonal matrix with non-negative entries. Implied, $\mathbf{A}$ and $\mathbf{B}$ will have the same singular vectors.
+
+Proof. Let us assume that $\mathbf{Z} = \mathbf{S}\Lambda \mathbf{T}^{\top}$ is a solution to the problem 21 where $\mathbf{S} \neq \mathbf{U}$ and $\mathbf{T} \neq \mathbf{V}$ . Trivially, $\mathbf{X} = \mathbf{U}\Lambda \mathbf{V}^{\top}$ also lies in the feasible set as it satisfies $\mathrm{srank}(\mathbf{X}) = r$ (note stable rank only depends on the singular values). Using the fact that the Frobenius norm is invariant to unitary transformations, we can write $\| \mathbf{A} - \mathbf{X}\|_{\mathrm{F}}^{2} = \| \mathbf{U}(\Sigma - \Lambda)\mathbf{V}^{\top}\|_{\mathrm{F}}^{2} = \| (\Sigma - \Lambda)\|_{\mathrm{F}}^{2}$ . Combining this with Lemma 4, we obtain $\| \mathbf{A} - \mathbf{X}\|_{\mathrm{F}}^{2} = \| (\Sigma - \Lambda)\|_{\mathrm{F}}^{2} \leq \| \mathbf{A} - \mathbf{Z}\|_{\mathrm{F}}^{2}$ . Since, $\mathbf{S} \neq \mathbf{U}$ and $\mathbf{T} \neq \mathbf{V}$ , we can further change $\leq$ to a strict inequality $<$ . This completes the proof.
+
+Generally speaking, the optimal solution to problem 21 with constraints depending only on the singular values (e.g. stable rank in this case) will have the same singular vectors as that of the original matrix.
+
+Further the inequality in (20) can be converted into a strict inequality if neither of $\mathbf{A}$ and $\mathbf{B}$ have repeated singular values. Using that strict inequality, if both $\Sigma$ and $\Lambda$ have no repeated values, then $\mathbf{B}$ is the only solution to (21) that has the singular values of $\Lambda$ .
+
+
+
+Lemma 6. Let $\mathbf{y}_1 = a\mathbf{x}_1 + b\hat{\mathbf{x}}_1$ and $\mathbf{y}_2 = a\mathbf{x}_2 + b\hat{\mathbf{x}}_2$ , where $\hat{\mathbf{x}}_1$ and $\hat{\mathbf{x}}_2$ denote the unit vectors. Then, $\mathbf{y}_1 = \mathbf{y}_2$ if $\mathbf{x}_1 = \mathbf{x}_2$ .
+
+# B EMPIRICAL LIPSCHITZ CONSTANT
+
+# B.1 RELATING EMPIRICAL LOCAL AND GLOBAL LIPSCHITZ CONSTANTS
+
+Proposition B.1. Let $f: \mathbb{R}^m \mapsto \mathbb{R}$ be a Fréchet differentiable function, $\mathcal{D}$ the dataset, and Conv $(\mathbf{x}_i, \mathbf{x}_j)$ denotes the convex combination of a pair of samples $\mathbf{x}_i$ and $\mathbf{x}_j$ , then $\forall p, q \in [1, \infty]$ such that $\frac{1}{p} + \frac{1}{q} = 1$
+
+$$
+\max_{\mathbf{x}_{i},\mathbf{x}_{j}\in \mathcal{D}}\frac{|f(\mathbf{x}_{i}) - f(\mathbf{x}_{j})|}{\|\mathbf{x}_{i} - \mathbf{x}_{j}\|_{p}}\leq \max_{\substack{\mathbf{x}_{i},\mathbf{x}_{j}\in \mathcal{D}\\ \mathbf{x}\in Conv (\mathbf{x}_{i},\mathbf{x}_{j})}}\| J_{f}(\mathbf{x})\|_{q}
+$$
+
+Proof. Let $f: \mathbb{R}^m \to \mathbb{R}$ be a differentiable function on an open set containing $\mathbf{x}_i$ and $\mathbf{x}_j$ such that $\mathbf{x}_i \neq \mathbf{x}_j$ . By applying fundamental theorem of calculus
+
+$$
+\begin{array}{l} \left| f \left(\mathbf {x} _ {i}\right) - f \left(\mathbf {x} _ {j}\right) \right| = \left| \int_ {0} ^ {1} \nabla f \left(\mathbf {x} _ {i} + \theta \left(\mathbf {x} _ {j} - \mathbf {x} _ {i}\right)\right) ^ {\top} \left(\mathbf {x} _ {j} - \mathbf {x} _ {i}\right) \partial \theta \right| \\ \leq \int_ {0} ^ {1} \left| \nabla f \left(\mathbf {x} _ {i} + \theta \left(\mathbf {x} _ {j} - \mathbf {x} _ {i}\right)\right) ^ {\top} \left(\mathbf {x} _ {j} - \mathbf {x} _ {i}\right) \right| \partial \theta \\ \stackrel {(a)} {\leq} \int_ {0} ^ {1} \| \nabla f (\mathbf {x} _ {i} + \theta (\mathbf {x} _ {j} - \mathbf {x} _ {i})) \| _ {q} \| (\mathbf {x} _ {j} - \mathbf {x} _ {i}) \| _ {p} \partial \theta \\ \leq \int_ {0} ^ {1} \max _ {\theta \in (0, 1)} \| \nabla f (\mathbf {x} _ {i} + \theta (\mathbf {x} _ {j} - \mathbf {x} _ {i})) \| _ {q} \| (\mathbf {x} _ {j} - \mathbf {x} _ {i}) \| _ {p} \partial \theta \\ = \max _ {\theta \in (0, 1)} \| \nabla f (\mathbf {x} _ {i} + \theta (\mathbf {x} _ {j} - \mathbf {x} _ {i})) \| _ {q} \| (\mathbf {x} _ {j} - \mathbf {x} _ {i}) \| _ {p} \int_ {0} ^ {1} \partial \theta \\ \end{array}
+$$
+
+$$
+\therefore \frac {\left| f \left(\mathbf {x} _ {i}\right) - f \left(\mathbf {x} _ {j}\right) \right|}{\left\| \left(\mathbf {x} _ {j} - \mathbf {x} _ {i}\right) \right\| _ {p}} \leq \max _ {\theta \in (0, 1)} \left\| \nabla f \left(\mathbf {x} _ {i} + \theta \left(\mathbf {x} _ {j} - \mathbf {x} _ {i}\right)\right) \right\| _ {q} = \max _ {\mathbf {x} \in C o n v \left(\mathbf {x} _ {i}, \mathbf {x} _ {j}\right)} \left\| \nabla f \left(\mathbf {x}\right) \right\| _ {q}.
+$$
+
+The inequality (a) is due to Hölder's inequality.
+
+
+
+# B.2 EFFECT OF RANK ON THE EMPIRICAL LIPSCHITZ CONSTANTS
+
+Let $f(\mathbf{x}) = \mathbf{W}_2\mathbf{W}_1\mathbf{x}$ be a two-layer linear NN with weights $\mathbf{W}_1$ and $\mathbf{W}_2$ . The Jacobian in this case is independent of $\mathbf{x}$ . Thus, the local Lipschitz constant is the same for all $\mathbf{x} \in \mathbb{R}^m$ , implying, local $L_{e} = L_{l}(\mathbf{x}) = L_{l} = \| \mathbf{W}_{2}\mathbf{W}_{1}\| \leq \| \mathbf{W}_{2}\| \| \mathbf{W}_{1}\|$ . Note, in the case of 2-matrix norm reducing the rank will not affect the upperbound. However, as will be discussed below, rank reduction greatly influences the global $L_{e}$ .
+
+Let $\mathbf{x}_i$ and $\mathbf{x}_j$ be random pairs from $\mathcal{D}$ and $\Delta \mathbf{x} \neq \mathbf{0}$ be the difference $\mathbf{x}_i - \mathbf{x}_j$ , then, the global $L_e$ is $\max_{\{\mathbf{x}_i, \mathbf{x}_j\} \in \mathcal{D}} \frac{\|\mathbf{W}_2 \mathbf{W}_1 \Delta \mathbf{x}\|}{\|\Delta \mathbf{x}\|}$ . Let $k_1$ and $k_2$ be the ranks, and $\sigma_1 \geq \dots \geq \sigma_{k_1}$ and $\lambda_1 \geq \dots \geq \lambda_{k_2}$ the singular values of the matrices $\mathbf{W}_1$ and $\mathbf{W}_2$ , respectively. Let $P_i = \mathbf{u}_i \bar{\mathbf{u}}_i^\top$ be the orthogonal projection matrix corresponding to $\mathbf{u}_i$ and $\bar{\mathbf{u}}_i$ , the left and the right singular vectors of $\mathbf{W}_1$ . Similarly, we define $Q_i$ for $\mathbf{W}_2$ corresponding to $\mathbf{v}_i$ and $\bar{\mathbf{v}}_i$ . Then, $\mathbf{W}_2 \mathbf{W}_1 = \sum_{i=1}^{k_2} \sum_{j=1}^{k_1} \lambda_i \sigma_j Q_i P_j$ . The upper bound, $\lambda_1 \sigma_1$ , can be achieved if and only if $\Delta \mathbf{x} = \bar{\mathbf{u}}_1 \| \Delta \mathbf{x} \|$ and $\mathbf{u}_1 = \bar{\mathbf{v}}_1$ (a perfect alignment), which is highly unlikely. In practice, not just the maximum singular values, as is the case with the Lipschitz upper-bound, rather the combination of the projection matrices and the singular values play a crucial role in providing an estimate of global $L_e$ . Thus, reducing the singular values, which is equivalent to minimizing the rank (or stable rank), will directly affect $L_e$ . For example, assigning $\sigma_j = 0$ , which in effect will reduce the rank of $\mathbf{W}_1$ by one, will nullify its influence on all projections associated with $P_j$ . Implied, all the $k_2$ projections $\sigma_j (\sum_{i=1}^{k_2} \lambda_i Q_i) P_j$ that would propagate the input via $P_j$ will be blocked. This, in effect, will influence $\|\mathbf{W}_2 \mathbf{W}_2 \Delta \mathbf{x}\|$ ; hence the global $L_e$ . In a more general setting, let $k_i$ be the rank of the $i$ -th linear layer, then, each singular value of a $j$ -th layer can influence the maximum of $\prod_{i=1}^{j-1} k_i \prod_{i=j+1}^l k_i$ many paths through which an input can be propagated. Thus, mappings with low rank (stable) will greatly reduce the global $L_e$ . Similar arguments can be drawn for local $L_e$ in the case of NN with non-linearity.
+
+# C THE LOCAL LIPSCHITZ UPPER-BOUND FOR NEURAL NETWORKS
+
+As mentioned in Section 2, $L_{l}(\mathbf{x}) = \| J_{f}(\mathbf{x})\|_{p,q}$ , where, in the case of NN, the Jacobian is:
+
+$$
+J _ {f} (\mathbf {x}) = \frac {\partial f (\mathbf {x})}{\partial \mathbf {x}} := \frac {\partial \mathbf {z} _ {1}}{\partial \mathbf {x}} \frac {\partial \phi_ {1} (\mathbf {z} _ {1})}{\partial \mathbf {z} _ {1}} \dots \frac {\partial \mathbf {z} _ {l}}{\partial \mathbf {a} _ {l - 1}} \frac {\partial \phi_ {l} (\mathbf {z} _ {l})}{\partial \mathbf {z} _ {l}}. \tag {22}
+$$
+
+Using $\frac{\partial\mathbf{z}_l}{\partial\mathbf{a}_{l - 1}} = \mathbf{W}_l$ (affine transformation), and applying submultiplicativity of the matrix norms:
+
+$$
+\left\| J _ {f} (\mathbf {x}) \right\| _ {p, q} \leq \left\| \mathbf {W} _ {1} \right\| _ {p, q} \left\| \frac {\partial \phi_ {1} (\mathbf {z} _ {1})}{\partial \mathbf {z} _ {1}} \right\| \dots \left\| \mathbf {W} _ {l} \right\| _ {p, q} \left\| \frac {\partial \phi_ {l} (\mathbf {z} _ {l})}{\partial \mathbf {z} _ {l}} \right\|. \tag {23}
+$$
+
+Note, most commonly used activation functions $\phi (.)$ such as ReLU, sigmoid, tanh and maxout are known to have Lipschitz constant of 1 (if scaled appropriately) $^{12}$ , thus, the upper bound can further be written only using the operator norms of the intermediate matrices as
+
+$$
+L _ {l} (\mathbf {x}) \leq \| J _ {f} (\mathbf {x}) \| _ {p, q} \leq \| \mathbf {W} _ {l} \| _ {p, q} \dots \| \mathbf {W} _ {1} \| _ {p, q}. \tag {24}
+$$
+
+Furthermore $L_{l}(\mathbf{x})$ can be substituted by $L_{l}$ , the local Lipschitz constant, as the upper bound (Eq. (24)) is independent of $\mathbf{x}$ . Note that this is one of the main reasons why we consider the empirical Lipschitz to better reflect the true behaviour of the function as the NN is never exposed to the entire domain $\mathbb{R}^{m}$ but only a small subset dependant on the data distribution.
+
+The other reason why this upper bound is a bad estimate is that the inequality in Eq (23) is tight only when the partial derivatives are aligned, implying, $\left\| \frac{\partial \mathbf{z}_{\ell}}{\partial \mathbf{z}_{\ell - 1}} \frac{\partial \mathbf{z}_{\ell + 1}}{\partial \mathbf{z}_{\ell}} \right\|_{2} = \left\| \frac{\partial \mathbf{z}_{\ell}}{\partial \mathbf{z}_{\ell - 1}} \right\|_{2} \left\| \frac{\partial \mathbf{z}_{\ell + 1}}{\partial \mathbf{z}_{\ell}} \right\|_{2} \quad \forall l - 2 \leq \ell \leq l$ . This problem has been referred to as the problem of mis-alignment and is similar to quantities like layer cushion in Arora et al. (2018).
+
+# D EXPERIMENTAL DETAILS
+
+WideResNet-28-10 We use a standard WideResNet with 28 layers and a growth factor of 10. In total, the network has 36,539,124 trainable parameters. The network is the standard configuration with batchnorm and ReLU activations and is trained with a weight decay of $1e - 4$ . The learning rate was multiplied by 0.2 after 60, 120, and 160 epochs respectively.
+
+ResNet-110 The ResNet-110 is a standard 110 layered ResNet with batch Norm and ReLU and has 1,973,236 parameters. The network is trained with SGD, an initial learning rate of 0.1, which is multiplied 0.1 after 150 and 250 epochs respectively, a weight decay of $5e - 4$ and a momentum of 0.9.
+
+Densenet-100 The DenseNet-100 is a standard 100-layered densenet with Batchnorm and ReLU and has a total of 800, 032 trainable parameters. The network is trained with SGD, an initial learning rate of 0.1, which is multiplied by 0.1 after 150 and 250 epochs respectively, a weight decay of $1e - 4$ , and a momentum of 0.9.
+
+VGG19 The VGG19 model is the standard 19-layered VGG model with Batchnorm and ReLU. It has a total of 20,548,392 trainable parameters and is trained with SGD with a momentum of 0.9 and a weight decay of $5e - 4$ . The initial learning rate is 0.1 and is multiplied by 0.1 after 150 and 250 epochs respectively. For the shattering experiments, we used the same architecture and the same training recipe except the initial learning rate, which was deceased to 0.01 as the model failed to learn the random labels with a large learning rate.
+
+AlexNet The Alexnet model is the standard ALexNet model with 4,965,092 trainable parameters. It was trained with SGD, with a momentum of 0.9, with an initial learning rate is 0.01, which is multiplied by 0.1 after 150 and 250 epochs respectively. The optimizer was further augmented with a weight decay rate of $5e - 4$ . Please refer to the next section for results on different learning rates and with and without weight decay.
+
+# D.1 ADDITIONAL EXPERIMENTS ON GENERALIZATION
+
+Complexity measures In this section, we provide more details about the various complexity measures we used in Figure 4.
+
+- Spec-Fro: $\frac{\prod_{i=1}^{L}\|\mathbf{W}_{i}\|_{2}^{2}\sum_{i=1}^{L}\operatorname{srank}(\mathbf{W}_{i})}{\gamma^{2}}$ (Neyshabur et al., 2018). This bound is the main motivation of this paper; the two quantities used to normalize the margin $(\gamma)$ is the product of spectral norm i.e. $\prod_{i=1}^{L}\|\mathbf{W}_{i}\|_{2}^{2}$ (or worst case lipschitzness) and sum of stable rank i.e., $\sum_{i=1}^{L}\operatorname{srank}(\mathbf{W}_{i})$ (or an approximate parameter count like rank of a matrix).
+
+- Spec-L1: $\frac{\prod_{i=1}^{L}\|\mathbf{W}_{i}\|_{2}^{2}\left(\sum_{i=1}^{L}\frac{\|\mathbf{W}_{i}\|_{2,1}^{2/3}}{\|\mathbf{W}_{i}\|_{2}^{2/3}}\right)^{3}}{\gamma^{2}}$ , where $\|\cdot\|_{2,1}$ is the matrix 2-1 norm. As showed by Bartlett et al. (2017), Spec-L1 is the spectrally normalized margin, and unlike just the margin, is a good indicator of the generalization properties of a network.
+- Jac-Norm: $\sum_{i=1}^{L} \frac{\|\mathbf{h}_i\|_2 \|\mathbf{J}_i\|_2}{\gamma}$ (Wei & Ma), where $\mathbf{h}_i$ is the $i^{th}$ hidden layer and $\mathbf{J}_i = \frac{\partial \gamma}{\partial h_i}$ i.e., the Jacobian of the margin with respect to the $i^{th}$ hidden layer (thus, a vector). Note, Jac-Norm depends on the norm of the Jacobian (local empirical Lipschitz) and norm of the hidden layers - additional data-dependent terms compared to Spec-Fro and Spec-L1, thus captures a more realistic (and optimistic) generalization behaviour.
+
+For better clarity regarding Figure 4, we provide the 90 percentile for each of these histograms in Table 5. As the plots and the table show, both SRN and SN produces a much smaller quantity than a Vanilla network and in 7 out of the 9 cases, SRN is better than SN. The difference between SRN and SN is much more significant in the case of Jac-Norm. As this depend on the empirical lipschitzness, it provides the empirical validation of our arguments in Section 3.
+
+| Model | Algorithm | Jac-Norm | Spec-L1 | Spec-Fro |
| ResNet-110 | Vanilla | 17.7 | ∞ | ∞ |
| Spectral (SN) | 17.8 | 10.8 | 7.4 |
| SRN-30 | 17.2 | 10.7 | 7.2 |
| WideResNet-28-10 | Vanilla | 16.2 | 14.60 | 11.18 |
| Spectral (SN) | 16.13 | 7.23 | 4.5 |
| SRN-50 | 15.8 | 7.3 | 4.5 |
| SRN-30 | 15.7 | 7.20 | 4.4 |
| Densenet-100 | Vanilla | 19.2 | ∞ | ∞ |
| Spectral (SN) | 17.8 | 12.2 | 9.4 |
| SRN-50 | 17.6 | 12 | 9.2 |
| SRN-30 | 17.7 | 11.8 | 9.0 |
+
+Alexnet experiments: Figure 6 shows the test error and generalization error of Alexnet trained with a large learning rate of 0.1. Note that, the model fails to learn completely without weight decay. Generalisation Error decreases monotonically with decreasing $c$ in the stable rank constraint. Test error is the lowest for $c = 0.5$ . The constraint becomes too aggressive for even $c$ lower than that. The slightly more interesting observation is that having a weight decay actually hurts generalization error while it has a slightly positive effect on test error.
+
+Low Learning Rate Here, we train a WideResnet-28-10 with SRN, SN, and vanilla methods with an $lr = 0.01$ and weight decay of $5 \times 10^{-4}$ on randomly labelled CIFAR100. for 50 epochs. The results are shown in Table 6 and it further supports that SRN is more robust to random noise than SN or vanilla methods.
+
+Table 5: Values of 90 percentile of log complexity measures from Figure 4. Here $\infty$ refers to the situations where the product of spectral norm blows up. This is the case in deep networks like ResNet-110 and Densenet-100 where the absence of spectral normalization (Vanilla) allows the product of spectral norm to grow arbitrarily large with increasing number of layers. Lower is better.
+
+| Stable-30 | Spectral | Vanilla |
| 29.04 | 17.24 | 1.22 |
+
+Table 6: Training Error for WideResNet-28-10 on CIFAR100 with randomized labels, low lr= 0.01, and with weight decay. (Higher is better.)
+
+With and without weight decay In Figure 7a, we show the training error of Alexnet trained with SGD with and without weight decay $(= 5e - 4)$ with a learning rate of 0.01. Again, we see that a
+
+
+Figure 6: Test Error and Generalization Error of AlexNet trained with SGD with $lr = 0.1$ on (clean) CIFAR-100. (Lower is better
+
+
+
+more aggressive stable rank constraint decreases fitting the random data. Similar results are seen for ResNet-110 in Figure 7b.
+
+
+Figure 7: Training error on randomly labelled CIFAR-100 with a learning rate of 0.01 and with/ without weight decay. (Higher is better.
+
+
+
+Low Learning Rate, with and without weight decay on clean CIFAR100 In Appendix D.1, we show the test accuracies for the clean data with the same configuration as in Table 1. This corresponds to the highly non-generic learning setting.
+
+ | Vanilla | Spectral | Stable-50 | Stable-30 |
| W/o WD | 69.2 ± 0.5 | 69±0.1 | 69.1 ±0.85 | 69.3 ±0.4 |
| With WD | 70.4± 0.3 | 71.35 ±0.25 | 70.6 ±0.1 | 70.6 ±0.1 |
+
+Table 7: Clean Test Accuracy on CIFAR10. The learning configuration corresponds to the nongenerizable settings with high learning rate. The corresponding shattering experiments for this setting are shown in Table 1.
+
+Training Accuracy as Stopping Criterion In this section we show that our regularizer performs consistently for a different stopping criterion. In particular, we use the train accuracy as a stopping criterion. For Resnet110, WideResnet-28,Densenet-100, and VGG-19 we use a train accuracy of $99\%$ as a stopping criterion and report the test accuracy when that train accuracy was achieved for the first time. For Alexnet, as SRN-30 never achieves a train accuracy higher than $55\%$ , we use $55\%$
+
+
+(a) Resnet110
+
+
+(b) WideResnet-28
+
+
+(c) Alexnet
+
+
+(d) Densenet-100
+
+
+(e) VGG-19
+
+
+Figure 8: Test accuracies on CIFAR100 for clean data using a stopping criterion based on train accuracy. Higher is better.
+(a) Resnet110
+Figure 9: Test accuracies on CIFAR10 for clean data using a stopping criterion based on train accuracy. Higher is better.
+
+
+(b) WideResnet-28
+
+
+(c) Alexnet
+
+
+(d) Densenet-100
+
+as the stopping criterion and plot the test accuracies in Figure 8. Our results show that SRN-30 and SRN-50 outperform SN and vanilla consistently. In Figure 9, we show similar plots for CIFAR10.
+
+CIFAR10 experiments In this section, we plot results on CIFAR10 trained using ResNet-110, Desnenet100, WideResNet-28, and Alexnet. In Figure 9, we plot the test accuracy on clean CIFAR-10 with the training accuracy as the stopping criterion. For all models other than Alexnet, we use $99\%$ training accuracy as the criterion and for Alexnet we use $85\%$ . In Figure 10, we plot the test accuracy on clean CIFAR10 using the number of epochs as the stopping criterion. The results here are consistent with those in the main paper in that SRN outperforms the vanilla and SN.
+
+In Figure 11, we plot the training accuracy on CIFAR10 when the labels are randomized for Resnet100, and Alexnet. SRN-50 and SRN-30 are much better than Vanilla and SN in this case.
+
+
+(a) Resnet110
+
+
+(b) Alexnet
+Figure 11: Training accuracy on randomly labelled CIFAR-10 (Lower is better).
+
+# E ADDITIONAL EXPERIMENTS ON GANS
+
+# E.1 GAN EXPERIMENTAL SETUP
+
+Datasets and Network Architectures Each of the CIFAR datasets contain a total of 50,000 RGB images in the training set, where each image is of size $32 \times 32$ , and a further 10,000 RGB images of the same dimension in the test set. The CelebA dataset contains more than 200K images scaled to a size of $64 \times 64$ . The model architecture for both the generator and the discriminator was chosen to be a 32 layered ResNet (He et al., 2016) due to its previous superior performance in other works (Miyato et al., 2018). We use Adam optimizer (Kingma & Ba, 2014) which depends on three main hyperparameters $\alpha$ - the initial learning rate, $\beta_{1}$ - the first order moment decay rate and $\beta_{2}$ - the second
+
+
+(a) Resnet110
+
+
+Figure 10: Test accuracies on CIFAR10 for clean data using the number of epochs as a stopping criterion. Higher is better.
+
+
+(b) WideResnet-28
+(c) Alexnet
+
+
+(d) Densenet-100
+
+order moment decay rate. We cross-validate these parameters in the set $\alpha \in \{0.0002, 0.0005\}$ , $\beta_{1} \in \{0, 0.5\}$ , $\beta_{2} \in \{0.9, 0.999\}$ and chose $\alpha = 0.0002$ , $\beta_{1} = 0.0$ and $\beta_{2} = 0.999$ which performed consistently well in all of the experiments.
+
+GAN objective functions In the case of conditional GANs (Mirza & Osindero, 2014), we used the conditional batch normalization (Dumoulin et al., 2017) to condition the generator and the projection discriminator (Miyato & Koyama, 2018) to condition the discriminator. The dimension of the latent variable for the generator was set to 128 and was sampled from a zero mean and unit variance Gaussian distribution. For training the model, we used the hinge loss version of the adversarial loss (Lim & Ye, 2017; Tran et al., 2017) in all experiments except the experiments with WGAN-GP. The hinge loss version was chosen as it has been shown to give consistently better performance in previous works (Zhang et al., 2018; Miyato et al., 2018). For training the WGAN-GP model, we used the original loss function as described in Gulrajani et al. (2017).
+
+Evaluation Metrics We use Inception (Salimans et al., 2016) and Frechet Inception Distance (FID) (Heusel et al., 2017) scores for the evaluation of the generated samples. For measuring the inception score, we generate 50,000 samples, as was recommended in Salimans et al. (2016). For measuring FID, we use the same setting as Miyato et al. (2018) where we sample 10,000 data points from the training set and compare its statistics with that of 5,000 generated samples. In addition, we use a recent evaluation metric called Neural divergence score Gulrajani et al. (2019) which is more robust to memorization. The exact set-up for the same is discussed below. In the case of conditional image generation, we also measure Intra-FID (Miyato et al., 2018), which is the mean of the FID of the generator, when it is conditioned over different classes. Let $\mathrm{FID}(\mathcal{G},c)$ be the FID of the generator $\mathcal{G}$ when it is conditioned on the class $c\in \mathcal{C}$ (where $\mathcal{C}$ is the set of classes), then, Intra $\mathrm{FID}(\mathcal{G}) = \frac{1}{|\mathcal{C}|}\mathrm{FID}(\mathcal{G},c)$
+
+Neural Divergence Setup We train a new classifier inline with the architecture in Gulrajani et al. (2019). It includes three convolution layers with 16, 32 and 64 channels, a kernel size of $5 \times 5$ and a stride of 2. Each of these layers are followed by a Swish activation (Ramachandran et al., 2018) and then finally a linear layer that gives a single output. The network is initialized using normal distribution with zero mean and the standard deviation of 0.02, and trained using Adam optimizer with $\alpha = 0.0002$ , $\beta_{1} = 0$ , $\beta_{2} = 0.9$ for a total of 100,000 iterations with minibatch of 128 generated samples and 128 samples from the test set13. We use the standard WGAN-GP loss function, $\log(1 + \exp(f(\mathbf{x}_{\mathrm{fake}}))) + \log(1 + \exp(-\mathbf{x}_{\mathrm{real}}))$ , where $f$ represents the network described above. Finally, we generate 1 Million samples from the generator and report the average $\log(1 + \exp(f(\mathbf{x}_{\mathrm{fake}})))$ over these samples. Higher average value implies better generation as the network in this case is unable to distinguish the generated and the real samples.
+
+# E.2 MORE EMPIRICAL LIPSCHITZ PLOTS
+
+For the purpose of analysis, Figure 13b and 14b shows eLhist for pairs where each sample either comes from the true data or from the generator, and we observe a similar trend. To verify that same results hold in the conditional setup, we show comparisons for GANs with projection discriminator (Miyato & Koyama, 2018) in Figure 12, 13a and 14a, and observe a similar trend. Further, to see the value of the local Lipschitzness in the vicinity of real and generated samples we also plot the norm of the
+
+Jacobian in Figure 15 and 16 in Appendix E.2 and observe mostly a similar trend. In Appendix E.3 (Figure 17), we also show that the discriminator training of SRN-GAN is more stable than SN-GAN.
+
+Conditional GANs Figure 12 shows the eLihst of conditional GANs with projection discriminator (Miyato & Koyama, 2018).
+
+
+Figure 12: Comparison: eLhist of the discriminator in the conditional GAN setting with projection discriminator on CIFAR100.
+
+Empirical Lipschitzness between real samples and between fake samples. Figure 13 shows the histogram of eLhist of the discriminator for pairs of fake samples i.e. samples generated by the generator. Figure 14 shows eLhist of the discriminator when samples came from the dataset.
+
+
+(a) Conditional GAN with projection discriminator.
+
+
+(b) Unconditional GAN setting.
+
+
+Figure 13: Comparison: eLhist of the discriminator for pairs of samples selected from the generator on CIFAR10
+(a) Conditional GAN with projection discriminator
+Figure 14: Comparison: eLhist of the discriminator for pairs of samples from the real distribution on CIFAR10.
+
+
+(b) Unconditional GAN setting.
+
+Jacobian norm in the vicinity of the points Here we compare the Jacobian of the discriminator of the trained models in the vicinity of the samples from the generator and the real dataset. This is a penalized measure in various algorithms Gulrajani et al. (2017); Petzka et al. (2018) (often referred to as local perturbations) and was independently proposed by Kodali et al. (2018). Figure 15
+
+and Figure 16 show the histogram of the norm of the Jacobian of the discriminator in the vicinity of the generated and the real samples, respectively. To generate these plots, 2,000 samples were used from the respective distributions. It is interesting to note that the norm is the same for the points in the vicinity of the real data points and the generated data points for the Stable Rank Normalization GAN (SRN-GAN) as well for WGAN-GP whereas it varies between fake and real samples for Spectral Normalization GAN (SN-GAN).
+
+
+(a) Conditional GAN with projection discriminator.
+
+
+(b) Unconditional GAN setting.
+Figure 15: Jacobian norm of the discriminator in the neighbourhood of the samples from the generator trained on CIFAR10.
+
+
+(a) Conditional GAN with projection discriminator
+
+
+(b) Unconditional GAN setting.
+Figure 16: Jacobian norm of the discriminator in the neighbourhood of the samples from the real dataset (CIFAR10).
+
+# E.3 TRAINING STABILITY
+
+
+Figure 17: Loss incurred by the discriminator. The loss of SRN-GAN with the stable rank constraint of 70 is shifted upwards by 0.2 so that we can compare the change of the loss during training as opposed to the absolute magnitude of the loss.
+
+
+
+Training Stability In Figure 17 we show the discriminator loss during the course of the training as an indicator of whether the generator gets sufficient gradient during training or not. These plots clearly suggest that the discriminator loss is more consistent for SRN than the SN.
+
+# F EXAMPLES OF GENERATED IMAGES
+
+# F.1 CELEBA IMAGES
+
+For these images, we generated 100 images from the respective models and hand-picked the 10 best images in terms of visual quality.
+
+
+Figure 18: Image samples generated from the unconditional SRN-GAN.
+
+
+Figure 19: Image samples generated from the unconditional SN-GAN.
+
+# F.2 CIFAR10-UNCONDITIONAL GAN
+
+
+
+
+(a) SRN-70-GAN
+
+
+(b) SRN-50-GAN
+
+
+(c) SN-GAN
+(d) WGAN-GP
+Figure 20: Image samples generated from the unconditional SRN-GAN, SN-GAN, and WGAN-GP.
+
+# F.3 CIFAR10-CONDITIONAL SRN-GAN
+
+
+
+
+
+
+
+
+(a) Air-planes
+(d) Cats
+Figure 21: Image samples generated from the conditional SRN-GAN with projection discriminator.
+
+
+(b) Cars
+(e) Deers
+
+
+(c) Birds
+(f) Dogs
\ No newline at end of file
diff --git a/stableranknormalizationforimprovedgeneralizationinneuralnetworksandgans/images.zip b/stableranknormalizationforimprovedgeneralizationinneuralnetworksandgans/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..9293ede1f9903fbfee07c25121166c1937312492
--- /dev/null
+++ b/stableranknormalizationforimprovedgeneralizationinneuralnetworksandgans/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a8c4a140021ace3854325b8c59b535418e0127deeaf4e266fd62dddae807025c
+size 1500123
diff --git a/stableranknormalizationforimprovedgeneralizationinneuralnetworksandgans/layout.json b/stableranknormalizationforimprovedgeneralizationinneuralnetworksandgans/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..b59a605648b0cf7a1743330fdc3a1da1416f4082
--- /dev/null
+++ b/stableranknormalizationforimprovedgeneralizationinneuralnetworksandgans/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ea98eba2f03ef717d6d854da3af8f2152f3014814bfbf01f8975a5f6b7d9555d
+size 1375552
diff --git a/strategiesforpretraininggraphneuralnetworks/26e2e904-3c1d-467c-9a7d-2494ee1b78cb_content_list.json b/strategiesforpretraininggraphneuralnetworks/26e2e904-3c1d-467c-9a7d-2494ee1b78cb_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..1f62bae3974ce5a3dea2e59109ade1b7ab1a07af
--- /dev/null
+++ b/strategiesforpretraininggraphneuralnetworks/26e2e904-3c1d-467c-9a7d-2494ee1b78cb_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a00d2415d44418a2c09f09debeb3fa303182f7b5ea33797ba94c78182da98a92
+size 128875
diff --git a/strategiesforpretraininggraphneuralnetworks/26e2e904-3c1d-467c-9a7d-2494ee1b78cb_model.json b/strategiesforpretraininggraphneuralnetworks/26e2e904-3c1d-467c-9a7d-2494ee1b78cb_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..f582f76b97a0a6703b951b4839002a86fce03ae1
--- /dev/null
+++ b/strategiesforpretraininggraphneuralnetworks/26e2e904-3c1d-467c-9a7d-2494ee1b78cb_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:4c28fcf017fb48d344888d71f482d80b0a67ccd627b7434327be9f6d46e11711
+size 159769
diff --git a/strategiesforpretraininggraphneuralnetworks/26e2e904-3c1d-467c-9a7d-2494ee1b78cb_origin.pdf b/strategiesforpretraininggraphneuralnetworks/26e2e904-3c1d-467c-9a7d-2494ee1b78cb_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..7e8fc6b4de52253840015b20c22723a90a4f9a9b
--- /dev/null
+++ b/strategiesforpretraininggraphneuralnetworks/26e2e904-3c1d-467c-9a7d-2494ee1b78cb_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:38ad4f3130ce1e7a8fed93dd6b3e45d444dd9a9109ab81d017706b49311e5aa1
+size 2122558
diff --git a/strategiesforpretraininggraphneuralnetworks/full.md b/strategiesforpretraininggraphneuralnetworks/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..f2612a4bc96bd313d58f144989ddc4bd75fd4b0d
--- /dev/null
+++ b/strategiesforpretraininggraphneuralnetworks/full.md
@@ -0,0 +1,479 @@
+# STRATEGIES FOR PRE-TRAINING GRAPH NEURAL NETWORKS
+
+Weihua Hu1*, Bowen Liu2*, Joseph Gomes4, Marinka Zitnik5, Percy Liang1, Vijay Pande3, Jure Leskovec1
+
+$^{1}$ Department of Computer Science, $^{2}$ Chemistry, $^{3}$ Bioengineering, Stanford University,
+$^{4}$ Department of Chemical and Biochemical Engineering, The University of Iowa,
+$^{5}$ Department of Biomedical Informatics, Harvard University
+
+{weihuahu, liubowen, pliang, jure}@cs.stanford.edu,
+
+joe-gomes@uiowa.edu,marinka@hms.harvard.edu,pande@stanford.edu
+
+# ABSTRACT
+
+Many applications of machine learning require a model to make accurate predictions on test examples that are distributionally different from training ones, while task-specific labels are scarce during training. An effective approach to this challenge is to pre-train a model on related tasks where data is abundant, and then fine-tune it on a downstream task of interest. While pre-training has been effective in many language and vision domains, it remains an open question how to effectively use pre-training on graph datasets. In this paper, we develop a new strategy and self-supervised methods for pre-training Graph Neural Networks (GNNs). The key to the success of our strategy is to pre-train an expressive GNN at the level of individual nodes as well as entire graphs so that the GNN can learn useful local and global representations simultaneously. We systematically study pre-training on multiple graph classification datasets. We find that naive strategies, which pre-train GNNs at the level of either entire graphs or individual nodes, give limited improvement and can even lead to negative transfer on many downstream tasks. In contrast, our strategy avoids negative transfer and improves generalization significantly across downstream tasks, leading up to $9.4\%$ absolute improvements in ROC-AUC over non-pre-trained models and achieving state-of-the-art performance for molecular property prediction and protein function prediction.
+
+# 1 INTRODUCTION
+
+Transfer learning refers to the setting where a model, initially trained on some tasks, is re-purposed on different but related tasks. Deep transfer learning has been immensely successful in computer vision (Donahue et al., 2014; Girshick et al., 2014; Zeiler & Fergus, 2014) and natural language processing (Devlin et al., 2019; Peters et al., 2018; Mikolov et al., 2013). Despite being an effective approach to transfer learning, few studies have generalized pre-training to graph data.
+
+Pre-training has the potential to provide an attractive solution to the following two fundamental challenges with learning on graph datasets (Pan & Yang, 2009; Hendrycks et al., 2019): First, task-specific labeled data can be extremely scarce. This problem is exacerbated in important graph datasets from scientific domains, such as chemistry and biology, where data labeling (e.g., biological experiments in a wet laboratory) is resource- and time-intensive (Zitnik et al., 2018). Second, graph data from real-world applications often contain out-of-distribution samples, meaning that graphs in the training set are structurally very different from graphs in the test set. Out-of-distribution prediction is common in real-world graph datasets, for example, when one wants to predict chemical properties of a brand-new, just synthesized molecule, which is different from all molecules synthesized so far, and thereby different from all molecules in the training set.
+
+However, pre-training on graph datasets remains a hard challenge. Several key studies (Xu et al., 2017; Ching et al., 2018; Wang et al., 2019) have shown that successful transfer learning is not only a
+
+
+Figure 1: (a.i) When only node-level pre-training is used, nodes of different shapes (semantically different nodes) can be well separated, however, node embeddings are not composable, and thus resulting graph embeddings (denoted by their classes, + and -) that are created by pooling node-level embeddings are not separable. (a.ii) With graph-level pre-training only, graph embeddings are well separated, however the embeddings of individual nodes do not necessarily capture their domain-specific semantics. (a.iii) High-quality node embeddings are such that nodes of different types are well separated, while at the same time, the embedding space is also composable. This allows for accurate and robust representations of entire graphs and enables robust transfer of pre-trained models to a variety of downstream tasks. (b) Categorization of pre-training methods for GNNs. Crucially, our methods, i.e., Context Prediction, Attribute Masking, and graph-level supervised pre-training (Supervised Attribute Prediction) enable both node-level and graph-level pre-training.
+
+matter of increasing the number of labeled pre-training datasets that are from the same domain as the downstream task. Instead, it requires substantial domain expertise to carefully select examples and target labels that are correlated with the downstream task of interest. Otherwise, the transfer of knowledge from related pre-training tasks to a new downstream task can harm generalization, which is known as negative transfer (Rosenstein et al., 2005) and significantly limits the applicability and reliability of pre-trained models.
+
+Present work. Here, we focus on pre-training as an approach to transfer learning in Graph Neural Networks (GNNs) (Kipf & Welling, 2017; Hamilton et al., 2017a; Ying et al., 2018b; Xu et al., 2019; 2018) for graph-level property prediction. Our work presents two key contributions. (1) We conduct the first systematic large-scale investigation of strategies for pre-training GNNs. For that, we build two large new pre-training datasets, which we share with the community: a chemistry dataset with 2 million graphs and a biology dataset with 395K graphs. We also show that large domain-specific datasets are crucial to investigate pre-training and that existing downstream benchmark datasets are too small to evaluate models in a statistically reliable way. (2) We develop an effective pretraining strategy for GNNs and demonstrate its effectiveness and its ability for out-of-distribution generalization on hard transfer-learning problems.
+
+In our systematic study, we show that pre-training GNNs does not always help. Naïve pre-training strategies can lead to negative transfer on many downstream tasks. Strikingly, a seemingly strong pre-training strategy (i.e., graph-level multi-task supervised pre-training using a state-of-the-art graph neural network architecture for graph-level prediction tasks) only gives marginal performance gains. Furthermore, this strategy even leads to negative transfer on many downstream tasks (2 out of 8 molecular datasets and 13 out of 40 protein prediction tasks).
+
+We develop an effective strategy for pre-training GNNs. The key idea is to use easily accessible node-level information and encourage GNNs to capture domain-specific knowledge about nodes and edges, in addition to graph-level knowledge. This helps the GNN to learn useful representations at both global and local levels (Figure 1 (a.iii)), and is crucial to be able to generate graph-level representations (which are obtained by pooling node representations) that are robust and transferable to diverse downstream tasks (Figure 1). Our strategy is in contrast to naive strategies that either leverage only at graph-level properties (Figure 1 (a.ii)) or node-level properties (Figure 1 (a.i)).
+
+Empirically, our pre-training strategy used together with the most expressive GNN architecture, GIN (Xu et al., 2019), yields state-of-the-art results on benchmark datasets and avoids negative transfer across downstream tasks we tested. It significantly improves generalization performance
+
+across downstream tasks, yielding up to $9.4\%$ higher average ROC-AUC than non-pre-trained GNNs, and up to $5.2\%$ higher average ROC-AUC compared to GNNs with the extensive graph-level multi-task supervised pre-training. Furthermore, we find that the most expressive architecture, GIN, benefits more from pre-training compared to those with less expressive power (e.g., GCN (Kipf & Welling, 2017), GraphSAGE (Hamilton et al., 2017b) and GAT (Velickovic et al., 2018)), and that pre-training GNNs leads to orders-of-magnitude faster training and convergence in the fine-tuning stage.
+
+# 2 PRELIMINARIES OF GRAPH NEURAL NETWORKS
+
+We first formalize supervised learning of graphs and provide an overview of GNNs (Gilmer et al., 2017). Then, we briefly review methods for unsupervised graph representation learning.
+
+Supervised learning of graphs. Let $G = (V, E)$ denote a graph with node attributes $X_v$ for $v \in V$ and edge attributes $e_{uv}$ for $(u, v) \in E$ . Given a set of graphs $\{G_1, \ldots, G_N\}$ and their labels $\{y_1, \ldots, y_N\}$ , the task of graph supervised learning is to learn a representation vector $h_G$ that helps predict the label of an entire graph $G$ , $y_G = g(h_G)$ . For example, in molecular property prediction, $G$ is a molecular graph, where nodes represent atoms and edges represent chemical bonds, and the label to be predicted can be toxicity or enzyme binding.
+
+Graph Neural Networks (GNNs). GNNs use the graph connectivity as well as node and edge features to learn a representation vector (i.e., embedding) $h_v$ for every node $v \in G$ and a vector $h_G$ for the entire graph $G$ . Modern GNNs use a neighborhood aggregation approach, where representation of node $v$ is iteratively updated by aggregating representations of $v$ 's neighboring nodes and edges (Gilmer et al., 2017). After $k$ iterations of aggregation, $v$ 's representation captures the structural information within its $k$ -hop network neighborhood. Formally, the $k$ -th layer of a GNN is:
+
+$$
+\left. h _ {v} ^ {(k)} = \operatorname {C O M B I N E} ^ {(k)} \left(h _ {v} ^ {(k - 1)}, \operatorname {A G G R E G A T E} ^ {(k)} \left(\left\{\left(h _ {v} ^ {(k - 1)}, h _ {u} ^ {(k - 1)}, e _ {u v}\right): u \in \mathcal {N} (v) \right\}\right)\right), \right. \tag {2.1}
+$$
+
+where $h_v^{(k)}$ is the representation of node $v$ at the $k$ -th iteration/layer, $e_{uv}$ is the feature vector of edge between $u$ and $v$ , and $\mathcal{N}(v)$ is a set of neighbors of $v$ . We initialize $h_v^{(0)} = X_v$ .
+
+Graph representation learning. To obtain the entire graph's representation $h_G$ , the READOUT function pools node features from the final iteration $K$
+
+$$
+h _ {G} = \operatorname {R E A D O U T} \left(\left\{h _ {v} ^ {(K)} \mid v \in G \right\}\right). \tag {2.2}
+$$
+
+READOUT is a permutation-invariant function, such as averaging or a more sophisticated graph-level pooling function (Ying et al., 2018b; Zhang et al., 2018).
+
+# 3 STRATEGIES FOR PRE-TRAINING GRAPH NEURAL NETWORKS
+
+At the technical core of our pre-training strategy is the notion to pre-train a GNN both at the level of individual nodes as well as entire graphs. This notion encourages the GNN to capture domain-specific semantics at both levels, as illustrated in Figure 1 (a.iii). This is in contrast to straightforward but limited pre-training strategies that either only use pre-training to predict properties of entire graphs (Figure 1 (a.ii)) or only use pre-training to predict properties of individual nodes (Figure 1 (a.i)).
+
+In the following, we first describe our node-level pre-training approach (Section 3.1) and then graph-level pre-training approach (Section 3.2). Finally, we describe the full pre-training strategy in Section 3.3.
+
+# 3.1 NODE-LEVEL PRE-TRAINING
+
+For node-level pre-training of GNNs, our approach is to use easily-accessible unlabeled data to capture domain-specific knowledge/regularities in the graph. Here we propose two self-supervised methods, Context Prediction and Attribute Masking.
+
+
+Input graph
+
+
+(a) Context Prediction
+Figure 2: Illustration of our node-level methods, Context Prediction and Attribute Masking for pretraining GNNs. (a) In Context Prediction, the subgraph is a $K$ -hop neighborhood around a selected center node, where $K$ is the number of GNN layers and is set to 2 in the figure. The context is defined as the surrounding graph structure that is between $r_1$ - and $r_2$ -hop from the center node, where we use $r_1 = 1$ and $r_2 = 4$ in the figure. (b) In Attribute Masking, the input node/edge attributes (e.g., atom type in the molecular graph) are randomly masked, and the GNN is asked to predict them.
+
+
+(b) Attribute Masking
+
+# 3.1.1 CONTEXT PREDICTION: EXPLOITING DISTRIBUTION OF GRAPH STRUCTURE
+
+In Context Prediction, we use subgraphs to predict their surrounding graph structures. Our goal is to pre-train a GNN so that it maps nodes appearing in similar structural contexts to nearby embeddings (Rubenstein & Goodenough, 1965; Mikolov et al., 2013).
+
+Neighborhood and context graphs. For every node $v$ , we define $v$ 's neighborhood and context graphs as follows. $K$ -hop neighborhood of $v$ contains all nodes and edges that are at most $K$ -hops away from $v$ in the graph. This is motivated by the fact that a $K$ -layer GNN aggregates information across the $K$ -th order neighborhood of $v$ , and thus node embedding $h_v^{(K)}$ depends on nodes that are at most $K$ -hops away from $v$ . We define context graph of node $v$ as graph structure that surrounds $v$ 's neighborhood. The context graph is described by two hyperparameters, $r_1$ and $r_2$ , and it represents a subgraph that is between $r_1$ -hops and $r_2$ -hops away from $v$ (i.e., it is a ring of width $r_2 - r_1$ ). Examples of neighborhood and context graphs are shown in Figure 2 (a). We require $r_1 < K$ so that some nodes are shared between the neighborhood and the context graph, and we refer to those nodes as context anchor nodes. These anchor nodes provide information about how the neighborhood and context graphs are connected with each other.
+
+Encoding context into a fixed vector using an auxiliary GNN. Directly predicting the context graph is intractable due to the combinatorial nature of graphs. This is different from natural language processing, where words come from a fixed and finite vocabulary. To enable context prediction, we encode context graphs as fixed-length vectors. To this end, we use an auxiliary GNN, which we refer to as the context GNN. As depicted in Figure 2 (a), we first apply the context GNN (denoted as $\mathrm{GNN}'$ in Figure 2 (a)) to obtain node embeddings in the context graph. We then average embeddings of context anchor nodes to obtain a fixed-length context embedding. For node $v$ in graph $G$ , we denote its corresponding context embedding as $c_v^G$ .
+
+Learning via negative sampling. We then use negative sampling (Mikolov et al., 2013; Ying et al., 2018a) to jointly learn the main GNN and the context GNN. The main GNN encodes neighborhoods to obtain node embeddings. The context GNN encodes context graphs to obtain context embeddings. In particular, the learning objective of Context Prediction is a binary classification of whether a particular neighborhood and a particular context graph belong to the same node:
+
+$$
+\sigma \left(h _ {v} ^ {(K) \top} c _ {v ^ {\prime}} ^ {G ^ {\prime}}\right) \approx \mathbf {1} \{v \text {a n d} v ^ {\prime} \text {a r e t h e s a m e n o d e s} \}, \tag {3.1}
+$$
+
+where $\sigma(\cdot)$ is the sigmoid function, and $\mathbf{1}(\cdot)$ is the indicator function. We either let $v' = v$ and $G' = G$ (i.e., a positive neighborhood-context pair), or we randomly sample $v'$ from a randomly chosen graph $G'$ (i.e., a negative neighborhood-context pair). We use a negative sampling ratio of 1 (one negative pair per one positive pair), and use the negative log likelihood as the loss function. After pre-training, the main GNN is retained as our pre-trained model
+
+# 3.1.2 ATTRIBUTEMASKING:EXPLOITINGDISTRIBUTIONOFGRAPHATTRIBUTES
+
+In Attribute Masking, we aim to capture domain knowledge by learning the regularities of the node/edge attributes distributed over graph structure.
+
+Masking node and edges attributes. Attribute Masking pre-training works as follows: We mask node/edge attributes and then we let GNNs predict those attributes (Devlin et al., 2019) based on neighboring structure. Figure 2 (b) illustrates our proposed method when applied to a molecular graph. Specifically, We randomly mask input node/edge attributes, for example atom types in molecular graphs, by replacing them with special masked indicators. We then apply GNNs to obtain the corresponding node/edge embeddings (edge embeddings can be obtained as a sum of node embeddings of the edge's end nodes). Finally, a linear model is applied on top of embeddings to predict a masked node/edge attribute. Different from Devlin et al. (2019) that operates on sentences and applies message passing over the fully-connected graph of tokens, we operate on non-fully-connected graphs and aim to capture the regularities of node/edge attributes distributed over different graph structures. Furthermore, we allow masking edge attributes, going beyond masking node attributes.
+
+Our node and edge attribute masking method is especially beneficial for richly-annotated graphs from scientific domains. For example, (1) in molecular graphs, the node attributes correspond to atom types, and capturing how they are distributed over the graphs enables GNNs to learn simple chemistry rules such as valency, as well as potentially more complex chemistry phenomenon such as the electronic or steric properties of functional groups. Similarly, (2) in protein-protein interaction (PPI) graphs, the edge attributes correspond to different kinds of interactions between a pair of proteins. Capturing how these attributes distribute across the PPI graphs enables GNNs to learn how different interactions relate and correlate with each other.
+
+# 3.2 GRAPH-LEVEL PRE-TRAINING
+
+We aim to pre-train GNNs to generate useful graph embeddings composed of the meaningful node embeddings obtained by methods in Section 3.1. Our goal is to ensure both node and graph embeddings are of high-quality so that graph embeddings are robust and transferable across downstream tasks, as illustrated in Figure 1 (a.iii). Additionally, there are two options for graph-level pre-training, as shown in Figure 1 (b): making predictions about domain-specific attributes of entire graphs (e.g., supervised labels), or making predictions about graph structure.
+
+# 3.2.1 SUPERVISED GRAPH-LEVEL PROPERTY PREDICTION
+
+As the graph-level representation $h_G$ is directly used for fine-tuning on downstream prediction tasks, it is desirable to directly encode domain-specific information into $h_G$ .
+
+We inject graph-level domain-specific knowledge into our pretrained embeddings by defining supervised graph-level prediction tasks. In particular, we consider a practical method to pre-train graph representations: graph-level multi-task supervised pre-training to jointly predict a diverse set of supervised labels of individual graphs. For example, in molecular property prediction, we can pre-train GNNs to predict essentially all the properties of molecules that have been experimentally measured so far. In protein function prediction, where the goal is to predict whether a given protein has a given functionality, we can pre-train GNNs to predict the existence of diverse protein functions that have been validated so far. In our experiments in Section 5, we prepare a diverse set of supervised tasks (up to 5000 tasks) to simulate these practical scenarios. Further details of the supervised tasks and datasets are described in Section 5.1. To jointly predict many graph properties, where each property corresponds to a binary classification task, we apply linear classifiers on top of graph representations.
+
+Importantly, naively performing the extensive multi-task graph-level pre-training alone can fail to give transferable graph-level representations, as empirically demonstrated in Section 5. This is because some supervised pre-training tasks might be unrelated to the downstream task of interest and can even hurt the downstream performance (negative transfer). One solution would be to select "truly-relevant" supervised pre-training tasks and pre-train GNNs only on those tasks. However, such a solution is extremely costly since selecting the relevant tasks requires significant domain expertise and pre-training needs to be performed separately for different downstream tasks.
+
+To alleviate this issue, our key insight is that the multi-task supervised pre-training only provides graph-level supervision; thus, local node embeddings from which the graph-level embeddings are created may not be meaningful, as illustrated in Figure 1 (a.ii). Such non-useful node embeddings can exacerbate the problem of negative transfer because many different pre-training tasks can more easily interfere with each other in the node embedding space. Motivated by this, our pre-training strategy is to first regularize GNNs at the level of individual nodes via node-level pre-training methods described in Section 3.1, before performing graph-level pre-training. As we demonstrate empirically, the combined strategy produces much more transferable graph representations and robustly improves downstream performance without expert selection of supervised pre-training tasks.
+
+# 3.2.2 STRUCTURAL SIMILARITY PREDICTION
+
+A second approach is to define a graph-level predictive task where the goal would be to model the structural similarity of two graphs. Examples of such tasks include modeling the graph edit distance (Bai et al., 2019) or predicting graph structure similarity (Navarin et al., 2018). However, finding the ground truth graph distance values is a difficult problem, and in large datasets there is a quadratic number of graph pairs to consider. Therefore, while this type of pre-training is also very natural, it is beyond the scope of this paper and we leave its investigation for future work.
+
+# 3.3 OVERVIEW: PRE-TRAINING GNNS AND FINE-TUNING FOR DOWNSSTREAM TASKS
+
+Altogether, our pre-training strategy is to first perform node-level self-supervised pre-training (Section 3.1) and then graph-level multi-task supervised pre-training (Section 3.2). When the GNN pre-training is finished, we fine-tune the pre-trained GNN model on downstream tasks. Specifically, we add linear classifiers on top of graph-level representations to predict downstream graph labels. The full model, i.e., the pre-trained GNN and downstream linear classifiers, is subsequently fine-tuned in an end-to-end manner. Time-complexity analysis is provided in Appendix F, where we show that our pre-training methods incur little computational overhead to forward computation in GNNs.
+
+# 4 FURTHER RELATED WORK
+
+There is rich literature on unsupervised representation learning of individual nodes within graphs, which broadly falls into two categories. In the first category are methods that use local random walk-based objectives (Grover & Leskovec, 2016; Perozzi et al., 2014; Tang et al., 2015) and methods that reconstruct a graph's adjacency matrix, e.g., by predicting edge existence (Hamilton et al., 2017a; Kipf & Welling, 2016). In the second category are methods, such as Deep Graph Infomax (Velicković et al., 2019), that train a node encoder that maximizes mutual information between local node representations and a pooled global graph representation. All these methods encourage nearby nodes to have similar embeddings and were originally proposed and evaluated for node classification and link prediction. This, however, can be sub-optimal for graph-level prediction tasks, where capturing structural similarity of local neighborhoods is often more important than capturing the positional information of nodes within a graph (You et al., 2019; Rogers & Hahn, 2010; Yang et al., 2014). Our approach thus considers both the node-level as well as graph-level pretraining tasks and as we show in our experiments, it is essential to use both types of tasks in order for pretrained models to achieve good performance.
+
+A number of recent works have also explored how node embeddings generalize across tasks (Jaeger et al., 2018; Zhou et al., 2018; Chakravarti, 2018; Narayanan et al., 2016). However, all of these methods use distinct node embeddings for different substructures and do not share any parameters. Thus, they are inherently transductive, cannot transfer between datasets, cannot be fine-tuned in an end-to-end manner, and cannot capture large and diverse neighborhoods/contexts due to data sparsity. Our approach addresses all these challenges by developing pre-training methods for GNNs that use shared parameters to encode the graph-level as well as node-level dependencies and structures.
+
+# 5 EXPERIMENTS
+
+# 5.1 DATASETS
+
+We consider two domains; molecular property prediction in chemistry and protein function prediction in biology. We release the new datasets at: http://snap.stanford.edu/gnn-pretrain.
+
+Pre-training datasets. For the chemistry domain, we use 2 million unlabeled molecules sampled from the ZINC15 database (Sterling & Irwin, 2015) for node-level self-supervised pre-training. For graph-level multi-task supervised pre-training, we use a preprocessed ChEMBL dataset (Mayr et al., 2018; Gaulton et al., 2011), containing 456K molecules with 1310 kinds of diverse and extensive biochemical assays. For the biology domain, we use 395K unlabeled protein ego-networks derived from PPI networks of 50 species (e.g., humans, yeast, zebra fish) for node-level self-supervised pretraining. For graph-level multi-task supervised pre-training, we use 88K labeled protein ego-networks to jointly predict 5000 coarse-grained biological functions (e.g., cell apoptosis, cell proliferation).
+
+Downstream classification datasets. For the chemistry domain, we considered classical graph classification benchmarks (MUTAG, PTC molecule datasets) (Kersting et al., 2016; Xu et al., 2019) as our downstream tasks, but found that they are too small (188 and 344 examples for MUTAG and PTC) to evaluate different methods in a statistically meaningful way (see Appendix B for the results and discussion). Because of this, as our downstream tasks, we decided to use 8 larger binary classification datasets contained in MoleculeNet (Wu et al., 2018), a recently-curated benchmark for molecular property prediction. The dataset statistics are summarized in Table 1. For the biology domain, we compose our PPI networks from Zitnik et al. (2019), consisting of 88K proteins from 8 different species, where the subgraphs centered at a protein of interest (i.e., ego-networks) are used to predict their biological functions. Our downstream task is to predict 40 fine-grained biological functions1 that correspond to 40 binary classification tasks. In contrast to existing PPI datasets (Hamilton et al., 2017a), our dataset is larger and spans multiple species (i.e., not only humans), which makes it a suitable benchmark for evaluating out-of-distribution prediction. Additional details about datasets and features of molecule/PPI graphs are in Appendices C and D.
+
+Dataset splitting. In many applications, conventional random split is overly optimistic and does not simulate the real-world use case, where test graphs can be structurally different from training graphs (Wu et al., 2018; Zitnik et al., 2019). To reflect the actual use case, we split the downstream data in the following ways to evaluate the models' out-of-distribution generalization. In the chemistry domain, we use scaffold split (Ramsundar et al., 2019), where we split molecules according to their scaffold (molecular substructure). In the biology domain, we use species split, where we predict functions of proteins from new species. Details are in Appendix E. Furthermore, to prevent data leakage, all test graphs used for performance evaluation are removed from the graph-level supervised pre-training datasets.
+
+# 5.2 EXPERIMENTAL SETUP
+
+We thoroughly compare our pre-training strategy with two naive baseline strategies: (i) extensive supervised multi-task pre-training on relevant graph-level tasks, and (ii) node-level self-supervised pre-training.
+
+GNN architectures. We mainly study Graph Isomorphism Networks (GINs) (Xu et al., 2019), the most expressive and state-of-the-art GNN architecture for graph-level prediction tasks. We also experimented with other popular architectures that are less expressive: GCN (Kipf & Welling, 2016), GAT (Velicković et al., 2019), and GraphSAGE (with mean neighborhood aggregation) (Hamilton et al., 2017b). We select the following hyper-parameters that performed well across all downstream tasks in the validation sets: 300 dimensional hidden units, 5 GNN layers ( $K = 5$ ), and average pooling for the READOUT function. Additional details can be found in Appendix A.
+
+Pre-training. For Context Prediction illustrated in Figure 2 (a), on molecular graphs, we define context graphs by setting inner radius $r_1 = 4$ . On PPI networks whose diameters are often smaller than 5, we use $r_1 = 1$ , which works well empirically despite the large overlap between the neighborhood and context subgraphs. For both molecular and PPI graphs, we let outer radius $r_2 = r_1 + 3$ , and
+
+| Dataset | BBBP | Tox21 | ToxCast | SIDER | ClinTox | MUV | HIV | BACE | Average |
| # Molecules | 2039 | 7831 | 8575 | 1427 | 1478 | 93087 | 41127 | 1513 | / |
| # Binary prediction tasks | 1 | 12 | 617 | 27 | 2 | 17 | 1 | 1 | / |
| Pre-training strategy | Out-of-distribution prediction (scaffold split) |
| Graph-level | Node-level |
| - | - | 65.8 ±4.5 | 74.0 ±0.8 | 63.4 ±0.6 | 57.3 ±1.6 | 58.0 ±4.4 | 71.8 ±2.5 | 75.3 ±1.9 | 70.1 ±5.4 | 67.0 |
| - | Infomax | 68.8 ±0.8 | 75.3 ±0.5 | 62.7 ±0.4 | 58.4 ±0.8 | 69.9 ±3.0 | 75.3 ±2.5 | 76.0 ±0.7 | 75.9 ±1.6 | 70.3 |
| - | EdgePred | 67.3 ±2.4 | 76.0 ±0.6 | 64.1 ±0.6 | 60.4 ±0.7 | 64.1 ±3.7 | 74.1 ±2.1 | 76.3 ±1.0 | 79.9 ±0.9 | 70.3 |
| - | AttrMasking | 64.3 ±2.8 | 76.7 ±0.4 | 64.2 ±0.5 | 61.0 ±0.7 | 71.8 ±4.1 | 74.7 ±1.4 | 77.2 ±1.1 | 79.3 ±1.6 | 71.1 |
| - | ContextPred | 68.0 ±2.0 | 75.7 ±0.7 | 63.9 ±0.6 | 60.9 ±0.6 | 65.9 ±3.8 | 75.8 ±1.7 | 77.3 ±1.0 | 79.6 ±1.2 | 70.9 |
| Supervised | - | 68.3 ±0.7 | 77.0 ±0.3 | 64.4 ±0.4 | 62.1 ±0.5 | 57.2 ±2.5 | 79.4 ±1.3 | 74.4 ±1.2 | 76.9 ±1.0 | 70.0 |
| Supervised | Infomax | 68.0 ±1.8 | 77.8 ±0.3 | 64.9 ±0.7 | 60.9 ±0.6 | 71.2 ±2.8 | 81.3 ±1.4 | 77.8 ±0.9 | 80.1 ±0.9 | 72.8 |
| Supervised | EdgePred | 66.6 ±2.2 | 78.3 ±0.3 | 66.5 ±0.3 | 63.3 ±0.9 | 70.9 ±4.6 | 78.5 ±2.4 | 77.5 ±0.8 | 79.1 ±3.7 | 72.6 |
| Supervised | AttrMasking | 66.5 ±2.5 | 77.9 ±0.4 | 65.1 ±0.3 | 63.9 ±0.9 | 73.7 ±2.8 | 81.2 ±1.9 | 77.1 ±1.2 | 80.3 ±0.9 | 73.2 |
| Supervised | ContextPred | 68.7 ±1.3 | 78.1 ±0.6 | 65.7 ±0.6 | 62.7 ±0.8 | 72.6 ±1.5 | 81.3 ±2.1 | 79.9 ±0.7 | 84.5 ±0.7 | 74.2 |
+
+Table 1: Test ROC-AUC (\%) performance on molecular prediction benchmarks using different pre-training strategies with GIN. The rightmost column averages the mean of test performance across the 8 datasets. The best result for each dataset and comparable results (i.e., results within one standard deviation from the best result) are bolded. The shaded cells indicate negative transfer, i.e., ROC-AUC of a pre-trained model is worse than that of a non-pre-trained model. Notice that node- as well as graph-level pretraining are essential for good performance.
+
+ | Chemistry | Biology |
| Non-pre-trained | Pre-trained | Gain | Non-pre-trained | Pre-trained | Gain |
| GIN | 67.0 | 74.2 | +7.2 | 64.8 ± 1.0 | 74.2 ± 1.5 | +9.4 |
| GCN | 68.9 | 72.2 | +3.4 | 63.2 ± 1.0 | 70.9 ± 1.7 | +7.7 |
| GraphSAGE | 68.3 | 70.3 | +2.0 | 65.7 ± 1.2 | 68.5 ± 1.5 | +2.8 |
| GAT | 66.8 | 60.3 | -6.5 | 68.2 ± 1.1 | 67.8 ± 3.6 | -0.4 |
+
+Table 2: Test ROC-AUC (\%) performance of different GNN architectures with and without pre-training. Without pre-training, the less expressive GNNs give slightly better performance than the most expressive GIN because of their smaller model complexity in a low data regime. However, with pre-training, the most expressive GIN is properly regularized and dominates the other architectures. For results split by chemistry datasets, see Table 4 in Appendix H. Pre-training strategy for chemistry data: Context Prediction + Graph-level supervised pre-training; pre-training strategy for biology data: Attribute Masking + Graph-level supervised pre-training.
+
+use a 3-layer GNN to encode the context structure. For Attribute Masking shown in Figure 2 (b), we randomly mask $15\%$ of node (for molecular graphs) or edge attributes (for PPI networks) for prediction. As baselines for node-level self-supervised pre-training, we adopt the original Edge Prediction (denoted by EdgePred) (Hamilton et al., 2017a) and Deep Graph Infomax (denoted by Infomax) (Veličković et al., 2019) implementations. Further details are provided in Appendix G.
+
+# 5.3 RESULTS
+
+We report results for molecular property prediction and protein function prediction in Tables 2 and 1 and Figure 3. Our systematic study suggests the following trends:
+
+Observation (1): Table 2 shows that the most expressive GNN architecture (GIN), when pre-trained, achieves the best performance across domains and datasets. Compared with gains of pre-training achieved by GIN architecture, gains of pre-training using less expressive GNNs (GCN, GraphSAGE, and GAT) are smaller and can sometimes even be negative (Table 2). This finding confirms previous observations (e.g., Erhan et al. (2010)) that using an expressive model is crucial to fully utilize pre-training, and that pre-training can even hurt performance when used on models with limited expressive power, such as GCN, GraphSAGE, and GAT.
+
+**Observation (2):** As seen from the shaded cells of Table 1 and highlighted region in the middle panel of Figure 3, the strong baseline strategy that performs extensive graph-level multi-task supervised pre-training of GNNs gives surprisingly limited performance gain and yields negative transfer on many downstream tasks (2 out of 8 datasets in molecular prediction, and 13 out of 40 tasks in protein function prediction).
+
+**Observation (3):** From the upper half of Table 1 and the left panel of Figure 3, we see that another baseline strategy, which only performs node-level self-supervised pre-training, also gives limited performance improvement and is comparable to the graph-level multi-task supervised pre-training baseline.
+
+Observation (4): From the lower half of Table 1 and the right panel of Figure 3, we see that our pre-training strategy of combining graph-level multi-task supervised and node-level self-supervised pre-training avoids negative transfer across downstream datasets and achieves best performance.
+
+Observation (5): Furthermore, from Table 1 and the left panel of Figure 3, we see that our strategy gives significantly better predictive performance than the two baseline pre-training strategies as well as non-pre-trained models, achieving state-of-the-art performance.
+
+Specifically, in the chemistry datasets, we see from Table 1 that our Context Prediction + Graph-level multi-task supervised pre-training strategy gives the most promising performance, leading to an increase in average ROC-AUC of $7.2\%$ over non-pre-trained baseline and $4.2\%$ over graph-level multi-task supervised pre-trained baseline. On the HIV dataset, where a number of recent works (Wu et al., 2018; Li et al., 2017; Ishiguro et al., 2019) have reported performance on the same scaffold split and using the same protocol, our best pre-trained model (ContextPred + Supervised) achieves state-of-the-art performance. In particular, we achieved a ROC-AUC score of $79.9\%$ , while best-performing graph models in Wu et al. (2018), Li et al. (2017), and Ishiguro et al. (2019) had ROC-AUC scores of $76.3\%$ , $77.6\%$ , and $76.2\%$ , respectively.
+
+Also, in the biology datasets, which we have built in this work, we see from the left panel of Figure 3 that our Attribute Masking + Graph-level multi-task supervised pre-training strategy achieves the best predictive performance compared to other baseline strategies across almost all 40 downstream prediction tasks (the right panel of Figure 3). On average, our strategy improves ROC-AUC by $9.4\%$ over non-pre-trained baseline and $5.2\%$ over graph-level multi-task supervised pre-trained baseline, again achieving state-of-the-art performance.
+
+**Observation (6):** In the chemistry domain, we also report performance on classic benchmarks (MUTAG, PTC molecule datasets) in Appendix B. However, as mentioned in Section 5.1, the extremely small dataset sizes make these benchmarks unsuitable to compare different methods in a statistically reliable way.
+
+**Observation (7):** Beyond predictive performance improvement, Figure 4 shows that our pre-trained models achieve orders-of-magnitude faster training and validation convergence than non-pre-trained models. For example, on the MUV dataset, it took 1 hour for the non-pre-trained GNN to get $74.9\%$ validation ROC-AUC, while it took only 5 minutes for our pre-trained GNN to get $85.3\%$ validation ROC-AUC. The same trend holds across the downstream datasets we used, as shown in Figure 5 in Appendix I. We emphasize that pre-training is a one-time-effort. Once the model is pre-trained, it can be used for any number of downstream tasks to improve performance with little training time.
+
+As a final remark, in our preliminary experiments, we performed the Attribute Masking and Context Prediction simultaneously to pre-train GNNs. That approach did not improve performance in our experiments. We leave a thorough analysis of the approach for future work.
+
+# 6 CONCLUSIONS AND FUTURE WORK
+
+We developed a novel strategy for pre-training GNNs. Crucial to the success of our strategy is to consider both node-level and graph-level pre-training in combination with an expressive GNN. This ensures that node embeddings capture local neighborhood semantics that are pooled together to obtain meaningful graph-level representations, which, in turn, are used for downstream tasks. Experiments on multiple datasets, diverse downstream tasks and different GNN architectures show that the new pre-training strategy achieves consistently better out-of-distribution generalization than non-pre-trained models.
+
+Our work makes an important step toward transfer learning on graphs and addresses the issue of negative transfer observed in prior studies. There are many interesting avenues for future work. For example, further increasing generalization by improving GNN architectures as well as pre-training and fine-tuning approaches, is a fruitful direction. Investigating what pre-trained models have learned would also be useful to aid scientific discovery (Tshitoyan et al., 2019). Finally, it would be interesting
+
+| Pre-training strategy | Out-of-dist. (species split) |
| Graph-level | Node-level |
| - | - | 64.8 ±1.0 |
| - | Infomax | 64.1 ±1.5 |
| - | EdgePred | 65.7 ±1.3 |
| - | ContextPred | 65.2 ±1.6 |
| - | AttrMasking | 64.4 ±1.3 |
| Supervised | - | 69.0 ±2.4 |
| Supervised | Infomax | 72.8 ±1.5 |
| Supervised | EdgePred | 72.3 ±1.4 |
| Supervised | ContextPred | 73.8 ±1.0 |
| Supervised | AttrMasking | 74.2 ±1.5 |
+
+
+
+
+Figure 3: Test ROC-AUC of protein function prediction using different pre-training strategies with GIN. (Left) Test ROC-AUC scores (\%) obtained by different pre-training strategies, where the scores are averaged over the 40 fine-grained prediction tasks. (Middle and right): Scatter plot comparisons of ROC-AUC scores for a pair of pre-training strategies on the 40 individual downstream tasks. Each point represents a particular individual downstream task. (Middle): There are many individual downstream tasks where graph-level multi-task supervised pre-trained model performs worse than non-pre-trained model, indicating negative transfer. (Right): When the graph-level multi-task supervised pre-training and Attribute Masking are combined, negative transfer is avoided across downstream tasks. The performance also improves over pure graph-level supervised pre-training.
+
+
+Figure 4: Training and validation curves of different pre-training strategies on GINs. Solid and dashed lines indicate training and validation curves, respectively.
+
+
+
+
+
+to apply our methods to other domains, e.g., physics, material science, and structural biology, where many problems are defined over graphs representing interactions of e.g., atoms, particles, and amino acids.
+
+# ACKNOWLEDGMENTS
+
+We thank Camilo Ruiz, Rex Ying, Zhenqin Wu, Shantao Li, Srijan Kumar, Hongwei Wang, and Robin Jia for their helpful discussion. W.H is supported by Funai Overseas Scholarship and Masason Foundation Fellowship. J.L is a Chan Zuckerberg Biohub investigator. We gratefully acknowledge the support of DARPA under Nos. FA865018C7880 (ASED), N660011924033 (MCS); ARO under Nos. W911NF-16-1-0342 (MURI), W911NF-16-1-0171 (DURIP); NSF under Nos. OAC-1835598 (CINES), OAC-1934578 (HDR); Stanford Data Science Initiative, Wu Tsai Neurosciences Institute, Chan Zuckerberg Biohub, JD.com, Amazon, Boeing, Docomo, Huawei, Hitachi, Observe, Siemens, UST Global.
+
+The U.S. Government is authorized to reproduce and distribute reprints for Governmental purposes notwithstanding any copyright notation thereon. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views, policies, or endorsements, either expressed or implied, of DARPA, NIH, ARO, or the U.S. Government.
+
+The Pande Group acknowledges the generous support of Dr. Anders G. Frøseth and Mr. Christian Sundt for our work on machine learning. The Pande Group is broadly supported by grants from the NIH (R01 GM062868 and U19 AI109662) as well as gift funds and contributions from Folding@home donors.
+
+V.S.P is a consultant & SAB member of Schrodinger, LLC and Globavir, sits on the Board of Directors of Apeel Sciences, Asimov, BioAge Labs, Ciitizen, Devoted Health, Freenome, Insitro, Omada Health, PatientPing, and is a General Partner at Andreessen Horowitz.
+
+# REFERENCES
+
+AACT. AACT database, Jan 2017. URL https://www.ctti-clinicaltrials.org/aact-database.
+Michael Ashburner, Catherine A Ball, Judith A Blake, David Botstein, Heather Butler, J Michael Cherry, Allan P Davis, Kara Dolinski, Selina S Dwight, Janan T Eppig, et al. Gene ontology: tool for the unification of biology. Nature Genetics, 25(1):25, 2000.
+Yunsheng Bai, Hao Ding, Yang Qiao, Agustin Marinovic, Ken Gu, Ting Chen, Yizhou Sun, and Wei Wang. Unsupervised inductive whole-graph embedding by preserving graph proximity. In International Joint Conference on Artificial Intelligence (IJCAI), 2019.
+Guy W. Bemis and Mark A. Murcko. The properties of known drugs. 1. molecular frameworks. Journal of Medicinal Chemistry, 39(15):2887-2893, 1996. doi: 10.1021/jm9602928. PMID: 8709122.
+Andrew P Bradley. The use of the area under the ROC curve in the evaluation of machine learning algorithms. Pattern Recognition, 30(7):1145-1159, 1997.
+Suman K Chakravarti. Distributed representation of chemical fragments. ACS Omega, 3(3):2825-2836, 2018.
+Bin Chen, Robert P. Sheridan, Viktor Hornak, and Johannes H. Voigt. Comparison of random forest and pipeline pilot naïve bayes in prospective QSAR predictions. Journal of Chemical Information and Modeling, 52(3):792-803, 2012. doi: 10.1021/ci200615h. PMID: 22360769.
+Travers Ching, Daniel S Himmelstein, Brett K Beaulieu-Jones, Alexandr A Kalinin, Brian T Do, Gregory P Way, Enrico Ferrero, Paul-Michael Agapow, Michael Zietz, Michael M Hoffman, et al. Opportunities and obstacles for deep learning in biology and medicine. Journal of The Royal Society Interface, 15(141):20170387, 2018.
+Gene Ontology Consortium. The gene ontology resource: 20 years and still going strong. Nucleic Acids Research, 47(D1):D330-D338, 2018.
+Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of deep bidirectional transformers for language understanding. In Annual Conference of the North American Chapter of the Association for Computational Linguistics (NAACL), 2019.
+Jeff Donahue, Yangqing Jia, Oriol Vinyals, Judy Hoffman, Ning Zhang, Eric Tzeng, and Trevor Darrell. Decaf: A deep convolutional activation feature for generic visual recognition. In International Conference on Machine Learning (ICML), pp. 647-655, 2014.
+Brendan L Douglas. The Weisfeiler-Lehman method and graph isomorphism testing. arXiv preprint arXiv:1101.5211, 2011.
+Dumitru Erhan, Yoshua Bengio, Aaron Courville, Pierre-Antoine Manzagol, Pascal Vincent, and Samy Bengio. Why does unsupervised pre-training help deep learning? Journal of Machine Learning Research, 11(Feb):625-660, 2010.
+Matthias Fey and Jan Eric Lenssen. Fast graph representation learning with Pytorch Geometric. In International Conference on Learning Representations (ICLR), RLGM Workshop, 2019.
+Eleanor J Gardiner, John D Holliday, Caroline O'Dowd, and Peter Willett. Effectiveness of 2d fingerprints for scaffold hopping. Future Medicinal Chemistry, 3(4):405-414, 2011.
+Anna Gaulton, Louisa J Bellis, A Patricia Bento, Jon Chambers, Mark Davies, Anne Hersey, Yvonne Light, Shaun McGlinchey, David Michalovich, Bissan Al-Lazikani, et al. ChEMBL: a large-scale bioactivity database for drug discovery. Nucleic Acids Research, 40(D1):D1100-D1107, 2011.
+
+Justin Gilmer, Samuel S Schoenholz, Patrick F Riley, Oriol Vinyals, and George E Dahl. Neural message passing for quantum chemistry. In International Conference on Machine Learning (ICML), pp. 1273-1272, 2017.
+Ross Girshick, Jeff Donahue, Trevor Darrell, and Jitendra Malik. Rich feature hierarchies for accurate object detection and semantic segmentation. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 580-587, 2014.
+Aditya Grover and Jure Leskovec. node2vec: Scalable feature learning for networks. In ACM SIGKDD Conference on Knowledge Discovery and Data Mining (KDD), pp. 855-864. ACM, 2016.
+William L Hamilton, Rex Ying, and Jure Leskovec. Inductive representation learning on large graphs. In Advances in Neural Information Processing Systems (NeurIPS), pp. 1025-1035, 2017a.
+William L Hamilton, Rex Ying, and Jure Leskovec. Representation learning on graphs: Methods and applications. IEEE Data Engineering Bulletin, 40(3):52-74, 2017b.
+Dan Hendrycks, Kimin Lee, and Mantas Mazeika. Using pre-training can improve model robustness and uncertainty. In International Conference on Machine Learning (ICML), 2019.
+Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In International Conference on Machine Learning (ICML), pp. 448-456, 2015.
+Katsuhiko Ishiguro, Shin-ichi Maeda, and Masanori Koyama. Graph warp module: An auxiliary module for boosting the power of graph neural networks. arXiv preprint arXiv:1902.01020, 2019.
+Sabrina Jaeger, Simone Fulle, and Samo Turk. Mol2vec: unsupervised machine learning approach with chemical intuition. Journal of chemical information and modeling, 58(1):27-35, 2018.
+Kristian Kersting, Nils M Kriege, Christopher Morris, Petra Mutzel, and Marion Neumann. Benchmark data sets for graph kernels, 2016. URL http://graphkernels.cs.tu-dortmund.de, 2016.
+Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In International Conference on Learning Representations (ICLR), 2015.
+Thomas N Kipf and Max Welling. Variational graph auto-encoders. In Advances in Neural Information Processing Systems (NeurIPS), Bayesian Deep Learning Workshop, 2016.
+Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. In International Conference on Learning Representations (ICLR), 2017.
+DV Klopfenstein, Liangsheng Zhang, Brent S Pedersen, Fidel Ramírez, Alex Warwick Vesztrony, Aurélien Naldi, Christopher J Mungall, Jeffrey M Yunes, Olga Botvinnik, Mark Weigel, et al. Goatools: A Python library for gene ontology analyses. *Scientific Reports*, 8(1):10872, 2018.
+Michael Kuhn, Ivica Letunic, Lars Juhl Jensen, and Peer Bork. The sider database of drugs and side effects. *Nucleic Acids Research*, 44(D1):D1075–D1079, 2015.
+Greg Landrum et al. RDKit: Open-source cheminformatics, 2006.
+Junying Li, Deng Cai, and Xiaofei He. Learning graph-level representation for drug discovery. arXiv preprint arXiv:1709.03741, 2017.
+Ines Filipa Martins, Ana L Teixeira, Luis Pinheiro, and Andre O Falcao. A bayesian approach to in silico blood-brain barrier penetration modeling. Journal of Chemical Information and Modeling, 52(6):1686-1697, 2012.
+Andreas Mayr, Günter Klambauer, Thomas Unterthiner, Marvin Steijaert, Jörg K Wegner, Hugo Ceulemans, Djork-Arné Clevert, and Sepp Hochreiter. Large-scale comparison of machine learning methods for drug target prediction on ChEMBL. Chemical Science, 9(24):5441-5451, 2018.
+
+Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S Corrado, and Jeff Dean. Distributed representations of words and phrases and their compositionality. In Advances in Neural Information Processing Systems (NeurIPS), pp. 3111-3119, 2013.
+Annamalai Narayanan, Mahinthan Chandramohan, Lihui Chen, Yang Liu, and Santhoshkumar Saminathan. subgraph2vec: Learning distributed representations of rooted sub-graphs from large graphs. In ACM SIGKDD Conference on Knowledge Discovery and Data Mining (KDD), MLG workshop, 2016.
+Nicolò Navarin, Dinh V Tran, and Alessandro Sperduti. Pre-training graph neural networks with kernels. arXiv preprint arXiv:1811.06930, 2018.
+Mathias Niepert, Mohamed Ahmed, and Konstantin Kutzkov. Learning convolutional neural networks for graphs. In International Conference on Machine Learning (ICML), pp. 2014-2023, 2016.
+Paul A. Novick, Oscar F. Ortiz, Jared Poelman, Amir Y. Abdulhay, and Vijay S. Pande. SWEETLEAD: an in silico database of approved drugs, regulated chemicals, and herbal isolates for computer-aided drug discovery. PLOS ONE, 8(11), 11 2013. doi: 10.1371/journal.pone.0079568. URL https://doi.org/10.1371/journal.pone.0079568.
+Sinno Jialin Pan and Qiang Yang. A survey on transfer learning. IEEE Transactions on knowledge and data engineering, 22(10):1345-1359, 2009.
+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 Advances in Neural Information Processing Systems (NeurIPS), Workshop, 2017.
+Bryan Perozzi, Rami Al-Rfou, and Steven Skiena. Deepwalk: Online learning of social representations. In ACM SIGKDD Conference on Knowledge Discovery and Data Mining (KDD), pp. 701-710. ACM, 2014.
+Matthew E Peters, Mark Neumann, Mohit Iyyer, Matt Gardner, Christopher Clark, Kenton Lee, and Luke Zettlemoyer. Deep contextualized word representations. In Annual Conference of the North American Chapter of the Association for Computational Linguistics (NAACL), 2018.
+Bharath Ramsundar, Peter Eastman, Patrick Walters, and Vijay Pande. Deep Learning for the Life Sciences. O'Reilly Media, 2019. https://www.amazon.com/Deep-Learning-Life-Sciences-Microscopy/dp/1492039837.
+Ann M. Richard, Richard S. Judson, Keith A. Houck, Christopher M. Grulke, Patra Volarath, Inthirany Thillainadarajah, Chihae Yang, James Rathman, Matthew T. Martin, John F. Wambaugh, Thomas B. Knudsen, Jayaram Kancherla, Kamel Mansouri, Grace Patlewicz, Antony J. Williams, Stephen B. Little, Kevin M. Crofton, and Russell S. Thomas. Toxcast chemical landscape: Paving the road to 21st century toxicology. Chemical Research in Toxicology, 29(8):1225-1251, 2016.
+David Rogers and Mathew Hahn. Extended-connectivity fingerprints. Journal of Chemical Information and Modeling, 50(5):742-754, 2010. doi: 10.1021/ci100050t.
+Michael T Rosenstein, Zvika Marx, Leslie Pack Kaelbling, and Thomas G Dietterich. To transfer or not to transfer. In Advances in Neural Information Processing Systems (NeurIPS), Workshop on transfer learning, volume 898, pp. 1-4, 2005.
+Herbert Rubenstein and John B Goodenough. Contextual correlates of synonymy. Communications of the ACM, 8(10):627-633, 1965.
+Robert P. Sheridan. Time-split cross-validation as a method for estimating the goodness of prospective prediction. Journal of Chemical Information and Modeling, 53(4):783-790, 2013. doi: 10.1021/ci400084k. PMID: 23521722.
+Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: a simple way to prevent neural networks from overfitting. The Journal of Machine Learning Research, 15(1):1929-1958, 2014.
+
+Teague Sterling and John J. Irwin. Zinc 15 – ligand discovery for everyone. Journal of Chemical Information and Modeling, 55(11):2324–2337, 2015. doi: 10.1021/acs.jcim.5b00559. PMID: 26479676.
+Govindan Subramanian, Bharath Ramsundar, Vijay Pande, and Rajiah Aldrin Denny. Computational modeling of $\beta$ -secretase 1 (BACE-1) inhibitors using ligand based approaches. Journal of Chemical Information and Modeling, 56(10):1936-1949, 2016.
+Jian Tang, Meng Qu, Mingzhe Wang, Ming Zhang, Jun Yan, and Qiao zhu Mei. Line: Large-scale information network embedding. In Proceedings of the International World Wide Web Conference (WWW), pp. 1067-1077, 2015.
+Tox21. Tox21 data challenge 2014, 2014. URL https://tripod.nih.gov/tox21/challenge/.
+Vahe Tshitoyan, John Dagdelen, Leigh Weston, Alexander Dunn, Ziqin Rong, Olga Kononova, Kristin A Persson, Gerbrand Ceder, and Anubhav Jain. Unsupervised word embeddings capture latent knowledge from materials science literature. Nature, 571(7763):95, 2019.
+Petar Velickovic, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Lio, and Yoshua Bengio. Graph attention networks. In International Conference on Learning Representations (ICLR), 2018.
+Petar Velicković, William Fedus, William L Hamilton, Pietro Lio, Yoshua Bengio, and R Devon Hjelm. Deep graph infomax. In International Conference on Learning Representations (ICLR), 2019.
+Jingshu Wang, Divyansh Agarwal, Mo Huang, Gang Hu, Zilu Zhou, Chengzhong Ye, and Nancy R Zhang. Data denoising with transfer learning in single-cell transcriptomics. Nature Methods, 16 (9):875-878, 2019.
+Zhenqin Wu, Bharath Ramsundar, Evan N Feinberg, Joseph Gomes, Caleb Genisses, Aneesh S Pappu, Karl Leswing, and Vijay Pande. MoleculeNet: a benchmark for molecular machine learning. Chemical science, 9(2):513-530, 2018.
+Keyulu Xu, Chengtao Li, Yonglong Tian, Tomohiro Sonobe, Ken-ichi Kawarabayashi, and Stefanie Jegelka. Representation learning on graphs with jumping knowledge networks. In International Conference on Machine Learning (ICML), pp. 5453-5462, 2018.
+Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How powerful are graph neural networks? In International Conference on Learning Representations (ICLR), 2019.
+Yuting Xu, Junshui Ma, Andy Liaw, Robert P Sheridan, and Vladimir Svetnik. Demystifying multi-task deep neural networks for quantitative structure-activity relationships. Journal of Chemical Information and Modeling, 57(10):2490-2504, 2017.
+Rendong Yang, Yun Bai, Zhaohui Qin, and Tianwei Yu. EgoNet: identification of human disease ego-network modules. BMC Genomics, 15(1):314, 2014.
+Rex Ying, Ruining He, Kaifeng Chen, Pong Eksombatchai, William L Hamilton, and Jure Leskovec. Graph convolutional neural networks for web-scale recommender systems. In ACM SIGKDD Conference on Knowledge Discovery and Data Mining (KDD), pp. 974-983, 2018a.
+Rex Ying, Jiaxuan You, Christopher Morris, Xiang Ren, William L Hamilton, and Jure Leskovec. Hierarchical graph representation learning with differentiable pooling. In Advances in Neural Information Processing Systems (NeurIPS), 2018b.
+Jiaxuan You, Rex Ying, and Jure Leskovec. Position-aware graph neural networks. In International Conference on Machine Learning (ICML), 2019.
+Matthew D Zeiler and Rob Fergus. Visualizing and understanding convolutional networks. In European Conference on Computer Vision (ECCV), pp. 818-833. Springer, 2014.
+
+Muhan Zhang, Zhicheng Cui, Marion Neumann, and Yixin Chen. An end-to-end deep learning architecture for graph classification. In AAAI Conference on Artificial Intelligence, pp. 4438-4445, 2018.
+Quan Zhou, Peizhe Tang, Shenxiu Liu, Jinbo Pan, Qimin Yan, and Shou-Cheng Zhang. Learning atoms for materials discovery. Proceedings of the National Academy of Sciences, 115(28):E6411-E6417, 2018.
+Marinka Zitnik, Rok Sosic, and Jure Leskovec. Prioritizing network communities. Nature Communications, 9(1):2544, 2018.
+Marinka Zitnik, Rok Sosič, Marcus W. Feldman, and Jure Leskovec. Evolution of resilience in protein interactomes across the tree of life. Proceedings of the National Academy of Sciences, 116(10):4426-4433, 2019. ISSN 0027-8424. doi: 10.1073/pnas.1818013116. URL https://www.pnas.org/content/116/10/4426.
+
+# A DETAILS OF GNN ARCHITECTURES
+
+Here we describe GNN architectures used in our molecular property and protein function prediction experiments. For both domains we use the GIN architecture (Xu et al., 2019) with some minor modifications to include edge features, as well as center node information in the protein ego-networks.
+
+As our primary goal is to systematically compare our pre-training strategy to the strong baseline strategies, we fix all of these hyper-parameters in our experiments and focus on relative improvement directly caused by the difference in pre-training strategies.
+
+Molecular property prediction. In molecular property prediction, the raw node features and edge features are both 2-dimensional categorical vectors (see Appendix C for details), denoted as $(i_{v,1}, i_{v,2})$ and $(j_{e,1}, j_{e,2})$ for node $v$ and edge $e$ , respectively. Note that we also introduce unique categories to indicate masked node/edges as well as self-loop edges. As input features to GNNs, we first embed the categorical vectors by
+
+$$
+\begin{array}{l} h _ {v} ^ {(0)} = \operatorname {E m b N o d e} _ {1} (i _ {v, 1}) + \operatorname {E m b N o d e} _ {2} (i _ {v, 2}) \\ h _ {e} ^ {(k)} = \mathrm {E m b E d g e} _ {1} ^ {(k)} (j _ {e, 1}) + \mathrm {E m b E d g e} _ {2} ^ {(k)} (j _ {e, 2}) \quad \mathrm {f o r} k = 0, 1, \ldots , K - 1, \\ \end{array}
+$$
+
+where $\mathrm{EmbNode}_1(\cdot)$ , $\mathrm{EmbNode}_2(\cdot)$ , $\mathrm{EmbEdge}_1^{(k)}(\cdot)$ , and $\mathrm{EmbNode}_1^{(k)}(\cdot)$ represent embedding operations that map integer indices to $d$ -dimensional real vectors, and $k$ represents the index of GNN layers. At the $k$ -th layer, GNNs update node representations by
+
+$$
+h _ {v} ^ {(k)} = \operatorname {R e L U} \left(\mathrm {M L P} ^ {(k)} \left(\sum_ {u \in \mathcal {N} (v) \cup \{v \}} h _ {u} ^ {(k - 1)} + \sum_ {e = (v, u): u \in \mathcal {N} (v) \cup \{v \}} h _ {e} ^ {(k - 1)}\right)\right), \tag {A.1}
+$$
+
+where $\mathcal{N}(v)$ is a set of nodes adjacent to $v$ , and $e = (v, v)$ represents the self-loop edge. Note that for the final layer, i.e., $k = K$ , we removed the ReLU from Eq. (A.1) so that $h_v^{(k)}$ can take negative values. This is crucial for pre-training methods based on the dot product, e.g., Context Prediction and Edge Prediction, as otherwise, the dot product between two vectors would be always positive.
+
+The graph-level representation $h_G$ is obtained by averaging the node embeddings at the final layer, i.e.,
+
+$$
+h _ {G} = \operatorname {M E A N} \left(\left\{h _ {v} ^ {(K)} \mid v \in G \right\}\right). \tag {A.2}
+$$
+
+The label prediction is made by a linear model on top of $h_G$ .
+
+In our experiments, we set the embedding dimension $d$ to 300. For MLPs in Eq. (A.1), we use the ReLU activation with 600 hidden units. We apply batch normalization (Ioffe & Szegedy, 2015) right before the ReLU in Eq. (A.1) and apply dropout (Srivastava et al., 2014) to $h_v^{(k)}$ at all the layers except the input layer.
+
+Protein function prediction. The GNN architecture used for protein function prediction is similar to the one used for molecular property prediction except for a few differences. First, the raw input node features are uniform (denoted as $X$ here) and second, the raw input edge features are binary vectors (see Appendix D for the detail), which we denote as $c_{e} \in \{0,1\}^{d_{0}}$ . As input features to GNNs, we first embed the raw features by
+
+$$
+h _ {v} ^ {(0)} = X
+$$
+
+$$
+h _ {e} ^ {(k)} = W c _ {e} + b \text {f o r} k = 0, 1, \dots , K - 1,
+$$
+
+where $W \in \mathbb{R}^{d \times d_0}$ and $b \in \mathbb{R}^d$ are learnable parameters, and $h_v^{(0)}, h_e^{(k)} \in \mathbb{R}^d$ . At each layer, GNNs update node representations by
+
+$$
+\left. h _ {v} ^ {(k)} = \operatorname {R e L U} \left(\mathrm {M L P} ^ {(k)} \left(\operatorname {C O N C A T} \left(\sum_ {u \in \mathcal {N} (v) \cup \{v \}} h _ {u} ^ {(k - 1)}, \sum_ {e = (v, u): u \in \mathcal {N} (v) \cup \{v \}} h _ {e} ^ {(k - 1)}\right)\right)\right), \right. \tag {A.3}
+$$
+
+| Dataset | MUTAG | PTC |
| # Molecules | 188 | 344 |
| # Binary prediction tasks | 1 | 1 |
| Previous results | Cross validation split |
| WL substree (Douglas, 2011) | 90.4 ± 5.7 | 59.9 ± 4.3 |
| Patchysan (Niepert et al., 2016) | 92.6 ± 4.2 | 60.0 ± 4.8 |
| GIN (Xu et al., 2019) | 89.4 ± 5.6 | 64.6 ± 7.0 |
| Pre-training strategy | Cross validation split |
| Graph-level | Node-level |
| - | - | 89.3 ± 7.4 | 62.4 ± 6.3 |
| - | Infomax | 89.8 ± 5.6 | 65.9 ± 3.9 |
| - | EdgePred | 91.9 ± 7.0 | 66.5 ± 5.7 |
| - | Masking | 91.4 ± 5.0 | 64.4 ± 7.3 |
| - | ContextPred | 92.4 ± 7.1 | 68.3 ± 7.8 |
| Supervised | - | 90.9 ± 5.8 | 64.7 ± 7.9 |
| Supervised | Infomax | 90.9 ± 5.4 | 63.0 ± 9.3 |
| Supervised | EdgePred | 91.9 ± 4.2 | 63.5 ± 8.2 |
| Supervised | Masking | 90.3 ± 3.3 | 60.9 ± 9.1 |
| Supervised | ContextPred | 92.5 ± 5.0 | 66.5 ± 5.2 |
+
+Table 3: 10-fold cross validation accuracy (%) on classic graph classification benchmarks using different pre-training strategies with GIN. All the previous results are excerpted from Xu et al. (2019).
+
+where $\mathrm{CONCAT}(\cdot ,\cdot)$ takes two vectors as input and concatenates them. Since the downstream task is ego-network classification, we use the embedding of the center node $v_{\mathrm{center}}$ together with the embedding of the entire ego-network. More specifically, we obtain graph-level representation $h_G$ by
+
+$$
+h _ {G} = \operatorname {C O N C A T} \left(\operatorname {M E A N} \left(\left\{h _ {v} ^ {(K)} \mid v \in G \right\}\right), h _ {v _ {\text {c e n t e r}}} ^ {(K)}\right). \tag {A.4}
+$$
+
+Other GNN architectures. For GCN, GraphSAGE, and GAT, we adopt the implementation in the Pytorch Geometric library (Fey & Lenssen, 2019), where we set the number of GAT attention heads to be 2. The dimensionality of node embeddings as well as the number of GNN layers are kept the same as GIN. These models do not originally handle edge features. We incorporate edge features into these models similarly to how we do it for the GIN; we add edge embeddings into node embeddings, and perform the GNN message-passing on the obtained node embeddings.
+
+# B EXPERIMENTS ON CLASSIC GRAPH CLASSIFICATION BENCHMARKS
+
+In Table 3 we report our experiments on the commonly-used classic graph classification benchmarks (Kersting et al., 2016). Among the datasets Xu et al. (2019) used, MUTAG, PTC, and NCI1 are molecule datasets for binary classification. Out of these three, we excluded the NCI1 dataset, because it misses edge information (i.e., bond type) and therefore, we cannot recover the original molecule information, which is necessary to construct our input representations described in Appendix C.
+
+For fair comparison, we used exactly the same evaluation protocol as Xu et al. (2019), i.e., report 10-fold cross-validation accuracy. All the hyper-parameters in our experiments are kept the same in the main experiments except that we additionally tuned dropout rate from $\{0,0.2,0.5\}$ and the batch size from $\{8,64\}$ at the fine-tuning stage.
+
+While the pre-trained GNNs (especially those with Context Prediction) give competent performance, all the accuracies (including all the previous methods) are within a standard deviation with each other, making it hard to reliably compare different methods. As Xu et al. (2019) has pointed out, this is due to the extremely small dataset size; a validation set at each fold only contains around 19 to 35 molecules for MUTAG and PTC, respectively. Given these results, we argue that it is necessary to use larger datasets to make reliable comparison, so we mainly focus on MoleculeNet (Wu et al., 2018) in this work.
+
+# C DETAILS OF MOLECULAR DATASETS
+
+Input graph representation. For simplicity, we use a minimal set of node and bond features that unambiguously describe the two-dimensional structure of molecules. We use RDKit (Landrum et al., 2006) to obtain these features.
+
+- Node features:
+
+- Atom number: [1, 118]
+- Chirality tag: {unspecified, tetrahedral cw, tetrahedral ccw, other}
+
+- Edge features:
+
+Bond type: {single, double, triple, aromatic}
+- Bond direction: $\{-, \text{endupright}, \text{enddownright}\}$
+
+Downstream task datasets. 8 binary graph classification datasets from Moleculenet (Wu et al., 2018) are used to evaluate model performance.
+
+- BBBP. Blood-brain barrier penetration (membrane permeability) (Martins et al., 2012).
+- Tox21. Toxicity data on 12 biological targets, including nuclear receptors and stress response pathways (Tox21).
+- **ToxCast. Toxicology measurements based on over 600 in vitro high-throughput screenings** (Richard et al., 2016).
+- SIDER. Database of marketed drugs and adverse drug reactions (ADR), grouped into 27 system organ classes (Kuhn et al., 2015).
+- ClinTox. Qualitative data classifying drugs approved by the FDA and those that have failed clinical trials for toxicity reasons (Novick et al., 2013; AACT).
+- MUV. Subset of PubChem BioAssay by applying a refined nearest neighbor analysis, designed for validation of virtual screening techniques (Gardiner et al., 2011).
+- HIV. Experimentally measured abilities to inhibit HIV replication (?).
+- BACE. Qualitative binding results for a set of inhibitors of human $\beta$ -secretase 1 (Subramanian et al., 2016).
+
+# D DETAILS OF PROTEIN DATASETS
+
+Input graph representation. The protein subgraphs only have edge features.
+
+- Edge features:
+
+- Neighbourhood: {True, False}
+-Fusion:{True,False}
+- Co-occurrence: {True, False}
+- Co-expression: {True, False}
+-Experiment:{True,False}
+- Database: {True, False}
+- Text: {True, False}
+
+These edge features indicate whether a particular type of relationship exists between a pair of proteins:
+
+- Neighbourhood: if a pair of genes are consistently observed in each other's genome neighbourhood
+- Fusion: if a pair of proteins have their respective orthologs fused into a single protein-coding gene in another organism
+- Co-occurrence: if a pair of proteins tend to be observed either as present or absent in the same subset of organisms
+- Co-expression: if a pair of proteins share similar expression patterns
+
+- Experiment: if a pair of proteins are experimentally observed to physically interact with each other
+- Database: if a pair of proteins belong to the same pathway, based on assessments by a human curator
+- Text mining: if a pair of proteins are mentioned together in PubMed abstracts
+
+Datasets. A dataset containing protein subgraphs from 50 species is used (Zitnik et al., 2019). The original PPI networks do not have node attributes, but contain edge attributes that correspond to the degree of confidence for 7 different types of protein-protein relationships. The edge weights range from 0, which indicates no evidence for the specific relationship, to 1000, which indicates the highest confidence. The weighted edges of the PPI networks are thresholded such that the distribution of edge types across the 50 PPI networks are uniform. Then, for every node in the PPI networks, subgraphs centered on each node were generated by: (1) performing a breadth first search to select the subgraph nodes, with a search depth limit of 2 and a maximum number of 10 neighbors randomly expanded per node, (2) including the selected subgraph nodes and all the edges between those nodes to form the resulting subgraph.
+
+The entire dataset contains 394,925 protein subgraphs derived from 50 species. Out of these 50 species, 8 species (arabidopsis, celegans, ecoli, fly, human, mouse, yeast, zebrafish) have proteins with GO protein annotations. The dataset contains 88,000 protein subgraphs from these 8 species, of which 57,448 proteins have at least one positive coarse-grained GO protein annotation and 22,876 proteins have at least one positive fine-grained GO protein annotation. For the self-supervised pre-training dataset, we use all 394,925 protein subgraphs.
+
+We define fine-grained protein functions as Gene Ontology (GO) annotations that are leaves in the GO hierarchy, and define coarse-grained protein functions as GO annotations that are the immediate parents of leaves (Ashburner et al., 2000; Consortium, 2018). For example, a fine-grained protein function is "Factor XII activation", while a coarse-grained function is "positive regulation of protein". The former is a specific type of the latter, and is much harder to derive experimentally. The GO hierarchy information is obtained using GOATools (Klopfenstein et al., 2018). The supervised pre-training dataset and the downstream evaluation dataset are derived from the 8 labeled species, as described in Appendix E. The 40-th most common fine-grained protein label only has 121 positively annotated proteins, while the 40-th most common coarse-grained protein label has 9386 positively annotated proteins. This illustrates the extreme label scarcity of our downstream tasks.
+
+For supervised pre-training, we combine the train, validation, and prior sets described previously, with the 5,000 most common coarse-grained protein function annotations as binary labels. For our downstream task, we predict the 40 most common fine-grained protein function annotations, to ensure that each protein function has at least 10 positive labels in our test set.
+
+# E DETAILS OF DATASET SPLITTING
+
+For molecular prediction tasks, following Ramsundar et al. (2019), we cluster molecules by scaffold (molecular graph substructure) (Bemis & Murcko, 1996), and recombine the clusters by placing the most common scaffolds in the training set, producing validation and test sets that contain structurally different molecules. Prior work has shown that this scaffold split provides a more realistic estimate of model performance in prospective evaluation compared to random split (Chen et al., 2012; Sheridan, 2013). The split for train/validation/test sets is $80\%$ : $10\%$ : $10\%$ .
+
+In the PPI network, species split simulates a scenario where we have only high-level coarse-grained knowledge on a subset of proteins (prior set) in a species of interest (human in our experiments), and want to predict fine-grained biological functions for the rest of the proteins in that species (test set). For species split, we use $50\%$ of the protein subgraphs from human as test set, and $50\%$ as a prior set containing only coarse-grained protein annotations. The protein subgraphs from 7 other labelled species (arabidopsis, telegans, ecoli, fly, mouse, yeast, zebrafish) are used as train and validation sets, which are split $85\% : 15\%$ . The effective split ratio for the train/Validation/prior/test sets is $69\% : 12\% : 9.5\% : 9.5\%$ .
+
+# F TIME COMPLEXITY OF PRE-TRAINING
+
+Here we analyze the time complexity for processing graphs in Attribute Masking and Context Prediction. First, the time complexity for Attribute Masking is linear with respect to the number of edges/nodes as it only involves sampling nodes/edges to be masked. Second, the time complexity for Context Prediction is again linear with respect to the number of edges/nodes, because it involves sampling a center node per graph plus extracting $K$ -hop neighborhood and context graph. Extracting the neighborhood/context graphs is performed by the breadth-first search, which takes at most linear time with respect to the number of edges in the graph. In summary, the time complexity for both of our pre-training methods are at most linear with respect to the number of edges, which is as efficient as message-passing computation in GNNs, and thus, is as efficient as the ordinary supervised learning using GNNs. Also, there is almost no memory overhead as we transform data (e.g., mask input node/edge features, sample the context graphs) on-the-fly.
+
+# G FURTHER DETAILS OF THE EXPERIMENTAL SETUP
+
+**Optimization.** All models are trained with Adam optimizer (Kingma & Ba, 2015) with a learning rate of 0.001. We use Pytorch (Paszke et al., 2017) and Pytorch Geometric (Fey & Lenssen, 2019) for all of our implementation. We run all pre-training methods for 100 epochs. For self-supervised pre-training, we use a batch size of 256, while for supervised pre-training, we use a batch size of 32 with dropout rate of $20\%$ .
+
+Fine-tuning. After pre-training, we follow the procedure in Section 3.3 to fine-tune the models on the training sets of the downstream datasets. We use a batch size of 32 and dropout rate of $50\%$ . Datasets with multiple prediction tasks are fit jointly. On the molecular property prediction datasets, we train models for 100 epochs, while on the protein function prediction dataset (with the 40 binary prediction tasks), we train models for 50 epochs.
+
+Evaluation. We evaluate test performance on downstream tasks using ROC-AUC (Bradley, 1997) with the validation early stopping protocol, i.e., test ROC-AUC at the best validation epoch is reported. For datasets with multiple prediction tasks, we take the average ROC-AUC across all their tasks. The downstream experiments are run with 10 random seeds, and we report mean ROC-AUC and standard deviation.
+
+Computation time for pre-training. The computation time for the two stages of our pre-training is reported below. Chemistry: Self-supervised pre-training takes about 24 hours, while supervised pre-training takes about 11 hours. Biology: Self-supervised pre-training takes about 3.8 hours, while supervised pre-training takes about 2.5 hours.
+
+# H COMPARISON OF PRE-TRAINING WITH DIFFERENT GNN ARCHITECTURES
+
+Table 4 shows the detailed comparison of different GNN architectures on the chemistry datasets. We see that the most expressive GIN architectures benefit most from pre-training compared to the other less expressive models.
+
+# I ADDITIONAL TRAINING AND VALIDATION CURVES
+
+Training and validation curves. In Figure 5, we plot training and validation curves for all the datasets used in the molecular property prediction experiments.
+
+Additional scatter plot comparisons of ROC-AUCs. In Figure 6, we compare our Context Prediction + graph-level supervised pre-training with a non-pre-trained model and a graph-level supervised pre-trained model. We see from the left plot that the combined strategy again completely avoids negative transfer across all the 40 downstream tasks. Furthermore, we see from the right plot that additionally adding our node-level Context Prediction pre-training almost always improves ROC-AUC scores of supervised pre-trained models across the 40 downstream tasks.
+
+| Dataset | BBBP | Tox21 | ToxCast | SIDER | ClinTox | MUV | HIV | BACE | Average |
| # Molecules | 2039 | 7831 | 8575 | 1427 | 1478 | 93087 | 41127 | 1513 | / |
| # Binary prediction tasks | 1 | 12 | 617 | 27 | 2 | 17 | 1 | 1 | / |
| Configuration | Out-of-distribution prediction (scaffold split) |
| Architecture | Pre-train? |
| GIN | No | 65.8 ±4.5 | 74.0 ±0.8 | 63.4 ±0.6 | 57.3 ±1.6 | 58.0 ±4.4 | 71.8 ±2.5 | 75.3 ±1.9 | 70.1 ±5.4 | 67.0 |
| GIN | Yes | 68.7 ±1.3 | 78.1 ±0.6 | 65.7 ±0.6 | 62.7 ±0.8 | 72.6 ±1.5 | 81.3 ±2.1 | 79.9 ±0.7 | 84.5 ±0.7 | 74.2 |
| GCN | No | 64.9±3.0 | 74.9±0.8 | 63.3±0.9 | 60.0±1.0 | 65.8±4.5 | 73.2±1.4 | 75.7±1.1 | 73.6±3.0 | 68.9 |
| GCN | Yes | 70.6±1.6 | 75.8±0.3 | 65.3±0.1 | 62.4±0.5 | 63.6±1.7 | 79.4±1.8 | 78.2±0.6 | 82.3±3.4 | 72.2 |
| GraphSAGE | No | 69.6±1.9 | 74.7±0.7 | 63.3±0.5 | 60.4±1.0 | 59.2±4.4 | 72.7±1.4 | 74.4±0.7 | 72.5±1.9 | 68.3 |
| GraphSAGE | Yes | 63.9±2.1 | 76.8±0.3 | 64.9±0.2 | 60.7±0.5 | 60.7±2.0 | 78.4±2.0 | 76.2±1.1 | 80.7±0.9 | 70.3 |
| GAT | No | 66.2±2.6 | 75.4±0.5 | 64.6±0.6 | 60.9±1.4 | 58.5±3.6 | 66.6±2.2 | 72.9±1.8 | 69.7±6.4 | 66.8 |
| GAT | Yes | 59.4±0.5 | 68.1±0.5 | 59.3±0.7 | 56.0±0.5 | 47.6±1.3 | 65.4±0.8 | 62.5±1.6 | 64.3±1.1 | 60.3 |
+
+Table 4: Test ROC-AUC (%) performance on molecular prediction benchmarks with different GNN architectures. The rightmost column averages the mean of test performance across the 8 datasets. For pre-training, we applied Context Prediction + graph-level supervised pre-training.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Figure 5: Training and validation curves of different pre-training strategies. The solid and dashed lines indicate the training and validation curves, respectively.
+
+
+
+
+
+
+Figure 6: Scatter plot comparisons of ROC-AUC scores of our Context Prediction + graph-level supervised pre-training strategy versus the two baseline strategies (non-pre-trained and graph-level supervised pre-trained) on the 40 individual downstream tasks of predicting different fine-grained protein function labels.
+
+
\ No newline at end of file
diff --git a/strategiesforpretraininggraphneuralnetworks/images.zip b/strategiesforpretraininggraphneuralnetworks/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..6d2659e9375c5fc22b5f618ff782003a529b748c
--- /dev/null
+++ b/strategiesforpretraininggraphneuralnetworks/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0c006b86ae31a074dcd065877e4f934c0df37f2454f896a2459c6c901fa25936
+size 734393
diff --git a/strategiesforpretraininggraphneuralnetworks/layout.json b/strategiesforpretraininggraphneuralnetworks/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..87b2b8f154017e3186ade37f05f486369cba937b
--- /dev/null
+++ b/strategiesforpretraininggraphneuralnetworks/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:6be4f310e1fac5a265be97a3f3efcc610974df2649c8c40a2e1e5e73604cb1e4
+size 626746
diff --git a/sumounbiasedestimationoflogmarginalprobabilityforlatentvariablemodels/899e58bf-7af2-4975-b190-7024e0761a4e_content_list.json b/sumounbiasedestimationoflogmarginalprobabilityforlatentvariablemodels/899e58bf-7af2-4975-b190-7024e0761a4e_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..8c5dc39c78513dcd31244171cc1b43f525e0c9e4
--- /dev/null
+++ b/sumounbiasedestimationoflogmarginalprobabilityforlatentvariablemodels/899e58bf-7af2-4975-b190-7024e0761a4e_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:4476bf38cb9abd4bcba42f4b47d29adea3b4d33f064fcaf04a485d7707e9e22b
+size 128378
diff --git a/sumounbiasedestimationoflogmarginalprobabilityforlatentvariablemodels/899e58bf-7af2-4975-b190-7024e0761a4e_model.json b/sumounbiasedestimationoflogmarginalprobabilityforlatentvariablemodels/899e58bf-7af2-4975-b190-7024e0761a4e_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..dcc3be9e45710912fa2a4eb93f79aa6b09da7beb
--- /dev/null
+++ b/sumounbiasedestimationoflogmarginalprobabilityforlatentvariablemodels/899e58bf-7af2-4975-b190-7024e0761a4e_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0804d74c990cc2d3cbda561223f93781f6b7bbd59ddf016e44032af9e51d1428
+size 155819
diff --git a/sumounbiasedestimationoflogmarginalprobabilityforlatentvariablemodels/899e58bf-7af2-4975-b190-7024e0761a4e_origin.pdf b/sumounbiasedestimationoflogmarginalprobabilityforlatentvariablemodels/899e58bf-7af2-4975-b190-7024e0761a4e_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..8235545fa6aad36b5fe6a8d770714224b06ff39f
--- /dev/null
+++ b/sumounbiasedestimationoflogmarginalprobabilityforlatentvariablemodels/899e58bf-7af2-4975-b190-7024e0761a4e_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d847d4bf17fd0cea44f81b41d955ba8c23177e6578db271e5be7d00a17cf26c1
+size 1563923
diff --git a/sumounbiasedestimationoflogmarginalprobabilityforlatentvariablemodels/full.md b/sumounbiasedestimationoflogmarginalprobabilityforlatentvariablemodels/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..562a2954b7b31be6f467810a8f698038510a81ce
--- /dev/null
+++ b/sumounbiasedestimationoflogmarginalprobabilityforlatentvariablemodels/full.md
@@ -0,0 +1,622 @@
+# SUMO: UNBIASED ESTIMATION OF LOG MARGINAL PROBABILITY FOR LATENT VARIABLE MODELS
+
+Yucen Luo*
+
+Tsinghua University
+
+luoc15@mails.tsinghua.edu.cn
+
+Alex Beatson
+
+Princeton University
+
+abeatson@cs.princeton.edu
+
+Mohammad Norouzi
+
+Google Research
+
+mnorouzi@google.com
+
+Jun Zhu
+
+Tsinghua University
+
+dcszj@tsinghua.edu.cn
+
+David Duvenaud
+
+University of Toronto
+
+duvenaud@cs.toronto.edu
+
+Ryan P. Adams
+
+Princeton University
+
+rpa@princeton.edu
+
+Ricky T. Q. Chen*
+
+University of Toronto
+
+rtqichen@cs.toronto.edu
+
+# ABSTRACT
+
+Standard variational lower bounds used to train latent variable models produce biased estimates of most quantities of interest. We introduce an unbiased estimator of the log marginal likelihood and its gradients for latent variable models based on randomized truncation of infinite series. If parameterized by an encoder-decoder architecture, the parameters of the encoder can be optimized to minimize its variance of this estimator. We show that models trained using our estimator give better test-set likelihoods than a standard importance-sampling based approach for the same average computational cost. This estimator also allows use of latent variable models for tasks where unbiased estimators, rather than marginal likelihood lower bounds, are preferred, such as minimizing reverse KL divergences and estimating score functions.
+
+# 1 INTRODUCTION
+
+Latent variable models are powerful tools for constructing highly expressive data distributions and for understanding how high-dimensional observations might possess a simpler representation. Latent variable models are often framed as probabilistic graphical models, allowing these relationships to be expressed in terms of conditional independence. Mixture models, probabilistic principal component analysis (Tipping & Bishop, 1999), hidden Markov models, and latent Dirichlet allocation (Blei et al., 2003) are all examples of powerful latent variable models. More recently there has been a surge of interest in probabilistic latent variable models that incorporate flexible nonlinear likelihoods via deep neural networks (Kingma & Welling, 2014). These models can blend the advantages of highly structured probabilistic priors with the empirical successes of deep learning (Johnson et al., 2016; Luo et al., 2018). Moreover, these explicit latent variable models can often yield relatively interpretable representations, in which simple interpolation in the latent space can lead to semantically-meaningful changes in high-dimensional observations (e.g., Higgins et al. (2017)).
+
+It can be challenging, however, to fit the parameters of a flexible latent variable model, since computing the marginal likelihood of the data requires integrating out the latent variables. Typical approaches to this problem include the celebrated expectation maximization algorithm (Dempster et al., 1977), Markov chain Monte Carlo, and the Laplace approximation. Variational inference generalizes expectation maximization by forming a lower bound on the aforementioned (log) marginal likelihood, using a tractable approximation to the unmanageable posterior over latent variables. The maximization of this lower bound—rather than the true log marginal likelihood—is often relatively straightforward when using automatic differentiation and Monte Carlo sampling. However, a
+
+lower bound may be ill-suited for tasks such as posterior inference and other situations where there exists an entropy maximization objective; for example in entropy-regularized reinforcement learning (Williams & Peng, 1991; Mnih et al., 2016; Norouzi et al., 2016) which requires minimizing the log probability of the samples under the model.
+
+While there is a long history in Bayesian statistics of estimating the marginal likelihood (e.g., Newton & Raftery (1994); Neal (2001)), we often want high-quality estimates of the logarithm of the marginal likelihood, which is better behaved when the data is high dimensional; it is not as susceptible to underflow and it has gradients that are numerically sensible. However, the log transformation introduces some challenges: Monte Carlo estimation techniques such as importance sampling do not straightforwardly give unbiased estimates of this quantity. Nevertheless, there has been significant work to construct estimators of the log marginal likelihood in which it is possible to explicitly trade off between bias against computational cost (Burda et al., 2016; Bamler et al., 2017; Nowozin, 2018). Unfortunately, while there are asymptotic regimes where the bias of these estimators approaches zero, it is always possible to optimize the parameters to increase this bias to infinity.
+
+In this work, we construct an unbiased estimator of the log marginal likelihood. Although there is no theoretical guarantee that this estimator has finite variance, we find that it can work well in practice. We show that this unbiased estimator can train latent variable models to achieve higher test log-likelihood than lower bound estimators at the same expected compute cost. More importantly, this unbiased estimator allows us to apply latent variable models in situations where these models were previously problematic to optimize with lower bound estimators. Such applications include latent variable modeling for posterior inference and for reinforcement learning in high-dimensional action spaces, where an ideal model is one that is highly expressive yet efficient to sample from.
+
+# 2 PRELIMINARIES
+
+# 2.1 LATENT VARIABLE MODELS
+
+Latent variable models (LVMs) describe a distribution over data in terms of a mixture over unobserved quantities. Let $p_{\theta}(x)$ be a family of probability density (mass) functions on a data space $\mathcal{X}$ , indexed by parameters $\theta$ . We will generally refer to this as a "density" for consistency, even when the data should be understood to be discrete; similarly we will use integrals even when the marginalization is over a discrete set. In a latent variable model, $p_{\theta}(x)$ is defined via a space of latent variables $\mathcal{Z}$ , a family of mixing measures on this latent space with density denoted $p_{\theta}(z)$ , and a conditional distribution $p_{\theta}(x|z)$ . This conditional distribution is sometimes called an "observation model" or a conditional likelihood. We will take $\theta$ to parameterize both $p_{\theta}(x|z)$ and $p_{\theta}(z)$ in the service of determining the marginal $p_{\theta}(x)$ via the mixture integral:
+
+$$
+p _ {\theta} (x) := \int_ {\mathcal {Z}} p _ {\theta} (x \mid z) p _ {\theta} (z) d z = \mathbb {E} _ {z \sim p _ {\theta} (z)} [ p _ {\theta} (x \mid z) ]. \tag {1}
+$$
+
+This simple formalism allows for a large range of modeling approaches, in which complexity can be baked into the latent variables (as in traditional graphical models), into the conditional likelihood (as in variational autoencoders), or into both (as in structured VAEs). The downside of this mixing approach is that the integral may be intractable to compute, making it difficult to evaluate $p_{\theta}(x)$ — a quantity often referred to in Bayesian statistics and machine learning as the marginal likelihood or evidence. Various Monte Carlo techniques have been developed to provide consistent and often unbiased estimators of $p_{\theta}(x)$ , but it is usually preferable to work with $\log p_{\theta}(x)$ and unbiased estimation of this quantity has, to our knowledge, not been previously studied.
+
+# 2.2 TRAINING LATENT VARIABLE MODELS
+
+Fitting a parametric distribution to observed data is often framed as the minimization of a difference between the model distribution and the empirical distribution. The most common difference measure is the forward Kullback-Leibler (KL) divergence; if $p_{\mathrm{data}}(x)$ is the empirical distribution and $p_{\theta}(x)$ is a parametric family, then minimizing the KL divergence $(D_{\mathrm{KL}})$ with respect to $\theta$ is equivalent to maximizing the likelihood:
+
+$$
+D _ {\mathrm {K L}} \left(p _ {\text {d a t a}} \mid \mid p _ {\theta}\right) = \int_ {\mathcal {X}} p _ {\text {d a t a}} (x) \log \frac {p _ {\text {d a t a}} (x)}{p _ {\theta} (x)} d x = - \mathbb {E} _ {\text {d a t a}} [ \log p _ {\theta} (x) ] + \text {c o n s t}. \tag {2}
+$$
+
+Equivalently, the optimization problem of finding the MLE parameters $\theta$ comes down to maximizing the expected log probability of the data:
+
+$$
+\theta^ {\mathrm {M L E}} = \underset {\theta} {\arg \min } D _ {\mathrm {K L}} \left(p _ {\text {d a t a}} \mid \mid p _ {\theta}\right) = \underset {\theta} {\arg \max } \mathbb {E} _ {\text {d a t a}} [ \log p _ {\theta} (x) ]. \tag {3}
+$$
+
+Since expectations can be estimated in an unbiased manner using Monte Carlo procedures, simple subsampling of the data enables powerful stochastic optimization techniques, with stochastic gradient descent in particular forming the basis for learning the parameters of many nonlinear models. However, this requires unbiased estimates of $\nabla_{\theta}\log p_{\theta}(x)$ , which are not available for latent variable models. Instead, a stochastic lower bound of $\log p_{\theta}(x)$ is often used and then differentiated for optimization.
+
+Though many lower bound estimators (Burda et al., 2016; Bamler et al., 2017; Nowozin, 2018) are applicable, we focus on an importance-weighted evidence lower bound (Burda et al., 2016). This lower bound is constructed by introducing a proposal distribution $q(z;x)$ and using it to form an importance sampling estimate of the marginal likelihood:
+
+$$
+p _ {\theta} (x) = \int_ {\mathcal {Z}} p _ {\theta} (x \mid z) p _ {\theta} (z) d z = \int_ {\mathcal {Z}} q (z; x) \frac {p _ {\theta} (x \mid z) p _ {\theta} (z)}{q (z ; x)} d z = \mathbb {E} _ {z \sim q} \left[ \frac {p _ {\theta} (x \mid z) p _ {\theta} (z)}{q (z ; x)} \right]. \tag {4}
+$$
+
+If $K$ samples are drawn from $q(z;x)$ then this provides an unbiased estimate of $p_{\theta}(x)$ and the biased "importance-weighted autoencoder" estimator $\mathrm{IWAE}_K(x)$ of $\log p_{\theta}(x)$ is given by
+
+$$
+\operatorname {I W A E} _ {K} (x) := \log \frac {1}{K} \sum_ {k = 1} ^ {K} \frac {p _ {\theta} (x \mid z _ {k}) p _ {\theta} (z _ {k})}{q \left(z _ {k}; x\right)}, \quad z _ {k} \stackrel {{i i d}} {{\sim}} q (z; x). \tag {5}
+$$
+
+The special case of $K = 1$ generates an unbiased estimate of the evidence lower bound (ELBO), which is often used for performing variational inference by stochastic gradient descent. While the IWAE lower bound acts as a useful replacement of $\log p_{\theta}(x)$ in maximum likelihood training, it may not be suitable for other objectives such as those that involve entropy maximization. We discuss tasks for which a lower bound estimator would be ill-suited in Section 3.4.
+
+There are two properties of IWAE that will allow us to modify it to produce an unbiased estimator: First, it is consistent in the sense that as the number of samples $K$ increases, the expectation of $\mathrm{IWAE}_K(x)$ converges to $\log p_{\theta}(x)$ . Second, it is also monotonically non-decreasing in expectation:
+
+$$
+\log p _ {\theta} (x) = \lim _ {K \rightarrow \infty} \mathbb {E} [ \mathrm {I W A E} _ {K} (x) ] \quad \text {a n d} \quad \mathbb {E} [ \mathrm {I W A E} _ {K + 1} (x) ] \geq \mathbb {E} [ \mathrm {I W A E} _ {K} (x) ]. \tag {6}
+$$
+
+These properties are sufficient to create an unbiased estimator using the Russian roulette estimator.
+
+# 2.3 RUSSIAN ROULETTE ESTIMATOR
+
+In order to create an unbiased estimator of the log probability function, we employ the Russian roulette estimator (Kahn, 1955). This estimator is used to estimate the sum of infinite series, where each sample of the estimator almost surely requires only a finite amount of computation. Intuitively, the Russian roulette estimator relies on a randomized truncation and weighting of each term to account for the possibility of not computing the remaining terms.
+
+To illustrate the idea, let $\tilde{\Delta}_k$ denote the $k$ -th term of an infinite series. Assume the partial sum of the series $\sum_{k=1}^{\infty} \tilde{\Delta}_k$ converges to some quantity we wish to obtain. We can construct a simple estimator by always computing the first term then flipping a coin $b \sim \operatorname{Bernoulli}(q)$ to determine whether we stop or continue evaluating the remaining terms. With probability $1 - q$ , we compute the rest of the series. By reweighting the remaining future terms by ${}^{1/(1-q)}$ , we obtain an unbiased estimator:
+
+$$
+\tilde {Y} = \tilde {\Delta} _ {1} + \left(\frac {\sum_ {k = 2} ^ {\infty} \tilde {\Delta} _ {k}}{1 - q}\right) \mathbb {1} _ {b = 0} + (0) \mathbb {1} _ {b = 1} \qquad \mathbb {E} [ \tilde {Y} ] = \tilde {\Delta} _ {1} + \frac {\sum_ {k = 2} ^ {\infty} \tilde {\Delta} _ {k}}{1 - q} (1 - q) = \sum_ {k = 1} ^ {\infty} \tilde {\Delta} _ {k}.
+$$
+
+To obtain the "Russian roulette" (RR) estimator (Forsythe & Leibler, 1950), we repeatedly apply this trick to the remaining terms. In effect, we make the number of terms a random variable $\mathcal{K}$ , taking values in $1,2,\ldots$ to use in the summation (i.e., the number of coin flips) from some distribution
+
+with probability mass function $p(K) = \mathbb{P}(\mathcal{K} = K)$ with support over the positive integers. With $K$ drawn from $p(K)$ , the estimator takes the form:
+
+$$
+\hat {Y} (K) = \sum_ {k = 1} ^ {K} \frac {\tilde {\Delta} _ {k}}{\mathbb {P} (\mathcal {K} \geq k)} \quad \mathbb {E} _ {K \sim p (K)} [ \hat {Y} (K) ] = \sum_ {k = 1} ^ {\infty} \tilde {\Delta} _ {k}. \tag {7}
+$$
+
+The equality on the right hand of equation 7 holds so long as (i) $\mathbb{P}(\mathcal{K}\geq k) > 0$ , $\forall k > 0$ , and (ii) the series converges absolutely, i.e., $\sum_{k = 1}^{\infty}|\tilde{\Delta}_k| < \infty$ (Chen et al. (2019); Lemma 3). This condition ensures that the average of multiple samples will converge to the value of the infinite series by the law of large numbers. However, the variance of this estimator depends on the choice of $p(K)$ and can potentially be very large or even infinite (McLeish, 2011; Rhee & Glynn, 2015; Beatson & Adams, 2019).
+
+# 3 SUMO: UNBIASED ESTIMATION OF LOG PROBABILITY FOR LVMS
+
+# 3.1 RUSSIAN ROULETTE TO DEBIAS LOWER BOUNDS
+
+We can turn any absolutely convergent series into a telescoping series and apply the Russian roulette randomization to form an unbiased stochastic estimator. We focus here on the IwAE bound described in Section 2.2. Let $\Delta_k(x) = \mathrm{IWAE}_{k+1}(x) - \mathrm{IWAE}_k(x)$ , then since $\mathbb{E}_q[\Delta_k(x)]$ converges absolutely, we apply equation 7 to construct our estimator, which we call SUMO (Stochastically Unbiased Marginalization Objective). The detailed derivation of SUMO is in Appendix A.1.
+
+$$
+\operatorname {S U M O} (x) = \mathrm {I W A E} _ {1} (x) + \sum_ {k = 1} ^ {K} \frac {\Delta_ {k} (x)}{\mathbb {P} (\mathcal {K} \geq k)} \quad \text {w h e r e} \quad K \sim p (K). \tag {8}
+$$
+
+The randomized truncation of the series using the Russian roulette estimator means that this is an unbiased estimator of the log marginal likelihood, regardless of the distribution $p(K)$ :
+
+$$
+\mathbb {E} [ \operatorname {S U M O} (x) ] = \log p _ {\theta} (x), \tag {9}
+$$
+
+where the expectation is taken over $p(K)$ and $q(z;x)$ (see Algorithm 1 for our exact sampling procedure). Furthermore, under some conditions, we have $\mathbb{E}\left[\nabla_{\theta}\mathrm{SUMO}(x)\right] = \nabla_{\theta}\mathbb{E}\left[\mathrm{SUMO}(x)\right] = \nabla_{\theta}\log p_{\theta}(x)$ (see Appendix A.4).
+
+# 3.2 OPTIMIZING VARIANCE-COMPUTE PRODUCT BY CHOICE OF $p(K)$
+
+To efficiently optimize a limit, one should choose an estimator to minimize the product of the second moment of the gradient estimates and the expected compute cost per evaluation. The choice of $p(K)$ effects both the variance and computation cost of our estimator. Denoting $\hat{G} \coloneqq \nabla_{\theta}\hat{Y}$ and $\Delta_k^g \coloneqq \nabla_\theta [\mathrm{IWAE}_{k + 1}(x) - \mathrm{IWAE}_k(x)]$ , the Russian roulette estimator is optimal across a broad family of unbiased randomized truncation estimators if the $\Delta_k^g$ are statistically independent, in which case it has second moment $\mathbb{E}||\hat{G} ||_2^2 = \sum_{k = 1}^\infty \mathbb{E}||\Delta_k^g ||_2^2 /\mathbb{P}(\kappa \geq k)$ (Beatson & Adams, 2019). While the $\Delta_k^g$ are not in fact strictly independent with our sampling procedure (Algorithm 1), and other estimators within the family may perform better, we justify our choice by showing that $\mathbb{E}\Delta_i\Delta_j$ for $i\neq j$ converges to zero much faster than $\mathbb{E}\Delta_k^2$ (Appendices A.2 & A.3). In the following, we assume independence of $\Delta_k^g$ and choose $p(K)$ to minimize the product of compute and variance.
+
+Algorithm 1 Computing SUMO, an unbiased estimator of $\log p(x)$
+Input: $x, m \geq 1$ , encoder $q(z; x)$ , decoder $p(x, z)$ , $p(K)$ , reverse_cdf( $\cdot$ ) = $\mathbb{P}(\mathcal{K} \geq \cdot)$
+1: Sample $K \sim p(\mathcal{K})$
+2: Sample $\{z_k\}_{k=1}^{K+m}$
+3: log $w_k \gets \log p(x, z_k) - \log q(z_k; x)$
+4: ks $\gets [1, \ldots, K+m]$
+5: cum_iwae $\gets \log_{-}$ cumsum_exp(log $w_k$ ) - log(ks[:k+1])
+6: invweights = 1/reverse_cdf(ks)
+return cum_iwae[m-1] + sum(invweights * (cum_iwae[m] - cum_iwae[m-1:-1]))
+
+We first show that $\mathbb{E}||\Delta_k^g ||_2^2$ is $\mathcal{O}(1 / k^2)$ (Appendix A.5). This implies the optimal compute-variance product (Rhee & Glynn, 2015; Beatson & Adams, 2019) is given by $\mathbb{P}(\mathcal{K}\geq k)\propto \sqrt{\mathbb{E}||\Delta_k^g||_2^2}$ . In our case, this gives $\mathbb{P}(\mathcal{K}\geq k) = 1 / k$ , which results in an estimator with infinite expected computation and no finite bound on variance. In fact, any $p(K)$ which gives rise to provably finite variance requires a heavier tail than $\mathbb{P}(\mathcal{K}\geq k) = 1 / k$ and so will have infinite expected computation.
+
+Though we could not theoretically show that our estimator and gradients have finite variance, we empirically find that gradient descent converges—even in the setting of minimizing log probability. We plot $||\Delta_k||_2^2$ for the toy variational inference task used to assess signal to noise ratio in Tucker et al. (2018) and Rainforth et al. (2018b), and find that they converge faster than $\frac{1}{k^2}$ in practice (Appendix A.6). While this indicates the variance is better than the theoretical bound, an estimator having infinite expected computation cost will always be an issue as it indicates significant probability of sampling arbitrarily large $K$ . We therefore modify the tail of the sampling distribution such that the estimator has finite expected computation:
+
+$$
+\mathbb {P} (\mathcal {K} \geq k) = \left\{ \begin{array}{l l} 1 / k & \text {i f} k < \alpha \\ 1 / \alpha \cdot (1 - 0. 1) ^ {k - \alpha} & \text {i f} k \geq \alpha \end{array} \right. \tag {10}
+$$
+
+We typically choose $\alpha = 80$ , which gives an expected computation cost of approximately 5 terms.
+
+# 3.2.1 TRADING VARIANCE AND COMPUTE
+
+One way to improve the RR estimator is to construct it so that some minimum number of terms (denoted here as $m$ ) are always computed. This puts a lower bound on the computational cost, but can potentially lower variance, providing a design space for trading off estimator quality against computational cost. This corresponds to a choice of RR estimator in which $\mathbb{P}(\mathcal{K} = K) = 0$ for $K \leq m$ . This computes the sum out to $m$ terms (effectively computing $\mathrm{IWAE}_m$ ) and then estimates the remaining difference with Russian roulette:
+
+$$
+\operatorname {S U M O} (x) = \operatorname {I W A E} _ {m} (x) + \sum_ {k = m} ^ {K} \frac {\Delta_ {k} (x)}{\mathbb {P} (\mathcal {K} \geq k)}, \quad K \sim p (K) \tag {11}
+$$
+
+In practice, instead of tuning parameters of $p(K)$ , we set $m$ to achieve a given expected computation cost per estimator evaluation for fair comparison with IWAE and related estimators.
+
+# 3.3 TRAINING $q(z;x)$ TO REDUCE VARIANCE
+
+The SUMO estimator does not require amortized variational inference, but the use of an "encoder" to produce an approximate posterior $q(z;x)$ has been shown to be a highly effective way to perform rapid feedforward inference in neural latent variable models. We use $\phi$ to denote the parameters of the encoder $q_{\phi}(z;x)$ . However, the gradients of SUMO with respect to $\phi$ are in expectation zero precisely because SUMO is an unbiased estimator of $\log p_{\theta}(x)$ , regardless of our choice of $q_{\phi}(z;x)$ . Nevertheless, we would expect the choice of $q_{\phi}(z;x)$ significantly impacts the variance of our estimator. As such, we optimize $q_{\phi}(z;x)$ to reduce the variance of the SUMO estimator. We can obtain unbiased gradients in the following way (Ruiz et al., 2016; Tucker et al., 2017):
+
+$$
+\nabla_ {\phi} \operatorname {V a r} [ \mathrm {S U M O} ] = \nabla_ {\phi} \mathbb {E} [ \mathrm {S U M O} ^ {2} ] - \underbrace {\nabla_ {\phi} (\mathbb {E} [ \mathrm {S U M O} ]) ^ {2}} = \mathbb {E} [ \nabla_ {\phi} \mathrm {S U M O} ^ {2} ]. \tag {12}
+$$
+
+Notably, the expectation of this estimator depends on the variance of SUMO, which we have not been able to bound. In practice, we observe gradients which are sometimes very large. We apply gradient clipping to the encoder to clip gradients which are excessively large in magnitude. This helps stabilize the training progress but introduces bias into the encoder gradients. Fortunately, the encoder itself is merely a tool for variance reduction, and biased gradients with respect to the encoder can still significantly help optimization.
+
+# 3.4 APPLICATIONS OF UNBIASED LOG PROBABILITY
+
+Here we list some applications where an unbiased log probability is useful. Using SUMO to replace existing lower bound estimates allows latent variable models to be used for new applications where a lower bound is inappropriate. As latent variable models can be both expressive and efficient to sample from, they are frequently useful in applications where the data is high-dimensional and samples from the model are needed.
+
+Minimizing $\log p_{\theta}(x)$ . Some machine learning objectives include terms that seek to increase the entropy of the learned model. The "reverse KL" objective—often used for training models to perform approximate posterior inference—minimizes $\mathbb{E}_{x \sim p_{\theta}(x)}[\log p_{\theta}(x) - \log \pi(x)]$ where $\pi(x)$ is a target density that may only be known up a normalization constant. Local updates of this form are the basis of the expectation propagation procedure (Minka, 2001). This objective has also been used for distilling autoregressive models that are inefficient at sampling (Oord et al., 2018). Moreover, reverse KL is connected to the use of entropy-regularized objectives (Williams & Peng, 1991; Ziebart, 2010; Mnih et al., 2016; Norouzi et al., 2016) in decision-making problems, where the goal is to encourage the decision maker toward exploration and prevent it from settling into a local minimum.
+
+Unbiased score function $\nabla_{\theta}\log p_{\theta}(x)$ . The score function is the gradient of the log-likelihood with respect to the parameters and has uses in estimating the Fisher information matrix and performing stochastic gradient Langevin dynamics (Welling & Teh, 2011), among other applications. Of particular note, the REINFORCE gradient estimator (Williams, 1992)—generally applicable for optimizing objectives of the form $\max_{\theta}\mathbb{E}_{x\sim p_{\theta}(x)}[R(x)]$ —is estimated using the score function. This can be replaced with the gradient of SUMO which itself is an estimator of the score function $\nabla_{\theta}\log p_{\theta}(x)$ .
+
+$$
+\begin{array}{l} \nabla_ {\theta} \mathbb {E} _ {x \sim p _ {\theta} (x)} [ R (x) ] = \mathbb {E} _ {x \sim p _ {\theta} (x)} [ R (x) \nabla_ {\theta} \log p _ {\theta} (x) ] \\ = \mathbb {E} _ {x \sim p _ {\theta} (x)} [ R (x) \nabla_ {\theta} \mathbb {E} [ \operatorname {S U M O} (x) ] ] \tag {13} \\ = \mathbb {E} _ {x \sim p _ {\theta} (x)} [ \mathbb {E} [ R (x) \nabla_ {\theta} \mathrm {S U M O} (x) ] ] \\ \end{array}
+$$
+
+where the inner expectation is over the stochasticity of the SUMO estimator. Such estimators are often used for reward maximization in reinforcement learning where $p_{\theta}(x)$ is a stochastic policy.
+
+# 4 RELATED WORK
+
+There is a long history in Bayesian statistics of marginal likelihood estimation in the service of model selection. The harmonic mean estimator (Newton & Raftery, 1994), for example, has a long (and notorious) history as a consistent estimator of the marginal likelihood that may have infinite variance (Murray & Salakhutdinov, 2009) and exhibits simulation psuedo-bias (Lenk, 2009). The Chib estimator (Chib, 1995), the Laplace approximation, and nested sampling (Skilling, 2006) are alternative proposals that can often have better properties (Murray & Salakhutdinov, 2009). Annealed importance sampling (Neal, 2001) probably represents the gold standard for marginal likelihood estimation. These, however, turn into consistent estimators at best when estimating the log marginal probability (Rainforth et al., 2018a). Bias removal schemes such as jackknife variational inference (Nowozin, 2018) have been proposed to debias log-evidence estimation, IwAE in particular. Hierarchical IwAE (Huang et al., 2019) uses a joint proposal to induce negative correlation among samples and connects the convergence of variance of the estimator and the convergence of the lower bound.
+
+Russian roulette also has a long history. It dates back to unpublished work from von Neumann and Ulam, who used it to debias Monte Carlo methods for matrix inversion (Forsythe & Leibler, 1950) and particle transport problems (Kahn, 1955). It has gained popularity in statistical physics (Spanier & Gelbard, 1969; Kuti, 1982; Wagner, 1987), for unbiased ray tracing in graphics and rendering (Arvo & Kirk, 1990), and for a number of estimation problems in the statistics community (Wei & Murray, 2017; Lyne et al., 2015; Rychlik, 1990; 1995; Jacob & Thiery, 2015; Jacob et al., 2017). It has also been independently rediscovered many times (Fearnhead et al., 2008; McLeish, 2011; Rhee & Glynn, 2012; Tallec & Ollivier, 2017).
+
+The use of Russian roulette estimation in deep learning and generative modeling applications has been gaining traction in recent years. It has been used to solve short-term bias in optimization problems (Tallec & Ollivier, 2017; Beatson & Adams, 2019). Wei & Murray (2017) estimates the reciprocal normalization constant of an unnormalized density. Han et al. (2018) uses a similar random truncation approach to estimate the distribution of eigenvalues in a symmetric matrix. Along similar motivations with our work, Chen et al. (2019) uses this estimator to construct an unbiased estimator of the change of variables equation in the context of normalizing flows (Rezende & Mohamed, 2015), and Xu et al. (2019) uses it to construct unbiased log probability for a nonparametric distribution in the context of variational autoencoders (Kingma & Welling, 2014).
+
+Though we extend latent variable models to applications that require unbiased estimates of log probability and benefit from efficient sampling, an interesting family of models already fulfill these requirements. Normalizing flows (Rezende & Mohamed, 2015; Dinh et al., 2017) offer exact log probability and certain models have been proven to be universal density estimators (e.g. Huang et al. (2018)). However, these models often require restrictive architectural choices with no dimensionality-reduction capabilities, and make use of many more parameters to scale up (Kingma & Dhariwal, 2018) than alternative generative models. Discrete variable versions of these models are still in their infancy and make use of biased gradients (Tran et al., 2019; Hoogeboom et al., 2019), whereas latent variable models naturally extend to discrete observations.
+
+# 5 DENSITY MODELING EXPERIMENTS
+
+We first compare the performance of SUMO when used as a replacement to IWAE with the same expected cost on density modeling tasks. We make use of two benchmark datasets: dynamically binarized MNIST (LeCun et al., 1998) and binarized OMNIGLOT (Lake et al., 2015).
+
+We use the same neural network architecture as IwAE (Burda et al., 2016). The prior $p(z)$ is a 50-dimensional standard Gaussian distribution. The conditional distributions $p(x_i|z)$ are independent Bernoulli, with the decoder parameterized by two hidden layers, each with 200 tanh units. The approximate posterior $q(z;x)$ is also a 50-dimensional Gaussian distribution with diagonal covariance, whose mean and variance are both parameterized by two hidden layers with 200 tanh units. We reimplemented and tuned IwAE, obtaining strong baseline results which are better than those previously reported. We then used the same hyperparameters to train with the SUMO estimator. We find clipping very large gradients can help performance, as large gradients may be infrequently sampled. This introduces a small amount of bias into the gradients while reducing variance, but can nevertheless help achieve faster convergence and should still result in a less-biased estimator. A posthoc study of the effect on final test performance as a function of this bias-variance tradeoff mechanism is discussed in Appendix A.7. We note that gradient clipping is only done for the density modeling experiments.
+
+The averaged test log-likelihoods and standard deviations over 3 runs are summarized in Table 1. To be consistent with existing literature, we evaluate our model using IWAE with 5000 samples. In all the cases, SUMO achieves slightly better performance than IWAE with the same expected cost. We also bold the results that are statistically insignificant from the best performing model according to an unpaired $t$ -test with significance level 0.05. However, we do see diminishing returns as we increase $k$ , suggesting that as we increase compute, the variance of our estimator may impact performance more than the bias of IWAE.
+
+# 6 LATENT VARIABLES MODELS FOR ENTROPY MAXIMIZATION
+
+We move on to our first task for which a lower bound estimate of log probability would not suffice. The reverse KL objective is useful when we have access to a (possibly unnormalized) target
+
+Table 1: Test negative log-likelihood of the trained model, estimated using IWAE $(k = 5000)$ . For SUMO, $k$ refers to the expected number of computed terms.
+
+| Training Objective | MNIST | OMNIGLOT |
| k=5 | k=15 | k=50 | k=5 | k=15 | k=50 |
| ELBO (Burda et al., 2016) | 86.47 | — | 86.35 | 107.62 | — | 107.80 |
| IWAE (Burda et al., 2016) | 85.54 | — | 84.78 | 106.12 | — | 104.67 |
| ELBO (Our impl.) | 85.97±0.01 | 85.99±0.05 | 85.88±0.07 | 106.79±0.08 | 106.98±0.19 | 106.84±0.13 |
| IWAE (Our impl.) | 85.28±0.01 | 84.89±0.03 | 84.50±0.02 | 104.96±0.04 | 104.53±0.05 | 103.99±0.12 |
| JVI (Our impl.) | — | — | 84.75±0.03 | — | — | 104.08±0.11 |
| SUMO | 85.09±0.01 | 84.71±0.02 | 84.40±0.03 | 104.85±0.04 | 104.29±0.12 | 103.79±0.14 |
+
+
+Target log probability
+
+
+Training w/ IWAE (k=15)
+Training w/ SUMO (k=15)
+Figure 1: We trained latent variable models for posterior inference, which requires minimizing log probability under the model. Training with IWAE leads to optimizing for the bias while leaving the true model in an unstable state, whereas training with SUMO—though noisy—leads to convergence.
+
+
+
+
+Model samples
+
+distribution but no efficient sampling algorithm.
+
+$$
+\min _ {\theta} D _ {\mathrm {K L}} \left(p _ {\theta} (x) \| p ^ {*} (x)\right) = \min _ {\theta} \mathbb {E} _ {x \sim p _ {\theta} (x)} \left[ \log p _ {\theta} (x) - \log p ^ {*} (x) \right] \tag {14}
+$$
+
+A major problem with fitting latent variables models to this objective is the presence of an entropy maximization term, effectively a minimization of $\log p_{\theta}(x)$ . Estimating this log marginal probability with a lower bound estimator could result in optimizing $\theta$ to maximize the bias of the estimator instead of the true objective. Our experiments demonstrate that this causes IWAE to often fail to optimize the objective unless we use a large amount of computation.
+
+Modifying IWAE. The bias of the IWAE estimator can be interpreted as the KL between an importance-weighted approximate posterior $q_{IW}(z;x)$ implicitly defined by the encoder and the true posterior $p(z|x)$ (Domke & Sheldon, 2018). Both the encoder and decoder parameters can therefore affect this bias. In practice, we find that the encoder optimization proceeds at a faster timescale than the decoder optimization: i.e., the encoder can match $q_{IW}(z;x)$ to the decoder's posterior $p(z|x)$ more quickly than the latter can match an objective. For this reason, we train the encoder to reduce bias and use a minimax training objective
+
+$$
+\min _ {p (x, z) \atop q (z; x)} \max _ {q (z; x)} \mathbb {E} _ {x \sim p (x)} \left[ \mathrm {I W A E} _ {K} (x) - \log p ^ {*} (x) \right] \tag {15}
+$$
+
+Though this is still a lower bound with unbounded bias, it makes for a stronger baseline than optimizing $q(z; x)$ in the same direction as $p(x, z)$ . We find that this approach can indeed work in practice, but requires setting $k$ extremely high.
+
+We choose a "funnel" target distribution (Figure 1) similar to the distribution used as a benchmark for inference in Neal et al. (2003), where $p^*$ has support in $\mathbb{R}^2$ and is defined $p^*(x_1, x_2) = \mathcal{N}(x_1; 0, 1.35^2) \mathcal{N}(x_2; 0, e^{2x_1})$ . We use neural networks with one hidden layer of 200 hidden units and tanh activations for both the encoder and decoder networks. We use 20 latent variables, with $p(z), p_\theta(x|z)$ , and $q_\phi(z; x)$ all being Gaussian distributed.
+
+Figure 2 shows the learning curves when using IWAE and SUMO. Unless $k$ is set very large, IWAE will at some point start optimizing the bias instead of the actual objective. The reverse KL is a non-negative quantity, so any estimate significantly below zero can be attributed to the unbounded bias. On the other hand, SUMO
+
+
+Figure 2: Training with reverse KL requires minimizing $\log p(x)$ . SUMO estimates are unbiased and trains well, but minimizing the lower bound IwAE with small $k$ leads to estimates of $-\infty$ .
+
+correctly optimizes for the objective even with a small expected cost. Increasing the expected cost $k$ for SUMO simply reduces variance. We also found that if $k$ is set sufficiently large, then IWAE can work when we train using the minimax objective in equation 15, suggesting that a sufficiently debiased estimator can also work in practice. However, this requires much more compute and likely does not scale compared to SUMO. We also visualize the contours of the resulting models in Figure 1. For IWAE, we visualize the model a few iterations before it reaches numerical instability.
+
+
+QPBO w/ 100 variables
+
+
+QPBO w/ 500 variables
+Figure 3: Latent variable policies allow faster exploration than autoregressive policy models, while being more expressive than an independent policy. SUMO works well with entropy regularization, whereas IWAE is unstable and converges to similar performance as the non-latent variable model.
+
+
+QPBO w/ 500 variables & Entropy regularization
+
+# 7 LATENT VARIABLE POLICIES FOR COMBINATORIAL OPTIMIZATION
+
+Let us now consider the problem of finding the maximum of a non-differentiable function, a special case of reinforcement learning without an interacting environment. Variational optimization (Staines & Barber, 2012) can be used to reformulate this as the optimization of a parametric distribution,
+
+$$
+\max _ {x} R (x) \geq \max _ {\theta} \mathbb {E} _ {x \sim p _ {\theta} (x)} [ R (x) ], \tag {16}
+$$
+
+which is now a differentiable function with respect to the parameters $\theta$ , whose gradients can be estimated using a combination of the REINFORCE gradient estimator and the SUMO estimator (equation 13). Furthermore, entropy regularized reinforcement learning—where we maximize $R(x) + \lambda \mathcal{H}(p_{\theta})$ with $\mathcal{H}(p_{\theta})$ being the entropy of $p_{\theta}(x)$ —encourages exploration and is inherently related to minimizing a reverse KL objective with the target being an exponentiated reward (Norouzi et al., 2016).
+
+For concreteness, we focus on the problem of quadratic pseudo-Boolean optimization (QPBO) where the objective is to maximize
+
+$$
+R (x) = \sum_ {i = 1} w _ {i} \left(x _ {i}\right) + \sum_ {i < j} w _ {i j} \left(x _ {i}, x _ {j}\right) \tag {17}
+$$
+
+where $\{x_{i}\}_{i = 1}^{d}\in \{0,1\}$ are binary variables. Without further assumptions, QPBO is NP-hard (Boros & Hammer, 2002). As there exist complex dependencies between the binary variables and optimization of equation 16 requires sampling from the policy distribution $p_{\theta}(x)$ , a model that is both expressive and allows efficient sampling would be ideal. For this reason, we motivate the use of latent variable models with independent conditional distributions, trained using the SUMO estimator. Our baselines are an autoregressive policy, which captures dependencies but for which sampling must be performed sequentially, and an independent policy, which is easy to sample from but captures no dependencies.
+
+$$
+p _ {\mathrm {L V M}} (x) := \int \prod_ {i = 1} ^ {d} p _ {\theta} (x _ {i} | z) p (z) d z \quad p _ {\text {A u t o r e g}} (x) := \prod_ {i = 1} ^ {d} p (x _ {i} | x _ {< i}) \quad p _ {\text {I n d e p}} (x) := \prod_ {i = 1} ^ {d} p (x _ {i})
+$$
+
+We note that Haarnoja et al. (2018) also argued for latent variable policies in favor of learning diverse strategies but ultimately made use of normalizing flows which do not require marginalization.
+
+We constructed one problem instance for each $d \in \{100, 500\}$ , which we note are already intractable for exact optimization. For each instance, we randomly sampled the weights $w_{i}$ and $w_{ij}$ uniformly from the interval $[-1, 1]$ . Figure 3 shows the performance of each policy model. In general, the independent policy is quick to converge to a local minima and is unable to explore different regions, whereas more complex models have a better grasp of the "frontier" of reward distributions during optimization. The autoregressive model works well overall but is much slower to train due to its sequential sampling procedure; with $d = 500$ , it is $19.2 \times$ slower per iteration than SUMO. Surprisingly, we find that estimating the REINFORCE gradient with IWAE results in decent performance when no entropy regularization is present. With entropy regularization, all policies improve
+
+significantly; however, training with IWAE in this setting results in performance similar to the independent model, suggesting that it may not be using the latent state. On the other hand, SUMO works with both REINFORCE gradient estimation and entropy regularization, albeit at the cost of slower convergence due to variance.
+
+# 8 CONCLUSION
+
+We introduced SUMO, a new unbiased estimator of the log probability for latent variable models, and demonstrated tasks for which this estimator performs better than standard lower bounds. Specifically, we investigated applications involving entropy maximization where a lower bound performs poorly, but our unbiased estimator can train properly with relatively smaller amount of compute.
+
+In the future, we plan to investigate new families of gradient-based optimizers which can handle heavy-tailed stochastic gradients. It may also be fruitful to investigate the use of convex combination of consistent estimators within the SUMO approach, as any convex combination is unbiased, or to apply variance reduction methods to increase stability of training with SUMO.
+
+# ACKNOWLEDGEMENTS
+
+This work was partially funded by NSF IIS-1421780. Y.L and J.Z were supported by the NSF China Project (No. 61620106010), Beijing NSF Project (No. L172037), the JP Morgan Faculty Research Program and the NVIDIA NVAIL Program with GPU/DGX Acceleration.
+
+# REFERENCES
+
+James Arvo and David Kirk. Particle transport and image synthesis. ACM SIGGRAPH Computer Graphics, 24(4):63-66, 1990.
+Robert Bamler, Cheng Zhang, Manfred Opper, and Stephan Mandt. Perturbative black box variational inference. In Advances in Neural Information Processing Systems. 2017.
+Alex Beatson and Ryan P. Adams. Efficient optimization of loops and limits with randomized telescoping sums. In International Conference on Machine Learning, 2019.
+Mikoaj Bikowski, Dougal J. Sutherland, Michael Arbel, and Arthur Gretton. Demystifying MMD GANs. In International Conference on Learning Representations, 2018.
+David M Blei, Andrew Y Ng, and Michael I Jordan. Latent Dirichlet allocation. Journal of Machine Learning Research, 3(Jan):993-1022, 2003.
+Endre Boros and Peter L Hammer. Pseudo-Boolean optimization. Discrete Applied Mathematics, 123(1-3):155-225, 2002.
+Yuri Burda, Roger Grosse, and Ruslan Salakhutdinov. Importance weighted autoencoders. In International Conference on Learning Representations, 2016.
+Ricky TQ Chen, Jens Behrmann, David Duvenaud, and Jorn-Henrik Jacobsen. Residual flows for invertible generative modeling. Advances in Neural Information Processing Systems, 2019.
+Siddhartha Chib. Marginal likelihood from the Gibbs output. Journal of the American Statistical Association, 90(432):1313-1321, 1995.
+Arthur P Dempster, Nan M Laird, and Donald B Rubin. Maximum likelihood from incomplete data via the EM algorithm. Journal of the Royal Statistical Society: Series B (Methodological), 39(1): 1-22, 1977.
+Laurent Dinh, Jascha Sohl-Dickstein, and Samy Bengio. Density estimation using real NVP. In International Conference on Learning Representations, 2017.
+Justin Domke and Daniel R Sheldon. Importance weighting and variational inference. In Advances in Neural Information Processing Systems, pp. 4470-4479, 2018.
+
+Paul Fearnhead, Omiros Papaspiliopoulos, and Gareth O Roberts. Particle filters for partially observed diffusions. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 70 (4):755-777, 2008.
+George E Forsythe and Richard A Leibler. Matrix inversion by a Monte Carlo method. Mathematics of Computation, 4(31):127-129, 1950.
+Tuomas Haarnoja, Kristian Hartikainen, Pieter Abbeel, and Sergey Levine. Latent space policies for hierarchical reinforcement learning. In International Conference on Machine Learning, pp. 1846-1855, 2018.
+Insu Han, Haim Avron, and Jinwoo Shin. Stochastic Chebyshev gradient descent for spectral optimization. In Advances in Neural Information Processing Systems, pp. 7386-7396, 2018.
+Irina Higgins, Loic Matthew, Arka Pal, Christopher Burgess, Xavier Glorot, Matthew M Botvinick, Shakir Mohamed, and Alexander Lerchner. beta-VAE: Learning basic visual concepts with a constrained variational framework. In International Conference on Machine Learning, 2017.
+Emiel Hoogeboom, Jorn WT Peters, Rianne van den Berg, and Max Welling. Integer discrete flows and lossless compression. arXiv preprint arXiv:1905.07376, 2019.
+Chin-Wei Huang, David Krueger, Alexandre Lacoste, and Aaron Courville. Neural autoregressive flows. In International Conference on Machine Learning, 2018.
+Chin-Wei Huang, Kris Sankaran, Eeshan Dhekane, Alexandre Lacoste, and Aaron Courville. Hierarchical importance weighted autoencoders. In International Conference on Machine Learning, pp. 2869-2878, 2019.
+Pierre E Jacob and Alexandre H Thiery. On nonnegative unbiased estimators. The Annals of Statistics, 43(2):769-784, 2015.
+Pierre E Jacob, John O'Leary, and Yves F Atchadé. Unbiased Markov chain Monte Carlo with couplings. arXiv preprint arXiv:1708.03625, 2017.
+Matthew Johnson, David K Duvenaud, Alex Wiltschko, Ryan P Adams, and Sandeep R Datta. Composing graphical models with neural networks for structured representations and fast inference. In Advances in Neural Information Processing Systems, pp. 2946-2954, 2016.
+Herman Kahn. Use of different Monte Carlo sampling techniques. Santa Monica, CA: RAND Corporation, 1955. URL https://www.rand.org/pubs/papers/P766.html.
+Diederik P Kingma and Max Welling. Auto-encoding variational Bayes. In International Conference on Learning Representations, 2014.
+Durk P Kingma and Prafulla Dhariwal. Glow: Generative flow with invertible 1x1 convolutions. In Advances in Neural Information Processing Systems, pp. 10215-10224, 2018.
+Julius Kuti. Stochastic method for the numerical study of lattice fermions. Physical Review Letters, 49(3):183, 1982.
+Brenden M Lake, Ruslan Salakhutdinov, and Joshua B Tenenbaum. Human-level concept learning through probabilistic program induction. Science, 350(6266):1332-1338, 2015.
+Yann LeCun, Léon Bottou, Yoshua Bengio, Patrick Haffner, et al. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278-2324, 1998.
+Peter Lenk. Simulation pseudo-bias correction to the harmonic mean estimator of integrated likelihoods. Journal of Computational and Graphical Statistics, 18(4):941-960, 2009.
+Yucen Luo, Tian Tian, Jiaxin Shi, Jun Zhu, and Bo Zhang. Semi-crowdsourced clustering with deep generative models. In Advances in Neural Information Processing Systems, pp. 3212-3222, 2018.
+Anne-Marie Lyne, Mark Girolami, Yves Atchade, Heiko Strathmann, Daniel Simpson, et al. On Russian roulette estimates for Bayesian inference with doubly-intractable likelihoods. Statistical science, 30(4):443-467, 2015.
+
+Don McLeish. A general method for debiasing a Monte Carlo estimator. Monte Carlo Methods and Applications, 17(4):301-315, 2011.
+Thomas P Minka. Expectation propagation for approximate Bayesian inference. In Proceedings of the Seventeenth Conference on Uncertainty in Artificial Intelligence, pp. 362-369. Morgan Kaufmann Publishers Inc., 2001.
+Volodymyr Mnih, Adria Puigdomenech Badia, Mehdi Mirza, Alex Graves, Timothy Lillicrap, Tim Harley, David Silver, and Koray Kavukcuoglu. Asynchronous methods for deep reinforcement learning. In International Conference on Machine Learning, pp. 1928-1937, 2016.
+Iain Murray and Ruslan Salakhutdinov. Evaluating probabilities under high-dimensional latent variable models. In D. Koller, D. Schuurmans, Y. Bengio, and L. Bottou (eds.), Advances in Neural Information Processing Systems 21, pp. 1137-1144. 2009.
+Radford M Neal. Annealed importance sampling. Statistics and Computing, 11(2):125-139, 2001.
+Radford M Neal et al. Slice sampling. The Annals of Statistics, 31(3):705-767, 2003.
+Michael A Newton and Adrian E Raftery. Approximate Bayesian inference with the weighted likelihood bootstrap. Journal of the Royal Statistical Society: Series B (Methodological), 56(1):3-26, 1994.
+Mohammad Norouzi, Samy Bengio, Navdeep Jaitly, Mike Schuster, Yonghui Wu, Dale Schuurmans, et al. Reward augmented maximum likelihood for neural structured prediction. In Advances In Neural Information Processing Systems, pp. 1723-1731, 2016.
+Sebastian Nowozin. Debiasing evidence approximations: On importance-weighted autoencoders and jackknife variational inference. In International Conference on Learning Representations, 2018.
+Aaron van den Oord, Yazhe Li, Igor Babuschkin, Karen Simonyan, Oriol Vinyals, Koray Kavukcuoglu, George van den Driessche, Edward Lockhart, Luis C Cobo, Florian Stimberg, et al. Parallel Wavenet: Fast high-fidelity speech synthesis. In International Conference on Machine Learning, 2018.
+Tom Rainforth, Robert Cornish, Hongseok Yang, Andrew Warrington, and Frank Wood. On nesting Monte Carlo estimators. In International Conference on Machine Learning, 2018a.
+Tom Rainforth, Adam R Kosiorek, Tuan Anh Le, Chris J Maddison, Maximilian Igl, Frank Wood, and Yee Whye Teh. Tighter variational bounds are not necessarily better. In International Conference on Machine Learning, 2018b.
+Sashank J Reddi, Satyen Kale, and Sanjiv Kumar. On the convergence of Adam and beyond. In International Conference on Learning Representations, 2018.
+Danilo Jimenez Rezende and Shakir Mohamed. Variational inference with normalizing flows. In International Conference on Machine Learning, 2015.
+Chang-han Rhee and Peter W Glynn. A new approach to unbiased estimation for SDEs. In Proceedings of the Winter Simulation Conference, pp. 17. Winter Simulation Conference, 2012.
+Chang-han Rhee and Peter W Glynn. Unbiased estimation with square root convergence for SDE models. Operations Research, 63(5):1026-1043, 2015.
+Francisco JR Ruiz, Michalis K Titsias, and David M Blei. Overdispersed black-box variational inference. In Proceedings of the Thirty-Second Conference on Uncertainty in Artificial Intelligence, 2016.
+Tomasz Rychlik. Unbiased nonparametric estimation of the derivative of the mean. Statistics & probability letters, 10(4):329-333, 1990.
+Tomasz Rychlik. A class of unbiased kernel estimates of a probability density function. Applicationes Mathematicae, 22(4):485-497, 1995.
+
+John Skilling. Nested sampling for general Bayesian computation. Bayesian Analysis, 1(4):833-859, 2006.
+Jerome Spanier and Ely M Gelbard. Monte Carlo Principles and Neutron Transport Problems. Addison-Wesley Publishing Company, 1969.
+Joe Staines and David Barber. Variational optimization. arXiv preprint arXiv:1212.4507, 2012.
+Coretin Tallec and Yann Ollivier. Unbiasing truncated backpropagation through time. arXiv preprint arXiv:1705.08209, 2017.
+Michael E Tipping and Christopher M Bishop. Probabilistic principal component analysis. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 61(3):611-622, 1999.
+Dustin Tran, Keyon Vafa, Kumar Krishna Agrawal, Laurent Dinh, and Ben Poole. Discrete flows: Invertible generative models of discrete data. arXiv preprint arXiv:1905.10347, 2019.
+George Tucker, Andriy Mnih, Chris J Maddison, John Lawson, and Jascha Sohl-Dickstein. Rebar: Low-variance, unbiased gradient estimates for discrete latent variable models. In Advances in Neural Information Processing Systems, pp. 2627-2636, 2017.
+George Tucker, Dieterich Lawson, Shixiang Gu, and Chris J Maddison. Doubly reparameterized gradient estimators for Monte Carlo objectives. In International Conference on Learning Representations, 2018.
+Wolfgang Wagner. Unbiased Monte Carlo evaluation of certain functional integrals. Journal of Computational Physics, 71(1):21-33, 1987.
+Colin Wei and Iain Murray. Markov Chain Truncation for Doubly-Intractable Inference. In Proceedings of the 20th International Conference on Artificial Intelligence and Statistics, 2017.
+Max Welling and Yee W Teh. Bayesian learning via stochastic gradient Langevin dynamics. In Proceedings of the 28th International Conference on Machine Learning, pp. 681-688, 2011.
+Ronald J Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine learning, 8(3-4):229-256, 1992.
+Ronald J Williams and Jing Peng. Function optimization using connectionist reinforcement learning algorithms. Connection Science, 3(3):241-268, 1991.
+Kai Xu, Akash Srivastava, and Charles Sutton. Variational Russian roulette for deep Bayesian nonparametrics. In International Conference on Machine Learning, pp. 6963-6972, 2019.
+Brian D Ziebart. Modeling purposeful adaptive behavior with the principle of maximum causal entropy. PhD thesis, figshare, 2010.
+
+# A APPENDIX
+
+# A.1 DERIVATION OF SUMO
+
+Let
+
+$$
+\mathbb {E} _ {q} [ \mathbf {I W A E} _ {k} (x) ] = \mathbb {E} _ {z _ {1}, \ldots , z _ {k} \sim q (z; x)} \left[ \log \frac {1}{K} \sum_ {k = 1} ^ {K} \frac {p _ {\theta} (x \mid z _ {k}) p _ {\theta} (z _ {k})}{q (z _ {k} ; x)} \right],
+$$
+
+where $z_{1}, \ldots, z_{k}$ are sampled independently from $q(z; x)$ . And we define the $k$ -th term of the infinite series $\tilde{\Delta}_{k}(x) \coloneqq \mathbb{E}_{q}[\mathrm{IWAE}_{k+1}(x)] - \mathbb{E}_{q}[\mathrm{IWAE}_{k}(x)]$ . Using the properties of IWAE in equation 6, we have $\tilde{\Delta}_{k}(x) \geq 0$ , and
+
+$$
+\begin{array}{l} \sum_ {k = 1} ^ {\infty} | \tilde {\Delta} _ {k} (x) | = \sum_ {k = 1} ^ {\infty} \tilde {\Delta} _ {k} (x) = \lim _ {k \rightarrow \infty} \mathbb {E} _ {q} [ \mathrm {I W A E} _ {k} (x) ] - \mathbb {E} _ {q} [ \mathrm {I W A E} _ {1} (x) ] \\ = \log p _ {\theta} (x) - \mathbb {E} _ {q} \left[ \mathrm {I W A E} _ {1} (x) \right] < \infty , \tag {18} \\ \end{array}
+$$
+
+which means the series converges absolutely. This is a sufficient condition for finite expectation of the Russian roulette estimator (Chen et al. (2019); Lemma 3). Applying equation 7 to the series:
+
+$$
+\begin{array}{l} \log p _ {\theta} (x) = \mathbb {E} _ {q} \left[ \mathrm {I W A E} _ {1} (x) \right] + \sum_ {k = 1} ^ {\infty} \tilde {\Delta} _ {k} (x) (19) \\ = \mathbb {E} _ {q} \left[ \mathrm {I W A E} _ {1} (x) \right] + \mathbb {E} _ {K \sim p (K)} \left[ \sum_ {k = 1} ^ {K} \frac {\tilde {\Delta} _ {k} (x)}{\mathbb {P} (\mathcal {K} \geq k)} \right] (20) \\ = \mathbb {E} _ {K \sim p (K)} \left[ \mathbb {E} _ {q} [ \mathrm {I W A E} _ {1} (x) ] + \sum_ {k = 1} ^ {K} \frac {\mathbb {E} _ {q} [ \mathrm {I W A E} _ {k + 1} (x) - \mathrm {I W A E} _ {k} (x) ]}{\mathbb {P} (\mathcal {K} \geq k)} \right] (21) \\ = \mathbb {E} _ {K \sim p (K)} \left[ \mathbb {E} _ {q} \left[ \mathrm {I W A E} _ {1} (x) + \sum_ {k = 1} ^ {K} \frac {\mathrm {I W A E} _ {k + 1} (x) - \mathrm {I W A E} _ {k} (x)}{\mathbb {P} (\mathcal {K} \geq k)} \right] \right]. (22) \\ \end{array}
+$$
+
+Let $\Delta_k(x) \coloneqq \mathrm{IWAE}_{k+1}(x) - \mathrm{IWAE}_k(x)$ , Hence our estimator is constructed:
+
+$$
+\operatorname {S U M O} (x) = \operatorname {I W A E} _ {1} (x) + \sum_ {k = 1} ^ {K} \frac {\Delta_ {k} (x)}{\mathbb {P} (\mathcal {K} \geq k)}, \quad K \sim p (K), z _ {k} \stackrel {{i i d}} {{\sim}} q (z; x). \tag {23}
+$$
+
+And it can be easily seen from equation 22 and equation 23 that SUMO is an unbiased estimator of the log marginal likelihood:
+
+$$
+\mathbb {E} _ {K \sim p (K), z _ {1}, \dots , z _ {K} \sim q (z; x)} [ \operatorname {S U M O} (x) ] = \log p _ {\theta} (x). \tag {24}
+$$
+
+# A.2 CONVERGENCE OF $\Delta_{k}$
+
+We follow the analysis of JVI (Nowozin, 2018), which applied the delta method for moments to show the asymptotic results on the bias and variance of $\mathrm{IWAE}_k$ both at a rate of $\mathcal{O}\left(\frac{1}{k}\right)$ . We build on this analysis to analyze the convergence of $\Delta_k$ .
+
+Let $w_{i} = \frac{p(x|z_{i})p(z_{i})}{q(z_{i};x)}$ and we define $Y_{k} := \frac{1}{k}\sum_{i=1}^{k}w_{i}$ as the sample mean and we have $\mathbb{E}[Y_k] = \mathbb{E}[w] = \mu$ .
+
+$$
+\begin{array}{l} \mathrm {I W A E} _ {k} = \log Y _ {k} = \log \left[ \mu + (Y _ {k} - \mu) \right] \\ = \log \mu - \sum_ {t = 1} ^ {\infty} \frac {(- 1) ^ {t}}{t \mu^ {t}} \left(Y _ {k} - \mu\right) ^ {t} \tag {25} \\ \end{array}
+$$
+
+We note that we rely on $||Y_{k} - \mu || < 1$ for this power series to converge. This condition was implicitly assumed, but not explicitly noted, in (Nowozin, 2018). This condition will hold for sufficiently
+
+large $k$ so long as the moments of $w_{i}$ exist: one could bound the probability $\| Y_k - \mu \| \geq 1$ by Chebyshev's inequality or by the Central Limit Theorem. We use the central moments $\gamma_t\coloneqq \mathbb{E}[(Y_k - \mu)^t ]$ and $\mu_t\coloneqq \mathbb{E}[(w - \mu)^t ]$ for $t\geq 2$
+
+$$
+\begin{array}{l} \mathbb {E} \Delta_ {k} ^ {2} = \mathbb {E} \left(\mathrm {I W A E} _ {k + 1} - \mathrm {I W A E} _ {k}\right) ^ {2} (26) \\ = \mathbb {E} \left[ \log \mu - \sum_ {t = 1} ^ {\infty} \frac {(- 1) ^ {t}}{t \mu^ {t}} \left(Y _ {k + 1} - \mu\right) ^ {t} - \log \mu + \sum_ {t = 1} ^ {\infty} \frac {(- 1) ^ {t}}{t \mu^ {t}} \left(Y _ {k} - \mu\right) ^ {t} \right] ^ {2} (27) \\ = \mathbb {E} \left[ \sum_ {t = 1} ^ {\infty} \frac {(- 1) ^ {t}}{t \mu^ {t}} \left[ \left(Y _ {k} - \mu\right) ^ {t} - \left(Y _ {k + 1} - \mu\right) ^ {t} \right] \right] ^ {2} (28) \\ \end{array}
+$$
+
+Expanding Eq. 28 to order two gives
+
+$$
+\begin{array}{l} \mathbb {E} \Delta_ {k} ^ {2} = \mathbb {E} \left[ - \frac {1}{\mu} \left(Y _ {k} - \mu - Y _ {k + 1} + \mu\right) + \frac {1}{2 \mu^ {2}} \left[ \left(Y _ {k} - \mu\right) ^ {2} - \left(Y _ {k + 1} - u\right) ^ {2} \right] \right] ^ {2} + o \left(k ^ {- 2}\right) (29) \\ = \frac {1}{\mu^ {2}} \mathbb {E} \left[ Y _ {k + 1} - Y _ {k} + \frac {1}{2 \mu} \left(Y _ {k} + Y _ {k + 1} - 2 \mu\right) \left(Y _ {k} - Y _ {k + 1}\right) \right] ^ {2} + o \left(k ^ {- 2}\right) (30) \\ = \frac {1}{\mu^ {2}} \mathbb {E} \left[ 2 \left(Y _ {k + 1} - Y _ {k}\right) + \frac {1}{2 \mu} \left(Y _ {k} + Y _ {k + 1}\right) \left(Y _ {k} - Y _ {k + 1}\right) \right] ^ {2} + o \left(k ^ {- 2}\right) (31) \\ \end{array}
+$$
+
+Since we use cumulative sum to compute $Y_{k}$ and $Y_{k + 1}$ , we obtain $Y_{k + 1} = \frac{kY_k + w_{k + 1}}{k + 1}$ .
+
+$$
+\Longrightarrow \mathbb {E} \Delta_ {k} ^ {2} = \frac {1}{\mu^ {2}} \mathbb {E} \left[ 2 \frac {w _ {k + 1} - 1}{k + 1} + \left(\frac {w _ {k + 1} + \frac {2 k + 1}{k + 1} \sum_ {i = 1} ^ {k} w _ {k}}{2 k \mu}\right) \left(\frac {w _ {k + 1} - 1}{k + 1}\right) \right] ^ {2} + o \left(k ^ {- 2}\right) \tag {32}
+$$
+
+We note that $\frac{w_{k+1}-1}{k+1}=\mathcal{O}\left(\frac{1}{k}\right)$ and $\frac{w_{k+1}+\frac{2k+1}{k+1}\sum_{i=1}^{k}w_{k}}{2k\mu}=\mathcal{O}(1)$ . Therefore $\Delta_{k}$ is $\mathcal{O}\left(\frac{1}{k}\right)$ , and $\mathbb{E}\Delta_{k}^{2}=\mathcal{O}\left(\frac{1}{k^{2}}\right)$ .
+
+# A.3 CONVERGENCE OF $\Delta_k\Delta_j$
+
+Without loss of generality, suppose $j \geq k + 1$ ,
+
+$$
+\mathbb {E} \Delta_ {k} \Delta_ {j} = \mathbb {E} \left[ \left(\sum_ {t = 1} ^ {\infty} \frac {(- 1) ^ {t}}{t \mu^ {t}} [ (Y _ {k} - \mu) ^ {t} - (Y _ {k + 1} - \mu) ^ {t} ]\right) \left(\sum_ {t = 1} ^ {\infty} \frac {(- 1) ^ {t}}{t \mu^ {t}} [ (Y _ {j} - \mu) ^ {t} - (Y _ {j + 1} - \mu) ^ {t} ]\right) \right] \tag {33}
+$$
+
+For clarity, let $C_k = Y_k - \mu$ be the zero-mean random variable. Nowozin (2018) gives the relations
+
+$$
+\mathbb {E} \left[ C _ {k} ^ {2} \right] = \gamma_ {2} = \frac {\mu_ {2}}{k} \tag {34}
+$$
+
+$$
+\mathbb {E} \left[ C _ {k} ^ {3} \right] = \gamma_ {3} = \frac {\mu_ {3}}{k ^ {2}} \tag {35}
+$$
+
+$$
+\mathbb {E} \left[ C _ {k} ^ {4} \right] = \gamma_ {4} = \frac {3 \mu_ {2} ^ {2}}{k ^ {2}} + \frac {\mu_ {4} - 3 \mu_ {2} ^ {2}}{k ^ {3}} \tag {36}
+$$
+
+$$
+\mathbb {E} \Delta_ {k} \Delta_ {j} = \mathbb {E} \left[ \left(\sum_ {t = 1} ^ {\infty} \frac {(- 1) ^ {t}}{t \mu^ {t}} \left(C _ {k} ^ {t} - C _ {k + 1} ^ {t}\right)\right) \left(\sum_ {t = 1} ^ {\infty} \frac {(- 1) ^ {t}}{t \mu^ {t}} \left(C _ {j} ^ {t} - C _ {j + 1} ^ {t}\right)\right) \right] \tag {37}
+$$
+
+Expanding both the sums inside the brackets to order two:
+
+$$
+\begin{array}{l} \mathbb {E} \Delta_ {k} \Delta_ {j} \approx \mathbb {E} \frac {1}{\mu^ {2}} \left(C _ {k + 1} - C _ {k}\right) \left(C _ {j + 1} - C _ {j}\right) (1) \\ - \mathbb {E} \frac {1}{2 \mu^ {3}} \left(C _ {k + 1} ^ {2} - C _ {k} ^ {2}\right) \left(C _ {j + 1} - C _ {j}\right) (2) \\ - \mathbb {E} \frac {1}{2 \mu^ {3}} \left(C _ {k + 1} - C _ {k}\right) \left(C _ {j + 1} ^ {2} - C _ {j} ^ {2}\right) (3) \\ + \mathbb {E} \frac {1}{4 \mu^ {4}} \left(C _ {k + 1} ^ {2} - C _ {k} ^ {2}\right) \left(C _ {j + 1} ^ {2} - C _ {j} ^ {2}\right) (4) \\ \end{array}
+$$
+
+We will proceed by bounding each of the terms (1), (2), (3), (4). First, we decompose $C_j$ . Let $B_{k,j} \coloneqq \frac{1}{j}\sum_{i = k + 1}^{j}(w_i - \mu)$ .
+
+$$
+C _ {j} = \frac {1}{j} \left(k C _ {k} + \sum_ {i = k + 1} ^ {j} \left(w _ {i} - \mu\right)\right) = \frac {k}{j} C _ {k} + \frac {1}{j} \sum_ {i = k + 1} ^ {j} \left(w _ {i} - \mu\right) = \frac {k}{j} C _ {k} + B _ {k, j} \tag {38}
+$$
+
+We know that $B_{k,j}$ is independent of $C_k$ and $\mathbb{E}[B_{k,j}] = 0$ , implying $\mathbb{E}[C_kB_{k,j}] = 0$ . Note $C_j^2 = \frac{k^2}{j^2} C_k^2 + 2\frac{k}{j} C_kB_{k,j} + B_{k,j}^2$ .
+
+Now we show that (1) is zero:
+
+$$
+\begin{array}{l} \mathbb {E} \left[ \frac {1}{\mu^ {2}} \left(C _ {k + 1} - C _ {k}\right) \left(C _ {j + 1} - C _ {j}\right) \right] = \frac {1}{\mu^ {2}} \mathbb {E} \left[ C _ {k + 1} \frac {k + 1}{j + 1} + C _ {k + 1} B _ {j + 1, k + 1} \right. \\ - \frac {k + 1}{j} C _ {k + 1} ^ {2} - B _ {j, k + 1} C _ {k + 1} - C _ {k} \frac {k}{j + 1} \\ \left. - C _ {k} B _ {j + 1, k} + \frac {k}{j} C _ {k} ^ {2} + C _ {k} B _ {j, k} \right] \\ = \frac {1}{\mu^ {2}} \mathbb {E} [ - \frac {k + 1}{j (j + 1)} C _ {k + 1} ^ {2} + C _ {k} ^ {2} \frac {k}{j (j + 1)} ] \\ = \frac {1}{\mu^ {2}} [ - \frac {k + 1}{j (j + 1)} \frac {\mu_ {2}}{k + 1} + \frac {\mu_ {2}}{k} \frac {k}{j (j + 1)} ] = 0 \\ \end{array}
+$$
+
+We now investigate (2):
+
+$$
+\begin{array}{l} \mathbb {E} [ - \frac {1}{2 \mu^ {3}} (C _ {k + 1} ^ {2} - C _ {k} ^ {2}) (C _ {j + 1} - C _ {j}) ] = \frac {1}{2 \mu^ {3}} \mathbb {E} \Big [ C _ {k} ^ {3} \frac {k}{j + 1} + C _ {k} ^ {2} B _ {j + 1, k} - C _ {k} ^ {3} \frac {k}{j} - C _ {k} ^ {2} B _ {j, k} \\ \left. + C _ {k + 1} ^ {3} \frac {k + 1}{j + 1} + C _ {k + 1} ^ {2} B _ {j, k} + \frac {k}{j} C _ {k} ^ {2} + C _ {k} B _ {j + 1, k} \right] \\ = \frac {1}{\mu^ {2}} \mathbb {E} \left[ - \frac {k + 1}{j (j + 1)} C _ {k + 1} ^ {2} + C _ {k} ^ {2} \frac {k}{j (j + 1)} \right] \\ = \frac {1}{2 \mu^ {3}} [ - \frac {\mu_ {3}}{k j (j + 1)} + \frac {\mu_ {3}}{(k + 1) j (j + 1)} ] = - \frac {\mu_ {3}}{2 \mu^ {3}} [ \frac {1}{k (k + 1) j (j + 1)} ] \\ \end{array}
+$$
+
+We now show that (3) is zero:
+
+$$
+\begin{array}{l} \mathbb {E} \left[ \frac {1}{2 \mu^ {3}} \left(C _ {k + 1} - C _ {k}\right) \left(C _ {j} ^ {2} - C _ {j + 1} ^ {2}\right) \right] = \frac {1}{2 \mu^ {3}} \mathbb {E} \left[ C _ {k + 1} C _ {j} ^ {2} - C _ {k + 1} C _ {j + 1} ^ {2} - C _ {k} C _ {j} ^ {2} + C _ {k} C _ {j + 1} ^ {2}) \right] \\ = \frac {1}{2 \mu^ {3}} [ \frac {\mu_ {3}}{j ^ {2}} - \frac {\mu_ {3}}{(j + 1) ^ {2}} - \frac {\mu_ {3}}{j ^ {2}} - \frac {\mu_ {3}}{(j + 1) ^ {2}} ] \\ = 0 \\ \end{array}
+$$
+
+Finally, we investigate (4):
+
+$$
+\mathbb {E} [ \frac {1}{4 \mu^ {4}} (C _ {k + 1} ^ {2} - C _ {k} ^ {2}) (C _ {j + 1} ^ {2} - C _ {j} ^ {2}) ]
+$$
+
+Using the relation in equation 36, we have
+
+$$
+\begin{array}{l} \mathbb {E} \left[ C _ {k} ^ {2} C _ {j} ^ {2} \right] = \mathbb {E} \left[ C _ {k} ^ {2} \left(\frac {k ^ {2}}{j ^ {2}} C _ {k} ^ {2} + \frac {2 k}{j} C _ {k} B _ {j, k} + B _ {j, k} ^ {2}\right) \right] (39) \\ = \frac {k ^ {2}}{j ^ {2}} \gamma_ {4} + \gamma_ {2} \frac {(j - k) \mu_ {2}}{j ^ {2}} (40) \\ = \frac {(2 k + j - 3) \mu_ {2} ^ {2} + \mu_ {4}}{j ^ {2} k} (41) \\ \end{array}
+$$
+
+$$
+\begin{array}{l} \mathbb {E} [ \frac {1}{4 \mu^ {4}} (C _ {k + 1} ^ {2} - C _ {k} ^ {2}) (C _ {j + 1} ^ {2} - C _ {j} ^ {2}) ] = \frac {(2 k + j - 3) \mu_ {2} ^ {2} + \mu_ {4}}{j ^ {2} k} - \frac {(2 k + j - 2) \mu_ {2} ^ {2} + \mu_ {4}}{(j + 1) ^ {2} k} \\ - \frac {(2 k + j - 1) \mu_ {2} ^ {2} + \mu_ {4}}{j ^ {2} (k + 1)} + \frac {(2 k + j) \mu_ {2} ^ {2} + \mu_ {4}}{(j + 1) ^ {2} (k + 1)} \\ = \frac {(j ^ {2} - 5 j - 3) \mu_ {2} ^ {2}}{j ^ {2} (j + 1) ^ {2} k (k + 1)} - \frac {\mu_ {4}}{(j + 1) ^ {2} k (k + 1)} \\ = \frac {j ^ {2} (\mu_ {2} ^ {2} - \mu_ {4}) - (5 j + 3) \mu_ {2} ^ {2}}{j ^ {2} (j + 1) ^ {2} k (k + 1)} \\ = \mathcal {O} \left(j ^ {- 2} k ^ {- 2}\right) \\ \end{array}
+$$
+
+In summary, $\mathbb{E}\Delta_k\Delta_j$ is $\mathcal{O}(k^{-2}j^{-2})$
+
+# A.4 GRADIENT OF SUMO
+
+Assume that $\nabla_{\theta}\mathrm{SUMO}$ is bounded: it is sufficient that $\nabla_{\theta}\mathrm{IWAE}_1$ is bounded and that the sampling probabilities are chosen such that the partial sums of $\frac{\nabla_{\theta}\Delta_k}{\mathbb{P}(\mathcal{K}\geq k)}$ converge, i.e. $\mathbb{P}(\mathcal{K}\geq k) > ck||\nabla_{\theta}\Delta_k||$ for some constant $c$ . Then we have $\mathbb{E}\left[\nabla_{\theta}\mathrm{SUMO}(x)\right] = \nabla_{\theta}\mathbb{E}\left[\mathrm{SUMO}(x)\right] = \nabla_{\theta}\log p_{\theta}(x)$ directly by the dominated convergence theorem, as long as SUMO is everywhere differentiable, which is satisfied by all of our experiments. If ReLU neural networks are to be used, one may be able to show the same property using Theorem 5 of Bikowski et al. (2018), assuming finite higher moments and Lipschitz continuity.
+
+# A.5 CONVERGENCE OF $\nabla \left(\mathrm{IWAE}_{k + 1} - \mathrm{IWAE}_k\right)$
+
+The IWAE log likelihood estimate is:
+
+$$
+\mathcal {L} _ {k} = \log \left(\frac {1}{k} \sum_ {i = 1} ^ {k} \frac {p _ {\theta} (x , z _ {i})}{q _ {\psi} (z _ {i} | x)}\right)
+$$
+
+The gradient of this with respect to $\lambda$ , where $\lambda$ is either $\theta$ or $\psi$ , is
+
+$$
+\frac {d \mathcal {L} _ {k}}{d \lambda} = \frac {1}{\sum_ {i = 1} ^ {k} \frac {p _ {\theta} (x , z _ {i})}{q _ {\psi} (z _ {i} | x)}} \sum_ {i = 1} ^ {k} \frac {d}{d \lambda} \frac {p _ {\theta} (x , z _ {i})}{q _ {\psi} (z _ {i} | x)}
+$$
+
+We abbreviate $w_{i} \coloneqq \frac{p_{\theta}(x, z_{i})}{q_{\psi}(z_{i}|x)}$ , and $\nu_{i} = \frac{dw_{i}}{d\lambda}$ . In both $\lambda = \psi$ and $\lambda = \theta$ cases, it suffices to treat the $w_{i}$ and $\nu_{i}$ as i.i.d. random variables with finite variance and expectation. Being a likelihood ratio, $w_{i}$ could be ill behaved when the importance sampling distribution $q_{\psi}(z_{i}|x)$ is is particularly mismatched from the true posterior $p(z_{i}|x) = \frac{p_{\theta}(x, z_{i})}{\mathbb{E}_{z \sim p(z)} p_{\theta}(x, z)}$ . However, the analysis from IWAE (Burda et al., 2016) requires assuming that the likelihood ratios $w_{i} = \frac{p_{\theta}(x, z_{i})}{q_{\psi}(z_{i}|x)}$ are bounded, and we adopt this assumption. Reasoning about when this assumption holds, and the behavior of IWAE-like estimators when it does not, is an interesting area for future work.
+
+Consider the differences between two gradients: we label $\Delta^g$ as follows:
+
+$$
+\Delta_ {k} ^ {g} := \frac {d \mathcal {L} _ {k + 1}}{d \lambda} - \frac {d \mathcal {L} _ {k}}{d \lambda}
+$$
+
+We have:
+
+$$
+\begin{array}{l} \Delta_ {k} ^ {g} = \frac {1}{\sum_ {i = 1} ^ {k + 1} w _ {i}} \nu_ {k + 1} + \left(\frac {1}{\sum_ {i = 1} ^ {k + 1} w _ {i}} - \frac {1}{\sum_ {i = 1} ^ {k} w _ {i}}\right) \sum_ {i = 1} ^ {k} \nu_ {i} \\ = \frac {1}{\sum_ {i = 1} ^ {k + 1} w _ {i}} \nu_ {k + 1} + \frac {w _ {k + 1}}{\left(\sum_ {i = 1} ^ {k + 1} w _ {i}\right) \left(\sum_ {i = 1} ^ {k} w _ {i}\right)} \sum_ {i = 1} ^ {k} \nu_ {i} \\ \end{array}
+$$
+
+
+Figure 4: A comparison of SUMO estimations with different distributions and IWAE estimations of test negative log-likelihood on a trained model with $\mathrm{IWAE}_1$ objective on MNIST. The expected cost is $K + 5$ for each evaluation. The results are averaged over 100 runs (mean in bold and std shaded).
+
+
+
+
+
+We again let $Y_{k}$ denote the $k$ th sample mean $\frac{1}{k}\sum_{i}w_{i}$ . Then:
+
+$$
+\Delta_ {k} ^ {g} = \frac {1}{k Y _ {k}} \nu_ {k + 1} + \frac {w _ {k + 1}}{(k + 1) Y _ {k} Y _ {k + 1}} \bar {\nu} _ {k}
+$$
+
+The sample means $Y_{k}$ and $\bar{\mu}_k$ have finite expectation and variance. The variance vanishes as $k\to \infty$ (but the expectation does not change).
+
+$$
+\begin{array}{l} \mathbb {E} | | \Delta_ {k} ^ {g} | | _ {2} ^ {2} = \frac {1}{k ^ {2}} \mathbb {E} | | \frac {\nu_ {k + 1}}{Y _ {k}} + \frac {k}{k + 1} \frac {w _ {k + 1} \bar {\nu_ {k}}}{Y _ {k} Y _ {k + 1}} | | _ {2} ^ {2} \\ \mathrm {L e t} \frac {\nu_ {k + 1}}{Y _ {k}} + \frac {k}{k + 1} \frac {w _ {k + 1} \bar {\nu_ {k}}}{Y _ {k} Y _ {k + 1}} := \phi_ {k} \\ \Longrightarrow \mathbb {E} | | \Delta_ {k} ^ {g} | | _ {2} ^ {2} = \frac {1}{k ^ {2}} | | \mathbb {E} \phi_ {k} | | _ {2} ^ {2} + \frac {1}{k ^ {2}} \operatorname {V a r} (\phi_ {k}) \\ \end{array}
+$$
+
+The second term vanishes at a rate strictly faster than $\frac{1}{k^2}$ : the variance of $\phi_k$ goes to zero as $k \to \infty$ . But the first term does not: $\phi_k$ is a biased estimator of $\phi_{\infty}$ so $\mathbb{E}\phi_k$ does change with $k$ , but it does not necessarily go to zero:
+
+$$
+\mathbb {E} \phi_ {\infty} = \mathbb {E} \Big [ \frac {\nu}{\mathbb {E} w} + \frac {k}{k + 1} \frac {w \mathbb {E} \nu}{(\mathbb {E} w) ^ {2}} \Big ] = \frac {\mathbb {E} \nu}{\mathbb {E} w}
+$$
+
+Thus, $\mathbb{E}||\Delta_k^g ||_2^2$ is at most $\mathcal{O}\left(\frac{1}{k^2}\right)$
+
+# A.6 EMPIRICAL CONFIRMATION ON THE CONVERGENCE OF $\mathbb{E}\Delta_k^2$ AND $\mathbb{E}||\Delta_k^g ||_2^2$
+
+We measure the $\Delta_k^2$ and $||\Delta_k^g ||_2^2$ on a toy example to verify the convergence rates empirically. We re-implement the toy Gaussian example from Rainforth et al. (2018b); Tucker et al. (2018). The generative model is $p_{\theta}(x,z) = \mathcal{N}(z|\theta ,I)\mathcal{N}(x|z,I)$ , where both $x$ and $z$ are in $\mathbb{R}^D$ . The encoder is $q_{\phi}(z|x) = \mathcal{N}(z|Ax + b,\frac{2}{3} I)$ , where $\phi = (A,b)$ . The synthetic dataset was generated with $D = 20$ and $N = 1000$ data points using the true model parameter $\theta_{\mathrm{true}}$ from a standard Gaussian. Alongside $||\Delta_k||_2^2$ , we plot several reference convergence rates such as $\mathcal{O}(1 / k^c)$ , $c > 1$ , and $\mathcal{O}(c^k)$ , $c < 1$ , as a visual guide. The results are shown in Figure 5. Following the setup in Rainforth et al. (2018b), we sample a group of model parameters close to the optimal values which are perturbed by Gaussian noise from $\mathcal{N}(0,0.01^2)$ . The gradient $\Delta_k^g$ is taken w.r.t. the model parameter $\theta$ .
+
+# A.7 BIAS-VARIANCE TRADEOFF VIA GRADIENT CLIPPING
+
+While SUMO is unbiased, its variance is extremely high or potentially infinite. This property leads to poor performance compared to lower bound estimates such as IWAE when maximizing log-likelihood. In order to obtain models with competitive log-likelihood values, we can make use of gradient clipping. This allows us to ignore rare gradient samples with extremely large values due to the heavy-tailed nature of its distribution.
+
+Figure 5: Empirical validation of the convergence rate of the norms of $\Delta$ and $\Delta^g$ .
+
+(a) Mean of estimated of $\mathbb{E}\Delta_k^2$ with increasing $k$ over ten random trials with 1000 samples per trial. X and Y axis are on log scale. Empirically the convergence rate of $\Delta_k^2$ is between $\mathcal{O}(1 / k^2)$ and $\mathcal{O}(1 / k^3)$ .
+
+
+(b) Mean of estimated $\mathbb{E}||\Delta_k^q ||_2^2$ with increasing $k$ over ten trials with 1000 samples per trial. Empirically the convergence is faster than theoretical analysis $\mathcal{O}(1 / k^2)$ .
+
+Gradient clipping introduces bias in favor of reduced variance. Figure 6 shows how the performance changes as a function of the clipping value, and more importantly, the percentage of clipped gradients. As shown, neither full clipping nor no clipping are desirable. We performed this experiment after reporting the results in Table 1, so this grid search was not used to tune hyperparameters for our experiments. As bias is introduced, we do not use gradient clipping for entropy maximization or policy gradient (REINFORCE).
+
+
+Figure 6: Test negative log-likelihood against the gradient clipping norm and clipping percentage, when training with SUMO (k=15).
+
+
+
+# A.8 EXPERIMENTAL SETUP
+
+In density modeling experiments, all the models are trained using a batch size of 100 and the AMS-Grad optimizer (Reddi et al., 2018) with parameters $lr = 0.001$ , $\beta_{1} = 0.9$ , $\beta_{2} = 0.999$ and $\epsilon = 10^{-4}$ . The learning rate is reduced by factor 0.8 if the validation likelihood does not improve for 50 epochs. We use gradient norm scaling in both the inference and generative networks. We train SUMO using the same architecture and hyperparameters as IWAE except the gradient clipping norm. We set the gradient norm to 5000 for encoder and {20, 40, 60} for decoder in SUMO. For IWAE, the gradient norm is fixed to 10 in all the experiments. We report the performance of models with early stopping if no improvements have been observed for 300 epochs on the validation set.
+
+We add additional plots of the test NLL against the norm and percentage of gradients clipped for the decoder in Figure 6. The plot is based on MNIST with expected number of compute $k = 15$ . Gradient clipping was not used in the other experiments except the density modeling ones, where it was used as a simple tool to obtain a better bias-variance trade-off.
+
+# A.8.1 REVERSE KL AND COMBINATORIAL OPTIMIZATION
+
+These two tasks use the same encoder and decoder architecture: one hidden layer with tanh nonlinearities and 200 hidden units. We set the latent state to be of size 20. The prior is a standard Gaussian with diagonal covariance, while the encoder distribution is a Gaussian with parameterized diagonal covariance. For reverse KL, we used independent Gaussian conditional likelihoods for $p(x|z)$ , while for combinatorial optimization we used independent Bernoulli conditional distributions. We found it helps stabilize training for both IWAE and SUMO to remove momentum and used RMSprop with learning rate 0.00005 and epsilon 1e-3 for fitting reverse KL. We used Adam with learning rate 0.001 and epsilon 1e-3, plus standard hyperparameters for the combinatorial optimization problems. SUMO used an expected compute of 15 terms.
\ No newline at end of file
diff --git a/sumounbiasedestimationoflogmarginalprobabilityforlatentvariablemodels/images.zip b/sumounbiasedestimationoflogmarginalprobabilityforlatentvariablemodels/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..921fb25f3ebbc64489f56e333d2f6620f4ebf94b
--- /dev/null
+++ b/sumounbiasedestimationoflogmarginalprobabilityforlatentvariablemodels/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:79b173ec643181825203b21f0d9db7a501d66040661e3c3b46ca60fe41c76608
+size 823732
diff --git a/sumounbiasedestimationoflogmarginalprobabilityforlatentvariablemodels/layout.json b/sumounbiasedestimationoflogmarginalprobabilityforlatentvariablemodels/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..f6f619e1af7c90234dc41082010ad176590c6cd7
--- /dev/null
+++ b/sumounbiasedestimationoflogmarginalprobabilityforlatentvariablemodels/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:1c9729c37fb7fea8532637e2e11dca57a529606d3b2d667bedc2543802cce798
+size 740563
diff --git a/symplecticrecurrentneuralnetworks/a611bfe9-2010-4366-96ab-2086ad5d7b09_content_list.json b/symplecticrecurrentneuralnetworks/a611bfe9-2010-4366-96ab-2086ad5d7b09_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..44a5dc415052f59a88eb29023eec2345e74818c4
--- /dev/null
+++ b/symplecticrecurrentneuralnetworks/a611bfe9-2010-4366-96ab-2086ad5d7b09_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:94d8e443b599b712161b6c847e8e7af8fe2265323232c31c3f9186a7839f13bd
+size 114991
diff --git a/symplecticrecurrentneuralnetworks/a611bfe9-2010-4366-96ab-2086ad5d7b09_model.json b/symplecticrecurrentneuralnetworks/a611bfe9-2010-4366-96ab-2086ad5d7b09_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..2d80a8bca06f024dfabfedfe46879769e0b6a120
--- /dev/null
+++ b/symplecticrecurrentneuralnetworks/a611bfe9-2010-4366-96ab-2086ad5d7b09_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c2f9ad2b24864453ab9ecdaede6df6c45a5cd860955d1ff9925e2a1b7f7d8a55
+size 133176
diff --git a/symplecticrecurrentneuralnetworks/a611bfe9-2010-4366-96ab-2086ad5d7b09_origin.pdf b/symplecticrecurrentneuralnetworks/a611bfe9-2010-4366-96ab-2086ad5d7b09_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..cf9dc5bfe426be5a8f3777b9992239217526b42a
--- /dev/null
+++ b/symplecticrecurrentneuralnetworks/a611bfe9-2010-4366-96ab-2086ad5d7b09_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:dde25d12aff94a9422732dce072e8a13d0e291d759ef5b28c9ac79d48d5e88b1
+size 1523606
diff --git a/symplecticrecurrentneuralnetworks/full.md b/symplecticrecurrentneuralnetworks/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..80635f2b35ff79ba64ec17b0e8ced2b92d438c84
--- /dev/null
+++ b/symplecticrecurrentneuralnetworks/full.md
@@ -0,0 +1,516 @@
+# SYMPLECTIC RECURRENT NEURAL NETWORKS
+
+Zhengdao Chen $^{a,c}$ , Jianyu Zhang $^{b,c}$ , Martin Arjovsky $^{a}$ , Léon Bottou $^{c,a}$
+
+a New York University, New York, USA
+$^{b}$ Tianjin University, Tianjin, China
+Facebook AI Research, New York, USA
+
+# ABSTRACT
+
+We propose Symplectic Recurrent Neural Networks (SRNNs) as learning algorithms that capture the dynamics of physical systems from observed trajectories. An SRNN models the Hamiltonian function of the system by a neural network and furthermore leverages symplectic integration, multiple-step training and initial state optimization to address the challenging numerical issues associated with Hamiltonian systems. We show SRNNs succeed reliably on complex and noisy Hamiltonian systems. We also show how to augment the SRNN integration scheme in order to handle stiff dynamical systems such as bouncing billiards.
+
+# 1 INTRODUCTION
+
+Can machines learn physical laws from data? A recent paper (Greydanus et al., 2019), Hamiltonian Neural Networks (HNN), proposes to do so representing the Hamiltonian function $H(q,p)$ as a multilayer neural network. The partial derivatives of this network are then trained to match the time derivatives $\dot{p}$ and $\dot{q}$ observed along the trajectories in state space.
+
+The ordinary differential equations (ODEs) that express Hamiltonian dynamics are famous for both their mathematical elegance and their challenges to numerical integration techniques. Except maybe for the simplest Hamiltonian systems, discretization errors and measurement noise lead to quickly diverging trajectories. In other words, Hamiltonian systems can often be stiff, a concept that usually refers to differential equations where we have to take very small time-steps of integration so that the numerical solution remains stable (Lambert, 1991). A plethora of numerical integration methods, symplectic integrators, have been developed to respect the conserved quantities in Hamiltonian systems, thereby usually being more stable and structure-preserving than non-symplectic ones (Hairer et al., 2002). For example, the simplest symplectic integrator is the well-known leapfrog method, also known as the Stömer-Verlet integrator (Leimkuhler and Reich, 2005). However, even the best integrators remain severely challenged by phenomena as intuitive as a mechanical rebound or a slingshot effect, which are more severe forms of stiffness. Such numerical issues are almost doomed to conflict with the inherently approximate nature of a learning algorithm.
+
+In the first part of this paper, we propose Symplectic Recurrent Neural Networks (SRNNs), where $(i)$ the partial derivatives of the neural-network-parametrized Hamiltonian are integrated with the leapfrog integrator and where $(ii)$ the loss is back-propagated through the ODE integration over multiple time steps. We find that in the presence of observation noise, SRNN are far more usable than HNNs. Further improvements are achieved by simultaneously optimizing the initial state and the Hamiltonian network, presenting an interesting contrast to previous literature on the hardness of general initial state optimization (Peifer and Timmer, 2007). The optimization can be motivated from a maximum likelihood estimation perspective, and we provide heuristic arguments for why the initial state optimization is likely convex given the symplecticness of the system. Furthermore, experiments in the three-body problem show that the SRNN-trained Hamiltonian compensates for discretization errors and can even outperform numerically solving the ODE using the true Hamiltonian and the same time-step size. This could be of particular interest to researchers who study the application of machine learning to numerically solving differential equations.
+
+The second part of this paper focuses on perfect rebound as an example of the more severe form of stiffness. When a point mass rebounds without loss of energy on a perfectly rigid
+
+obstacle, the motion of the point mass is changed in ways that can be interpreted as an infinite force applied during an infinitesimal time. The precise timing of this event affects the trajectory of the point mass in ways that essentially make it impossible to merely simulate the Hamiltonian system on a predefined grid of time points. In order to address such events in learning, we augment the leapfrog integrator used in our SRNN with an additional trainable operator that models the rebound events and relates their occurrence to visual hints. Training such an augmented SRNN on observed trajectories not only learns the point mass dynamics but also learns the visual appearance of the obstacles.
+
+# 2 RELATED WORK
+
+Learning physics with neural networks A popular category of methods attempts to replicate the intuitive ways in which humans perceive simple physical interactions, identifying objects and learning how they relate to each other (Battaglia et al., 2016; Chang et al., 2016). Since such methods cannot be used for more general physical systems, another category of methods seeks to learn which differential equations govern the evolution of a physical system on the basis of observed trajectories. Brunton et al. (2016) assemble a small number of predefined primitives in order to find an algebraically simple solution. Lutter et al. (2019) use a neural network to model the Lagrangian function of a robotic system. Most closely related to ours, Greydanus et al. (2019) use a neural network to learn the Hamiltonian of the dynamical system in such a way that its partial derivatives match the time derivatives of the position and momentum variables, which are both assumed to be observed. Although the authors show success on a simple pendulum system, this approach does not perform well on a more complex system such as a three-body problem.
+
+ODE-based learning and recurrent neural networks (RNNs) To learn an ODE that underlies some observed time series data, Chen et al. (2018a) proposes to solve a neural-network-parameterized ODE numerically and minimize the distance between the generated time series with the observed data. To save memory, they propose to use the adjoint ODE instead of back-propagating through the ODE solver. Using stability analysis of ODEs, Chang et al. (2019) propose the AntisymmetricRNN with better trainability. Niu et al. (2019) establish a correspondence between RNNs and ODEs, and propose an RNN architecture inspired by a universal quantum computation scheme.
+
+Summary of our main contributions: In this paper, we propose SRNN, which
+
+- learns Hamiltonian dynamics directly from position and momentum time series
+- performs well on noisy and complex systems such as a spring-chain system and a three-body system, and is compatible with initial state optimization
+- is augmented to handle perfect rebound, an example of very stiff Hamiltonian dynamics
+
+# 3 FRAMEWORK
+
+# 3.1 HAMILTONIAN SYSTEMS
+
+A Hamiltonian system of dimension $d$ is described by two vectors $p, q \in \mathbb{R}^d$ . Typically, they correspond to the momentum and position variables, respectively. The evolution of the system is determined by the Hamiltonian function $H: (p, q, t) \in \mathbb{R}^{2d + 1} \mapsto H(p, q, t) \in \mathbb{R}$ through a system of ordinary differential equations called Hamilton's equations,
+
+$$
+\dot {p} = - \frac {\partial H}{\partial q}, \quad \dot {q} = + \frac {\partial H}{\partial p}, \tag {1}
+$$
+
+where we use the dot notation to compactly represent derivatives with respect to the time variable $t$ . We are focusing in this work on Hamiltonians that are conservative, that is, they do not depend on the time variable $t$ , and separable, that is, they can be written as a
+
+sum $H(p,q) = K(p) + V(q)$ . In this case, (1) becomes
+
+$$
+\dot {p} = - V ^ {\prime} (q), \dot {q} = K ^ {\prime} (p) \tag {2}
+$$
+
+With a proper choice of the $p$ and $q$ variables, the evolution of essentially all physical systems can be described with the Hamiltonian framework. In other words, Hamilton's equations restrict the vast space of dynamical systems to the considerably smaller space of dynamical systems that are physically plausible.
+
+Therefore, instead of modeling the dynamics of a physical system with a neural network $f_{\theta}(p,q)$ whose outputs are interpreted as estimates of the time derivatives $\dot{p}$ and $\dot{q}$ , we can also use a neural network $H_{\theta}(p,q) = K_{\theta_1}(p) + V_{\theta_2}(q)$ with $\theta = [\theta_1,\theta_2]$ , whose partial derivatives $-V_{\theta_2}'(q)$ and $K_{\theta_1}'(p)$ are interpreted as the time derivatives $\dot{p}$ and $\dot{q}$ . We refer to the former as ODE neural networks (O-NET) and the latter approach as Hamiltonian neural networks (H-NET). In order to define a complete learning system, we need to explain how to determine the parameter $\theta$ of the neural networks on the basis of observed discrete trajectories. For instance, Greydanus et al. (2019) trains H-NET in a fully supervised manner using the observed tuples $(p,q,\dot{p},\dot{q})$ .
+
+# 3.2 FROM ODES TO DISCRETE TRAJECTORIES
+
+A numerical integrator (or ODE solver) approximates the true solution of an ODE of the form $\dot{z} = f(z,t)$ at discrete time steps $t_0, t_1 \ldots t_T$ . For instance, the simplest integrator, Euler's integrator, starts from the initial state $z_0$ at time $t_0$ and estimates the function $z(t)$ at uniformly spaced time points $t_n = t_0 + n \Delta t$ with the recursive expression
+
+$$
+z _ {n + 1} = z _ {n} + \Delta t f \left(z _ {n}, t _ {n}\right) \tag {3}
+$$
+
+In stiff ODE systems, however, using Euler's method could easily lead to unstable solutions unless the time-step is chosen to be very small (Lambert, 1991). The development of efficient and accurate numerical integrators is the object of considerable research (Hairer et al., 2008; Hairer and Wanner, 2013). Symplectic integrators3 are particularly attractive for the integration of Hamilton's equations (Leimkuhler and Reich, 2005). They are able to preserve quadratic invariants, and therefore usually have desired stability properties as well as being structure-preserving (McLachlan et al., 2004), even for certain non-Hamiltonian systems (Chen et al., 2018b). A simple and widely-used symplectic integrator is the leapfrog integrator. When the Hamiltonian is conservative and separable (2), it computes successive estimates $(p_n, q_n)$ with
+
+$$
+p _ {n + 1 / 2} = p _ {n} - \frac {1}{2} \Delta t V ^ {\prime} (q _ {n})
+$$
+
+$$
+q _ {n + 1} = q _ {n} + \Delta t K ^ {\prime} \left(p _ {n + 1 / 2}\right) \tag {4}
+$$
+
+$$
+p _ {n + 1} = p _ {n + 1 / 2} - \frac {1}{2} \Delta t V ^ {\prime} \left(q _ {n + 1}\right)
+$$
+
+Repeatedly executing update equations (4) is called the leapfrog algorithm, which is as computationally efficient as Euler's method yet considerably more accurate when the ODE belongs to a Hamiltonian system (Leimkuhler and Reich, 2005).
+
+# 3.3 LEARNING ODES FROM DISCRETE TRAJECTORIES
+
+Following Chen et al. (2018a), let the right hand side of the ODE be a parametric function $f_{\theta}(z,t)$ and let $z_0\ldots z_T$ be an observed trajectory measured at uniformly spaced time points $t_0\ldots t_T$ . We can estimate the parameter $\theta$ that best represents the dynamics of the observed trajectory by minimizing the mean squared error $\sum_{i = 1}^{T}\| z_i - \hat{z}_i(\theta)\| _2$ between the observed trajectory $\{z_i\}_{i = 0}^T$ and the trajectory $\{\hat{z}_i(\theta)\}_{i = 0}^T$ generated with our integrator of choice,
+
+$$
+\{\hat {z} _ {i} (\theta) \} _ {i = 0} ^ {T} = I n t e g r a t o r \left(z _ {0}, f _ {\theta}, \left\{t _ {i} \right\} _ {i = 0} ^ {T}\right).
+$$
+
+For instance, this minimization can be achieved using stochastic gradient descent after back-propagating through the steps of our numerical integration algorithm of choice and then through each call to the functions $f_{\theta}$ . This can be done when $f_{\theta}(z)$ is a neural network (O-NET), or is the concatenation $[-V_{\theta_2}'(q), K_{\theta_1}'(p)]$ of the partial derivatives of an H-NET
+
+$H_{\theta}(p,q) = K_{\theta_1}(p) + V_{\theta_2}(q)$ , where the partial derivatives can be expressed using the same parameters $\theta$ as the Hamiltonian $H_{\theta}(p,q)$ , for instance using automatic differentiation. We can then predict trajectories at testing time using the trained $f_{\theta^*}$ and initial state $z_0^{\mathrm{test}}$ ,
+
+$$
+\{\hat {z} _ {i} ^ {\mathrm {t e s t}} \} _ {i = 0} ^ {T ^ {\mathrm {t e s t}}} = I n t e g r a t o r (z _ {0} ^ {\mathrm {t e s t}}, f _ {\theta^ {*}}, \{t _ {i} \} _ {i = 0} ^ {T ^ {\mathrm {t e s t}}}).
+$$
+
+Note that neither the integrator, nor the number of steps, nor the step size, need to be the same at training and testing.
+
+# 3.4 SYMPLECTIC RECURRENT NEURAL NETWORK
+
+This framework provides a number of nearly orthogonal design options for the construction of algorithms that model dynamical systems using trajectories:
+
+- The time derivative model could be an O-NET or H-NET.
+- The training integrator can be any explicit integrators. In our experiments, we only focus on Euler's integrator and the leapfrog integrator.
+- The training trajectories can consist of a single step, $T = 1$ , or multiple steps, $T > 1$ . We refer to the first case as single-step and the second case as multi-step or recurrent training, because back-propagating through multiple steps of the training integrator is comparable to back-propagating through time in recurrent networks.
+- The testing integrator can also be chosen freely and can use a different time-step size as it does not involve back-propagation.
+
+In order to save space while describing the possibly different integrators used for training and testing, we use the labels "E-E", "E-L", and "L-L", where the first letter tells which integrator was used for training — "E" for Euler and "L" for leapfrog—and the second letter indicates which integrator was used as testing time. For instance, with our terminology, the HNN model of Greydanus et al. (2019) is a "single-step E-E H-NET" with the additional subtlety that they supervise the training with actual derivatives instead of relying on finite differences between successive steps of the observed trajectories.
+
+A Symplectic Recurrent Neural Network (SRNN) is a recurrent H-NET that relies on a symplectic integrator for both training and testing, such as, for instance, a "recurrent L-L H-NET". As shown in the rest of this paper, SRNNs are far more usable and robust than the alternatives, especially when the Hamiltonian gets complex and the data gets noisy. We believe that SRNNs may also have other potential benefits: because leapfrog preserves volumes in the state space (Hairer et al., 2002), we conjecture that vanishing and exploding gradients' issues in backpropagating through entire state sequences are ameliorated (Arjovsky et al., 2015). Finally, because the leapfrog integrator is reversible in time, there is no need to store states during the forward pass as they can be recomputed exactly during the backward pass. We leave studying these other computational and optimization benefits as a topic of future work.
+
+# 4 SRNN CAN LEARN COMPLEX AND NOISY HAMILTONIAN DYNAMICS
+
+As an example of a complex Hamiltonian system, we first present experiments performed on the spring-chain system: a chain of 20 masses with neighbors connected via springs. Each of the two masses on the ends are connected to fixed ground via another spring. The chain can be assumed to lay horizontally and the masses move vertically but no gravity is assumed. The 20 masses and the 21 spring constants are chosen randomly and independently. The training data consist of 1000 trajectories of the same chain, each of which starts from a random initial state of positions and momenta of the masses and is 10-time-step long (including the initial state). We thus take $T = 9$ when performing recurrent training. When performing single-step training, each training trajectory of length 10 is instead considered as 9 consecutive trajectories of length 2. In this way, 1000 sample trajectories of length 10 ( $T = 9$ ) are turned into 9000 sample trajectories of length 2 ( $T = 1$ ), allowing for a fair comparison between single-step training and recurrent training. During testing, the trained model is given 32 random initial states in order to predict 32 trajectories of length 100. Detailed experiment setups and model architectures are provided in Appendix A.1, and a PyTorch implementation can be found at https://github.com/zhengdao-chen/SRNN.git.
+
+
+Figure 1: Testing results in the noiseless case by single-step methods. Left: Prediction error of each method over time, measured by the L2 distance between the true and predicted positions of the 20 masses. Right: Each curve represents the position of one of the masses (number 5) as a function of time predicted by the three single-step-trained H-NET models. Plots of the other masses' positions are provided in Appendix D.1.
+
+
+
+# 4.1 GOING SYMPLECTIC - RESCUING HNN WITH THE LEAPFROG INTEGRATOR
+
+First, we consider the noiseless case, where the training data consist of exact values of the positions $(q)$ and momenta $(p)$ of the masses on the chain at each discrete time point. As shown in figure 1, the prediction of a single-step E-E H-NET deviates from the ground truth quickly and is unable to capture the periodic motion. By comparison, a single-step E-E O-NET yields predictions that is qualitatively reasonable. This shows that using Hamiltonian models without paying attention to the integration scheme may not be a good idea.
+
+We then replace Euler's integrator used during testing by a leapfrog integrator, yielding a Single-step E-L H-NET. Figure 1 shows that this helps the H-NET produce predictions that remain stable and periodic over a longer period of time. Since the training process remains the same, this implies that part of the instability and degeneration of H-NET's predictions comes from the nature of Euler's integrator rather than the lack of proper training.
+
+In contrast, using a leapfrog integrator for both training and testing substantially improve the performance, as also shown again in figure 1. This improvement shows the importance of consistency between the integrators used in training and predicting modes. This can be understood with the concept of modified equations (Hairer, 1994): when we use a numerical integrator to solve an ODE, the numerical solution usually does not strictly follow the original equation due to discretization, but can be regarded as a solution to a modified version of the original equation that depends on the integrator and the time-step size. Therefore, training and testing with the same numerical integrator and time-step size could allow the system to learn a modified Hamiltonian that corrects some of the errors caused by the discretization scheme.
+
+# 4.2 GOING RECURRENT - USING MULTI-STEP TRAINING WHEN NOISE IS PRESENT
+
+Since noise is prevalent in real-world observations, we also test our models on noisy trajectories. Independent and identically distributed Gaussian noise is added to both the position and the momentum variables at each time step. Applying the single-step methods described above yield considerably worse predictions, as shown in Figure 2 (left).
+
+This phenomenon can be controlled by training on multiple steps, effectively arriving at a type of recurrent neural network: if noise is added independently at each time-step, then having data from multiple consecutive time steps may allow us to discern the actual noiseless trajectory, analogous to performing linear regression on multiple (more than 2) noisy data points. As we see in Figure 2 (left), recurrent training consistently improves the predictions except for E-E H-NET. The best performing model is the SRNN (recurrent L-L H-Net) which improves substantially over the single-step L-L H-NET. Interestingly, the recurrent E-E H-NET does not improve over the single-step E-E H-NET, which means that recurrent training does not help if one uses a naive integrator.
+
+# 4.3 INITIAL STATE OPTIMIZATION (ISO)
+
+However, one issue remains to be addressed: in the framework that we have adopted so far, the initial states $p_0$ and $q_0$ are treated as the actual initial states from which the system
+
+
+Figure 2: Prediction error of all methods in the noisy case measured by L2 distance, presented in two plots due to the large number of methods. Included in the left plot are the single-step-trained methods, recurrently trained methods, vanilla RNN and LSTM. Included in the right plot are the (same) recurrently trained methods, the recurrently trained methods with initial state optimization (ISO), as well as vanilla RNN and LSTM with ISO.
+
+
+
+
+(a) HNN
+
+
+(b) SRNN
+
+
+(c) SRNN-ISO
+Figure 3: Predictions made by three methods in the noisy case. The Y-axis corresponds to the position of one of the masses (number 5) on the chain.
+
+
+
+begins to evolve despite the added noise in observation. With noise added to the observation of $p_0$ and $q_0$ , our dynamical models will start from these noisy states and remain biased as we advance in time in both the training and the testing mode.
+
+To mitigate this issue, we propose to introduce two new parameter vectors for each sample, $\hat{p}_0$ and $\hat{q}_0$ , interpreted as our estimate of the actual initial states, and we let our dynamical models evolve starting from them instead of the observed $p_0$ and $q_0$ . Treating $\hat{p}_0$ and $\hat{q}_0$ as parameters, we can optimize them based on the loss function while fixing the model's parameters, a process that we call initial state optimization (ISO). When the model is good enough, we hope that this will guide us towards the true initial states without observation noise. In Appendix B, we motivate the use of ISO from the perspective of maximum likelihood inference. In actual training, we first train the neural network parameters for 100 epochs as usual, and starting from the 101st, after every epoch we perform ISO with the L-BFGS-B algorithm (Zhu et al., 1997) on the $\hat{p}_0$ and $\hat{q}_0$ parameters for every training trajectory. At testing time, the model is given the noisy values of $p$ and $q$ for the first 10 time steps and must complete the trajectory for the next 200 steps. These 10 initial time steps allow us to perform the same L-BFGS-B optimization to determine the initial state $\hat{p}_0$ before advancing in time to predict the entire trajectory.
+
+As seen in Figure 2 (right), SRNN-ISO (i.e. SRNN equipped with ISO) clearly yields the best prediction among all the methods. Figure 3 shows the predictions of HNN, SRNN and SRNN-ISO on one test sample, and we clearly see the qualitative improvements thanks to recurrent training and ISO. O-NET also benefits from ISO while vanilla RNN and LSTM do not seem to, likely because the initial state optimization only works when we already have a reasonable model of the system. In Appendix C, we give a heuristic argument for the convexity of ISO, which helps to explain the success of using L-BFGS-B for ISO.
+
+In summary, we have proposed three extensions to learning complex and noisy dynamics with H-NET and demonstrated the improvements they lead to: a) using the leapfrog integrator instead of Euler's integrator; b) using recurrent instead of single-step training; and c)
+
+Table 1: Testing results of predicting the dynamics of the spring-chain system by methods based on fixed $p_0$ , $q_0$ (i.e., not optimizing $p_0$ , $q_0$ as parameters). The error is defined as the discrepancy between the (noisy) ground truth and the predictions at each time step averaged over the first 200 time steps, where the discrepancy is measured by the L2 distance between the true and predicted positions of the 20 masses in the chain, both of which considered as 20-dimensional vectors. The mean and standard deviation are computed based on 32 testing samples, each starting from a random configuration of the chain.
+
+ | Model | Integrator (tr) | Integrator (te) | Error mean | Error std |
| single-step | O-NET | Euler | Euler | 6.93 | 1.22 |
| Euler | Leapfrog | 5.87 | 1.04 |
| Leapfrog | Leapfrog | 7.28 | 1.48 |
| H-NET | Euler | Euler | 7.24 | 0.64 |
| Euler | Leapfrog | 3.32 | 0.89 |
| Leapfrog | Leapfrog | 3.36 | 0.67 |
| recurrent | O-NET | Euler | Euler | 2.88 | 0.45 |
| Euler | Leapfrog | 4.12 | 0.41 |
| Leapfrog | Leapfrog | 3.34 | 0.86 |
| H-NET | Euler | Euler | 7.58 | 0.63 |
| Euler | Leapfrog | 5.26 | 0.63 |
| Leapfrog | Leapfrog | 2.37 | 0.87 |
| Vanilla RNN | N/A | N/A | 4.80 | 0.82 |
| LSTM | N/A | N/A | 5.95 | 1.05 |
+
+Table 2: Testing results of predicting the dynamics of the spring-chain system by methods that optimize on $p_0$ and $q_0$ starting from their observed (noisy) values using L-BFGS-B, as explained in the text. The definition of the errors is the same as in the above table.
+
+| Model | Integrator (tr) | Integrator (te) | Error mean | Error std |
| O-NET | Euler | Euler | 2.13 | 0.37 |
| Euler | Leapfrog | 3.59 | 0.50 |
| Leapfrog | Leapfrog | 2.27 | 0.60 |
| H-NET | Euler | Euler | 6.26 | 0.60 |
| Euler | Leapfrog | 3.00 | 0.63 |
| Leapfrog | Leapfrog | 1.45 | 0.32 |
| Vanilla RNN | N/A | N/A | 4.72 | 0.94 |
| LSTM | N/A | N/A | 5.81 | 0.98 |
+
+optimizing the initial states of each trajectory as parameters when data are noisy. Thorough comparisons of test errors are given in Tables 1 and 2, where we highlight that the SRNN (recurrent L-L H-NET) models achieve the lowest errors.
+
+# 5 SRNN CAN LEARN THE DYNAMICS OF A THREE-BODY SYSTEM
+
+Next, we test SRNN with the three-body system, which is a well-known example of a chaotic system, meaning that a small difference in the initial condition could lead to drastically different evolution trajectories, even without noise added. As a result, even when the exact equations are known, simulating it with different time-step sizes could also lead to qualitatively different solutions. Moreover, Greydanus et al. (2019) mentions that HNN does not outperform a baseline method using O-NET in learning the three-body system's evolution. Here, we test our SRNN together with other baselines on the noiseless three-body system with the same configurations as Greydanus et al. (2019). The detailed experimental setup and model architectures are provided in Appendix A.2.
+
+As we see in Table 3, the best-performing model is SRNN and the second-best is the single-step L-L H-NET. Interestingly, and perhaps counter-intuitively, they even outperform the baseline method of simulating the correct equation with the same time-step size. How is this possible? In short, our explanation is that the error introduced by numerical discretization could be learned and therefore compensated for by the models we train. More concretely, once again using the concept of modified equations mentioned in Section 4.1, we argue that the ODE-based learning models, including both H-NET and O-NET models, could learn not
+
+Table 3: Prediction error results for the three-body system with time-step $\Delta t = 1$ . The last row corresponds to numerically solving the correct underlying equations using the leapfrog integrator with time-step $\Delta t = 1$ . The other rows correspond to the different learning-based methods, same as in the spring-chain experiments.
+
+ | Model | Integrator (tr) | Integrator (te) | Error mean | Error std |
| single-step | O-NET | Euler | Euler | 0.65 | 0.16 |
| Euler | Leapfrog | 1.36 | 0.18 |
| Leapfrog | Leapfrog | 1.33 | 0.20 |
| H-NET | Euler | Euler | 1.64 | 0.25 |
| Euler | Leapfrog | 0.88 | 0.33 |
| Leapfrog | Leapfrog | 0.35 | 0.09 |
| recurrent | O-NET | Euler | Euler | 0.51 | 0.11 |
| Euler | Leapfrog | 1.27 | 0.18 |
| Leapfrog | Leapfrog | 0.49 | 0.10 |
| H-NET | Euler | Euler | 0.79 | 0.17 |
| Euler | Leapfrog | 1.76 | 0.62 |
| Leapfrog | Leapfrog | 0.26 | 0.07 |
| simulation | true eqns. | (no training) | Leapfrog | 0.47 | 0.18 |
+
+the correct underlying equation, but rather the equation whose modified equation associated with our choice of numerical integrator and time-step size is the original equation. Hence, when the time-step size is large and the error of numerical discretization is not negligible, it is possible that the learned equation could yield better predictions than the correct one. In addition, we also see that the recurrently trained models outperform the corresponding single-step-trained models. Plots of the predicted trajectories are provided in Appendix E.
+
+# 6 LEARNING PERFECT REBOUND WITH AN AUGMENTED SRNN
+
+We focus in this section on the perfect rebound problem as a prototypical example of stiff ODE in a physical system. We consider a heavy billiard, subject to gravitational forces pointing downwards, and bouncing around a two-dimensional square domain delimited by impenetrable walls. Whenever it hits a wall, the billiard rebounds without loss of energy, by reversing the component of its momentum orthogonal to the wall surface. Microscopically, when the billiard hits the wall, the atomic structure deformation produces strong electromagnetic forces that reverse the momentum during a very brief timescale. Simulating this microscopic phenomenon with a Hamiltonian ODE would not only be computationally expensive, but also require a detailed knowledge of the atomic structures of the billiard and the walls. The perfect rebound is a macroscopic approximation that treats the billiard as a point mass and the rebound as an event with zero duration infinite forces. Although this approximation is convenient for high-school level derivations, the singularity makes it hard to simulate using Hamiltonian dynamics.
+
+We propose to approach this problem by augmenting each time step of a leapfrog-based SRNN with an additional operation that models a possible rebound event,
+
+$$
+p _ {t} ^ {\text {p o s t}} \leftarrow p _ {t} ^ {\text {p r e}} - 2 \left(p _ {t} ^ {\text {p r e}} \cdot n\right) n, \tag {5}
+$$
+
+where $p_t^{pre}$ is the pre-rebound momentum vector and $p_t^{post}$ is the post-rebound momentum vector. When the vector $n$ is zero, this operation does not change the momentum in any way. When $n$ is a unit vector orthogonal to a wall, this operation computes the momentum reversal that is characteristic of a perfect rebound. Vectors $n$ of smaller length could also be used to model energy dissipation in manner that is reminiscent of the famous LSTM forget gate (Hochreiter and Schmidhuber, 1997).
+
+Because the billiard trajectory depends on the exact timing of the rebound event, we also need a scalar $\alpha \in [0,1]$ that precisely places the rebound event at time $t + \alpha \Delta t$ between the successive time steps $t$ and $t + \Delta t$ . The augmented leapfrog schema then becomes
+
+$$
+\left[ p _ {t + \alpha \Delta t} ^ {\text {p r e}}, q _ {t + \alpha \Delta t} ^ {\text {p r e}} \right] \xleftarrow [ \alpha \Delta t ] {\text {l e a p f r o g}} \left[ p _ {t}, q _ {t} \right] \tag {6}
+$$
+
+$$
+p _ {t + \alpha \Delta t} ^ {\text {p o s t}} = p _ {t + \alpha \Delta t} ^ {\text {p r e}} - 2 \left(p _ {t + \alpha \Delta t} ^ {\text {p r e}} \cdot n\right) n \tag {7}
+$$
+
+
+
+
+
+
+Figure 4: Actual versus predicted trajectories of the heavy billiard with perfect rebound. The predictions are obtained by an SRNN plus the rebound module described in section 6.
+
+
+
+$$
+\left[ p _ {t + \Delta t}, q _ {t + \Delta t} \right] \xleftarrow {\text {l e a p f r o g}} \left[ p _ {t + \alpha \Delta t} ^ {\text {p o s t}}, q _ {t + \alpha \Delta t} ^ {\text {p o s t}} \right] \tag {8}
+$$
+
+where equations (6) and (8) represent ordinary leapfrog updates (4) for time steps of respective durations $\alpha \Delta t$ and $(1 - \alpha)\Delta t$ . More precisely, we first compute a tentative position $\tilde{q}_{t + \Delta t}$ and momentum $\tilde{p}_{t + \Delta t}$ assuming no rebound,
+
+$$
+\left[ \tilde {p} _ {t + \Delta t}, \tilde {q} _ {t + \alpha \Delta t} \right] \xleftarrow [ \Delta t ] {\text {l e a p f r o g}} \left[ p _ {t}, q _ {t} \right], \tag {9}
+$$
+
+then compute both $n$ and $\alpha$ as parametric functions of the tentative position $\tilde{q}_{t + \Delta t}$ as well as the current position $q_{t}$ , and finally apply the forward model (6-8). Note that the final state is equal to the tentative state when no rebound occurs, that is, when $n = 0$ .
+
+Directly modeling $n$ and $\alpha$ with a neural network taking $\tilde{q}_{t + \Delta t}$ as the input would be very inefficient because we would need to train with a lot of rebound events to precisely reveal the location of the walls. We chose instead to use visual cues in the form of a background image representing the walls. We model $n$ as the product of a direction vector $\bar{n}$ and a magnitude $\gamma \in [0,1]$ , and we want the latter to take value close to 1 when perfect rebound actually occurs between $t$ and $t + \Delta t$ and close to 0 otherwise. Both $\bar{n}$ and $\alpha$ are modeled as MLPs that take as input two 10x10 neighborhoods of the background image, centered at positions $q_{t}$ and $\tilde{q}_{t + \Delta t}$ , respectively. In contrast, $\gamma$ is modeled as an MLP that takes as input a smaller 2x2 neighborhood centered at $\tilde{q}_{t + \Delta t}$ and is trained with an additional regularization term $\| \gamma \|_1$ in order to switch the rebound module off when it is not needed.
+
+Training is achieved by back-propagating through the successive copies of the augmented leapfrog scheme, through the models of $\bar{n}$ , $\alpha$ , and $\gamma$ , and also through the computation of the tentative $\tilde{p}_{t + \Delta t}$ and $\tilde{q}_{t + \Delta t}$ . We use 5000 training trajectories of length 10 starting from a randomly-sampled initial positions and velocities. Similarly, we use 32 testing trajectories of length 60. Detailed experimental setup is included in Appendix A.3. Figure 5 plots some predicted and actual testing trajectories. Appendix F compares these results with the inferior results obtained with several baseline methods, including SRNN without the rebound module, and SRNN with a rebound module that does not learn $\alpha$ . One limitation of our method, however, results from the assumption that there is at most one rebound event per time step. Although this assumption fails when the billiard rebounds twice near a corner, as shown in the bottom right plot in Figure 5, our method still outperforms the baseline methods even in this case.
+
+# 7 CONCLUSION
+
+We propose the Symplectic Recurrent Neural Network, which learns the dynamics of Hamiltonian systems from data. Thanks to symplectic integration, multi-step training and initial state optimization, it outperforms previous methods in predicting the evolution of complex and noisy Hamiltonian systems, such as the spring-chain and the three-body systems. It can even outperform simulating with the exact equations, likely by learning to compensate for numerical discretization error. We further augment it to learn perfect rebound from data, opening up the possibility to handle stiff systems using ODE-based learning algorithms.
+
+# ACKNOWLEDGMENTS
+
+The authors acknowledge stimulating discussions with Dan Roberts, Marylou Gabrie, Anna Klimovskaia, Yann Ollivier and Joan Bruna.
+
+# REFERENCES
+
+Arjovsky, M., Shah, A., and Bengio, Y. (2015). Unitary evolution recurrent neural networks. CoRR, abs/1511.06464.
+Battaglia, P. W., Pascanu, R., Lai, M., Rezende, D. J., and Kavukcuoglu, K. (2016). Interaction networks for learning about objects, relations and physics. CoRR, abs/1612.00222.
+Brunton, S. L., Proctor, J. L., and Kutz, J. N. (2016). Discovering governing equations from data by sparse identification of nonlinear dynamical systems. Proceedings of the National Academy of Sciences, 113(15):3932-3937.
+Chang, B., Chen, M., Haber, E., and Chi, E. H. (2019). AntisymmetricRNN: A dynamical system view on recurrent neural networks. In International Conference on Learning Representations.
+Chang, M. B., Ullman, T., Torralba, A., and Tenenbaum, J. B. (2016). A compositional object-based approach to learning physical dynamics. CoRR, abs/1612.00341.
+Chen, T. Q., Rubanova, Y., Bettencourt, J., and Duvenaud, D. K. (2018a). Neural ordinary differential equations. In Bengio, S., Wallach, H., Larochelle, H., Grauman, K., Cesa-Bianchi, N., and Garnett, R., editors, Advances in Neural Information Processing Systems 31, pages 6571-6583. Curran Associates, Inc.
+Chen, Z., Raman, B., and Stern, A. (2018b). Structure-preserving numerical integrators for hodgkin-huxley-type systems.
+Greydanus, S., Dzamba, M., and Yosinski, J. (2019). Hamiltonian neural networks. arXiv preprint arXiv:1906.01563.
+Hairer, E. (1994). Backward analysis of numerical integrators and symplectic methods. Annals of Numerical Mathematics, 1:107-132. ID: unige:12640.
+Hairer, E., Lubich, C., and Wanner, G. (2002). Geometric Numerical Integration: Structure-Preserving Algorithms for Ordinary Differential Equations. Springer series in computational mathematics. Springer.
+Hairer, E., Nørsett, S. P., and Wanner, G. (2008). Solving Ordinary Differential Equations I: Nonstiff Problems. Springer Series in Computational Mathematics. Springer Berlin Heidelberg.
+Hairer, E. and Wanner, G. (2013). Solving Ordinary Differential Equations II: Stiff and Differential - Algebraic Problems. Springer Series in Computational Mathematics. Springer Berlin Heidelberg.
+Hochreiter, S. and Schmidhuber, J. (1997). Long short-term memory. *Neural Computation*, 9(8):1735-1780.
+Kingma, D. P. and Ba, J. (2014). Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980.
+
+Lambert, J. D. (1991). Numerical Methods for Ordinary Differential Systems: The Initial Value Problem. John Wiley & Sons, Inc., New York, NY, USA.
+Leimkuhler, B. and Reich, S. (2005). Simulating Hamiltonian Dynamics. Cambridge Monographs on Applied and Computational Mathematics. Cambridge University Press.
+Lutter, M., Ritter, C., and Peters, J. (2019). Deep lagrangian networks: Using physics as model prior for deep learning. In International Conference on Learning Representations.
+McLachlan, R. I., Perlmutter, M., and Quispel, G. R. W. (2004). On the nonlinear stability of symplectic integrators. BIT Numerical Mathematics, 44(1):99-117.
+Niu, M. Y., Horesh, L., and Chuang, I. (2019). Recurrent neural networks in the eye of differential equations. arXiv preprint arXiv:1904.12933.
+Peifer, M. and Timmer, J. (2007). Parameter estimation in ordinary differential equations for biochemical processes using the method of multiple shooting. The Institution of Engineering and Technology, Systems Biology.
+Stapor, P., Fröhlich, F., and Hasenauer, J. (2018). Optimization and profile calculation of ODE models using second order adjoint sensitivity analysis. *Bioinformatics*, 34(13):i151-i159.
+Tao, M. (2016). Explicit symplectic approximation of nonseparable hamiltonians: Algorithm and long time performance. Phys. Rev. E, 94:043303.
+Zhu, C., Byrd, R. H., Lu, P., and Nocedal, J. (1997). Algorithm 778: L-bfgs-b: Fortran subroutines for large-scale bound-constrained optimization. ACM Trans. Math. Softw., 23(4):550-560.
+
+# A EXPERIMENT SETUP
+
+# A.1 THE SPRING-CHAIN EXPERIMENT
+
+We set $\Delta t = 0.1$ . The ground truth trajectories in both training and testing are simulated by the leapfrog integrator using $\Delta t' = 0.001$ and coarsened into time-grids of 0.1 with a factor of 100, since simulating with a much smaller time-step leads to much more accurate solution, which we will treat as the ground truth solution.
+
+The O-NET that represents $f_{\theta}(p,q)$ is a one-hidden-layer MLP with 40 input units, 2048 hidden units and 40 output units. The H-NET that represents $H_{\theta}(p,q) = K_{\theta_1}(p) + V_{\theta_2}(q)$ consists of two one-hidden-layer MLPs, one for $K_{\theta_1}$ and the other for $V_{\theta_2}$ . Each of the MLPs have 20 input units, 2048 hidden units and 1 output unit. The vanilla RNN and LSTM models also have hidden states of size 2048. Implemented in PyTorch, the models are trained over 1000 epochs with the Adam optimizer (Kingma and Ba, 2014) with initial learning rate 0.001 and using the ReduceLROnPlateau scheduler4 with patience 15 and factor 0.7.
+
+# A.2 THE THREE-BODY EXPERIMENT
+
+The ground truth trajectories are simulated by SciPy's solve_ivp adaptive solver5 with method RK45. We coarse-grain the simulated ground truth trajectories into time-steps of $\Delta t = 1$ , so that the models developed in section 4 are numerically integrated with time-step $\Delta t = 1$ in both training and testing. We intentionally set the time-step to be relatively large, so that it becomes interesting to compare these models with a baseline method of simulating the true equations with time-step $\Delta t = 1$ . In addition, the training data consist of 100 sample trajectories of length $10 \cdot \Delta t = 10$ , which are then turned into 900 trajectories of length 2 and 600 trajectories of length 5, respectively for single-step and recurrent training, in the same way as for the spring-chain experiments above.
+
+The O-NET that represents $f_{\theta}(p,q)$ is a three-hidden-layer MLP with 12 input units, 512 hidden units in each hidden layer and 12 output units. The H-NET that represents $H_{\theta}(p,q) = K_{\theta_1}(p) + V_{\theta_2}(q)$ consists of two three-hidden-layer MLPs, one for $K_{\theta_1}$ and the other for $V_{\theta_2}$ . Each of the MLPs have 6 input units, 512 hidden units in each hidden layer and 1 output unit. The vanilla RNN and LSTM models also have hidden states of size 512. Implemented in PyTorch, the models are trained over 1000 epochs with the Adam optimizer with initial learning rate 0.0003 and using the ReduceLROnPlateau scheduler with patience 15 and factor 0.7.
+
+# A.3 THE HEAVY BILLLIARD EXPERIMENT
+
+The full image has size 128x128 pixels. The thickness of the wall is 12 pixels on each of the four sides, which leaves the free space of size 104x104 pixels in the middle for the billiard to move within. The billiard has size 3x3 pixels.
+
+The O-NET that represents $f_{\theta}(p,q)$ is a one-hidden-layer MLP with 4 input units, 32 hidden units and 4 output units. The H-NET that represents $H_{\theta}(p,q) = K_{\theta_1}(p) + V_{\theta_2}(q)$ consists of two one-hidden-layer MLPs, one for $K_{\theta_1}$ and the other for $V_{\theta_2}$ . Each of the MLPs have 2 input units, 32 hidden units and 1 output unit. The vanilla RNN model also has hidden states of size 32. For the rebound module, $\bar{n}$ is computed as the normalized output of a two-hidden-layer MLP, with 200 input units, 128 units in the first hidden layer, 32 units in the second hidden layer and 2 output units. $\alpha$ is also computed using a two-hidden-layer MLP, sharing the first hidden layer units with the MLP for $\bar{n}$ , and having 32 units in the second hidden layer and 1 output unit. $\gamma$ is computed by passing through sigmoid the output of a two-hidden-layer MLP, with 4 input units, 16 units in each hidden layer and 1 output unit. All of the activation functions are tanh except for the hidden-to-output activation in the MLP for $\alpha$ , where ReLU is used. Implemented in PyTorch, the models are trained over 1500 epochs with the Adam optimizer with initial learning rate 0.005 and using the ExponentialLR scheduler6 with decay factor 0.99 until the learning rate reaches 0.0001. We set $\Delta t = 0.1$ , and use 5000 trajectories of length $10 \cdot \Delta t = 1$ as training data, and 32 trajectories of length $60 \cdot \Delta t = 6$ as testing data.
+
+# B THE MAXIMUM LIKELIHOOD ESTIMATION PERSPECTIVE
+
+In the presence of noise, we can interpret the learning problem described in section 3.3 above from the perspective of maximum likelihood inference, which also provides justification for treating the initial states as trainable parameters. We define models as follow:
+
+$$
+\hat {z} _ {i} (\theta) = \operatorname {I n t e g r a t o r} \left(\hat {z} _ {0} = z _ {0}, f _ {\theta}, \left\{t _ {i} \right\} _ {i = 0} ^ {T}\right)
+$$
+
+$$
+q \left(z _ {i}; \theta\right) = \frac {1}{\sqrt {(2 \pi) ^ {d} \sigma^ {2 d}}} e ^ {- \| z _ {i} - \hat {z} _ {i} (\theta) \| _ {2} ^ {2} / \left(2 \sigma^ {2}\right)} \tag {10}
+$$
+
+$$
+P (\{z _ {i} \} _ {i = 1} ^ {n} | \theta) = \prod_ {i = 1} ^ {n} q (z _ {i}; \theta) = \frac {1}{(\sqrt {2 \pi \sigma^ {2}}) ^ {n d}} \prod_ {i = 1} ^ {n} e ^ {- \| z _ {i} - \hat {z} _ {i} (\theta) \| _ {2} ^ {2} / (2 \sigma^ {2})},
+$$
+
+and $\mathcal{L}(\theta|\{z_i\}_{i=1}^n) = P(\{z_i\}_{i=1}^n|\theta)$ is the likelihood function given the time-series data $\{z_i\}_{i=1}^n$ . Note that this model assumes independence between $z_i$ and $z_j$ for $i \neq j$ once $\theta$ is fixed.
+
+If we are to perform maximum likelihood inference, we arrive at the following:
+
+$$
+\max _ {\theta}: \log \mathcal {L} \left(\theta \mid \left\{z _ {i} \right\} _ {i = 1} ^ {n}\right) = - \frac {n d}{2} \log \left(2 \pi \sigma^ {2}\right) - \frac {1}{2 \sigma^ {2}} \sum_ {i = 1} ^ {n} \| z _ {i} - \hat {z} _ {i} (\theta) \| _ {2} ^ {2}, \tag {11}
+$$
+
+which is equivalent to
+
+$$
+\min _ {\theta} \sum_ {i = 1} ^ {n} \| z _ {i} - \hat {z} _ {i} (\theta) \| _ {2} ^ {2} \tag {12}
+$$
+
+This provides a motivation for using the $L^2$ loss, as we did in the experiments.
+
+So far, we consider $\theta$ as the only parameter of the model defined by equations 10, and therefore the only argument of the likelihood function, while $\hat{z}_0$ is fixed to be the observed initial state $z_0$ . As a generalization, we can consider a strictly larger family of models by allowing $z_0$ to vary as well. In this way, we treat both $\theta$ and $z_0$ as the parameters in the model and therefore arguments of the likelihood function that we optimize on. In other words, the model becomes
+
+$$
+\hat {z} _ {i} (\theta , \hat {z} _ {0}) = \operatorname {I n t e g r a t o r} \left(\hat {z} _ {0}, f _ {\theta}, \left\{t _ {i} \right\} _ {i = 0} ^ {T}\right)
+$$
+
+$$
+q \left(z _ {i}; \theta , \hat {z} _ {0}\right) = \frac {1}{\sqrt {\left(2 \pi\right) ^ {d} \sigma^ {2 d}}} e ^ {- \left\| z _ {i} - \hat {z} _ {i} \left(\theta , \hat {z} _ {0}\right) \right\| _ {2} ^ {2} / \left(2 \sigma^ {2}\right)} \tag {13}
+$$
+
+$$
+P (\{z _ {i} \} _ {i = 1} ^ {n} | \theta , \hat {z} _ {0}) = \prod_ {i = 1} ^ {n} q (z _ {i}; \theta) = \frac {1}{(\sqrt {2 \pi \sigma^ {2}}) ^ {n d}} \prod_ {i = 1} ^ {n} e ^ {- \| z _ {i} - \hat {z} _ {i} (\theta) \| _ {2} ^ {2} / (2 \sigma^ {2})},
+$$
+
+and the optimization problem becomes
+
+$$
+\min _ {\theta , \hat {z} _ {0}} \sum_ {i = 1} ^ {n} \| z _ {i} - \hat {z} _ {i} (\theta , \hat {z} _ {0}) \| _ {2} ^ {2}, \tag {14}
+$$
+
+which justifies optimizing over the initial states $p_0$ , $q_0$ in addition to the neural network parameters $\theta$ as described in the previous section.
+
+Such an interpretation is similar to approaches for parameter estimation in the literature of inverse problems and systems biology, though in those cases the parameters of interest appear directly in ODEs instead of via neural networks (Peifer and Timmer, 2007; Stapor et al., 2018). In particular, jointly optimizing the parameters in the model as well as the initial value is called the initial value approach. However, despite the success we demonstrate in section 4.2, two difficulties of this approach have been pointed out: 1) The optimization could converge to local minima; 2) The numerical solution of the ODE can be unstable (Peifer and Timmer, 2007). As explained in section 4.1, using HNN together with the leapfrog integrator mitigates the second issue. But what about the first issue? In particular, even if we assume that the optimization of the neural network can work "magically" well and do not suffer from bag local minima, what about optimizing the initial value $\hat{z}_0$ ?
+
+# C SYMPLECTICNESS AND INITIAL-STATE-OPTIMIZATION CONVEXITY
+
+The success of optimizing on the initial state of the system in addition to the recurrent H-NET and O-NET models as described in section 4.2 raises the following question: If we
+
+already have a relatively well-trained H-NET or O-NET, is the optimization on the initial values convex? We formalize the question below and provide a heuristic answer.
+
+For simplicity, we restrict our attention to autonomous ODEs, which means that the function $f$ in $\frac{dz}{dt} = f(z)$ does not depend on $t$ . Assuming existence and uniqueness of solutions, there exists a function $\phi_t$ that maps each initial state $\hat{z}_0$ to the state of the system after evolving from $\hat{z}_0$ for time $t$ , $\phi_t(\hat{z}_0)$ . This function is usually called the flow map. Flow maps have also been defined for numerical solutions of ODEs, by letting $\phi_t(\hat{z}_0) = \text{Integrator}(z_0, f, \{t_i\}_{i=0}^T)$ with $t_0 = 0$ . We can extend this definition to all the trainable models we have considered, including the models based on O-NET and H-NET by defining $\phi_t(\hat{z}_0)$ to be the state of the system after letting the system evolve from initial state $\hat{z}_0$ for time $t$ , for suitable choices of $t$ . For example, for O-NET, we have $\phi_t(\hat{z}_0) = \text{Integrator}(z_0, f_\theta, \{t_i\}_{i=0}^T)$ .
+
+Suppose we impose an L2 loss on $\phi_t(\hat{z}_0)$ , $e_t(\hat{z}_0) = \| \phi_t(\hat{z}_0) - z_t\|_2^2$ , where $z_t$ corresponds to the observed data at time $t$ . The question is, is $e_t(z)$ a (perhaps locally) convex function of $z$ , for what functions and numerical integrators? To understand convexity, we compute the gradient and the Hessian as follow.
+
+$$
+\frac {\partial}{\partial z} e _ {t} (z) = 2 \left(\phi_ {t} (z) - z _ {t}\right) ^ {\mathsf {T}} \cdot F _ {t} (z) \tag {15}
+$$
+
+$$
+\frac {\partial^ {2}}{\partial z ^ {2}} e _ {t} (z) = 2 \left(\phi_ {t} (z) - z _ {t}\right) \cdot {} ^ {(3)} G _ {t} (z) + F _ {t} (z) ^ {\intercal} \cdot F _ {t} (z), \tag {16}
+$$
+
+where $F_{t}(z)$ is the Jacobian matrix of the flow map, defined as $F_{t}(z)_{ij} = \frac{\partial}{\partial z_{j}} (\phi_{t}(z)_{i})$ , and $G_{t}(z)$ is a third-order tensor contains the second order derivatives of the flow map, defined as $G_{t}(z)_{ijk} = \frac{\partial^{2}}{\partial z_{i}z_{j}} (\phi_{t}(z)_{k})$ . We use $\cdot^{(3)}$ to denote the dot product in the third dimension.
+
+$F_{t}(z)^{\intercal} \cdot F_{t}(z)$ is symmetric positive semidefinite for any matrix $F_{t}(z)$ . If $\phi_t$ corresponds to either the exact flow map of a Hamiltonian system or the flow of a symplectic integrator, such as the leapfrog integrator, applied to a Hamiltonian system, then $F_{t}(z)$ is a symplectic matrix, implying that $\operatorname{det}(F_t(z)) = 1$ . Hence, $\operatorname{det}(F_t(z)^{\intercal} \cdot F_t(z)) = 1$ , which further implies that $F_{t}(z)^{\intercal} \cdot F_{t}(z)$ is a positive definite matrix. Therefore, non-rigorously, when $\| \phi_t(z) - z_t \|_2$ is small and so the first term on the right hand side of equation 16 is negligible compared to the least eigenvalue of $F_{t}(z)^{\intercal} \cdot F_{t}(z)$ , the entire Hessian matrix $\frac{\partial^2}{\partial z^2} e_t(z)$ is also positive definite, implying strong convexity of the optimization problem.
+
+If $\phi_t$ is the exact flow map, then $\| \phi_t(z) - z_t\|$ being small means that noise in the data is small. If $\phi_t$ is the flow map of a learned model, then it means that we have a model close to the true underlying system in addition to not having too much noise in the data. Translating back to the learning problem, we see that, heuristically, when the model we use is close to symplectic, which is likely if the underlying system is a Hamiltonian system, and trained to be close enough to the true underlying system, and the noise in the data is small enough, then the optimization problem on the initial state is strongly convex.
+
+# D ADDITIONAL PLOTS OF THE SPRING-CHAIN EXPERIMENTS
+
+# D.1 NOISELESS DATA (SECTION 4.1)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Figure 5: Extension of Figure 1 to 10 masses on the chain (1st being the closest to one end, and 10th being in the center).
+
+
+
+# D.2 NOISY DATA (SECTION 4.2)
+
+
+Figure 6: Single-step E-E O-NET
+
+
+Figure 7: Single-step E-E H-NET
+
+
+Figure 8: Single-step L-L O-NET
+
+
+Figure 9: Single-step L-L H-NET
+
+
+Figure 10: Recurrent E-E O-NET
+
+
+Figure 11: Recurrent E-E H-NET
+
+
+Figure 12: Recurrent L-L O-NET
+
+
+Figure 13: (SRNN) Recurrent L-L H-NET
+
+
+Figure 14: Recurrent E-E O-NET w/ ISO
+
+
+Figure 15: Recurrent E-E H-NET w/ ISO
+
+
+Figure 16: Recurrent L-L O-NET w/ ISO
+
+
+Figure 17: (SRNN-ISO) Recurrent L-L H-NET w/ ISO
+
+
+Figure 18: Vanilla RNN
+
+
+Figure 19: LSTM
+
+# E ADDITIONAL PLOTS OF THE THREE-BODY EXPERIMENTS
+
+In each of the plots below, the three dashdot curves represent the ground truth trajectories of the three masses, and the three sequences of dots are the predictions made by each method.
+
+
+
+
+
+
+
+
+Euler-Euler
+
+
+Euler-Leapfrog
+
+
+Leapfrog-Leapfrog
+
+
+Figure 20: Actual versus predicted trajectories of the three-body system by the various single-step-trained methods.
+
+
+
+
+
+
+Euler-Euler
+
+
+Euler-Leapfrog
+
+
+Leapfrog-Leapfrog
+
+
+Figure 21: Actual versus predicted trajectories of the three-body system by the various recurrently trained methods.
+
+
+Figure 22: Actual trajectory versus the trajectory simulated by the leapfrog integrator with time-step 1 (left) and 0.1 (right).
+
+# F ADDITIONAL PLOTS OF THE HEAVY BILLLIARD EXPERIMENT
+
+
+
+
+
+
+Figure 23: SRNN with a rebound module that does not learn $\alpha$ (and effectively treats $\alpha = 1$ ).
+
+
+
+
+
+
+
+
+Figure 24: SRNN without the rebound module.
+
+
+
+
+
+
+
+
+Figure 25: Recurrent L-L O-NET with the rebound module.
+
+
+
+
+
+
+
+
+Figure 26: Vanilla RNN.
+
+
\ No newline at end of file
diff --git a/symplecticrecurrentneuralnetworks/images.zip b/symplecticrecurrentneuralnetworks/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..e1a5a4d04839d6375772f3a86bbe4b4c2972b6a1
--- /dev/null
+++ b/symplecticrecurrentneuralnetworks/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f05797678ec580429f28dabdb2e3f165712f6274a6cf8aab623b4584c1e83f3d
+size 1295050
diff --git a/symplecticrecurrentneuralnetworks/layout.json b/symplecticrecurrentneuralnetworks/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..bc1cd0087b39fec0853a3d9671d0dd66e51d488b
--- /dev/null
+++ b/symplecticrecurrentneuralnetworks/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:6055d144516b89d4c9f9660600667b6a6624be63f53aa59a184387c2cdb49908
+size 672840
diff --git a/thebreakevenpointonoptimizationtrajectoriesofdeepneuralnetworks/ed38148b-aecd-400e-8f08-d7178e37e9eb_content_list.json b/thebreakevenpointonoptimizationtrajectoriesofdeepneuralnetworks/ed38148b-aecd-400e-8f08-d7178e37e9eb_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..bd6867a0d860388d4c7d54b28aaa456df8bd1c8a
--- /dev/null
+++ b/thebreakevenpointonoptimizationtrajectoriesofdeepneuralnetworks/ed38148b-aecd-400e-8f08-d7178e37e9eb_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c157a3cc7739050112e21dfe05a7b88c0e71d3545b9549a4bae9181d44530ddd
+size 124900
diff --git a/thebreakevenpointonoptimizationtrajectoriesofdeepneuralnetworks/ed38148b-aecd-400e-8f08-d7178e37e9eb_model.json b/thebreakevenpointonoptimizationtrajectoriesofdeepneuralnetworks/ed38148b-aecd-400e-8f08-d7178e37e9eb_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..1853d48c1a9cf8552c651585db4556339793ef79
--- /dev/null
+++ b/thebreakevenpointonoptimizationtrajectoriesofdeepneuralnetworks/ed38148b-aecd-400e-8f08-d7178e37e9eb_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f7933c0a77c1da18a060a01655c6928dfd86189018a73e6088943cb262810ffa
+size 152848
diff --git a/thebreakevenpointonoptimizationtrajectoriesofdeepneuralnetworks/ed38148b-aecd-400e-8f08-d7178e37e9eb_origin.pdf b/thebreakevenpointonoptimizationtrajectoriesofdeepneuralnetworks/ed38148b-aecd-400e-8f08-d7178e37e9eb_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..aa316f54d00c7ebde3954ac98a18cf1aaf3a3b23
--- /dev/null
+++ b/thebreakevenpointonoptimizationtrajectoriesofdeepneuralnetworks/ed38148b-aecd-400e-8f08-d7178e37e9eb_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:3ff13279b34913f9068ce5db991dc46422d86430c3351a8f9a42a09bcef8be6f
+size 9053499
diff --git a/thebreakevenpointonoptimizationtrajectoriesofdeepneuralnetworks/full.md b/thebreakevenpointonoptimizationtrajectoriesofdeepneuralnetworks/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..65253cbaf724c5b97fe3d7eeca7718e9ad05ca3d
--- /dev/null
+++ b/thebreakevenpointonoptimizationtrajectoriesofdeepneuralnetworks/full.md
@@ -0,0 +1,525 @@
+# THE BREAK-EVEN POINT ON OPTIMIZATION TRAJECTORIES OF DEEP NEURAL NETWORKS
+
+Stanisław Jastrzejski1, Maciej Szymczak2, Stanislav Fort3, Devansh Arpit4, Jacek Tabor2, Kyunghyun Cho1,5,6*, Krzysztof Geras1*
+
+$^{1}$ New York University, USA
+$^{2}$ Jagiellonian University, Poland
+3Stanford University, USA
+4Salesforce Research, USA
+$^{5}$ Facebook AI Research, USA
+$^{6}$ CIFAR Azrieli Global Scholar
+
+# ABSTRACT
+
+The early phase of training of deep neural networks is critical for their final performance. In this work, we study how the hyperparameters of stochastic gradient descent (SGD) used in the early phase of training affect the rest of the optimization trajectory. We argue for the existence of the "break-even" point on this trajectory, beyond which the curvature of the loss surface and noise in the gradient are implicitly regularized by SGD. In particular, we demonstrate on multiple classification tasks that using a large learning rate in the initial phase of training reduces the variance of the gradient, and improves the conditioning of the covariance of gradients. These effects are beneficial from the optimization perspective and become visible after the break-even point. Complementing prior work, we also show that using a low learning rate results in bad conditioning of the loss surface even for a neural network with batch normalization layers. In short, our work shows that key properties of the loss surface are strongly influenced by SGD in the early phase of training. We argue that studying the impact of the identified effects on generalization is a promising future direction.
+
+# 1 INTRODUCTION
+
+The connection between optimization and generalization of deep neural networks (DNNs) is not fully understood. For instance, using a large initial learning rate often improves generalization, which can come at the expense of the initial training loss reduction (Goodfellow et al., 2016; Li et al., 2019; Jiang et al., 2020). In contrast, using batch normalization layers typically improves both generalization and convergence speed of deep neural networks (Luo et al., 2019; Bjorck et al., 2018). These simple examples illustrate limitations of our understanding of DNNs.
+
+Understanding the early phase of training has recently emerged as a promising avenue for studying the link between optimization and generalization of DNNs. It has been observed that applying regularization in the early phase of training is necessary to arrive at a well generalizing final solution (Keskar et al., 2017; Sagun et al., 2017; Achille et al., 2017). Another observed phenomenon is that the local shape of the loss surface changes rapidly in the beginning of training (LeCun et al., 2012; Keskar et al., 2017; Achille et al., 2017; Jastrzebski et al., 2018; Fort & Ganguli, 2019). Theoretical approaches to understanding deep networks also increasingly focus on the early part of the optimization trajectory (Li et al., 2019; Arora et al., 2019).
+
+In this work, we study the dependence of the entire optimization trajectory on the early phase of training. We investigate noise in the mini-batch gradients using the covariance of gradients, $^{1}$ and the local curvature of the loss surface using the Hessian. These two matrices capture important and
+
+complementary aspects of optimization (Roux et al., 2008; Ghorbani et al., 2019) and generalization performance of DNNs (Jiang et al., 2020; Keskar et al., 2017; Bjorck et al., 2018; Fort et al., 2019). We include a more detailed discussion in Sec. 2.
+
+
+Figure 1: Visualization of the early part of the training trajectories on CIFAR-10 (before reaching $65\%$ training accuracy) of a simple CNN model optimized using SGD with learning rates $\eta = 0.01$ (red) and $\eta = 0.001$ (blue). Each model on the training trajectory, shown as a point, is represented by its test predictions embedded into a two-dimensional space using UMAP. The background color indicates the spectral norm of the covariance of gradients $\mathbf{K}(\lambda_K^1,$ left) and the training accuracy (right). For lower $\eta$ , after reaching what we call the break-even point, the trajectory is steered towards a region characterized by larger $\lambda_K^1$ (left) for the same training accuracy (right). See Sec. 4.1 for details. We also include an analogous figure for other quantities that we study in App. A.
+
+
+
+Our first contribution is a simplified model of the early part of the training trajectory of DNNs. Based on prior empirical work (Sagun et al., 2017), we assume that the local curvature of the loss surface (the spectral norm of the Hessian) increases or decreases monotonically along the optimization trajectory. Under this model, gradient descent reaches a point in the early phase of training at which it oscillates along the most curved direction of the loss surface. We call this point the break-even point and show empirical evidence of its existence in the training of actual DNNs.
+
+Our main contribution is to state and present empirical evidence for two conjectures about the dependence of the entire optimization trajectory on the early phase of training. Specifically, we conjecture that the hyperparameters of stochastic gradient descent (SGD) used before reaching the break-even point control: (1) the spectral norms of $\mathbf{K}$ and $\mathbf{H}$ , and (2) the conditioning of $\mathbf{K}$ and $\mathbf{H}$ . In particular, using a larger learning rate prior to reaching the break-even point reduces the spectral norm of $\mathbf{K}$ along the optimization trajectory (see Fig. 1 for an illustration of this phenomenon). Reducing the spectral norm of $\mathbf{K}$ decreases the variance of the mini-batch gradient, which has been linked to improved convergence speed (Johnson & Zhang, 2013).
+
+Finally, we apply our analysis to a network with batch normalization (BN) layers and find that our predictions are valid in this case as well. Delving deeper in this line of investigation, we show that using a large learning rate is necessary to reach better-conditioned (relatively to a network without BN layers) regions of the loss surface, which was previously attributed to BN alone (BJORCK et al., 2018; Ghorbani et al., 2019; Page, 2019).
+
+# 2 RELATED WORK
+
+Implicit regularization induced by the optimization method. The choice of the optimization method implicitly affects generalization performance of deep neural networks (Neyshabur, 2017). In particular, using a large initial learning rate is known to improve generalization (Goodfellow et al.,
+
+2016; Li et al., 2019). A classical approach to study these questions is to bound the generalization error using measures such as the norm of the parameters at the final minimum (Bartlett et al., 2017; Jiang et al., 2020).
+
+An emerging approach is to study the properties of the whole optimization trajectory. Arora et al. (2019) suggest it is necessary to study the optimization trajectory to understand optimization and generalization of deep networks. In a related work, Erhan et al. (2010); Achille et al. (2017) show the existence of a critical period of learning. Erhan et al. (2010) argue that training, unless pretraining is used, is sensitive to shuffling of examples in the first epochs of training. Achille et al. (2017); Golatkar et al. (2019); Sagun et al. (2017); Keskar et al. (2017) demonstrate that adding regularization in the beginning of training affects the final generalization disproportionately more compared to doing so later. We continue research in this direction and study how the choice of hyperparameters in SGD in the early phase of training affects the optimization trajectory in terms of the covariance of gradients, and the Hessian.
+
+The covariance of gradients and the Hessian. The Hessian quantifies the local curvature of the loss surface. Recent work has shown that the largest eigenvalues of $\mathbf{H}$ can grow quickly in the early phase of training (Keskar et al., 2017; Sagun et al., 2017; Fort & Scherlis, 2019; Jastrzebski et al., 2018). Keskar et al. (2017); Jastrzebski et al. (2017) studied the dependence of the Hessian (at the final minimum) on the optimization hyperparameters. The Hessian can be decomposed into two terms, where the dominant term (at least at the end of training) is the uncentered covariance of gradients $\mathbf{G}$ (Sagun et al., 2017; Papyan, 2019).
+
+The covariance of gradients, which we denote by $\mathbf{K}$ , encapsulates the geometry and the magnitude of variation in gradients across different samples. The matrix $\mathbf{K}$ was related to the generalization error in Roux et al. (2008); Jiang et al. (2020). Closely related quantities, such as the cosine alignment between gradients computed on different examples, were recently shown to explain some aspects of deep networks generalization (Fort et al., 2019; Liu et al., 2020; He & Su, 2020). Zhang et al. (2019) argues that in DNNs the Hessian and the covariance of gradients are close in terms of the largest eigenvalues.
+
+Learning dynamics of deep neural networks. Our theoretical model is motivated by recent work on learning dynamics of neural networks (Goodfellow et al., 2014; Masters & Luschi, 2018; Wu et al., 2018; Yao et al., 2018; Xing et al., 2018; Jastrzebski et al., 2018; Lan et al., 2019). We are directly inspired by Xing et al. (2018) who show that for popular classification benchmarks, the cosine of the angle between consecutive optimization steps in SGD is negative. Similar observations can be found in Lan et al. (2019). Our theoretical analysis is inspired by Wu et al. (2018) who study how SGD selects the final minimum from a stability perspective. We apply their methodology to the early phase of training, and make predictions about the entire training trajectory.
+
+# 3 THE BREAK-EVEN POINT AND THE TWO CONJECTURES ABOUT SGD TRAJECTORY
+
+Our overall motivation is to better understand the connection between optimization and generalization of DNNs. In this section we study how the covariance of gradients $(\mathbf{K})$ and the Hessian $(\mathbf{H})$ depend on the early phase of training. We are inspired by recent empirical observations showing their importance for optimization and generalization of DNNs (see Sec. 2 for a detailed discussion).
+
+Recent work has shown that in the early phase of training the gradient norm (Goodfellow et al., 2016; Fort & Ganguli, 2019; Liu et al., 2020) and the local curvature of the loss surface (Jastrzebski et al., 2018; Fort & Ganguli, 2019) can rapidly increase. Informally speaking, one scenario we study here is when this initial growth is rapid enough to destabilize training. Inspired by Wu et al. (2018), we formalize this intuition using concepts from dynamical stability. Based on the developed analysis, we state two conjectures about the dependence of $\mathbf{K}$ and $\mathbf{H}$ on hyperparameters of SGD, which we investigate empirically in Sec. 4.
+
+**Definitions.** We begin by introducing the notation. Let us denote the loss on an example $(\mathbf{x},y)$ by $\mathcal{L}(\mathbf{x},y;\theta)$ , where $\theta$ is a $D$ -dimensional parameter vector. The two key objects we study are the Hessian of the training loss $(\mathbf{H})$ , and the covariance of gradients $\mathbf{K} = \frac{1}{N}\sum_{i=1}^{N}(g_i - g)^T(g_i - g)$ ,
+
+where $g_{i} = g(\mathbf{x}_{\mathrm{i}},y_{i};\theta)$ is the gradient of $\mathcal{L}$ with respect to $\theta$ calculated on $i$ -th example, $N$ is the number of training examples, and $g$ is the full-batch gradient. We denote the $i$ -th normalized eigenvector and eigenvalue of a matrix $\mathbf{A}$ by $e_A^i$ and $\lambda_A^i$ . Both $\mathbf{H}$ and $\mathbf{K}$ are computed at a given $\theta$ , but we omit this dependence in the notation. Let $t$ index steps of optimization, and let $\theta (t)$ denote the parameter vector at optimization step $t$ .
+
+Inspired by Wu et al. (2018) we introduce the following condition to quantify stability at a given $\theta(t)$ . Let us denote the projection of parameters $\theta$ onto $e_H^1$ by $\psi = \langle \theta, e_H^1 \rangle$ . With a slight abuse of notation let $g(\psi) = \langle g(\theta), e_H^1 \rangle$ . We say SGD is unstable along $e_H^1$ at $\theta(t)$ if the norm of elements of sequence $\psi(\tau + 1) = \psi(\tau) - \eta g(\psi(\tau))$ diverges when $\tau \to \infty$ , where $\psi(0) = \theta(t)$ . The sequence $\psi(\tau)$ represents optimization trajectory in which every step $t' > t$ is projected onto $e_H^1$ .
+
+Assumptions. Based on recent empirical studies, we make the following assumptions.
+
+1. The loss surface projected onto $e_H^1$ is a quadratic one-dimensional function of the form $f(\psi) = \sum_{i=1}^{N} (\psi - \psi^*)^2 H_i$ . The same assumption was made in Wu et al. (2018), but for all directions in the weight space. Alain et al. (2019) show empirically that the loss averaged over all training examples is well approximated by a quadratic function along $e_H^1$ .
+2. The eigenvectors $e_H^1$ and $e_K^1$ are co-linear, i.e. $e_H^1 = \pm e_K^1$ , and $\lambda_K^1 = \alpha \lambda_H^1$ for some $\alpha \in \mathbb{R}$ . This is inspired by the fact that the top eigenvalues of $\mathbf{H}$ can be well approximated using $\mathbf{G}$ (non-centered $\mathbf{K}$ ) (Papyan, 2019; Sagun et al., 2017). Zhang et al. (2019) shows empirical evidence for co-linearity of the largest eigenvalues of $\mathbf{K}$ and $\mathbf{H}$ .
+3. If optimization is not stable along $e_H^1$ at a given $\theta(t)$ , $\lambda_H^1$ decreases in the next step, and the distance to the minimum along $e_H^1$ increases in the next step. This is inspired by recent work showing training can escape a region with too large curvature compared to the learning rate (Zhu et al., 2018; Wu et al., 2018; Jastrzebski et al., 2018).
+4. The spectral norm of $\mathbf{H}$ , $\lambda_H^1$ , increases during training and the distance to the minimum along $e_H^1$ decreases, unless increasing $\lambda_H^1$ would lead to entering a region where training is not stable along $e_H^1$ . This is inspired by (Keskar et al., 2017; Goodfellow et al., 2016; Sagun et al., 2017; Jastrzebski et al., 2018; Fort & Scherlis, 2019; Fort & Ganguli, 2019) who show that in many settings $\lambda_H^1$ or gradient norm increases in the beginning of training, while at the same time the overall training loss decreases.
+
+Finally, we also assume that $S \gg N$ , i.e. that the batch size is small compared to the number of training examples. These assumptions are only used to build a theoretical model for the early phase of training. Its main purpose is to make predictions about the training procedure that we test empirically in Sec. 4.
+
+Reaching the break-even point earlier for a larger learning rate or a smaller batch size. Let us restrict ourselves to the case when training is initialized at $\theta(0)$ at which SGD is stable along $e_H^1(0)$ . We aim to show that the learning rate $(\eta)$ and the batch size $(S)$ determine $\mathbf{H}$ and $\mathbf{K}$ in our model, and conjecture that the same holds empirically for realistic neural networks.
+
+Consider two optimization trajectories for $\eta_{1}$ and $\eta_{2}$ , where $\eta_{1} > \eta_{2}$ , that are initialized at the same $\theta_{0}$ , where optimization is stable along $e_{H}^{1}(t)$ and $\lambda_H^1 (t) > 0$ . Under Assumption 1 the loss surface along $e_H^1 (t)$ can be expressed as $f(\psi) = \sum_{i = 1}^{N}(\psi -\psi^{*})^{2}H_{i}(t)$ , where $H_{i}(t)\in \mathbb{R}$ . It can be shown that at any iteration $t$ the necessary and sufficient condition for SGD to be stable along $e_H^1 (t)$ is:
+
+$$
+\left(1 - \eta \lambda_ {H} ^ {1} (t)\right) ^ {2} + s (t) ^ {2} \frac {\eta^ {2} (N - S)}{S (N - 1)} \leq 1, \tag {1}
+$$
+
+where $N$ is the training set size and $s(t)^2 = \mathrm{Var}[H_i(t)]$ over the training examples. A proof can be found in (Wu et al., 2018). We call this point on the trajectory on which the LHS of Eq. 1 becomes equal to 1 for the first time the break-even point. By definition, there exists only a single break-even point on the training trajectory.
+
+Under Assumption 3, $\lambda_H^1 (t)$ and $\lambda_K^1 (t)$ increase over time. If $S = N$ , the break-even point is reached at $\lambda_H^1 (t) = \frac{2}{\eta}$ . More generally, it can be shown that for $\eta_{1}$ , the break-even point is reached
+
+for a lower magnitude of $\lambda_H^1 (t)$ than for $\eta_{2}$ . The same reasoning can be repeated for $S$ (in which case we assume $N\gg S$ ). We state this formally and prove in App. B.
+
+Under Assumption 4, after passing the break-even point on the training trajectory, SGD does not enter regions where either $\lambda_H^1$ or $\lambda_K^1$ is larger than at the break-even point, as otherwise it would lead to increasing one of the terms in LHS of Eq. 1, and hence losing stability along $e_H^1$ .
+
+Two conjectures about real DNNs. Assuming that real DNNs reach the break-even point, we make the following two conjectures about their optimization trajectory.
+
+The most direct implication of reaching the break-even point is that $\lambda_K^1$ and $\lambda_H^1$ at the break-even point depend on $\eta$ and $S$ , which we formalize as:
+
+Conjecture 1 (Variance reduction effect of SGD). Along the SGD trajectory, the maximum attained values of $\lambda_H^1$ and $\lambda_K^1$ are smaller for a larger learning rate or a smaller batch size.
+
+We refer to Conjecture 1 as variance reduction effect of SGD because reducing $\lambda_K^1$ can be shown to reduce the $L_{2}$ distance between the full-batch gradient, and the mini-batch gradient. We expect that similar effects exist for other optimization or regularization methods. We leave investigating them for future work.
+
+Next, we make another, stronger, conjecture. It is plausible to assume that reaching the break-even point affects to a lesser degree $\lambda_H^i$ and $\lambda_K^i$ for $i\neq 1$ because increasing their values does not impact stability along $e_H^1$ . Based on this we conjecture that:
+
+Conjecture 2 (Pre-conditioning effect of SGD). Along the SGD trajectory, the maximum attained values of $\frac{\lambda_K^*}{\lambda_K^*}$ and $\frac{\lambda_H^*}{\lambda_H^*}$ are larger for a larger learning rate or a smaller batch size, where $\lambda_K^*$ and $\lambda_H^*$ are the smallest non-zero eigenvalues of $\mathbf{K}$ and $\mathbf{H}$ , respectively. Furthermore, the maximum attained values of $\operatorname{Tr}(\mathbf{K})$ and $\operatorname{Tr}(\mathbf{H})$ are smaller for a larger learning rate or a smaller batch size.
+
+We consider non-zero eigenvalues in the conjecture, because $\mathbf{K}$ has at most $N - 1$ non-zero eigenvalues, where $N$ is the number of training points, which can be much smaller than $D$ in overparametrized DNNs. Both conjectures are valid only for learning rates and batch sizes that guarantee that training converges.
+
+From the optimization perspective, the effects discussed above are desirable. Many papers in the optimization literature underline the importance of reducing the variance of the mini-batch gradient (Johnson & Zhang, 2013) and the conditioning of the covariance of gradients (Roux et al., 2008). There also exists a connection between these effects and generalization (Jiang et al., 2020), which we discuss towards the end of the paper.
+
+# 4 EXPERIMENTS
+
+In this section we first analyse learning dynamics in the early phase of training. Next, we empirically investigate the two conjectures. In the final part we extend our analysis to a neural network with batch normalization layers.
+
+We run experiments on the following datasets: CIFAR-10 (Krizhevsky, 2009), IMDB dataset (Maas et al., 2011), ImageNet (Deng et al., 2009), and MNLI (Williams et al., 2018). We apply to these datasets the following architectures: a vanilla CNN (SimpleCNN) following Keras example (Chollet et al., 2015), ResNet-32 (He et al., 2015), LSTM (Hochreiter & Schmidhuber, 1997), DenseNet (Huang et al., 2016), and BERT (Devlin et al., 2018). We also include experiments using a multi-layer perceptron trained on the FashionMNIST dataset (Xiao et al., 2017) in the Appendix. All experimental details are described in App. D.
+
+Following Dauphin et al. (2014); Alain et al. (2019), we estimate the top eigenvalues and eigenvectors of $\mathbf{H}$ on a small subset of the training set (e.g. $5\%$ in the case of CIFAR-10) using the Lanczos algorithm (Lanczos, 1950). As computing the full eigenspace of $\mathbf{K}$ is infeasible for real DNNs, we compute the covariance using mini-batch gradients. In App. C we show empirically that (after normalization) this approximates well the largest eigenvalue, and we include other details on computing the eigenspaces.
+
+
+Figure 2: The spectral norm of $\mathbf{H}(\lambda_H^1,$ left) and $\Delta \mathcal{L}$ (difference in the training loss computed between two consecutive steps, right) versus $\lambda_K^1$ at different training iterations. Experiment was performed with SimpleCNN on the CIFAR-10 dataset with two different learning rates (color). Consistently with our theoretical model, $\lambda_K^1$ is correlated initially with $\lambda_H^1$ , and training is generally stable $(\Delta \mathcal{L} > 0)$ prior to achieving the maximum value of $\lambda_K^1$ .
+
+
+
+
+Figure 3: The spectrum of $\mathbf{K}$ (left) and $\mathbf{H}$ (right) at the training iteration corresponding to the largest value of $\lambda_{K}^{1}$ and $\lambda_{H}^{1}$ , respectively. Experiment was performed with SimpleCNN on the CIFAR-10 dataset with two different learning rates (color). Consistently with Conjecture 2, training with lower learning rate results in finding a region of the loss surface characterized by worse conditioning of $\mathbf{K}$ and $\mathbf{H}$ (visible in terms of the large number of "spikes" in the spectrum, see also Fig. 4).
+
+
+
+# 4.1 A CLOSER LOOK AT THE EARLY PHASE OF TRAINING
+
+First, we examine the learning dynamics in the early phase of training. Our goal is to verify some of the assumptions made in Sec. 3. We analyse the evolution of $\lambda_H^1$ and $\lambda_K^1$ when using $\eta = 0.01$ and $\eta = 0.001$ to train SimpleCNN on the CIFAR-10 dataset. We repeat this experiment 5 times using different random initializations of network parameters.
+
+Visualizing the break-even point. We visualize the early part of the optimization trajectory in Fig. 1. Following Erhan et al. (2010), we embed the test set predictions at each step of training of SimpleCNN using UMAP (McInnes et al., 2018). The background color indicates $\lambda_{K}^{1}$ (left) and the training accuracy (right) at the iteration with the closest embedding in Euclidean distance.
+
+We observe that the trajectory corresponding to the lower learning rate reaches regions of the loss surface characterized by larger $\lambda_K^1$ , compared to regions reached at the same training accuracy in the second trajectory. Additionally, in Fig. 3 we plot the spectrum of $\mathbf{K}$ (left) and $\mathbf{H}$ (right) at the iterations when $\lambda_K$ and $\lambda_H$ respectively reach the highest values. We observe more outliers for the lower learning rate in the distributions of both $\lambda_K$ and $\lambda_H$ .
+
+Are $\lambda_K^1$ and $\lambda_H^1$ correlated in the beginning of training? The key assumption behind our theoretical model is that $\lambda_K^1$ and $\lambda_H^1$ are correlated, at least prior to reaching the break-even point. We confirm this in Fig. 2. The highest achieved $\lambda_K^1$ and $\lambda_H^1$ are larger for the smaller $\eta$ . Additionally, we observe that after achieving the highest value of $\lambda_H^1$ , further growth of $\lambda_K^1$ does not translate to an increase of $\lambda_H^1$ . This is expected as $\lambda_H^1$ decays to 0 when the mean loss decays to 0 for cross entropy loss (Martens, 2016).
+
+Does training become increasingly unstable in the early phase of training? According to Assumption 3, an increase of $\lambda_K^1$ and $\lambda_H^1$ translates into a decrease in stability, which we formalized as stability along $e_H^1$ . Computing stability along $e_H^1$ directly is computationally expensive. Instead, we measure a more tractable proxy. At each iteration we measure the loss on the training set before and
+
+
+(a) SimpleCNN trained on the CIFAR-10 dataset.
+
+
+
+
+
+
+
+
+(b) ResNet-32 trained on the CIFAR-10 dataset.
+
+
+
+
+
+
+
+
+
+
+(c) LSTM trained on the IMDB dataset.
+
+
+Figure 4: The variance reduction and the pre-conditioning effect of SGD in various settings. The optimization trajectories corresponding to higher learning rates $(\eta)$ or lower batch sizes $(S)$ are characterized by lower maximum $\lambda_{K}^{1}$ (the spectral norm of the covariance of gradients) and larger maximum $\lambda_{K}^{*} / \lambda_{K}^{1}$ (the condition number of the covariance of gradients). Vertical lines mark epochs at which the training accuracy is larger (for the first time) than a manually picked threshold, which illustrates that the effects are not explained by differences in training speeds.
+
+
+
+after taking the step, which we denote as $\Delta \mathcal{L}$ (a positive value indicates a reduction of the training loss). In Fig. 2 we observe that training becomes increasingly unstable ( $\Delta \mathcal{L}$ starts to take negative values) as $\lambda_K^1$ reaches the maximum value.
+
+Summary. We have shown that the early phase of training is consistent with the assumptions made in our theoretical model. That is, $\lambda_K^1$ and $\lambda_H^1$ increase approximately proportionally to each other, which is also generally correlated with a decrease of a proxy of stability. Finally, we have shown qualitatively reaching the break-even point.
+
+# 4.2 THE VARIANCE REDUCTION AND THE PRE-CONDITIONING EFFECT OF SGD
+
+In this section we test empirically Conjecture 1 and Conjecture 2. For each model we manually pick a suitable range of learning rates and batch sizes to ensure that the properties of $\mathbf{K}$ and $\mathbf{H}$ that we study have converged under a reasonable computational budget. We mainly focus on studying the covariance of gradients $(\mathbf{K})$ , and leave a closer investigation of the Hessian for future work. We use the batch size of 128 to compute $\mathbf{K}$ when we vary the batch size for training. When we vary the learning rate instead, we use the same batch size as the one used to train the model. App. C describes the remaining details on how we approximate the eigenspaces of $\mathbf{K}$ and $\mathbf{H}$ .
+
+We summarize the results for SimpleCNN, ResNet-32, LSTM, BERT, and DenseNet in Fig. 4, Fig. 5, and Fig. 6. Curves are smoothed using moving average for clarity. Training curves and additional experiments are reported in App. E.
+
+Testing Conjecture 1. To test Conjecture 1, we examine the highest value of $\lambda_K^1$ observed along the optimization trajectory. As visible in Fig. 4, using a higher $\eta$ results in $\lambda_K^1$ achieving a lower
+
+
+(a) Varying the learning rate.
+
+
+(b) Varying the batch size.
+Figure 5: The variance reduction effect of SGD, for ResNet-32 and SimpleCNN. Trajectories corresponding to higher learning rates $(\eta, \text{left})$ or smaller batch sizes $(S, \text{right})$ are characterized by a lower maximum $\lambda_H^1$ (the spectral norm of the Hessian) along the trajectory. Vertical lines mark epochs at which the training accuracy is larger (for the first time) than a manually picked threshold.
+
+maximum during training. Similarly, we observe that using a higher $S$ in SGD leads to reaching a higher maximum value of $\lambda_K^1$ . For instance, for SimpleCNN (top row of Fig. 4) we observe $\max(\lambda_K^1) = 0.68$ and $\max(\lambda_K^1) = 3.30$ for $\eta = 0.1$ and $\eta = 0.01$ , respectively.
+
+Testing Conjecture 2. To test Conjecture 2, we compute the maximum value of $\lambda_K^* / \lambda_K^1$ along the optimization trajectory. It is visible in Fig. 4 that using a higher $\eta$ results in reaching a larger maximum value of $\lambda_K^* / \lambda_K^1$ along the trajectory. For instance, in the case of SimpleCNN $\max(\lambda_K^* / \lambda_K^1) = 0.37$ and $\max(\lambda_K^* / \lambda_K^1) = 0.24$ for $\eta = 0.1$ and $\eta = 0.01$ , respectively.
+
+A counter-intuitive effect of decreasing the batch size. Consistently with Conjecture 2, we observe that the maximum value of $\mathrm{Tr}(\mathbf{K})$ is smaller for the smaller batch size. In the case of SimpleCNN $\max (\mathrm{Tr}(\mathbf{K})) = 5.56$ and $\max (\mathrm{Tr}(\mathbf{K})) = 10.86$ for $S = 10$ and $S = 100$ , respectively. Due to space constraints we report the effect of $\eta$ and $S$ on $\mathrm{Tr}(\mathbf{K})$ in other settings in App. E.
+
+This effect is counter-intuitive because $\mathrm{Tr}(\mathbf{K})$ is proportional to the variance of the mini-batch gradient (see also App. C). Naturally, using a lower batch size generally increases the variance of the mini-batch gradient, and $\mathrm{Tr}(\mathbf{K})$ . This apparent contradiction is explained by the fact that we measure $\mathrm{Tr}(\mathbf{K})$ using a different batch size (128) than the one used to train the model. Hence, decreasing the batch size both increases (due to approximating the gradient using fewer samples) and decreases (as predicted in Conjecture 2) the variance of the mini-batch gradient along the optimization trajectory.
+
+How early in training is the break-even point reached? We find that $\lambda_K^1$ and $\lambda_H^1$ reach their highest values early in training, close to reaching $60\%$ training accuracy on CIFAR-10, and $75\%$ training accuracy on IMDB. The training and validation accuracies are reported for all the experiments in App. E. This suggests that the break-even point is reached early in training.
+
+The Hessian. In the above, we have focused on the covariance of gradients. In Fig. 5 we report how $\lambda_H^1$ depends on $\eta$ and $S$ for ResNet-32 and SimpleCNN. Consistently with prior work (Keskar et al., 2017; Jastrzebski et al., 2018), we observe that using a smaller $\eta$ or using a larger $S$ coincides with a larger maximum value of $\lambda_H^1$ . For instance, for SimpleCNN we observe $\max (\lambda_H^1) = 26.27$ and $\max (\lambda_H^1) = 211.17$ for $\eta = 0.1$ and $\eta = 0.01$ , respectively. We leave testing predictions made in Conjecture 2 about the Hessian for future work.
+
+Larger scale studies. Finally, we test the two conjectures in two larger scale settings: BERT fine-tuned on the MNLI dataset, and DenseNet trained on the ImageNet dataset. Due to memory constraints, we only vary the learning rate. We report results in Fig. 6. We observe that both conjectures hold in these two settings. It is worth noting that DenseNet uses batch normalization layers. In the next section we investigate closer batch-normalized networks.
+
+Summary. In this section we have shown evidence supporting the variance reduction (Conjecture 1) and the pre-conditioning effect (Conjecture 2) of SGD in a range of classification tasks. We also found that the above conclusions hold for MLP trained on the Fashion MNIST dataset, SGD with momentum, and SGD with learning rate decay. We include these results in App. E-G.
+
+
+(a) BERT trained on the MNLI dataset.
+
+
+(b) DenseNet trained on the ImageNet dataset.
+Figure 6: The variance reduction and the pre-conditioning effect of SGD, demonstrated on two larger scale settings: BERT on the MNLI dataset (left), and DenseNet on the ImageNet dataset (right). For each setting we report $\lambda_K^1$ (left) and $\lambda_K^* / \lambda_K^1$ (right). Vertical lines mark epochs at which the training accuracy is larger (for the first time) than a manually picked threshold.
+
+# 4.3 IMPORTANCE OF LEARNING RATE FOR CONDITIONING IN NETWORKS WITH BATCH NORMALIZATION LAYERS
+
+
+(a) Left to right: $\frac{\|g\|}{\|g_5\|}$ for SimpleCNN-BN, $\frac{\|g\|}{\|g_5\|}$ for SimpleCNN, $\lambda_H^1$ for SimpleCNN-BN, and $\lambda_K^1$ for SimpleCNN-BN.
+
+
+- $\eta = 0.001$ - $\eta = 0.010$ - $\eta = 0.100$ - $\eta = 1.000$
+
+
+
+
+
+
+$\eta = 0.001$
+
+
+$\eta = 0.010$ $\eta = 0.100$
+
+
+- $\eta = 1.000$
+(b) Left to right: $\| \gamma \|$ of the last layer, $\lambda_K^1$ , and $\lambda_K^* / \lambda_K^1$ . All for SimpleCNN-BN.
+Figure 7: The effect of changing the learning rate on various metrics (see text for details) for SimpleCNN with and without batch normalization layers (SimpleCNN-BN and SimpleCNN).
+
+The loss surface of deep neural networks has been widely reported to be ill-conditioned (LeCun et al., 2012; Martens, 2016). Recently, Ghorbani et al. (2019); Page (2019) argued that the key reason behind the efficacy of batch normalization (Ioffe & Szegedy, 2015) is improving conditioning of the loss surface. In Conjecture 2 we suggest that using a high $\eta$ (or a small $S$ ) results in improving the conditioning of $\mathbf{K}$ and $\mathbf{H}$ . A natural question that we investigate in this section is how the two phenomena are related. We study here the effect of learning rate, and report in App. H an analogous study for batch size.
+
+Are the two conjectures valid in networks with batch normalization layers? First, to investigate whether our conjectures hold in networks with batch normalization layers, we run similar experiments as in Sec. 4.2 with a SimpleCNN model with batch normalization layers inserted after each layer (SimpleCNN-BN), on the CIFAR-10 dataset. We test $\eta \in \{0.001, 0.01, 0.1, 1.0\}$ (using $\eta = 1.0$ leads to divergence of SimpleCNN without BN). We summarize the results in Fig. 7. We observe that the evolution of $\lambda_{K}^{*} / \lambda_{K}^{1}$ and $\lambda_{K}^{1}$ is consistent with both Conjecture 1 and Conjecture 2.
+
+A closer look at the early phase of training. To further corroborate that our analysis applies to networks with batch normalization layers, we study the early phase of training of SimpleCNN-BN, complementing the results in Sec. 4.1.
+
+We observe in Fig. 7 (bottom) that training of SimpleCNN-BN starts in a region characterized by a relatively high $\lambda_{K}^{1}$ . This is consistent with prior work showing that networks with batch normalization layers can exhibit gradient explosion in the first iteration (Yang et al., 2019). The value of $\lambda_{K}^{1}$ then decays for all but the lowest $\eta$ . This behavior is consistent with our theoretical model. We also track the norm of the scaling factor in the batch normalization layers, $\| \gamma \|$ , in the last layer of the network in Fig. 7 (bottom). It is visible that $\eta = 1.0$ and $\eta = 0.1$ initially decrease the value of $\| \gamma \|$ which we hypothesize to be one of the mechanisms due to which high $\eta$ steers optimization towards better conditioned regions of the loss surface in batch-normalized networks. Interestingly, this seems consistent with Luo et al. (2019) who argue that using mini-batch statistics in batch normalization acts as an implicit regularizer by reducing $\| \gamma \|$ .
+
+Using batch normalization requires using a high learning rate. As our conjectures hold for SimpleCNN-BN, a natural question is if the loss surface can be ill-conditioned with a low learning rate even when batch normalization is used. Ghorbani et al. (2019) show that without batch normalization, mini-batch gradients are largely contained in the subspace spanned by the top eigenvectors of noncentered $\mathbf{K}$ . To answer this question we track $\| g\| /\| g_5\|$ , where $g$ denotes the mini-batch gradient, and $g_{5}$ denotes the mini-batch gradient projected onto the top 5 eigenvectors of $\mathbf{K}$ . A value of $\| g\| /\| g_5\|$ close to 1 implies that the mini-batch gradient is mostly contained in the subspace spanned by the top 5 eigenvectors of $\mathbf{K}$ .
+
+We compare two settings: SimpleCNN-BN optimized with $\eta = 0.001$ , and SimpleCNN optimized with $\eta = 0.01$ . We make three observations. First, the maximum and minimum values of $\| g \| / \| g_5 \|$ are 1.90 (1.37) and 2.02 (1.09), respectively. Second, the maximum and minimum values of $\lambda_K^1$ are 12.05 and 3.30, respectively. Finally, $\lambda_K^* / \lambda_K^1$ reaches 0.343 in the first setting, and 0.24 in the second setting. Comparing these differences to differences that are induced by using the highest $\eta = 1.0$ in SimpleCNN-BN, we can conclude that using a large learning rate is necessary to observe the effect of loss smoothing which was previously attributed to batch normalization alone (Ghorbani et al., 2019; Page, 2019; Bjorck et al., 2018). This might be directly related to the result that using a high learning rate is necessary to achieve good generalization when using batch normalization layers (Bjorck et al., 2018).
+
+Summary. We have shown that the effects of the learning rate predicted in Conjecture 1 and Conjecture 2 hold for a network with batch normalization layers, and that using a high learning rate is necessary in a network with batch normalization layers to improve conditioning of the loss surface, compared to conditioning of the loss surface in the same network without batch normalization layers.
+
+# 5 CONCLUSION
+
+Based on our theoretical model, we argued for the existence of the break-even point on the optimization trajectory induced by SGD. We presented evidence that hyperparameters used in the early phase of training control the spectral norm and the conditioning of $\mathbf{K}$ (a matrix describing noise in the mini-batch gradients) and $\mathbf{H}$ (a matrix describing local curvature of the loss surface) after reaching the break-even point. In particular, using a large initial learning rate steers training to better conditioned regions of the loss surface, which is beneficial from the optimization point of view.
+
+A natural direction for the future is connecting our observations to recent studies on the relation of measures, such as gradient variance, to the generalization of deep networks (Li et al., 2019; Jiang et al., 2020; Fort et al., 2019). Our work shows that the hyperparameters of SGD control these measures after the break-even point. Another interesting direction is to understand the connection between the existence of the break-even point and the existence of the critical learning period in training of DNNs (Achille et al., 2017).
+
+# ACKNOWLEDGMENTS
+
+KC thanks NVIDIA and eBay for their support. SJ thanks Amos Storkey and Luke Darlow for fruitful discussions.
+
+# REFERENCES
+
+Alessandro Achille, Matteo Rovere, and Stefano Soatto. Critical learning periods in deep neural networks. CoRR, abs/1711.08856, 2017.
+Guillaume Alain, Nicolas Le Roux, and Pierre-Antoine Manzagol. Negative eigenvalues of the hessian in deep neural networks. CoRR, abs/1902.02366, 2019.
+Sanjeev Arora, Nadav Cohen, Noah Golowich, and Wei Hu. A convergence analysis of gradient descent for deep linear neural networks. In International Conference on Learning Representations, 2019.
+Peter L Bartlett, Dylan J Foster, and Matus J Telgarsky. Spectrally-normalized margin bounds for neural networks. In Advances in Neural Information Processing Systems. 2017.
+Nils Bjorck, Carla P Gomes, Bart Selman, and Kilian Q Weinberger. Understanding batch normalization. In Advances in Neural Information Processing Systems. 2018.
+François Chollet et al. Keras, 2015.
+Yann N. Dauphin, Razvan Pascanu, Caglar Güçehre, Kyunghyun Cho, Surya Ganguli, and Yoshua Bengio. Identifying and attacking the saddle point problem in high-dimensional non-convex optimization. CoRR, abs/1406.2572, 2014.
+J. Deng, W. Dong, R. Socher, L.-J. Li, K. Li, and L. Fei-Fei. ImageNet: A Large-Scale Hierarchical Image Database. In CVPR09, 2009.
+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.
+Dumitru Erhan, Yoshua Bengio, Aaron Courville, Pierre-Antoine Manzagol, Pascal Vincent, and Samy Bengio. Why does unsupervised pre-training help deep learning? J. Mach. Learn. Res., 2010.
+Stanislav Fort and Surya Ganguli. Emergent properties of the local geometry of neural loss landscapes. arXiv preprint arXiv:1910.05929, 2019.
+Stanislav Fort and Adam Scherlis. The goldilocks zone: Towards better understanding of neural network loss landscapes. In Proceedings of the AAAI Conference on Artificial Intelligence, 2019.
+Stanislav Fort, Paweł Krzysztof Nowak, Stanisław Jastrzebski, and Srini Narayanan. Stiffness: A new perspective on generalization in neural networks. arXiv preprint arXiv:1901.09491, 2019.
+Behrooz Ghorbani, Shankar Krishnan, and Ying Xiao. An investigation into neural net optimization via hessian eigenvalue density. In Proceedings of the 36th International Conference on Machine Learning, 2019.
+Aditya Golatkar, Alessandro Achille, and Stefano Soatto. Time Matters in Regularizing Deep Networks: Weight Decay and Data Augmentation Affect Early Learning Dynamics, Matter Little Near Convergence. arXiv preprint arXiv:1905.13277, 2019.
+Ian Goodfellow, Yoshua Bengio, and Aaron Courville. Deep Learning. 2016.
+Ian J. Goodfellow, Oriol Vinyals, and Andrew M. Saxe. Qualitatively characterizing neural network optimization problems. arXiv preprint arXiv:1412.6544, 2014.
+Hangfeng He and Weijie Su. The local elasticity of neural networks. In International Conference on Learning Representations, 2020.
+Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2015.
+Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural Comput., 1997.
+Gao Huang, Zhuang Liu, and Kilian Q. Weinberger. Densely connected convolutional networks. CoRR, abs/1608.06993, 2016.
+
+Sergey Ioffe and Christian 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, 2015.
+Stanislaw Jastrzebski, Zachary Kenton, Devansh Arpit, Nicolas Ballas, Asja Fischer, Yoshua Bengio, and Amos J. Storkey. Three factors influencing minima in SGD. CoRR, abs/1711.04623, 2017.
+Stanislaw Jastrzebski, Zachary Kenton, Nicolas Ballas, Asja Fischer, Yoshua Bengio, and Amos Storkey. On the Relation Between the Sharpest Directions of DNN Loss and the SGD Step Length. arXiv preprint arXiv: 1807.0531, 2018.
+Yiding Jiang, Behnam Neyshabur, Dilip Krishnan, Hossein Mobahi, and Samy Bengio. *Fantastic generalization measures and where to find them.* In International Conference on Learning Representations, 2020.
+Rie Johnson and Tong Zhang. Accelerating stochastic gradient descent using predictive variance reduction. In Advances in Neural Information Processing Systems 26. 2013.
+Nitish Shirish Keskar, Dheevatsa Mudigere, Jorge Nocedal, Mikhail Smelyanskiy, and Ping Tak Peter Tang. On large-batch training for deep learning: Generalization gap and sharp minima. In 5th International Conference on Learning Representations, ICLR, 2017.
+Alex Krizhevsky. Learning multiple layers of features from tiny images. Technical report, 2009.
+Janice Lan, Rosanne Liu, Hattie Zhou, and Jason Yosinski. LCA: Loss Change Allocation for Neural Network Training. arXiv preprint arXiv:1909.01440, 2019.
+Cornelius Lanczos. An iteration method for the solution of the eigenvalue problem of linear differential and integral operators. J. Res. Natl. Bur. Stand. B, 1950.
+Yann LeCun, Léon Bottou, Genevieve B. Orr, and Klaus-Robert Müller. Efficient backprop. In Neural Networks: Tricks of the Trade (2nd ed.). 2012.
+Yuanzhi Li, Colin Wei, and Tengyu Ma. Towards explaining the regularization effect of initial large learning rate in training neural networks. In Advances in Neural Information Processing Systems. 2019.
+Jinlong Liu, Yunzhi Bai, Guoqing Jiang, Ting Chen, and Huayan Wang. Understanding why neural networks generalize well through gsnr of parameters. In International Conference on Learning Representations, 2020.
+Ping Luo, Xinjiang Wang, Wenqi Shao, and Zhanglin Peng. Towards understanding regularization in batch normalization. In International Conference on Learning Representations, 2019.
+Andrew L. Maas, Raymond E. Daly, Peter T. Pham, Dan Huang, Andrew Y. Ng, and Christopher Potts. Learning word vectors for sentiment analysis. In Proceedings of the 49th Annual Meeting of the Association for Computational Linguistics: Human Language Technologies, 2011.
+James Martens. Second-order optimization for neural networks. University of Toronto (Canada), 2016.
+Dominic Masters and Carlo Luschi. Revisiting small batch training for deep neural networks. CoRR, abs/1804.07612, 2018.
+Leland McInnes, John Healy, Nathaniel Saul, and Lukas Grossberger. Umap: Uniform manifold approximation and projection. The Journal of Open Source Software, 2018.
+Behnam Neyshabur. Implicit regularization in deep learning. CoRR, abs/1709.01953, 2017.
+David Page. How to train your resnet 7: Batch norm. 2019.
+Vardan Papyan. Measurements of three-level hierarchical structure in the outliers in the spectrum of deepnet hESSians. CoRR, abs/1901.08244, 2019.
+
+Nicolas L. Roux, Pierre antoine Manzagol, and Yoshua Bengio. Topmoumoute online natural gradient algorithm. In Advances in Neural Information Processing Systems. 2008.
+Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, Alexander C. Berg, and Li Fei-Fei. ImageNet Large Scale Visual Recognition Challenge. International Journal of Computer Vision (IJCV), 2015.
+Levent Sagun, Utku Evci, V. Ugur Güney, Yann N. Dauphin, and Léon Bottou. Empirical analysis of the hessian of over-parametrized neural networks. CoRR, abs/1706.04454, 2017.
+Adina Williams, Nikita Nangia, and Samuel Bowman. A broad-coverage challenge corpus for sentence understanding through inference. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, 2018.
+Lei Wu, Chao Ma, and Weinan E. How sgd selects the global minima in over-parameterized learning: A dynamical stability perspective. In Proceedings of the 32nd International Conference on Neural Information Processing Systems, 2018.
+Han Xiao, Kashif Rasul, and Roland Vollgraf. Fashion-mnist: a novel image dataset for benchmarking machine learning algorithms. CoRR, abs/1708.07747, 2017.
+Chen Xing, Devansh Arpit, Christos Tsirigotis, and Yoshua Bengio. A Walk with SGD. arXiv preprint arXiv:1802.08770, 2018.
+Greg Yang, Jeffrey Pennington, Vinay Rao, Jascha Sohl-Dickstein, and Samuel S. Schoenholz. A mean field theory of batch normalization. CoRR, abs/1902.08129, 2019.
+Zhewei Yao, Amir Gholami, Qi Lei, Kurt Keutzer, and Michael W. Mahoney. Hessian-based analysis of large batch training and robustness to adversaries. CoRR, abs/1802.08241, 2018.
+Guodong Zhang, Lala Li, Zachary Nado, James Martens, Sushant Sachdeva, George Dahl, Chris Shallue, and Roger B Grosse. Which algorithmic choices matter at which batch sizes? insights from a noisy quadratic model. In H. Wallach, H. Larochelle, A. Beygelzimer, F. dAlché-Buc, E. Fox, and R. Garnett (eds.), Advances in Neural Information Processing Systems 32, pp. 8196-8207. Curran Associates, Inc., 2019.
+Zhanxing Zhu, Jingfeng Wu, Bing Yu, Lei Wu, and Jinwen Ma. The Anisotropic Noise in Stochastic Gradient Descent: Its Behavior of Escaping from Minima and Regularization Effects. arXiv preprint arXiv:1803.00195, 2018.
+
+# A ADDITIONAL VISUALIZATION OF THE BREAK-EVEN POINT
+
+We include here an analogous Figure to Fig. 1, but visualizing the conditioning of the covariance of gradients $(\lambda_{K}^{*} / \lambda_{K}^{1}$ , left), the trace of the covariance of gradients (Tr(K), middle), and the spectral norm of the Hessian ( $\lambda_{H}^{1}$ , right).
+
+
+Figure 8: Analogous to Fig. 1. The background color indicates the conditioning of the covariance of gradients $\mathbf{K}(\lambda_K^* /\lambda_K^1$ , left), the trace of the covariance of gradients $(\mathrm{Tr}(\mathbf{K})$ , middle), and the spectral norm of the Hessian $(\lambda_H^1$ , right).
+
+
+
+
+
+# B PROOFS
+
+In this section we formally state and prove the theorem used in Sec. 3. With the definitions introduced in Sec. 3 in mind, we state the following:
+
+Theorem 1. Assuming that training is stable along $e_H^1 (t)$ at $t = 0$ , then $\lambda_H^1 (t)$ and $\lambda_K^1 (t)$ at which SGD becomes unstable along $e_H^1 (t)$ are smaller for a larger $\eta$ or a smaller $S$ .
+
+Proof. This theorem is a straightforward application of Theorem 1 from Wu et al. (2018) to the early phase of training. First, let us consider two optimization trajectories corresponding to using two different learning rates $\eta_{1}$ and $\eta_{2}$ ( $\eta_{1} > \eta_{2}$ ). For both trajectories, Theorem 1 of Wu et al. (2018) states that SGD is stable at an iteration $t$ if the following inequality is satisfied:
+
+$$
+(1 - \eta \lambda_ {H} ^ {1} (t)) ^ {2} + s ^ {2} (t) \frac {\eta^ {2} (n - S)}{S (n - 1)} \leq 1, \tag {2}
+$$
+
+where $s(t) = \mathrm{Var}[\mathrm{H}_{\mathrm{i}}(t)]$ . Using Assumption 1 we get $\mathrm{Var}[g_i(\psi)] = \mathrm{Var}[\psi H_i] = \psi^2 s(t)^2$ . Using this we can rewrite inequality (2) as:
+
+$$
+(1 - \eta \lambda_ {H} ^ {1} (t)) ^ {2} + \frac {\lambda_ {K} ^ {1} (t)}{\psi (t) ^ {2}} \frac {\eta^ {2} (n - S)}{S (n - 1)} \leq 1. \tag {3}
+$$
+
+To calculate the spectral norm of the Hessian at iteration $t^*$ at which training becomes unstable we equate the two sides of inequality (3) and solve for $\lambda_H^1(t^*)$ , which gives
+
+$$
+\lambda_ {H} ^ {1} \left(t ^ {*}\right) = \frac {2 - \frac {\alpha}{\psi \left(t ^ {*}\right)} \frac {(n - S)}{(n - 1)} \frac {\eta}{S}}{\eta}, \tag {4}
+$$
+
+where $\alpha$ denotes the proportionality constant from Assumption 2. Note that if $n = S$ the right hand side degenerates to $\frac{2}{\eta}$ , which completes the proof for $n = S$ .
+
+To prove the general case, let denote by $\lambda_H^1 (t_1^*)$ and $\lambda_H^1 (t_2^*)$ the value of $\lambda_H^1$ at which training becomes unstable along $e_H^1$ for $\eta_{1}$ and $\eta_{2}$ , respectively. Similarly, let us denote by $\psi (t_1^*)$ and $\psi (t_2^*)$ the corresponding values of $\psi$ .
+
+Let us assume by contradiction that $\lambda_H^1 (t_1^*) > \lambda_H^1 (t_2^*)$ . A necessary condition for this inequality to hold is that $\psi (t_1^*) > \psi (t_2^*)$ . However, Assumption 4 implies that prior to reaching the break-even point $\psi (t)$ decreases monotonically with increasing $\lambda_H^1 (t_1^*)$ , which corresponds to reducing distance to the minimum along $e_H^1$ , which contradicts $\lambda_H^1 (t_1^*) > \lambda_H^1 (t_2^*)$ . Repeating the same argument for two trajectories optimized using two different batch sizes completes the proof.
+
+
+
+It is also straightforward to extend the argument to the case when training is initialized at an unstable region along $e_H^1 (0)$ , which we formalize as follows.
+
+Theorem 2. If training is unstable along $e_H^1(t)$ at $t = 0$ , then $\lambda_H^1(t)$ and $\lambda_K^1(t)$ at which SGD becomes for the first time stable along $e_H^1(t)$ are smaller for a larger $\eta$ or a smaller $S$ .
+
+Proof. We will use a similar argument as in the proof of Th. 1. Let us consider two optimization trajectories corresponding to using two different learning rates $\eta_{1}$ and $\eta_{2}$ ( $\eta_{1} > \eta_{2}$ ).
+
+Let $\lambda_H^1 (t_1^*)$ and $\lambda_H^1 (t_2^*)$ denote the spectral norm of $\mathbf{H}$ at the iteration at which training is for the first time stable along $e_H^1$ for $\eta_{1}$ and $\eta_{2}$ , respectively. Following the steps in the proof of Th. 1 we get that
+
+$$
+\lambda_ {H} ^ {1} (t ^ {*}) = \frac {2 - \frac {\alpha}{\psi (t ^ {*})} \frac {(n - S)}{(n - 1)} \frac {\eta}{S}}{\eta}. \tag {5}
+$$
+
+Using the same notation as in the proof of Th. 1, let us assume by contradiction that $\lambda_H^1 (t_1^*) > \lambda_H^1 (t_2^*)$ . Assumption 3 implies that $\psi (t)$ increases with decreasing $\lambda_H^1 (t)$ . Hence, if $\lambda_H^1 (t_2^*)$ is smaller, it means $\psi (t_2^*)$ increased to a larger value, i.e. $\psi (t_2^*) > \psi (t_1^*)$ . However, if $\frac{(n - S)}{(n - 1)}\approx 1$ , a necessary condition for $\lambda_H^1 (t_1^*) > \lambda_H^1 (t_2^*)$ inequality to hold is that $\psi (t_1^*) > \psi (t_2^*)$ , which leads to a contradiction. Repeating the same argument for batch size completes the proof.
+
+
+
+# C APPROXIMATING THE EIGENSPACE OF $\mathbf{K}$ AND $\mathbf{H}$
+
+Using a small subset of the training set suffices to approximate well the largest eigenvalues of the Hessian on the CIFAR-10 dataset (Alain et al., 2019). Following Alain et al. (2019) we use approximately the same $5\%$ fraction of the dataset in CIFAR-10 experiments, and the SCIPY Python package. We use the same setting on the other datasets as well.
+
+Analysing the eigenspace of $\mathbf{K}$ is less common in deep learning. For the purposes of this paper, we are primarily interested in estimating $\lambda_{K}^{*}$ and $\lambda_{K}$ . We also estimate $\operatorname{Tr}(\mathbf{K})$ . It is worth noting that $\operatorname{Tr}(\mathbf{K})$ is related to the variance in gradients as $\frac{1}{D}\operatorname{Tr}(\mathbf{K}) = \frac{1}{D}\frac{1}{N}\sum_{i=1}^{N}||g - g_i||^2$ , where $g$ is the full-batch gradient, $D$ is the number of parameters and $N$ is the number of datapoints.
+
+The naive computation of the eigenspace of $\mathbf{K}$ is infeasible for realistically large deep networks due to the quadratic cost in the number of parameters. Instead, we compute $\mathbf{K}$ using mini-batches. To avoid storing a $D\times D$ matrix in memory, we first sample $L$ mini-batch gradient of size $M$ and compute the corresponding Gram matrix $\mathbf{K}^M$ that has entries $\mathbf{K}_{ij}^{M} = \frac{1}{L}\langle g_{i} - g,g_{j} - g\rangle$ , where $g$ is the full-batch gradient, which we estimate based on the $L$ mini-batches. To compute the eigenspace of $\mathbf{K}^M$ we use SVD routine from the NumPy package. We take the $(L - 1)^{th}$ smallest eigenvalue as the smallest non-zero eigenvalue of $\mathbf{K}^M$ (covariance matrix computed using $L$ observations has by definition $L - 1$ non-zero eigenvalues).
+
+Papyan (2019); Fort & Ganguli (2019) show that the top eigenvalues of $\mathbf{H}$ emerge due to clustering of gradients of the logits. See also Fort & Ganguli (2019). Based on the proximity of the largest eigenvalues of $\mathbf{H}$ and $\mathbf{K}$ , this observation suggests that the top eigenvalue of $\mathbf{K}$ might be similar to that of $\mathbf{K}^M$ . To investigate this, we run the following experiment on the CIFAR-10 dataset using
+
+SimpleCNN. We estimate $\lambda_K^1$ using $M = 1$ and $M = 128$ , in both cases using the whole training set. We subsample the dataset to $10\%$ to speed up the computation. Fig. 9 shows a strong correlation between $\lambda_K^1$ computed with $M = 1$ and with $M = 128$ , for three different learning rates.
+
+
+Figure 9: Pearson correlation between $\lambda_K^1$ calculated using either $M = 128$ or $M = 1$ for three different values of $\eta = 0.1, 0.01$ and 0.001.
+
+
+
+
+
+In all experiments we use $L = 25$ , and for the IMDB dataset we increase the number of mini-batch gradients to $L = 200$ to reduce noise (same conclusion hold for $L = 25$ ). For instance, on the CIFAR-10 dataset this amounts to using approximately $5\%$ of the training set. In experiments that vary the batch size we use $M = 128$ . Otherwise, we use the value $M$ as the batch size used to train the model.
+
+# D EXPERIMENTAL DETAILS FOR SEC. 4.2
+
+In this section we describe all the details for experiments in Sec. 4.2.
+
+ResNet-32 on CIFAR-10. ResNet-32 (He et al., 2015) is trained for 200 epochs with a batch size equal to 128 on the CIFAR-10 dataset. Standard data augmentation and preprocessing is applied. Following He et al. (2015), we regularize the model using weight decay 0.0001. We apply weight decay to all convolutional kernels. When varying the batch size, we use learning rate of 0.05. When varying the learning rate, we use batch size of 128.
+
+SimpleCNN on CIFAR-10. SimpleCNN is a simple convolutional network with four convolutional layers based on Keras examples repository (Chollet et al., 2015). The architecture is as follows. The first two convolutional layers have 32 filters, and the last two convolutional layers have 64 filters. After each pair of convolutional layers, we include a max pooling layer with a window size of 2. After each layer we include a ReLU nonlinearity. The output of the final convolutional layer is processed by a densely connected layer with 128 units and ReLU nonlinearity. When varying the batch size, we use a learning rate of 0.05. When varying the learning rate, we use a batch size of 128.
+
+BERT on MNLI. The model used in this experiment is the BERT-base from Devlin et al. (2018), pretrained on multilingual data4. The model is trained on the MultiNLI dataset (Williams et al., 2018) with the maximum sentence length equal to 40. The network is trained for 20 epochs using a batch size of 32. Experiments are repeated with three different seeds that control initialization and data shuffling.
+
+MLP on FashionMNIST. This experiment is using a multi-layer perceptron with two hidden layers of size 300 and 100, both with ReLU activations. The data is normalized to the [0, 1] range. The network is trained with a batch size of 64 for 200 epochs.
+
+LSTM on IMDB. The network used in this experiment consists of an embedding layer followed by an LSTM with 100 hidden units. We use vocabulary size of 20000 words and the maximum
+
+length of the sequence equal to 80. The model is trained for 100 epochs. When varying the learning rate, we use batch size of 128. When varying the batch size, we use learning rate of 1.0. Experiments are repeated with two different seeds that control initialization and data shuffling.
+
+DenseNet on ImageNet. The network used is the DenseNet-121 from Huang et al. (2016). The dataset used is the ILSVRC 2012 (Russakovsky et al., 2015). The images are centered and normalized. No data augmentation is used. Due to large computational cost, the network is trained only for 10 epochs using a batch size of 32.
+
+# E ADDITIONAL EXPERIMENTS FOR SEC. 4.2.
+
+In this section we include additional data for experiments in Sec. 4.2, as well as include experiments using MLP trained on the Fashion MNIST dataset.
+
+SimpleCNN on CIFAR-10. In Fig. 12 and Fig. 13 we report accuracy on the training set and the validation set, $\lambda_H^1$ , and $\mathrm{Tr}(\mathbf{K})$ for all experiments with SimpleCNN model on the CIFAR-10 dataset
+
+Figure 10: Additional metrics for the experiments using SimpleCNN on the CIFAR-10 dataset with different learning rates. From left to right: training accuracy, validation accuracy, $\operatorname{Tr}(\mathbf{K})$ .
+
+$\eta = 0.001$ $\eta = 0.010$ $\eta = 0.100$
+
+
+
+
+
+
+Figure 11: Additional metrics for the experiments using SimpleCNN on the CIFAR-10 dataset with different batch sizes. From left to right: training accuracy, validation accuracy, and $\mathrm{Tr}(\mathbf{K})$ .
+
+
+S=30 S=300
+
+
+
+ResNet-32 on CIFAR-10. In Fig. 12 and Fig. 13 we report accuracy on the training set and the validation set, $\lambda_H^1$ , and $\mathrm{Tr}(\mathbf{K})$ for all experiments with ResNet-32 on the CIFAR-10 dataset.
+
+Figure 12: Additional figures for the experiments using ResNet-32 on the CIFAR-10 dataset with different learning rates. From left to right: the evolution of accuracy, validation accuracy, $\mathrm{Tr}(\mathbf{K})$ .
+
+$\eta = 0.001$ $\eta = 0.010$ $\eta = 0.100$
+
+
+
+
+
+
+Figure 13: Additional figures for the experiments using ResNet-32 on the CIFAR-10 dataset with different batch sizes. From left to right: training accuracy, validation accuracy, $\operatorname{Tr}(\mathbf{K})$ .
+
+
+S=10 S=100
+
+
+
+LSTM on IMDB. In Fig. 14 and Fig. 15 we report accuracy on the training set and the validation set, $\lambda_H^1$ , and $\mathrm{Tr}(\mathbf{K})$ for all experiments with LSTM on the IMDB dataset.
+
+Figure 14: Additional figures for the experiments using LSTM on the IMDB dataset with different learning rates. From left to right: the evolution of accuracy, validation accuracy, and $\mathrm{Tr}(\mathbf{K})$ .
+
+- $\eta = 0.333$ - $\eta = 1.000$ - $\eta = 3.000$
+
+
+
+
+
+
+Figure 15: Additional metrics for the experiments using LSTM on the IMDB dataset with different batch sizes. From left to right: training accuracy, validation accuracy, $\lambda_H^1$ and $\mathrm{Tr}(\mathbf{K})$ .
+
+
+$S = 10$ $S = 100$
+
+
+
+BERT on MNLI. In Fig. 16 we report accuracy on the training set and the validation set and $\mathrm{Tr}(\mathbf{K})$ for BERT model on the MNLI dataset.
+
+$\eta = 0.001$ $\eta = 0.003$ $\eta = 0.010$
+
+
+Figure 16: Additional metrics for the experiments using BERT on the MNLI dataset with different learning rates. From left to right: training accuracy, validation accuracy, and $\mathrm{Tr}(\mathbf{K})$ .
+
+
+
+DenseNet on ImageNet. In Fig. 17 we report accuracy on the training set and the validation set and $\mathrm{Tr}(\mathbf{K})$ for DenseNet on the ImageNet dataset.
+
+
+Figure 17: Additional metrics for the experiments using DenseNet on the ImageNet dataset with different learning rates. From left to right: training accuracy, validation accuracy, and $\mathrm{Tr}(\mathbf{K})$ .
+
+MLP on FashionMNIST. In Fig. 18 and Fig. 19 we report results for MLP model on the FashionMNIST dataset. We observe that all conclusions carry over to this setting.
+
+
+Figure 18: Results of experiment using the MLP model on the FashionMNIST dataset for different learning rates. From left to right: $\lambda_K^1$ , $\lambda_K^*$ / $\lambda_K^1$ , $\lambda_H^1$ and $\mathrm{Tr}(\mathbf{K})$ .
+
+
+Figure 19: Training accuracy and validation accuracy for experiment in Fig. 18.
+
+# F ADDITIONAL EXPERIMENTS FOR SGD WITH MOMENTUM
+
+Here, we run the same experiment as in Sec. 4.2 using SimpleCNN on the CIFAR-10 dataset. Instead of varying the learning rate, we test different values of the momentum $\beta$ parameter in the range of 0.1, 0.5 and 0.9. We can observe that Conjecture 1 and Conjecture 2 generalize to momentum in the sense that using a higher momentum has an analogous effect to using a higher learning rate, or using a smaller batch size in SGD. We report the results in Fig. 20 and Fig. 21.
+
+
+Figure 20: The variance reduction and the pre-conditioning effect for SimpleCNN trained using SGD with momentum. From left to right: $\lambda_K^1$ , $\lambda_K^*$ and $\mathrm{Tr}(\mathbf{K})$ .
+
+
+Figure 21: Training accuracy and validation accuracy for the experiment in Fig. 20.
+
+Next, to study whether our Conjectures are also valid for SGD with momentum, but held constant, we run the same experiment as in Sec. 4.2 using SimpleCNN on the CIFAR-10 dataset. For all runs, we set momentum to 0.9. Learning rate 0.1 diverged training, so we include only 0.01 and 0.001. We can observe that both Conjectures generalize to this setting. We report the results in Fig. 22 and Fig. 23.
+
+
+Figure 22: The variance reduction and the pre-conditioning effect for SimpleCNN trained using SGD with momentum. From left to right: $\lambda_K^1$ , $\lambda_K^*$ and $\mathrm{Tr}(\mathbf{K})$ .
+
+
+Figure 23: Training accuracy and validation accuracy for the experiment in Fig. 22.
+
+# G ADDITIONAL EXPERIMENTS FOR SGD WITH LEARNING RATE DECAY
+
+To understand the effect of learning rate decay, we run the same experiment as in Sec. 4.2 using SimpleCNN on the CIFAR-10 dataset. Additionally, we divide the learning rate by the factor of 10 after 100th epoch. We can observe that Conjecture 1 and Conjecture 2 generalize to scenario with learning rate schedule in the sense that changing learning rate doesn't change the relative ordering of the maximum $\lambda_{K}^{1}$ and $\lambda_{K}^{*} / \lambda_{K}^{1}$ . We report the results in Fig. 24 and Fig. 25.
+
+
+Figure 24: The variance reduction and the pre-conditioning effect for SimpleCNN trained using SGD with learning rate schedule. From left to right: $\lambda_K^1$ , $\lambda_K^*$ and $\mathrm{Tr}(\mathbf{K})$ .
+
+
+Figure 25: Training accuracy and validation accuracy for the experiment in Fig. 24.
+
+# H ADDITIONAL EXPERIMENTS FOR SIMPLECNN-BN
+
+To further explore the connection between our conjectures and the effects of batch-normalization layers on the conditioning of the loss surface, we repeat here experiments from Sec. 4.3, but varying the batch size. Fig. 26 summarizes the results.
+
+On the whole, conclusions from Sec. 4.3 carry over to this setting in the sense that decreasing the batch size has a similar effect on the studied metrics as increasing the learning rate. One exception is the experiment using the smallest batch size of 10. In this case, the maximum values of $\frac{\|g\|}{\|g_5\|}$ and $\lambda_{K}^{*} / \lambda_{K}^{1}$ are smaller than in the experiments using larger batch sizes.
+
+
+(a) Left to right: $\frac{\|g\|}{\|g_5\|}$ , $\lambda_H^1$ for SimpleCNN-BN, and $\lambda_K^1$ for SimpleCNN-BN.
+
+
+(b) Left to right: $\|\gamma\|$ of the last BN layer early in training, $\lambda_K^1$ early in training, $\lambda_K^* / \lambda_K^1$ for SimpleCNN-BN.
+Figure 26: Evolution of various metrics that quantify conditioning of the loss surface for SimpleCNN with batch normalization layers (SimpleCNN-BN), for different batch sizes.
\ No newline at end of file
diff --git a/thebreakevenpointonoptimizationtrajectoriesofdeepneuralnetworks/images.zip b/thebreakevenpointonoptimizationtrajectoriesofdeepneuralnetworks/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..35972d3052b18424fb3d0558ea7a8427f585504d
--- /dev/null
+++ b/thebreakevenpointonoptimizationtrajectoriesofdeepneuralnetworks/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:cd0e7104544a6906b0168ec6624a6972f123bb46188c8b76c845276f20c29ccb
+size 1058861
diff --git a/thebreakevenpointonoptimizationtrajectoriesofdeepneuralnetworks/layout.json b/thebreakevenpointonoptimizationtrajectoriesofdeepneuralnetworks/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..1c3bcc36b012d4aa2c6b965db072756cf351288b
--- /dev/null
+++ b/thebreakevenpointonoptimizationtrajectoriesofdeepneuralnetworks/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f222805d228bc22a02af94fcedc4c9612c9b68961ab8b350f72d4791500feb97
+size 969440
diff --git a/theingredientsofrealworldroboticreinforcementlearning/45d196b9-1a91-4820-aed2-cd46e8e26db4_content_list.json b/theingredientsofrealworldroboticreinforcementlearning/45d196b9-1a91-4820-aed2-cd46e8e26db4_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..d31d73f90d2b50e0e85baa902e7d57754c72d20e
--- /dev/null
+++ b/theingredientsofrealworldroboticreinforcementlearning/45d196b9-1a91-4820-aed2-cd46e8e26db4_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:7f417cc380c65ac0f3c78178b3446d69b348f2446dd4dce23b7cc25370176683
+size 107018
diff --git a/theingredientsofrealworldroboticreinforcementlearning/45d196b9-1a91-4820-aed2-cd46e8e26db4_model.json b/theingredientsofrealworldroboticreinforcementlearning/45d196b9-1a91-4820-aed2-cd46e8e26db4_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..a56988dd21fed77f89dde7e1015469652d6c5591
--- /dev/null
+++ b/theingredientsofrealworldroboticreinforcementlearning/45d196b9-1a91-4820-aed2-cd46e8e26db4_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:6e84d5eacd5ef26f34293d8076c4d1c201b4c04fa725b14c0521c6d0b13baf0c
+size 124990
diff --git a/theingredientsofrealworldroboticreinforcementlearning/45d196b9-1a91-4820-aed2-cd46e8e26db4_origin.pdf b/theingredientsofrealworldroboticreinforcementlearning/45d196b9-1a91-4820-aed2-cd46e8e26db4_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..adb2a1d138a6ac53e07b71fe7b07c029d01a41bb
--- /dev/null
+++ b/theingredientsofrealworldroboticreinforcementlearning/45d196b9-1a91-4820-aed2-cd46e8e26db4_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a2032a000d6ca18f436e86bc06eb98b6f5b564d78dec124cc4f33660c87ee8d8
+size 19199535
diff --git a/theingredientsofrealworldroboticreinforcementlearning/full.md b/theingredientsofrealworldroboticreinforcementlearning/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..fd1d68f570f92863f0cbc03d0b66867c4e9f571f
--- /dev/null
+++ b/theingredientsofrealworldroboticreinforcementlearning/full.md
@@ -0,0 +1,411 @@
+# THE INGREDIENTS OF REAL- WORLD ROBOTIC REINFORCEMENT LEARNING
+
+Henry Zhu\*, Justin Yu\*, Abhishek Gupta\*, Dhruv Shah\*, Kristian Hartikainen\*, Avi Singh\*, Vikash Kumar\*, Sergey Levine\*
+
+1 University of California, Berkeley 2 University of Oxford 3 University of Washington
+
+# ABSTRACT
+
+The success of reinforcement learning for real world robotics has been, in many cases limited to instrumented laboratory scenarios, often requiring arduous human effort and oversight to enable continuous learning. In this work, we discuss the elements that are needed for a robotic learning system that can continually and autonomously improve with data collected in the real world. We propose a particular instantiation of such a system, using dexterous manipulation as our case study. Subsequently, we investigate a number of challenges that come up when learning without instrumentation. In such settings, learning must be feasible without manually designed resets, using only on-board perception, and without hand-engineered reward functions. We propose simple and scalable solutions to these challenges, and then demonstrate the efficacy of our proposed system on a set of dexterous robotic manipulation tasks, providing an in-depth analysis of the challenges associated with this learning paradigm. We demonstrate that our complete system can learn without any human intervention, acquiring a variety of vision-based skills with a real-world three-fingered hand. Results and videos can be found at https://sites.google.com/view/realworld-rl/.
+
+# 1 INTRODUCTION
+
+Reinforcement learning (RL) can in principle enable autonomous systems, such as robots, to acquire a large repertoire of skills automatically. Perhaps even more importantly, reinforcement learning can enable such systems to continuously improve the proficiency of their skills from experience. However, realizing this in reality has proven challenging: even with reinforcement learning methods that can acquire complex behaviors from high-dimensional low-level observations, such as images, the assumptions of the reinforcement learning problem setting do not fit cleanly into the constraints of the real world. For this reason, most successful robotic learning experiments have employed various kinds of environmental instrumentation in order to define reward functions, reset between trials, and obtain ground truth state (Levine et al., 2016; Haarnoja et al., 2018a; Kumar et al., 2016; Andrychowicz et al., 2018; Zhu et al., 2019; Chebotar et al., 2016; Nagabandi et al., 2019; Gupta et al., 2016). In order to practically and scalably deploy autonomous learning systems that improve continuously through real-world operation, we must lift these limitations and design algorithms that can learn under the constraints of real-world environments, as illustrated in Figure 2.
+
+We propose that overcoming these challenges in a scalable way requires designing robotic systems that possess three capabilities: they are able to (1) learn from their own raw sensory inputs, (2) assign rewards to their own trials without hand-designed perception systems or instrumentation, and (3) learn continuously in non-episodic settings without requiring human intervention to manually reset the environment. A system with these capabilities can autonomously collect large amounts of real world data – typically crucial for effective generalization – without significant instrumentation in each training environment, an example of which is shown in Figure 1. If successful, this would lift a major constraint that stands between current reinforcement learning algorithms and the ability to learn scalable, generalizable, and robust real-world behaviors. Such a system would also bring us significantly closer to the goal of embodied learning-based systems that improve continuously through their own real-world experience.
+
+
+Figure 1: Illustration of our proposed instrumentation-free system requiring minimal human engineering. Human intervention is only required in the goal collection phase (1). The robot is left to train unattended (2) during the learning phase and can be evaluated from arbitrary initial states at the end of training (3). We show sample goal and intermediate images from the training process of a real hardware system
+
+Having laid out these requirements, we propose a practical instantiation of such a learning system. While prior works have studied many of these issues in isolation, combining them into a complete real-world learning system presents a number of challenges, as we discuss in Section 3. We provide an empirical analysis of these issues, both in simulation and on a real-world robotic system, and propose a number of simple but effective solutions that together produce a complete robotic learning system. This system can autonomously learn from raw sensory inputs, learn reward functions from easily available supervision, and learn without manually designed reset mechanisms. We show that this system can learn dexterous robotic manipulation tasks in the real world, substantially outperforming ablations and prior work.
+
+# 2 THE STRUCTURE OF A REAL-WORLD RL SYSTEM
+
+The standard reinforcement learning paradigm assumes that the controlled system is represented as a Markov decision process with a state space $S$ , action space $A$ , unknown transition dynamics $\mathcal{T}$ , unknown reward function $\mathcal{R}$ , and a (typically) episodic initial state distribution $\rho$ . The goal is to learn a policy that maximizes the expected sum of rewards via interactions with the environment.
+
+Although this formalism is simple and concise, it does not capture all of the complexities of real-world robotic learning problems. If a robotic system is to learn continuously and autonomously in the real world, we must ensure that it can learn under the actual conditions that are imposed by the real world. To move from the idealized MDP formulation to the real world, we require a system that has the following properties. First, all of the information necessary for learning must be obtained from the robot's own sensors. This includes information about the state and necessitates that the policy must be learned from high-dimensional and low-level sensory observations, such as camera images. Second, the robot must also obtain the reward signal itself from its own sensor readings. This is exceptionally difficult for all but the simplest tasks (e.g., reward functions that depend on interactions with specific objects require perceiving those objects explicitly). Third, we must be able to learn without access to episodic resets. A setup with explicit resets quickly becomes impractical in open-world settings, due to the requirement for significant human engineering of the environment, or direct human intervention during learning. While this list may not exhaustively enumerate all the components necessary for an effective real-world learning system, we posit that the properties listed here are fundamental to building such systems.
+
+While some of the components discussed above can be tackled in isolation by current algorithms, there are considerable challenges inherent to assembling all these components into a complete learning system for real world robotic learning. In the rest of this section, we outline the challenges associated with each component, then discuss the challenges associated with combining these components in Section 3, and then proceed to address these challenges in Section 4.
+
+
+Figure 2: We draw a comparison between current real world learning systems which rely on instrumentation versus a system that learns in an environment more representative of the real world, free of instrumentation. While all three prior works utilize instrumentation for resets, state estimation, and reward, the motion capture system of Gupta et al. (2016), sensor attached to the door in Zhu et al. (2019), and auxiliary robot which picks up fallen balls in Nagabandi et al. (2019) are good examples of engineered state estimation, reward estimation, and reset mechanisms respectively.
+
+# 2.1 LEARNING FROM RAW SENSORY INPUT
+
+To enable learning without complex state estimation systems or environment instrumentation, we require our robotic systems to be able to learn from their own raw sensory observations. Typically, these sensory observations are raw camera images from a camera mounted on the robot, as well as proprioceptive sensory inputs such as the joint angles. These observations do not directly provide the poses of the objects in the scene, which is the typical assumption in simulated robotic environments – any such information must be extracted by the learning system.
+
+While in principle many RL frameworks can support learning from raw sensory inputs (Levine et al., 2016; Mnih et al., 2015; Schulman et al., 2015; Lillicrap et al., 2015), it is important to consider the practicalities of this approach. For instance, we can instantiate vision-based RL with policy gradient algorithms such as TRPO (Schulman et al., 2015) and PPO (Schulman et al., 2017), but these have high sample complexities which make them unsuited for real world robotic learning (Haarnoja et al., 2018a). In our work, we consider adopting the general framework of off-policy actor-critic reinforcement learning, using a version of the soft actor critic (SAC) algorithm described by (Haarnoja et al., 2018b). This algorithm effectively uses off-policy data and has been shown to learn some tasks directly from visual inputs. However, while SAC can learn directly from images, we find in our experiments that, as the task complexity increases, the efficiency of direct end-to-end learning (particularly without resets and with learned rewards) still degrades substantially. However, as we will discuss in Section 3, augmenting end-to-end learning with unsupervised representation learning substantially alleviates such challenges.
+
+# 2.2 REWARD FUNCTIONS WITHOUT REWARD ENGINEERING
+
+Vision-based RL algorithms, such as SAC, rely on a reward function being provided to the system, which is typically manually programmed by a user. While this can be simple to do in simulation by using ground truth state information, it is significantly harder to implement in uninstrumented real world environments. In the real world, the robot must obtain the reward signal itself from its own sensor readings. A few options for tackling this challenge have been discussed in prior work: design complete computer vision systems to detect objects and extract the reward signals (Devin et al., 2018; Nagabandi et al., 2019), engineer reward functions that use various task-specific heuristics to obtain rewards from pixels (Schenck & Fox, 2017; Kalashnikov et al., 2018), or instrument every environment (Chebotar et al., 2017). Many of these solutions are manual and tedious, and a more general approach is needed to scale real-world robotic learning gracefully.
+
+# 2.3 LEARNING WITHOUT RESETS
+
+While the components described in Section 2.1 and 2.2 are essential to building continuously learning RL systems in the real world, they have often been implemented with the assumption of episodic learning Fu et al. (2018); Haarnoja et al. (2018b). However, natural open-world settings do not provide any such reset mechanism, and in order to enable scalable and autonomous real-world learning we need systems that do not require an episodic formulation of the learning problem.
+
+To devise a system that requires minimal human engineering for providing rewards, we must use algorithms that are able to assign themselves rewards, using learned models that operate on the same raw sensory inputs as the policy. One candidate is for a user to specify intended behavior beforehand through examples of desired outcomes (i.e., images). The algorithm can then assign itself rewards based on a measure of how well it is accomplishing the specified goals, with no additional human supervision. This approach can scale well in principle, since it requires minimal human engineering, and goal images are easy to provide.
+
+In principle, algorithms such as SAC do not actually require episodic learning; however, in practice, most instantiations use explicit resets, even in simulation, and removing resets has resulted in failure to solve challenging tasks. In our experiments in Section 3 as well, we see that actor-critic methods applied naively to the reset free setting do not learn the intended behaviors. Introducing visual observations and classifier based rewards exacerbates these challenges.
+
+We propose that these three components - vision-based RL with actor-critic algorithms, vision-based goal classifier for rewards, and reset-free learning - are the fundamental pieces that we need to build a real world robotic learning system. However, when we actually combine the individual components in Sections 3 and 6, we find that learning effective policies is quite challenging. We provide insight into these challenges in Section 3. Based on these insights, we propose simple but important changes in Section 4 to build a system, R3L, that can learn effectively and autonomously in the real world without human intervention.
+
+# 3 THE CHALLENGES OF REAL WORLD RL
+
+The system design outlined in Section 2 in principle gives us a complete system to perform real world reinforcement learning without instrumentation. However, when utilized for robotic learning problems, we find this basic design to be largely ineffective. To study this, we present results for a simulated robotic manipulation task that requires repositioning a free-floating objects with a three-fingered robotic hand, shown in Fig 3. We use this task for our investigative analysis and show that the same insights extend to several other tasks, including real world tasks, in Section 6. The goal in this task is to reposition the object to a target pose from any initial pose in the arena. When the system is instantiated with vision-based soft actor-critic, rewards from goal images using VICE, and run without episodic resets, we see that the algorithm fails to make progress (Fig 4). Although it might appear that this setup fits within the assumptions of all of the components that are used, the complete system is ineffective. Which particular components of this problem make it so difficult?
+
+To investigate this issue, we perform experiments investigating the combination of the three main ingredients: varying observation type
+
+(visual vs. low-dimensional state), reward structure (VICE vs. hand-defined rewards that utilize ground-truth object state), and the ability to reset (episodic resets vs. reset-free, non-episodic learning). We start by considering the training time reward under each combination of factors as shown in Fig 4, which reveals several trends. First, the results in Fig 4 show that learning with resets achieves high training time reward from both vision and state, while reset-free only achieves high training time reward with low-dimensional state. Second, we find that the policy is able to pass the threshold for training time reward in a non-episodic setting when learning from low-dimensional state, but it
+
+
+Figure 3: Our object repositioning task. The goal is to move the object from any starting configuration to a particular goal position and orientation.
+
+
+Figure 4: We report the approximate number of samples needed for a policy learned with a prior off-policy RL algorithm (SAC) to achieve average training performance of less than 0.15 in pose distance (defined in Appendix C.1.3) across 3 seeds on the repositioning task. We compare training performance after varying three axes: ground truth rewards vs. learned rewards, with vs. without episodic resets, low-level state vs. images as inputs. We observe learning without resets is harder than with resets and is much harder when combined with visual inputs.
+
+
+Figure 5: We observe that when training reset free to reach a single goal, while the pose distance at training time is quite low, the pose errors obtained at test-time with the learned policy are very high. This indicates that while the object is getting close to the goal at training time, the policies being learned are still not effective.
+
+is not able to do the same using image observations. This suggests that combining the reset-free learning problem with visual observations makes it significantly more challenging.
+
+However, the table in Fig 4 paints an incomplete picture. These numbers are related to the performance of the policies at training time, not how effective the learned policies are when being evaluated. When we consider the test-time performance (Fig 5) of the policies that are learned under reset free conditions, we obtain a different set of conclusions. While learning from low-dimensional state in the reset free setting achieves high reward at training time, the test-time performance of the corresponding learned policies is very poor. This can likely be attributed to the fact that when the agent spends all its time stuck at the goal, and sees very little diversity of data in other parts of the state space, which significantly reduces the efficacy of the actual policies being learned. In a sense, the reset encodes some prior information about the task: it tells the policy about what types of states it might be required to succeed from at test time. Without this knowledge, performance is substantially worse. This makes it very challenging to learn policies with completely reset-free schemes, which has prompted prior work to consider schemes such as learning reset controllers (Eysenbach et al., 2018). As we discuss in the following section and in our experiments, these schemes are often insufficient for learning effective policies in the real world without any resets.
+
+# 4 A REAL-WORLD ROBOTIC REINFORCEMENT LEARNING SYSTEM
+
+To address the challenges identified in Section 3, we present two improvements, which we found to be essential for uninstrumented real-world training: randomized perturbation controllers and unsupervised representation learning. Incorporating these components into the system in Section 2 results in a system that can learn successfully in uninstrumented environments, as we will show in Section 6, and attains good performance both at training time and at test time.
+
+# 4.1 RANDOMIZED PERTURBATION CONTROLLER
+
+Prior works in addressing the reset free setting problem have considered converting the problem into a more standard episodic problem, by learning a "reset controller," which is trained to reset the system to a particular initial state (Eysenbach et al., 2018; Han et al., 2015). This scheme has been thought to make the learning problem easier by reducing the variance of the resulting initial state distribution. However, as we will show in our experiments in Section 6, this still results in policies whose success depends heavily on a narrow range of initial states. Indeed, prior reset controller methods all reset to a single initial state (Eysenbach et al., 2018; Han et al., 2015).
+
+We take a different approach to learning in a reset-free setting. Rather than attributing the problem to the variance of the initial state distribution, we hypothesize that a major problem with reset-free learning is that the support of the distribution of states visited by the policy is too narrow, which
+
+makes the learning problem challenging and doesn't allow the agent to learn how to perform the desired task from any state it might find itself in. In this view, the goal should not be to reduce the variance of the initial state distribution, but instead to increase it.
+
+To this end, we utilize what we call random perturbation controllers: controllers that introduce perturbations intermittently into the system through a policy that is trained to explore the environment. The standard actor $\pi(a|s)$ is executed for $H$ time-steps, following which we executed the perturbation controller $\pi_p(a|s)$ for $H$ steps, and repeat. The policy $\pi$ is trained with the VICE-based rewards for reaching the desired goals, while the perturbation controller $\pi_p$ is trained only with an intrinsic motivation objective that encourages visiting under-explored states. In our implementation, we use the random network distillation (RND) objective for training the perturbation controller (Burda et al., 2018), but any effective exploration method can be used for the same. This procedure is described in detail in Appendix A, and is evaluated on the tasks we consider in Fig 6. The perturbation controller ensures that the support of the training distribution grows and as a result the policies can learn the desired behavior much more effectively, as shown in Fig 7.
+
+# 4.2 GOAL CLASSIFIER
+
+To design a system that requires minimal human engineering for providing reward, we use a data-driven reward specification framework called variational inverse control with events (VICE) introduced by Fu et al. (2018). VICE learns rewards in a task-agnostic way: we provide the algorithm with success examples in the form of images where the task is accomplished, and learn a discriminator that is capable of distinguishing successes from failures. This discriminator can then be used to provide a learning signal to nudge the reinforcement learning agent towards success. This algorithm has been previously considered in the context of learning tasks from raw sensory observations in the real world by (Singh et al., 2019) but we show that it presents unique challenges when used in conjunction with learning without episodic resets. Details and specifics of the algorithms being considered are described in Appendix A and also discussed by Singh et al. (2019).
+
+# 4.3 UNSUPERVISED REPRESENTATION LEARNING
+
+The perturbation controller discussed above allows us to learn policies that can succeed at the task from a variety of starting states. However, learning from visual observations still present a challenge. Our experiments in Fig 4 show that learning without resets from low-dimensional states is comparatively easier. We therefore aim to convert the vision-based learning problem into one that more closely resembles state-based learning, by training a variational autoencoder (VAE, Kingma & Welling (2013)) and sharing the latent-variable representation across the actor and critic networks (refer to Appendix B for more details). Note that we use a VAE as an instantiation of representation learning techniques that works well in the domains we considered, but other more sophisticated density models proposed in prior work may also be substituted in place of the VAE (Lee et al., 2019; Hjelm et al., 2019; Anand et al., 2019).
+
+While several works have also sought to incorporate unsupervised learning into reinforcement learning to make learning from images easier (Nair et al., 2018; Lee et al., 2019), we note that this becomes especially critical in the vision-based, reset-free setting, as motivated by the experiments in Section 3, which indicate that it is precisely this combination of factors – vision and no resets – that presents the most difficult learning problem. Therefore, although the particular solution we use in our system has been studied in prior work, it is brought to bare to address a challenge that arises in real-world learning that we believe has not been explored in prior studies.
+
+These two improvements – the perturbation controller and unsupervised learning – combined with the general system described above, give us a complete practical system for real world reinforcement learning. The overall method uses soft-actor critic for learning with visual observations and classifier based rewards with VICE, introduces auxiliary reconstruction objectives or pretrains encoders for unsupervised representation learning, and uses a perturbation controller during training to ensure that the support of visited states grows sufficiently. We term this full system for real-world robotic reinforcement learning R3L. Further implementation details can be found in Appendix A.
+
+# 5 RELATED WORK
+
+The primary contribution of this work is to propose a paradigm for continual instrumentation-free real world robotic learning and a practical instantiation of such a system. A number of prior works have studied reinforcement learning in the real world for acquiring robotic skills (Levine et al., 2016; Kumar et al., 2016; Gu et al., 2017; Kalashnikov et al., 2018; Haarnoja et al., 2018b; Finn & Levine, 2016; Zhu et al., 2019; Nagabandi et al., 2019). Much of the focus in prior work has been on improving the efficiency and generalization of RL algorithms to make real-world training feasible, or else on utilizing simulation and transferring policies into the real world (Tzeng et al., 2015; Tobin et al., 2017; Peng et al., 2017; Clavera et al., 2018; Kang et al., 2019). The simulation-based methods typically require considerable effort in terms of both simulator design and overcoming the distributional shift between simulated and real-experience, while prior real-world training methods typically require additional instrumentation for either reward function evaluation (Levine & Koltun, 2013) or resetting between trials (Gu et al., 2017; Chebotar et al., 2017; Zhu et al., 2019), or both. In contrast, our work is primarily focused on lifting these requirements, rather than devising more efficient RL methods. We show that removing the need for instrumentation (i.e., for reward evaluation and resets) introduces additional challenges, which in turn require a careful set of design choices. Our complete R3L method is able to learn completely autonomously, without manual resets or reward design.
+
+A key component of our system involves learning from raw visual inputs. This has proven to be difficult for policy gradient style algorithms (Pinto et al., 2017a) due to challenging representation learning problems. This has been made easier in simulated domains by using modified objectives, such as auxiliary losses (Jaderberg et al., 2016), or by using more efficient algorithms (Haarnoja et al., 2018a). We show that reinforcement learning on raw visual input, while possible in standard RL settings, becomes significantly more challenging when considered in conjunction with nonepisodec, reset-free scenarios.
+
+Reward function design is crucial for any RL system, and is non-trivial to provide in the real world. Prior works have considered instrumenting the environment with additional sensors to evaluate rewards (Gu et al., 2017; Chebotar et al., 2017; Zhu et al., 2019), which is a highly manual process, using demonstrations, which require manual effort to collect (Vecerik et al., 2017; Ng & Russell, 2000; Liu et al., 2018), or using interactive supervision from the user (Christiano et al., 2017). In this work, we leverage the algorithm introduced by Fu et al. (2018) to assign rewards based on the likelihood of a goal classifier. While prior work also applied this method to robotic tasks (Singh et al., 2019), this was done in a setting where manual resets were provided by hand, while we demonstrate that we can use learned rewards in a fully uninstrumented, reset-free setup.
+
+Learning without resets has been considered in prior works (Eysenbach et al., 2018; Han et al., 2015), although in different contexts – safe learning and learning compound controllers, respectively. Eysenbach et al. (2018) provide an algorithm to learn a reset controller with the goal of ensuring safe operation, but makes several assumptions that make it difficult to use in the real world: it assumes access to a ground truth reward function, it assumes access to an oracle function that can detect if an attempted reset by the reset policy was successful or not, and it assumes the ability to perform manual resets if the reset policy fails a certain number of times. In contrast, we propose an algorithm that allows for fully automated reinforcement learning in the real world. We compare to an ablation of our method that uses a reset controller similar to Eysenbach et al. (2018), and show that our method performs substantially better. Our perturbation controller also resembles the adversarial RL setup Pinto et al. (2017b); Sukhbaatar et al. (2018). However, while these prior methods explicitly aim to train policies that are robust to perturbations Pinto et al. (2017b) or explore effectively Sukhbaatar et al. (2018), we are concerned with learning without access to resets.
+
+While this line of work has connections to developmental robotics (Lungarella et al., 2003; Asada et al., 2009) and its subfields, such as continual (Lesort et al., 2019) and lifelong (Thrun & Mitchell, 1995) learning, the goal of our work is to handle the practicalities of enabling reinforcement learning systems to learn in the real world without instrumentation or interruption, even for a single task setting. Though our work does not directly study continual lifelong learning, nor all facets of developmental robotics, it relates to continual learning (Lesort et al., 2019), intrinsic motivation (Schmidhuber, 2006) and sensory-motor development involving proprioceptive manipulation (Stoica, 2001).
+
+# 6 EXPERIMENTS
+
+In our experimental evaluation, we study how well the R3L system, described in Sections 2 and 4, can learn under realistic settings – visual observations, no hand-specified rewards, and no resets. We consider the following hypotheses:
+
+1. Can we use R3L to learn complex robotic manipulation tasks without instrumentation? Does this system learn skills in both simulation and the real world?
+2. Do the solutions proposed in Section 4 actually enable R3L to perform tasks without instrumentation that would not have been otherwise possible?
+
+# 6.1 EXPERIMENTAL SETUP
+
+We consider the task of dexterous manipulation with a three fingered robotic hand, the D'Claw (Zhu et al., 2019; Ahn et al., 2019), on a number of simulated and real world tasks. These tasks involve complex coordination of three fingers with 3 DoF each in order to manipulate objects. Prior works that used this robot utilized explicit resets and low-dimensional true state observations, while we consider settings with visual observations, no hand-specified rewards, and no resets.
+
+
+Figure 6: Visualizations of the goal configurations of the simulated and real world tasks being considered. From left to right we depict valve rotation, bead manipulation and free object repositioning in simulation, as well as valve rotation and bead manipulation manipulation in the real world.
+
+
+
+
+
+
+
+
+
+The tasks in our experiments are shown in Fig 6: manipulating beads on an abacus row, valve rotation, and free object repositioning. These tasks represent a wide class of problems that robots might encounter in the real world. For each task, we consider the problem of reaching the depicted goal configuration: moving the abacus beads to a particular position, rotating the valve to a particular angle, and repositioning the free object to a particular goal position. For each task, policies are evaluated from a wide selection of initial configurations. Additional details about the tasks and evaluation procedures are provided in Appendix C. Videos and additional details can be found at https://sites.google.com/view/realworld-rl/
+
+# 6.2 LEARNING IN SIMULATION WITHOUT INSTRUMENTATION
+
+We compare our entire proposed system implementation (Section 4) with a number of baselines and ablations. Importantly, all methods must operate under the same assumptions: none of the algorithms have access to system instrumentation for state estimation, reward specification, or episodic resets. Firstly, we compare the performance of R3L to a system which uses SAC for vision-based RL from raw pixels, VICE for providing rewards and running reset-free (denoted as "VICE"). This corresponds to the vanilla version of R3L (Section 2), with none of the proposed insights and changes. We then compare with prior reset-free RL algorithms (Eysenbach et al., 2018) that explicitly learn a reset controller to alternate goals in the state space ("Reset Controller + VAE"). Lastly, we compare algorithm performance with two ablations: running R3L without the perturbation controller ("VICE + VAE") and without the unsupervised learning ("R3L w/o VAE"). This highlights the significance of each of the components of R3L.
+
+From the experimental results in Fig 7, it is clear that R3L is able to reach the best performance across tasks, while none of the other methods are able to solve all of the tasks. Different prior methods and ablations fail for different reasons: (1) methods without the reconstruction objective struggle at parsing the high-dimensional input and are unable to solve the harder task; (2) methods
+
+
+Figure 7: Quantitative evaluation of performance in simulation for bead manipulation, valve rotation and free object repositioning (left to right) run with 10 random seeds. The error bars show $95\%$ bootstrap confidence intervals for average performance. While other variants are sufficient to get good evaluation performance on easier tasks, harder tasks like free object repositioning require random perturbations and unsupervised representation learning to learn skills reset-free. See Appendix C.1 for details of evaluation procedures.
+
+
+
+
+
+without the perturbation controller are ineffective at learning how to reach the goal from novel initialization positions for the more challenging object repositioning tasks, as discussed in Section 4.
+
+We note that an explicit reset controller, which can be viewed as a softer version of our perturbation controller with goal-directedness, learns to solve the easier tasks due to the reset controller encouraging exploration of the state space. In our experiments for free object repositioning, performance was reported across 3 choices of reset states. The high variance in evaluation performance indicates that the performance of such a controller (or a goal conditioned variant of it) is highly sensitive to the choice of reset states. A poor choice of reset states, such as two that are very close together, may yield poor exploration leading to performance similar to the single goal VICE baseline. Furthermore, the choice of reset states is highly task dependent and it is often not clear what choice of goals will yield the best performance. On the contrary, our method does not require such task-specific knowledge and uses random perturbations to reset while training without any explicit reset states: this allows for a robust, instrumentation-free controller while also ensuring fast convergence.
+
+# 6.3 LEARNING IN THE REAL WORLD WITHOUT INSTRUMENTATION
+
+Since the aim of R3L is to enable uninstrumented training in the real world, we next evaluate our method on a real-world robotic system, providing evidence that our insights generalize to the real world without any instrumentation. After providing the initial outcome examples for learning the reward function with VICE, we leave the robot unattended, and the algorithm learns the desired behavior through interaction. The experiments are performed on the D'Claw robotic hand with an RGB camera as the only sensory input. Intermediate policies are saved at regular intervals, and evaluations of all policies is performed after training has completed. For valve rotation, we declare an evaluation rollout a success if the final orientation is within within $15^{\circ}$ of the goal. For bead manipulation, we declare success if all the beads are within 2cm of the goal state. Fig 8 compares the performance of our method without supervised learning ("R3L w/o VAE") in the real world against a baseline that uses SAC for vision-based RL from raw pixels, VICE for providing rewards, and running reset-free (denoted as "VICE"). We see that our method learns policies that succeed from nearly all the initial configurations, whereas VICE alone fails from most initial configurations. Fig 9 depicts sample evaluation rollouts of the policies learned using our method. For further details about real world experiments see Appendix C.2.
+
+# 7 DISCUSSION
+
+We presented the design and instantiation of a system for real world reinforcement learning. We identify and investigate the various ingredients required for such a system to scale gracefully with minimal human engineering and supervision. We show that this system must be able to learn from raw sensory observations, learn from very easily specified reward functions without reward engineering, and learn without any episodic resets. We describe the basic elements that are required
+
+
+Figure 8: Quantitative evaluation of performance in real-world for valve rotation and bead manipulation. Policies trained with perturbation controllers have effectively learned behaviors after 17 and 5 hours of training, respectively. For more fine-grained reporting of results see Figs 13-16.
+
+
+
+
+
+
+Figure 9: Evaluation rollouts of R3L on the real world tasks for policies trained without instrumentation. Successful evaluation rollouts for bead manipulation (top) and valve rotation (bottom) are shown here.
+
+to construct such a system, and identify unexpected learning challenges that arise from interplay of these elements. We propose simple and scalable fixes to these challenges through introducing unsupervised representation learning and a randomized perturbation controller.
+
+The ability to train robots directly in the real world with minimal instrumentation opens a number of exciting avenues for future research. Robots that can learn unattended, without resets or hand-designed reward functions, can in principle collect very large amounts of experience autonomously, which may enable very broad generalization in the future. However, there are also a number of additional challenges, including sample complexity, optimization and exploration difficulties on more complex tasks, safe operation, communication latency, sensing and actuation noise, and so forth, all of which would need to be addressed in future work in order to enable truly scalable real-world robotic learning.
+
+# ACKNOWLEDGMENTS
+
+This research is supported by the Office of Naval Research, the National Science Foundation under IIS-1651843 and IIS-1700696, Google, NVIDIA, and Amazon. The authors would like to thank Ignasi Clavera, Gregory Kahn, Coline Devin, Benjamin Eysenbach, Aviral Kumar, Anusha Nagabandi, Marvin Zhang, Ashvin Nair and several others in the RAIL Lab for helpful discussions and feedback.
+
+# REFERENCES
+
+Michael Ahn, Henry Zhu, Kristian Hartikainen, Hugo Ponte, Abhishek Gupta, Sergey Levine, and Vikash Kumar. ROBEL: RObotics BEnchmarks for Learning with low-cost robots. In Conference on Robot Learning (CoRL), 2019.
+Ankesh Anand, Evan Racah, Sherjil Ozair, Yoshua Bengio, Marc-Alexandre Côté, and R. Devon Hjelm. Unsupervised state representation learning in atari. arXiv, 2019.
+Marcin Andrychowicz, Bowen Baker, Maciek Chogiej, Rafal Jozefowicz, Bob McGrew, Jakub Pachocki, Arthur Petron, Matthias Plappert, Glenn Powell, Alex Ray, et al. Learning dexterous in-hand manipulation. arXiv preprint arXiv:1808.00177, 2018.
+Minoru Asada, Koh Hosoda, Yasuo Kuniyoshi, Hiroshi Ishiguro, Toshio Inui, Yuichiro Yoshikawa, Masaki Ogino, and Chisato Yoshida. Cognitive developmental robotics: A survey. IEEE Trans. Autonomous Mental Development, 1(1):12-34, 2009. doi: 10.1109/TAMD.2009.2021702. URL https://doi.org/10.1109/TAMD.2009.2021702.
+Yuri Burda, Harrison Edwards, Amos Storkey, and Oleg Klimov. Exploration by random network distillation. arXiv preprint arXiv:1810.12894, 2018.
+Yevgen Chebotar, Mrinal Kalakrishnan, Ali Yahya, Adrian Li, Stefan Schaal, and Sergey Levine. Path integral guided policy search. CoRR, abs/1610.00529, 2016.
+Yevgen Chebotar, Karol Hausman, Marvin Zhang, Gaurav Sukhatme, Stefan Schaal, and Sergey Levine. Combining model-based and model-free updates for trajectory-centric reinforcement learning. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 703-711. JMLR.org, 2017.
+Paul F Christiano, Jan Leike, Tom Brown, Miljan Martic, Shane Legg, and Dario Amodei. Deep reinforcement learning from human preferences. In Advances in Neural Information Processing Systems, pp. 4299-4307, 2017.
+Ignasi Clavera, Jonas Rothfuss, John Schulman, Yasuhiro Fujita, Tamim Asfour, and Pieter Abbeel. Model-Based Reinforcement Learning via Meta-Policy Optimization. arXiv e-prints, art. arXiv:1809.05214, Sep 2018.
+Coline Devin, Pieter Abbeel, Trevor Darrell, and Sergey Levine. Deep object-centric representations for generalizable robot learning. In 2018 IEEE International Conference on Robotics and Automation (ICRA), pp. 7111-7118. IEEE, 2018.
+Benjamin Eysenbach, Shixiang Gu, Julian Ibarz, and Sergey Levine. Leave no trace: Learning to reset for safe and autonomous reinforcement learning. In International Conference on Learning Representations (ICLR), 2018.
+Chelsea Finn and Sergey Levine. Deep visual foresight for planning robot motion. CoRR, abs/1610.00696, 2016. URL http://arxiv.org/abs/1610.00696.
+Justin Fu, Avi Singh, Dibya Ghosh, Larry Yang, and Sergey Levine. Variational inverse control with events: A general framework for data-driven reward definition. In Advances in Neural Information Processing Systems, 2018.
+Shixiang Gu, Ethan Holly, Timothy Lillicrap, and Sergey Levine. Deep reinforcement learning for robotic manipulation with asynchronous off-policy updates. In 2017 IEEE international conference on robotics and automation (ICRA), pp. 3389-3396. IEEE, 2017.
+Abhishek Gupta, Clemens Eppner, Sergey Levine, and Pieter Abbeel. Learning dexterous manipulation for a soft robotic hand from human demonstrations. 2016 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), pp. 3786-3793, 2016.
+Tuomas Haarnoja, Aurick Zhou, Pieter Abbeel, and Sergey Levine. Soft actor-critic: Off-policy maximum entropy deep reinforcement learning with a stochastic actor. In Proceedings of the 35th International Conference on Machine Learning, 2018a.
+
+Tuomas Haarnoja, Aurick Zhou, Kristian Hartikainen, George Tucker, Sehoon Ha, Jie Tan, Vikash Kumar, Henry Zhu, Abhishek Gupta, Pieter Abbeel, and Sergey Levine. Soft actor-critic algorithms and applications. arXiv preprint arXiv:1812.05905, 2018b.
+Weiqiao Han, Sergey Levine, and Pieter Abbeel. Learning compound multi-step controllers under unknown dynamics. In 2015 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), pp. 6435-6442. IEEE, 2015.
+R Devon Hjelm, Alex Fedorov, Samuel Lavoie-Marchildon, Karan Grewal, Phil Bachman, Adam Trischler, and Yoshua Bengio. Learning deep representations by mutual information estimation and maximization. In International Conference on Learning Representations, 2019. URL https://openreview.net/forum?id=Bklr3j0cKX.
+Max Jaderberg, Volodymyr Mnih, Wojciech Marian Czarnecki, Tom Schaul, Joel Z Leibo, David Silver, and Koray Kavukcuoglu. Reinforcement learning with unsupervised auxiliary tasks. arXiv preprint arXiv:1611.05397, 2016.
+Dmitry Kalashnikov, Alex Irpan, Peter Pastor, Julian Ibarz, Alexander Herzog, Eric Jang, Deirdre Quillen, Ethan Holly, Mrinal Kalakrishnan, Vincent Vanhoucke, et al. Qt-opt: Scalable deep reinforcement learning for vision-based robotic manipulation. arXiv preprint arXiv:1806.10293, 2018.
+Katie Kang, Suneel Belkhale, Gregory Kahn, Pieter Abbeel, and Sergey Levine. Generalization through Simulation: Integrating Simulated and Real Data into Deep Reinforcement Learning for Vision-Based Autonomous Flight. arXiv e-prints, art. arXiv:1902.03701, Feb 2019.
+Diederik P. Kingma and Max Welling. Auto-encoding variational bayes. CoRR, abs/1312.6114, 2013.
+Vikash Kumar, Emanuel Todorov, and Sergey Levine. Optimal control with learned local models: Application to dexterous manipulation. In 2016 IEEE International Conference on Robotics and Automation (ICRA), pp. 378-383. IEEE, 2016.
+Alex X. Lee, Anusha Nagabandi, Pieter Abbeel, and Sergey Levine. Stochastic latent actor-critic: Deep reinforcement learning with a latent variable model. CoRR, abs/1907.00953, 2019.
+Timothee Lesort, Vincenzo Lomonaco, Andrei Stoian, Davide Maltoni, David Filliat, and Natalia Diaz Rodríguez. Continual learning for robotics. CoRR, abs/1907.00182, 2019. URL http://arxiv.org/abs/1907.00182.
+Sergey Levine and Vladlen Koltun. Guided policy search. In Proceedings of The 30th International Conference on Machine Learning, 2013.
+Sergey Levine, Chelsea Finn, Trevor Darrell, and Pieter Abbeel. End-to-end training of deep visuomotor policies. J. Mach. Learn. Res., 17(1), 2016. ISSN 1532-4435.
+Timothy P. Lillicrap, Jonathan J. Hunt, Alexander Pritzel, Nicolas Heess, Tom Erez, Yuval Tassa, David Silver, and Daan Wierstra. Continuous control with deep reinforcement learning. arXiv preprint arXiv:1509.02971, 2015.
+YuXuan Liu, Abhishek Gupta, Pieter Abbeel, and Sergey Levine. Imitation from observation: Learning to imitate behaviors from raw video via context translation. In 2018 IEEE International Conference on Robotics and Automation (ICRA), pp. 1118-1125. IEEE, 2018.
+Max Lungarella, Giorgio Metta, Rolf Pfeifer, and Giulio Sandini. Developmental robotics: a survey. Connection Science, 15(4):151-190, 2003. doi: 10.1080/09540090310001655110.
+Volodymyr Mniih, 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), 2015.
+
+Anusha Nagabandi, Kurt Konoglie, Sergey Levine, and Vikash Kumar. Deep Dynamics Models for Learning Dexterous Manipulation. In Conference on Robot Learning (CoRL), 2019.
+Ashvin Nair, Vitchyr Pong, Murtaza Dalal, Shikhar Bahl, Steven Lin, and Sergey Levine. Visual reinforcement learning with imagined goals. CoRR, abs/1807.04742, 2018.
+Andrew Y. Ng and Stuart J. Russell. Algorithms for inverse reinforcement learning. In Proceedings of the Seventeenth International Conference on Machine Learning, ICML '00, 2000. ISBN 1-55860-707-2.
+Xue Bin Peng, Marcin Andrychowicz, Wojciech Zaremba, and Pieter Abbeel. Sim-to-Real Transfer of Robotic Control with Dynamics Randomization. arXiv e-prints, art. arXiv:1710.06537, Oct 2017.
+Lerrel Pinto, Marcin Andrychowicz, Peter Welinder, Wojciech Zaremba, and Pieter Abbeel. Asymmetric actor critic for image-based robot learning. arXiv preprint arXiv:1710.06542, 2017a.
+Lerrel Pinto, James Davidson, Rahul Sukthankar, and Abhinav Gupta. Robust adversarial reinforcement learning. In Doina Precup and Yee Whye Teh (eds.), Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pp. 2817-2826, International Convention Centre, Sydney, Australia, 06-11 Aug 2017b. PMLR. URL http://proceedings.mlr.press/v70/pintol7a.html.
+Connor Schenck and Dieter Fox. Visual closed-loop control for pouring liquids. In 2017 IEEE International Conference on Robotics and Automation (ICRA), pp. 2629-2636. IEEE, 2017.
+Jürgen Schmidhuber. Developmental robotics, optimal artificial curiosity, creativity, music, and the fine arts. Connect. Sci., 18(2):173-187, 2006. doi: 10.1080/09540090600768658. URL https://doi.org/10.1080/09540090600768658.
+John Schulman, Sergey Levine, Pieter Abbeel, Michael Jordan, and Philipp Moritz. Trust region policy optimization. In International conference on machine learning, pp. 1889-1897, 2015.
+John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017.
+Avi Singh, Larry Yang, Kristian Hartikainen, Chelsea Finn, and Sergey Levine. End-to-end robotic reinforcement learning without reward engineering. In Robotics: Science and Systems (RSS), 2019.
+Adrian Stoica. Robot fostering techniques for sensory-motor development of humanoid robots. Robotics and Autonomous Systems, 37(2-3):127-143, 2001. doi: 10.1016/S0921-8890(01)00154-3. URL https://doi.org/10.1016/S0921-8890(01)00154-3.
+Sainbayar Sukhbaatar, Zeming Lin, Ilya Kostrikov, Gabriel Synnaeve, Arthur Szlam, and Rob Fergus. Intrinsic motivation and automatic curricula via asymmetric self-play. In 6th International Conference on Learning Representations, ICLR 2018, 2018.
+Sebastian Thrun and Tom M. Mitchell. Lifelong robot learning. Robotics and Autonomous Systems, 15(1-2):25-46, 1995. doi: 10.1016/0921-8890(95)00004-Y. URL https://doi.org/10.1016/0921-8890(95)00004-Y.
+Josh Tobin, Rachel Fong, Alex Ray, Jonas Schneider, Wojciech Zaremba, and Pieter Abbeel. Domain Randomization for Transferring Deep Neural Networks from Simulation to the Real World. arXiv e-prints, art. arXiv:1703.06907, Mar 2017.
+Eric Tzeng, Coline Devin, Judy Hoffman, Chelsea Finn, Pieter Abbeel, Sergey Levine, Kate Saenko, and Trevor Darrell. Adapting Deep Visuomotor Representations with Weak Pairwise Constraints. arXiv e-prints, art. arXiv:1511.07111, Nov 2015.
+Matej Vecerik, Todd Hester, Jonathan Scholz, Fumin Wang, Olivier Pietquin, Bilal Piot, Nicolas Heess, Thomas Rothörl, Thomas Lampe, and Martin A. Riedmiller. Leveraging demonstrations for deep reinforcement learning on robotics problems with sparse rewards. CoRR, abs/1707.08817, 2017. URL http://arxiv.org/abs/1707.08817.
+
+Hongyi Zhang, Moustapha Cisse, Yann N. Dauphin, and David Lopez-Paz. mixup: Beyond empirical risk minimization. In International Conference on Learning Representations, 2018.
+Henry Zhu, Abhishek Gupta, Aravind Rajeswaran, Sergey Levine, and Vikash Kumar. Dexterous manipulation with deep reinforcement learning: Efficient, general, and low-cost. In 2019 International Conference on Robotics and Automation (ICRA), pp. 3651-3657. IEEE, 2019.
+
+# A ALGORITHM DETAILS
+
+Algorithm 1 Real-World Robotic Reinforcement Learning (R3L)
+1: procedure R3L
+2: $N\gets$ number of training epochs
+3: $H\gets$ trajectory length (horizon)
+4: $n_{\mathrm{VICE}}\gets$ number of VICE classifier training iterations per epoch
+5: Initialize forward and perturbing policies $\pi_0,\pi_1$
+6: Obtain goal states $s_i^E$ and initialize as a goal pool $\mathcal{G}$
+7: Initialize RND target and predictor networks $f(s),\hat{f} (s)$
+8: Initialize VICE reward classifier $r_{\mathrm{VICE}}(s)$
+9: Initialize replay buffer $\mathcal{D}$
+10: Collect initial exploration data and add to $\mathcal{D}$
+11: for $i = 1$ to $2N$ do
+12: $k\gets i\% 2$
+13: for $t = 1$ to $H$ do
+14: Sample $a_{t}\sim \pi_{k}(s_{t})$
+15: Sample $s_{t + 1}\sim p(s_{t + 1}|s_t,a_t)$
+16: if $\mathrm{k} == 0$ then
+17: $r_t(s_t) = c_{\mathrm{VICE}}*r_{\mathrm{VICE}}(s_t) + c_{\mathrm{RND}}*r_{\mathrm{RND}}(s_t)$
+18: else if $\mathrm{k} == 1$ then
+19: $r_t(s_t) = r_{\mathrm{RND}}(s_t)$
+20: end if
+21: Sample batch from $\mathcal{D}$
+22: Update $\pi_k$ with batch according to SAC
+23: Update RND predictor network with batch
+24: Update running estimate of standard deviations of classifier and RND reward
+25: end for
+26: Add experience to the replay buffer with $\mathcal{D}\gets \mathcal{D}\cup \tau_i$
+27: Sample an equal number of goal examples from $\mathcal{G}$ and negative examples from $\mathcal{D}$
+28: for $t = 1$ to $n_{\mathrm{VICE}}$ do
+29: Train the VICE classifier on this batch with binary labels
+30: end for
+31: end for
+32: end procedure
+
+# B TRAINING DETAILS
+
+B.0.1 HYPERPARAMETERS
+
+| General | |
| Standard deviation up-date coefficient | 0.99 |
| Image Sizes | [(16, 16, 3), (32, 32, 3), (64, 64, 3)] |
| SAC | |
| Learning Rate | 3e-4 |
| γ | 0.99 |
| Batch Size | 256 |
| Convnet Filters | [(64, 64, 64), (16, 32, 64)] |
| Stride | (2, 2) |
| Kernel Sizes | (3, 3) |
| Pooling | [MaxPool2D, None] |
| Actor/Critic FC Lay-ers | [(512, 512), (256, 256, 256)] |
| VICE | |
| nVICE | [1, 5, 10] |
| Batch Size | 128 |
| Learning Rate | 1e-4 |
| Mixup α | Uniform(0, 1) |
| Convnet Filters | [(64, 64, 64), (16, 32, 64)] |
| Stride | (2, 2) |
| Kernel Sizes | (3, 3) |
| Pooling | [MaxPool2D, None] |
| FC Layers | [(512, 512), (256, 256, 256)] |
| RND | |
| Learning Rate | 3e-4 |
| Batch Size | 256 |
| Convnet Filters | (16, 32, 64) |
| Stride | (2, 2) |
| Kernel Sizes | (3, 3) |
| Pooling | [MaxPool2D, None] |
| FC Layers | [(512, 512), (256, 256, 256)] |
| VAE | |
| Learning Rate | 1e-4 |
| Batch Size | 256 |
| Encoder (Convnet) | (64, 64, 32) |
| Filters | |
| Latent Dimension | [8, 16, 32, 64] |
| β | [1e-3, 0.1, 0.5, 1, 10] |
| Stride | (2, 2) |
| Kernel Sizes | (3, 3) |
| Pooling | [MaxPool2D, None] |
+
+The ranges of values listed above represent the hyperparameters we searched over, and the bolded values are what we use in the Section 6 experiments.
+
+# B.0.2 VICE
+
+We use a variant of VICE which defines the reward as the logits of the classifier, notably omitting the $-\log(\pi(a|s))$ term. We also regularize our classifier with mixup (Zhang et al., 2018). We train all of our experiments using 200 goal images, which takes under an hour to collect in the real world for each task.
+
+# B.0.3 RANDOM NETWORK DISTILLATION (RND)
+
+We found it important to normalize the predictor errors, just as (Burda et al., 2018) did.
+
+# B.0.4 VAE
+
+We train a standard beta-VAE to maximize the evidence lower bound, given by:
+
+$$
+\mathbb {E} _ {z \sim q _ {\phi} (z | x)} \left[ p _ {\theta} (x | z) \right] - \beta D _ {\mathrm {K L}} \left(q _ {\phi} (z | x) \mid \mid p _ {\theta} (z)\right)
+$$
+
+To collect training data, we sampled random states in the observation space. In the real world, this sampling can be replaced with training an exploratory policy (i.e. using the RND reward as the policy's only objective). The learned weights of the encoder of the VAE are frozen, and the latent input is used to train the policy for reset-free RL.
+
+# C TASK DETAILS
+
+# C.1 SIMULATED TASKS
+
+We evaluated our system across three tasks in simulation: bead manipulation, valve rotation, free object repositioning.
+
+# C.1.1 BEAD MANIPULATION
+
+The bead manipulation task involves an abacus rod with four beads that can slide freely. The goal is to position two beads on each end from any initial configuration of beads. This can take the form of sliding one bead over (if three beads start on one side), two beads over (if all four beads start on one side), splitting beads apart (all four beads start in the middle), or some intermediate combination of those. The true reward is defined as the mean goal distance of all four beads. Policies are evaluated starting from the 8 initial configurations depicted in Fig 10. Evaluation performance reported in Section 6 for this task is defined as the final reward averaged across the 8 evaluation rollouts.
+
+
+
+
+
+
+
+
+
+
+Figure 10: These are the 8 initial positions used for evaluating the performance of the bead manipulation policy. The goal configuration (which is also an initial evaluation position) is highlighted in yellow.
+
+
+
+
+
+
+
+# C.1.2 VALVE ROTATION
+
+The claw is positioned above a three pronged valve (15 cm in diameter). The objective is to turn the valve to a given orientation from any initial orientation. The "true reward" is $r = -\log (|\theta_{state} - \theta_{goal}|)$ . Policies are evaluated starting from the 8 initial configurations depicted in Fig 11. Evaluation performance reported in Section 6 for this task is defined as the final orientation distance averaged across the 8 evaluation rollouts.
+
+# C.1.3 FREE OBJECT REPOSITIONING
+
+The claw is positioned atop a free (6 DoF) three pronged object (15cm in diameter), which can translate and rotate within a 30cmx30cm box. The goal is specified by a xy-position as well as a z-angle, where the xy-plane is the plane of the arena. The true reward is defined as the weighted sum of the angular and translational distances, $r = -2\log (\left|\left[x_{state},y_{state}\right] - \left[x_{goal},y_{goal}\right]\right|_{2}) -$
+
+
+
+
+
+
+
+
+
+
+Figure 11: These are the 8 initial positions used for evaluating the performance of the valve rotation policy. The goal configuration (which is also an initial evaluation position) is highlighted in yellow.
+
+
+
+
+
+
+
+$\log (|\theta_{state} - \theta_{goal}|)$ . In our experiments, $(x,y,\theta)_{goal} = (0,0, - \frac{\pi}{2})$ , where the origin is centered in the arena. Policies are evaluated starting from the 15 initial configurations depicted in Figure 12. Evaluation performance reported in Section 6 for this task is defined as the final pose distance $\left(\frac{||[x_{final},y_{final}] - [x_{goal},y_{goal}]]|_2}{0.25\mathrm{m}} +\frac{|\theta_{final} - \theta_{goal}|}{\pi\mathrm{rad}}\right)$ averaged across the 15 evaluation rollouts.
+
+In our reset controller experiments, we averaged evaluation performance over three different choices of reset states, where the first reset state is always the goal:
+
+1. $(x,y,\theta)_{reset,1} = (x,y,\theta)_{goal},(x,y,\theta)_{reset,2} = (0.05,0.05,\frac{\pi}{2})$
+2. $(x,y,\theta)_{reset,1} = (x,y,\theta)_{goal},(x,y,\theta)_{reset,2} = (0,0, - \frac{\pi}{6})$
+3. $(x,y,\theta)_{reset,1} = (x,y,\theta)_{goal},(x,y,\theta)_{reset,2} = (-0.04, - 0.04, - \frac{\pi}{2})$
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Figure 12: These are the 15 initial positions used for evaluating the performance of the free object repositioning policy. The goal configuration $(x,y,\theta)_{\text{goal}}$ which is also an initial evaluation position is highlighted in yellow.
+
+
+
+
+
+
+
+
+
+# C.2 REAL WORLD TASKS
+
+For each setup we use an RGB camera to get images. We execute actions on the DClaw at $10\mathrm{Hz}$ . In order to operate at such a high frequency while also training from images we sample and train asynchronously, but limit training to not exceed two gradient steps per transition sampled in the real world. Since direct performance metrics cannot be measured during training due to the lack of object instrumentation, evaluations of performance are done post-training.
+
+# C.2.1 VALVE ROTATION
+
+The task is identical to the one in simulation. Evaluations were done post-training. An evaluation trajectory was defined as a success if at the last step, the valve was within 15 degrees of the goal. Each policy was evaluated over 8 rollouts, with initial configurations evenly spaced out between at increments of 45 degrees. Results are reported in Figures 13, 14.
+
+# C.2.2 BEAD MANIPULATION
+
+The rod is $22\mathrm{cm}$ in length, and each bead measures $3.5\mathrm{cm}$ in diameter. Evaluations were done post-training, using the following procedure: the environment was manually reset to each of the 8 specified configurations shown in Figures 15 and 16 (which cover a full range of the state space) at the start of each evaluation rollout. An evaluation trajectory was defined as a success if at the last time step, all beads were within $2\mathrm{cm}$ of their goal positions. Performance was evaluated at around 20 hours, at which point the policy achieved greater than $80\%$ success on the 10 evaluation rollouts (a random policy achieved a success rate of $10\%$ ). Results are reported in Figs 15, 16.
+
+
+Figure 13: These are the results of the evaluation rollouts on the valve rotation task in the real world using our method (without the VAE). Trained policies were saved at regular intervals and evaluated post-training. Each row is a different policy, and each column an evaluation rollout from a different initial configuration. The goal is highlighted in yellow. Our method is able to achieve high success rates after 5 hours of training.
+
+
+Figure 14: These are the results of evaluation rollouts on the valve rotation task in the real world using the VICE single goal baseline. The policies fail to evaluate well, especially from initial positions far from the goal position.
+
+
+Figure 15: These are the results of the evaluation rollouts on the valve rotation task in the real world using our method (without the VAE). Trained policies were saved at regular intervals and evaluated post-training. Each row is a different policy, and each column an evaluation rollout from a different initial configuration. The goal is highlighted in yellow. Our method is able to achieve high success rates after 17 hours of training.
+
+
+Figure 16: These are the results of evaluation rollouts on the valve rotation task in the real world using the VICE single goal baseline. The policies fail to evaluate consistently, except when the initial configuration matches the goal configuration.
\ No newline at end of file
diff --git a/theingredientsofrealworldroboticreinforcementlearning/images.zip b/theingredientsofrealworldroboticreinforcementlearning/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..b2642d04854ae14fbf3b3a24dd54c35369479b04
--- /dev/null
+++ b/theingredientsofrealworldroboticreinforcementlearning/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f9d276fe0788feee14b0a9b9e50d2d638fdd8fe0fd333db47e10282d58671adb
+size 933182
diff --git a/theingredientsofrealworldroboticreinforcementlearning/layout.json b/theingredientsofrealworldroboticreinforcementlearning/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..71688e0e4571420dcc467808fd388b1773eeb255
--- /dev/null
+++ b/theingredientsofrealworldroboticreinforcementlearning/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f89b218762c39c622e48a2f3688d0b91bb18f8013d06fabfcffc1b67dca98eba
+size 478806
diff --git a/theintriguingroleofmodulecriticalityinthegeneralizationofdeepnetworks/df21f30a-4695-43dc-b441-d56424d2d2a4_content_list.json b/theintriguingroleofmodulecriticalityinthegeneralizationofdeepnetworks/df21f30a-4695-43dc-b441-d56424d2d2a4_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..d7ed36f3c51d998488768b4585b7faa65d94185e
--- /dev/null
+++ b/theintriguingroleofmodulecriticalityinthegeneralizationofdeepnetworks/df21f30a-4695-43dc-b441-d56424d2d2a4_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:098ceaf7520f132aef442cf2110ac5baf1c170fdcd418c50c835b70f08ba359a
+size 113596
diff --git a/theintriguingroleofmodulecriticalityinthegeneralizationofdeepnetworks/df21f30a-4695-43dc-b441-d56424d2d2a4_model.json b/theintriguingroleofmodulecriticalityinthegeneralizationofdeepnetworks/df21f30a-4695-43dc-b441-d56424d2d2a4_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..8baf5001ee42992c24cb93bcb35ffc5f91fefc82
--- /dev/null
+++ b/theintriguingroleofmodulecriticalityinthegeneralizationofdeepnetworks/df21f30a-4695-43dc-b441-d56424d2d2a4_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:1aabc2d39704e2ed751d9195f0678f00a8304eb721b8cad607ad54a42bb19ada
+size 132976
diff --git a/theintriguingroleofmodulecriticalityinthegeneralizationofdeepnetworks/df21f30a-4695-43dc-b441-d56424d2d2a4_origin.pdf b/theintriguingroleofmodulecriticalityinthegeneralizationofdeepnetworks/df21f30a-4695-43dc-b441-d56424d2d2a4_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..43f1c94d767dc573124ea79c46d3c4614fab83a6
--- /dev/null
+++ b/theintriguingroleofmodulecriticalityinthegeneralizationofdeepnetworks/df21f30a-4695-43dc-b441-d56424d2d2a4_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:79dde9fd2b90f37fbb18f454e4f44bfbdc2388b62efe38db66ef0c69a1eac962
+size 5205865
diff --git a/theintriguingroleofmodulecriticalityinthegeneralizationofdeepnetworks/full.md b/theintriguingroleofmodulecriticalityinthegeneralizationofdeepnetworks/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..441edbc75f3ce231d66693f74abdb471a7df43d2
--- /dev/null
+++ b/theintriguingroleofmodulecriticalityinthegeneralizationofdeepnetworks/full.md
@@ -0,0 +1,475 @@
+# THE INTRIGUING ROLE OF MODULE CRITICALITY IN THE GENERALIZATION OF DEEP NETWORKS
+
+Niladri S. Chatterji
+
+University of California, Berkeley
+chatterji@berkeley.edu
+
+Behnam Neyshabur
+
+Google
+
+neyshabur@google.com
+
+Hanie Sedghi
+
+Google
+
+hsedghi@google.com
+
+# ABSTRACT
+
+We study the phenomenon that some modules of deep neural networks (DNNs) are more critical than others. Meaning that rewinding their parameter values back to initialization, while keeping other modules fixed at the trained parameters, results in a large drop in the network's performance. Our analysis reveals interesting properties of the loss landscape which leads us to propose a complexity measure, called module criticality, based on the shape of the valleys that connect the initial and final values of the module parameters. We formulate how generalization relates to the module criticality, and show that this measure is able to explain the superior generalization performance of some architectures over others, whereas, earlier measures fail to do so.
+
+# 1 INTRODUCTION
+
+Neural networks have had tremendous practical impact in various domains such as revolutionizing many tasks in computer vision, speech and natural language processing. However, many aspects of their design and analysis have remained mysterious to this date. One of the most important questions is "what makes an architecture work better than others given a specific task?" Extensive research in this area has led to many potential explanations on why some types of architectures have better performance; however, we lack a unified view that provides a complete and satisfactory answer. In order to attain a unified view on superiority of one architecture over another in terms of generalization performance, we need to come up with a measure that effectively captures this.
+
+Analyzing the generalization behavior of neural networks has been an active area of research since Baum & Haussler (1989). Many generalization bounds and complexity measures have been proposed so far. Bartlett (1998) emphasized the importance of the norm of the weights in predicting the generalization error. Since then various analysis have been proposed. These results are either based on covering number and Rademacher complexity (Neyshabur et al., 2015; Bartlett et al., 2017; Neyshabur et al., 2019; Long & Sedghi, 2019; Wei & Ma, 2019), or they use approaches similar to PAC-Bayes (McAllester, 1999; Dziugaite & Roy, 2017; Neyshabur et al., 2017; 2018; Arora et al., 2018; Nagarajan & Kolter, 2019a; Zhou et al., 2019). Recently authors have emphasized on the role of distance to initialization rather than norm of the weights in generalization (Dziugaite & Roy, 2017; Nagarajan & Kolter, 2019b; Neyshabur et al., 2019; Long & Sedghi, 2019). Earlier results have an exponential dependency on the depth and focus on fully connected networks. More recently, Long & Sedghi (2019) provided generalization bounds for convolutional neural networks (CNNs) and fully connected networks used in practice and their bounds have linear dependency on the depth.
+
+Despite the success of earlier works in capturing the dependency of generalization performance of a model on different parameters, they fail at the following task: Rank the generalization performance of candidate architectures for a specific task such that the ranking aligns well with the ground truth. Moreover, majority of these bounds are proposed for fully connected modules and it is not straightforward to evaluate them for different architectures such as ResNets.
+
+
+Figure 1: Module Criticality: Loss values in the valleys that connect the initial weights $\theta^0$ to the final weights $\theta^F$ of a non-critical (left) and a critical (right) module in the ResNet18 architecture. Given a ball with radius $r$ (length of the red line), module criticality can be defined as how far one can push the ball in the valley towards initialization (length of the white dashed line) divided by the radius $r$ . Hence, non-critical modules are the ones with a wide valley connecting the initial weight vector to the final one whereas in critical modules, the valley either becomes too sharp or the loss values start to increase when the ball comes too close to the initial weight. The $x$ axis is simply chosen to be parallel to $\theta^F - \theta^0$ and the $y$ axis is a compact representation of all other dimensions generated by adding Gaussian noise to the points on the convex combination of $\theta^0$ and $\theta^F$ and evaluating the loss. The sign on the $y$ axis is decided based on the sign of the inner product of the noise to $\theta^0$ .
+
+
+
+Every DNN architecture is a computation graph where each node is a module1. We are interested in understanding how different modules in the network interact with each other and influence generalization performance as a whole. To do so, we delve deeper into the phenomenon of "module criticality" which was reported by Zhang et al. (2019a). They observed that modules of the network present different robustness characteristics to parameter perturbation. Specifically, they look into the following perturbation: Rewind one module back to its initialization value while keeping all other modules fixed (at the final trained value). They note that the impact of this perturbation on network performance varies between modules and depends on which module was rewound. Some modules are "critical" meaning that rewinding their value to the initialization harms the network performance, while for others the impact of this perturbation on performance is negligible. They show that various conventional DNN architectures exhibit this phenomenon.
+
+Let us now informally define what we mean by the measure "module criticality" (see Figure 1). For each module, we move on a line from its final trained value to its initialization value (convex combination $^2$ path) while keeping all other modules fixed at their trained value. Then we measure the performance drop. Let $\theta_i^\alpha = (1 - \alpha)\theta_i^0 + \alpha \theta_i^F$ , $\alpha \in [0,1]$ be the convex combination between initial weights $\theta_i^0$ and the final weights $\theta_i^F$ at module $i$ , where $\alpha_i$ is the minimum value between 0 and 1 when performance (train error) of the network drops by at most a threshold value $\epsilon$ . If $\alpha_i$ is small we can move a long way back to initialization without hurting performance and the "module criticality" of this module would be low. Further, we also wish to incorporate the robustness to noise (that is, the valley width) for the module along this path. If the module is robust to noise along this path (that is, the valley is wide) then the module criticality would again be low (see Definition 3.1 for a formal definition).
+
+In this paper, we seek to study this phenomenon in depth and shed some light on it by showing that conventional complexity measures cannot capture criticality (see Section 2). Next, we theoretically formulate this phenomenon and analyze its role in generalization. Through this analysis, we provide
+
+
+Figure 2: Analysis of rewinding modules to initialization for the ResNet-18 architecture. Each row represents a module in ResNet18-v1 and each column represents a particular training epoch to which this module is rewound to. The difference from analysis of Zhang et al. (2019a) is that we rewind each module, whereas Zhang et al. (2019a) rewind the entire ResNet blocks.
+
+a new generalization measure that captures the dissimilarity of different modules and depicts how it influences the generalization of the corresponding DNN. Intuitively, the closer we can get to initialization for each module, the better the generalization.
+
+We analyze the relation between generalization and module criticality through a PAC-Bayesian analysis. In Section 3 we show that it is the overall network criticality measure and not the number of critical modules that controls generalization. If the network criticality measure is smaller for an architecture, it has better generalization performance. In Section 4, we demonstrate through various experiments that our proposed measure is able to distinguish between different network architectures in terms of their generalization performance. Moreover, the network criticality measure is able to correctly rank the generalization performance of different architectures better than the measures proposed earlier.
+
+Notation: We use upper case letters for matrices. The operator norm and Frobenius norm of $M$ are denoted by $\| M\| _2$ , $\| M\|_{\mathrm{Fr}}$ respectively. For $n\in \mathbb{N}$ , we use $[n]$ to denote the set $\{1,\ldots ,n\}$ . Let $\mathcal{L}_S(f)$ be the loss of function $f$ on the training set $S$ with $m$ samples. We are mainly interested in the classification task where $\mathcal{L}_S(f) = \frac{1}{m}\sum_{(x,y)\in S}\mathbf{1}[f(x)[y]\leq \max_{j\neq y}f(x)[j]]$ . For any $\gamma >0$ , we also define margin loss $\mathcal{L}_{S,\gamma}(f) = \frac{1}{m}\sum_{(x,y)\in S}\mathbf{1}[f(x)[y]\leq \gamma +\max_{j\neq y}f(x)[j]]$ . Let $\mathcal{L}_D(f)$ be the loss of function $f$ on population data distribution $D$ defined similar to $\mathcal{L}_S(f)$ . We will denote the function parameterized by $\Theta$ by $f_{\Theta}$ .
+
+# 2 TOWARDS UNDERSTANDING MODULE CRITICALITY
+
+# 2.1 SETTING
+
+A DNN architecture is a directed acyclic computation graph which may or may not be layered. In order to have a unifying definition between different architectures, we use the notion of a "module". A module is a node in the computation graph that has incoming edges from other modules and outgoing edges to other nodes, and performs a linear transformation on its inputs. For a layered model such as a VGG, a module is equivalent to a layer. On the other hand, in a ResNet some modules are parallel to each other. For example, a downsample module and the concatenation of two convolutional modules in a ResNet18-v1 architecture. Note that, similar to conventional definitions the non-linearity (such as a ReLU) is not part of the module.
+
+Let $\Theta = (\theta_{1},\dots,\theta_{d})$ correspond to all parameters of a DNN with $d$ modules, where $\theta_{i}$ refers to the weight matrix (or operator matrix in case of convolution) at module $i$ and $\dot{\theta}_i^0,\dot{\theta}_i^F$ refer to the value
+
+
+(a) A non-critical module
+
+
+(b) A critical module
+Figure 3: Spectrum of a non-critical and a critical module during different epochs of training.
+
+of weight matrix at initialization and the end of training, respectively. For sequential architectures, $d$ is equal to the depth of the network but that is not necessarily true for a general architectures such as a ResNet.
+
+# 2.2 ROBUSTNESS TO REWINDING
+
+Consider the following perturbation to a trained network at some training epoch as considered by Zhang et al. (2019a). For each module in the network, rewind its value back to its value at this training epoch while keeping the values of all other modules fixed (at their final trained value). Next, measure the change in performance of the model before and after this manipulation. We repeat a similar analysis that differs from that of Zhang et al. (2019a) in one detail. Zhang et al. (2019a) rewind the whole ResNet block at once, whereas, we rewind each module (each convolutional module) separately. This rewind analysis is shown in Figure 2 for ResNet18-v1. Each column represents a module in ResNet18-v1 and each row represents a particular training epoch to which this module is rewound to. Similar to earlier analysis, we observe that for many modules of the network, this manipulation does not influence the network performance drastically, while, for some others the impact is more pronounced. For example, in Figure 2 we look at the effect of rewinding on train error. The "Stage2.block1Conv2" module is critical, whereas, most other modules, once rewound, do not affect the performance. In Figure 6 in Appendix E we plot the effect of rewinding on different performance criteria (train loss, train error and test error) and observe that they exhibit a similar trend.
+
+A stable phenomena: The plots in Figure 2 capture a network trained with SGD with weights initialized using the standard Kaiming initialization (He et al., 2015). To ensure that the observed phenomenon is not an artifact of the training method and the initialization scheme, we repeated the experiments with different initialization and optimization methods. We saw a similar pattern. For example, Figures 7a, 7b in the appendix illustrate the pattern when we changed the initialization to Fixup (Zhang et al., 2019b), and when we replace SGD with Adam (Kingma & Ba, 2014) respectively.
+
+# 2.3 WHAT MEASURES FAIL TO DistinguISH CRITICAL LAYERS
+
+Spectrum of weight matrices: We explore the change in the spectrum of different weight matrices on rewinding and note that the spectrum for a critical and non-critical module look similar. This is shown in Figure 3. We calculate the spectrum of convolutional layers using the algorithm by Sedghi et al. (2019).
+
+Distance to initialization: Next, we analyze the operator norm of difference from initialization for each module. Figure 8 in the appendix depicts this and reveals no difference between critical and non-critical modules. A similar plot was explored by Zhang et al. (2019a), where they find that the Frobenius norm and the infinity norm also fail to capture criticality.
+
+Change in the activation patterns: We investigated the change in the activation patterns of a network when we rewind a module. To do this, we study the similarity between two networks: 1. The original trained network and 2. The network with a rewound module. We use CKA (Kornblith et al., 2019) as the measure of similarity. For a non-critical module, the original and rewound networks are similar and in case of a critical module, the similarity between the activation patterns between the two networks degrades gradually rather than abruptly. See Figure 9 in Appendix E.
+
+# 3 GENERALIZATION BOUNDS BASED ON MODULE CRITICALITY
+
+Our goal is to understand criticality and how it affects the generalization performance of a DNN. Inspired by the rewind to initialization experiments of Zhang et al. (2019a), we take one step further and consider changing the value of each module, to the convex combination of its initial and final value. That is, for each module $i$ , we replace $\theta_{i}$ with $\theta_{i}^{\alpha} = (1 - \alpha)\theta_{i}^{0} + \alpha \theta_{i}^{F}$ , $\alpha \in [0,1]$ , and keep all other layers fixed. Then we look at the effect of this perturbation on the performance of the network.
+
+Figure 4 depicts how the train error, test error and train loss change as we decrease the value of $\alpha$ in $\theta_i^\alpha$ when $i$ refers to a critical module (yellow dashdot curve), a non-critical module (red dashed curve) and all modules (blue solid curve). We find that along this convex combination path all these performance measures degrade monotonically (increase in error and loss), as we move from the final weights to the initial weights.
+
+The above experiment shows the effect of moving along a convex combination between module's initial and trained value. To capture the relation between criticality and generalization, we are interested in also accounting for the width of the valley as we move from the final value to the initial value. In particular, we are interested in analyzing what happens if we are moving inside a ball of some radius $\sigma_{i}$ around each point in this path. PAC-Bayesian analysis, looks for a ball around final value of parameters such that the loss does not change if we move in this ball. Bringing this idea together with the one mentioned above, we are interested in moving from the final value to the initial value in a valley of some radius, and want to find out how far we can move on this path. Intuitively, being able to move closer to initialization values indicate that the effective function class is smaller and hence the network should generalize better. For example, in the extreme case where none of the weights change from their initialization value the function class would be a single function (the initial function) and the generalization error would be very low ( $\sim 0\%$ ) as both the train and test error would be very high (but equal). In this paper, we consider the case of trained models where train error is very low and hence low generalization error means good performance on test data.
+
+Definition 3.1 (Module and Network Criticality). Given an $\epsilon >0$ and network $f_{\Theta}$ , we define the module criticality for module $i$ as follows:
+
+$$
+\mu_ {i, \epsilon} \left(f _ {\Theta}\right) = \min _ {0 \leq \alpha_ {i}, \sigma_ {i} \leq 1} \left\{\frac {\alpha_ {i} ^ {2} \left\| \theta_ {i} ^ {F} - \theta_ {i} ^ {0} \right\| _ {\mathrm {F r}} ^ {2}}{\sigma_ {i} ^ {2}}: \mathbb {E} _ {u \sim \mathcal {N} \left(0, \sigma_ {i} ^ {2}\right)} \left[ \mathcal {L} _ {S} \left(f _ {\theta_ {i} ^ {\alpha} + u, \Theta_ {- i} ^ {F}}\right) \right] \leq \epsilon \right\}, \tag {1}
+$$
+
+We also define the network criticality as the sum of the module criticality over modules of the network:
+
+$$
+\mu_ {\epsilon} \left(f _ {\Theta}\right) = \sum_ {i = 1} ^ {d} \mu_ {i, \epsilon} \left(f _ {\Theta}\right). \tag {2}
+$$
+
+Here, $\mathcal{L}_S$ denotes the empirical zero-one loss over the training set, $f_{\theta_i^\alpha, \Theta_{-i}^F}$ is the DNN's function value where weight matrix corresponding to $i^{th}$ module is replaced by $\theta_i^\alpha$ and all other modules are fixed at their values in the end of training, $\Theta_{-i}^F$ . $\theta_i^\alpha = (1 - \alpha)\theta_i^0 + \alpha\theta_i^F$ , where $\theta_i^0$ is the value of the weight matrix at initialization and $\theta_i^F$ is the trained value.
+
+Intuitively, network criticality measure is sum of module criticalities. This is also theoretically derived using the analysis below.
+
+# 3.1 A PAC-BAYESIAN GENERALIZATION BOUND
+
+We attempt to understand the relationship between module criticality, and generalization by deriving a generalization bound using the PAC-Bayesian framework (McAllester, 1999). Given a prior
+
+
+Figure 4: Performance degradation as we move on convex combination path from final to initial value of modules. We find that along this path the training error (as well as test error and train loss) increases monotonically from the final weights to initial weights. The blue (solid) curve is when we replace all the parameters in the network by the convex combination between their initial and final value simultaneously, the red (dashed) curve corresponds to moving on the convex path for a single (non-critical) layer and the yellow (dashdot) curve corresponds to moving on the convex path for a critical layer in ResNet-18 architecture.
+
+
+
+
+
+distribution over the parameters that is picked in advance before observing a training set, a posterior distribution over the parameters that could depend on the training set and a learning algorithm, the PAC-Bayesian framework bounds the generalization error in terms of the Kullback-Leibler (KL) divergence (Kullback & Leibler, 1951) between the posterior and the prior distribution. We use PAC-Bayesian bounds as they hold for any architecture.
+
+The intuition from Figure 4 suggests moving the parameters of each module as close as possible to the initialization value before harming the performance. For such $\alpha_{i}$ , we can then define the posterior $Q_{i}$ for module $i$ to be a Gaussian distribution centered at $\theta_{i}^{\alpha}$ with covariance matrix $\sigma_{i}^{2}I$ , that is, as if we have additive noise $u_{i} \sim \mathcal{N}(0, \sigma_{i}I)$ . We use $\Theta^{\alpha}$ to refer to the case where all the parameters $\theta_{i}$ are replaced with $\theta_{i}^{\alpha_{i}}$ and matrix $U$ includes all the noise $u_{i}$ . Then the following theorem holds.
+
+Theorem 3.2. For any data distribution $D$ , number of samples $m \in \mathbb{N}$ , for any $0 < \delta < 1$ , for any $0 < \sigma_{i} \leq 1$ and any $0 \leq \alpha_{i} \leq 1$ , with probability $1 - \delta$ over the choice of the training set $S_{m} \sim D$ the following generalization bound holds:
+
+$$
+\mathbb {E} _ {U} [ \mathcal {L} _ {D} (f _ {\Theta^ {\alpha} + U}) ] \leq \mathbb {E} _ {U} [ \mathcal {L} _ {S} (f _ {\Theta^ {\alpha} + U}) ] + \sqrt {\frac {\frac {1}{4} \sum_ {i = 1} ^ {d} k _ {i} \log \left(1 + \frac {\alpha_ {i} ^ {2} \left\| \theta_ {i} ^ {F} - \theta_ {i} ^ {0} \right\| _ {\mathrm {F r}} ^ {2}}{k _ {i} \sigma_ {i} ^ {2}}\right) + \log \left(\frac {m}{\delta}\right) + \widetilde {\mathcal {O}} (1)}{m - 1}},
+$$
+
+where $k_{i}$ is the number of parameters in module $i$ . For example, for a convolution module with kernel size $q_{i} \times q_{i}$ and number of output channels $c_{i}$ , $k_{i} = q_{i}^{2}c_{i - 1}c_{i}$ .
+
+The exact bound including the constants and the proof of the theorem above is given in Appendix A. Theorem 3.2 already gives us some insight into generalization of the original network. However, it is not exactly a generalization bound on the original network but rather on a perturbed network. We conjecture that for almost any realistic distribution $D$ , any random $\Theta^0$ , any $\Theta^F$ achieved by known gradient based optimization algorithms, any $0 \leq \alpha \leq 1$ and any $\sigma \geq 0$ , the test error does not improve by taking a convex combination of parameters and their initial values followed by Gaussian perturbation. Therefore, we have that $\mathcal{L}_D(f_{\Theta^F}) \leq \mathbb{E}_U[L_D(f_{\Theta^\alpha + U})]$ . The following corollary restates Theorem 3.2 by using this assumption and optimizing over $\alpha$ and $\sigma$ in the bound.
+
+Corollary 3.3. For any data distribution $D$ , number of samples $m \in \mathbb{N}$ . For any $\epsilon > 0$ , for any $0 < \delta$ , if $\mathcal{L}_D(f_{\Theta^F}) \leq \mathbb{E}_U[\mathcal{L}_D(f_{\Theta^\alpha + U})]$ where $u_i \sim \mathcal{N}(0, \sigma_i I)$ , then with probability $1 - \delta$ over the choice of the training set $S_m \sim D$ , the following generalization bound holds
+
+$$
+\mathcal {L} _ {D} (f _ {\Theta}) \leq \epsilon + \sqrt {\frac {\frac {1}{4} \mu_ {\epsilon} ^ {\prime} (f _ {\Theta}) + \log \left(\frac {m}{\delta}\right) + \widetilde {\mathcal {O}} (1)}{m - 1}},
+$$
+
+where $\mu_{\epsilon}^{\prime}(f_{\Theta})$ is calculated as follows:
+
+$$
+\mu_ {\epsilon} ^ {\prime} (f _ {\Theta}) = \min _ {0 \leq \alpha , \sigma \leq 1} \left\{\sum_ {i} \frac {\alpha_ {i} ^ {2} \left\| \theta_ {i} ^ {F} - \theta_ {i} ^ {0} \right\| _ {\mathrm {F r}} ^ {2}}{\sigma_ {i} ^ {2}}: \mathbb {E} _ {U} [ \mathcal {L} _ {S} (f _ {\Theta^ {\alpha} + U}) ] \leq \epsilon \right\}.
+$$
+
+Note that the above bound uses a slightly different notion of network criticality compared to Definition 3.1, as the bound requires finding $\alpha$ and $\sigma$ values simultaneously for all modules, whereas, Definition 3.1 allows us to decouple the search over $\alpha$ and $\sigma$ .
+
+Deterministic generalization bound for convolutional networks Although PAC-Bayesian bounds are data-dependent and hence numerically superior, they provide less insight about the underlying reason that results in generalization. For example, the flatness of the solution after adding Gaussian perturbation can be computed numerically. But computing this value does not reveal what properties of the network enforce the loss surface around a point to be flat. On the other hand, deterministic norm-based generalization bounds are numerically much looser yet they provide better insights into the dependence of generalization on different network parameters. In Appendix B, we build on the results of Theorem 3.2 to present a norm-based deterministic bound using module criticality.
+
+In this section, we intuitively justified network criticality measure and related the generalization of a DNN to the network criticality measure in Corollary 3.3. In the next section, we empirically show that the network criticality measure is able to correctly rank the generalization performance of different architectures better than measures proposed earlier.
+
+# 4 EXPERIMENTS
+
+We perform several experiments to compare our network criticality measure to earlier complexity measures in the literature. Our experiments are performed on the CIFAR10 and CIFAR100 datasets. For all experiments, implementation and architecture details are presented in Appendix C.
+
+Table 1 summarizes the quantities that are calculated in this section. The quantity SoSP was proposed by Long & Sedghi (2019). For the last two measures, we calculate $\sigma_{i}$ and $\alpha_{i}$ as per Definition 3.1. In our experiments, each module is a single convolutional or linear layer. This represents a natural choice where each module is a linear transformation (with respect to the parameters). This choice also leads to the lowest number of modules such that each module is a linear transformation.
+
+Table 1: Quantities of Interest
+
+| Generalization Error (GE) | LD(fΘ) - LS(fΘ) |
| Product of Frobenius Norms (PFN) | Πi||θiF||Fr |
| Product of Spectral Norms (PSN) | Πi||θiF||2 |
| Distance to Initialization (DtI) | Σi||θi0- θiF||2Fr |
| Number of Parameters (NoP) | Total number of parameters in the network |
| Sum of Spectral Norms (SoSP) | Total number of parameters ×(Σi||θi0- θiF||2) |
| PAC Bayes (at error threshold 0.1) | Σi||θi0- θiF||2Fr/σi2 |
| Network Criticality Measure (at error threshold 0.1) | Σiαi2||θi0- θiF||2Fr/σi2 |
+
+First, as a sanity check we use our complexity measure (lower is better) to compare between a ResNet18 trained on true labels and a ResNet18 trained on data where $20\%$ of the labels are randomly corrupted. As seen in Figure 5a, our measure is able to correctly capture that the network trained with true label generalizes better than the one trained on corrupted labels ( $4.62\%$ error vs. $35\%$ error).
+
+Next, in Table 2 we compare the generalization performance of several conventional DNN architectures trained on the CIFAR10 dataset. There is a particular ranking of the networks based on their generalization error and it is desirable for a complexity measure to capture this ranking. Therefore, we compare the rankings proposed by network criticality measure and complexity measures from the literature with the empirical rankings obtained in the experiment. To do this, we calculate the Kendall's $\tau$ correlation coefficient (Kendall, 1938) which is defined as follows:
+
+$$
+\text {K e n d a l l} \tau = \frac {\# \text {o f p a i r s w h e r e t h e r a n k i n g s a g r e e - \# o f p a i r s w h e r e t h e r a n k i n g s d i s a g r e e}}{\# \text {p a i r s}}.
+$$
+
+
+(a) Comparing ResNet18 on trained true labels vs. corrupted labels
+
+
+(b) Comparing ResNet18, ResNet34, VGG16 and FCN (I).
+Figure 5: Network criticality as a function of error threshold for networks trained on CIFAR10.
+
+This coefficient lies between $-1$ and $1$ , where $1$ denotes a high correlation between the two set of rankings. Table 2 shows that the Kendall's $\tau$ coefficient between our network criticality measure and the generalization error is higher than all other complexity measures that we compared to.
+
+We find that our measure correctly ranks the generalization performance of the networks - ResNet18, ResNet101, VGG16 and FCN (I). It fails to correctly identify the correct rank of ResNet34, ResNet50, DenseNet121, VGG11 and FCN (II).
+
+We also repeat the above experiment for the same networks trained on the CIFAR100 dataset (see Table 3). We note that network criticality measure correctly predicts the ranking of generalization performance for ResNet101, ResNet34, ResNet18, ResNet50, VGG16 and the 3-layer fully connected networks (FCN). We find that the generalization error of ResNet101 is the lowest which is correctly captured only by our complexity measure and not by any other measure. Further, the Kendall's $\tau$ correlation coefficient between the ranking based of the generalization error and our network criticality measure is 0.55 which is again higher than this coefficient for any other complexity measure. Our measure only fails to capture the ranking of VGG11 and DenseNet121 relative to the other DNN architectures and the relative ranking between FCN (I) and FCN (II).
+
+Table 2: Measuring complexity of different architectures trained on CIFAR10.
+
+| Network | GE | PFN | PSN | DtI | NoP | SoSP | PAC Bayes | Net. Criticality |
| ResNet18 | 4.61% | 1e22 | 4e14 | 3430 | 1.1e7 | 1.3e9 | 6.9e5 | 2.2e5 |
| ResNet34 | 6.3% | 2e37 | 3e24 | 4768 | 2.1e7 | 3.7e9 | 9.1e5 | 1.7e5 |
| ResNet50 | 6.6% | 4e56 | 4e20 | 10018 | 2.3e7 | 3.3e9 | 1.6e6 | 1.8e5 |
| ResNet101 | 6.4% | 8e110 | 3e32 | 18730 | 4.2e7 | 9.8e9 | 2.8e6 | 6.3e5 |
| DenseNet121 | 7.8% | 2e129 | 7e42 | 21359 | 6.8e6 | 2.0e9 | 1.2e6 | 4.1e5 |
| VGG11 | 8.51% | 1e11 | 1e6 | 2106 | 2.8e7 | 1.3e9 | 1.0e6 | 2.8e5 |
| VGG16 | 7.47% | 5e15 | 2e8 | 2341 | 3.4e7 | 2.1e9 | 1.2e6 | 2.70e5 |
| FCN (I) | 29.83% | 3e20 | 2e7 | 75221 | 2.0e7 | 4.6e8 | 9.0e6 | 5.7e6 |
| FCN (II) | 26.45% | 3e21 | 1e7 | 81258 | 5.0e7 | 2.0e9 | 9.5e6 | 6.2e6 |
| Kendall's τ | - | -0.22 | -0.33 | 0.38 | 0.16 | -0.53 | 0.42 | 0.55 |
+
+We also perform an additional set of experiments in Appendix D where we calculate these complexity measures on four ResNet18 networks with changing channel widths.
+
+# 5 CONCLUSION
+
+In this paper, we studied the module criticality phenomenon and proposed a complexity measure based on module criticality that is able to correctly predict the superior performance of some DNN
+
+Table 3: Measuring complexity of different architectures trained on CIFAR100.
+
+| Network | GE | PFN | PSN | DtI | NoP | SoSP | PAC Bayes | Net. Criticality |
| ResNet18 | 30.6% | 2e22 | 9e14 | 4855 | 1.1e7 | 1.4e9 | 3.4e6 | 1.6e6 |
| ResNet34 | 29.3% | 1e37 | 1e22 | 6017 | 2.1e7 | 3.6e9 | 6.7e6 | 1.4e6 |
| ResNet50 | 31.1% | 7e57 | 9e23 | 12715 | 2.3e7 | 4.1e9 | 5.8e6 | 1.9e6 |
| ResNet101 | 25.5% | 2e112 | 5e36 | 21233 | 4.2e7 | 1.1e10 | 6.4e6 | 1.3e6 |
| DenseNet121 | 35.3% | 1e131 | 1e49 | 23702 | 6.9e6 | 2.4e9 | 4.5e6 | 2.6e6 |
| VGG11 | 43.5% | 6e13 | 1e8 | 5059 | 2.8e7 | 1.7e9 | 3.6e6 | 2.4e5 |
| VGG16 | 32.69% | 8e19 | 4e12 | 7010 | 3.4e7 | 3.6e9 | 8.1e6 | 4.6e6 |
| FCN (I) | 57.59% | 8e27 | 1e10 | 246636 | 2.0e7 | 8.3e8 | 2.4e7 | 1.2e7 |
| FCN (II) | 53.17% | 1e29 | 1e10 | 329296 | 5.0e7 | 3.7e9 | 3.3e7 | 2.3e7 |
| Kendall's τ | - | -0.27 | -0.47 | 0.33 | 0 | -0.42 | 0.22 | 0.55 |
+
+architectures over others, for a specific task. We believe module criticality can be used as a road-map for designing new task-specific architectures. Proposing new regularizers that improve generalization performance by bounding criticality or spreading it among various modules of the network is an exciting direction for future work. Our measure could also be potentially used in architecture search where we could calculate this score over the training set to select architectures that generalize well on the unseen test set.
+
+# ACKNOWLEDGEMENTS
+
+We would like to thank Samy Bengio and Chiyuan Zhang for valuable conversations, and Yann Dauphin for his help with the implementation of Fixup initialization. We would also like to thank Chiyuan Zhang for sharing the code for the paper "Are all layers created equal?" Part of this work was performed while the author NC was an intern at Google AI, Brain team.
+
+# REFERENCES
+
+Sanjeev Arora, Rong Ge, Behnam Neyshabur, and Yi Zhang. Stronger generalization bounds for deep nets via a compression approach. In Proceedings of the International Conference on Machine Learning, 2018.
+Peter Bartlett. The sample complexity of pattern classification with neural networks: the size of the weights is more important than the size of the network. IEEE Transactions on Information Theory, 44(2):525-536, 1998.
+Peter Bartlett, Dylan Foster, and Matus Telgarsky. Spectrally-normalized margin bounds for neural networks. In Proceedings of the Advances in Neural Information Processing Systems, 2017.
+Eric Baum and David Haussler. What size net gives valid generalization? In Proceedings of the Advances in Neural Information Processing Systems. 1989.
+Gintare Karolina Dziugaite and Daniel Roy. Computing nonvacuous generalization bounds for deep (stochastic) neural networks with many more parameters than training data. In Proceedings of Uncertainty in Artificial Intelligence, 2017.
+Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Delving deep into rectifiers: Surpassing human-level performance on imagenet classification. In Proceedings of the IEEE International Conference on Computer Vision, 2015.
+Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2016.
+Gao Huang, Zhuang Liu, Laurens Van Der Maaten, and Kilian Weinberger. Densely connected convolutional networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2017.
+
+Maurice Kendall. A new measure of rank correlation. Biometrika, 30(1/2):81-93, 1938.
+Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
+Simon Kornblith, Mohammad Norouzi, Honglak Lee, and Geoffrey Hinton. Similarity of neural network representations revisited. In Proceedings of the International Conference on Machine Learning, 2019.
+Solomon Kullback and Richard Leibler. On information and sufficiency. The Annals of Mathematical Statistics, 22(1):79-86, 1951.
+John Langford and Rich Caruana. (not) bounding the true error. In Proceedings of the Advances in Neural Information Processing Systems, 2002.
+Philip Long and Hanie Sedghi. Generalization bounds for deep convolutional neural networks. arXiv preprint arXiv:1905.12600, 2019.
+David McAllester. PAC-bayesian model averaging. In Proceedings of the Conference on Computational Learning Theory, 1999.
+Vaishnavh Nagarajan and Zico Kolter. Deterministic PAC-Bayesian generalization bounds for deep networks via generalizing noise-resilience. In Proceedings of the International Conference on Learning Representations, 2019a.
+Vaishnavh Nagarajan and Zico Kolter. Generalization in deep networks: The role of distance from initialization. arXiv preprint arXiv:1901.01672, 2019b.
+Behnam Neyshabur, Ryota Tomioka, and Nathan Srebro. Norm-based capacity control in neural networks. In Proceedings of the Conference on Learning Theory, 2015.
+Behnam Neyshabur, Srinadh Bhojanapalli, David McAllester, and Nathan Srebro. Exploring generalization in deep learning. In Proceedings of the Advances in Neural Information Processing Systems, 2017.
+Behnam Neyshabur, Srinadh Bhojanapalli, and Nathan Srebro. A PAC-Bayesian approach to spectrally-normalized margin bounds for neural networks. In Proceedings of the International Conference on Learning Representations, 2018.
+Behnam Neyshabur, Zhiyuan Li, Srinadh Bhojanapalli, Yann LeCun, and Nathan Srebro. Towards understanding the role of over-parametrization in generalization of neural networks. In Proceedings of the International Conference on Learning Representations, 2019.
+Konstantinos Pitas, Mike Davies, and Pierre Vandergheynst. PAC-Bayesian margin bounds for convolutional neural networks. arXiv preprint arXiv:1801.00171, 2017.
+Hanie Sedghi, Vineet Gupta, and Philip Long. The singular values of convolutional layers. In Proceedings of the International Conference on Learning Representations, 2019.
+Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. In Proceedings of the International Conference on Learning Representations, 2015.
+Colin Wei and Tengyu Ma. Data-dependent sample complexity of deep neural networks via lipschitz augmentation. arXiv preprint arXiv:1905.03684, 2019.
+Chiyuan Zhang, Samy Bengio, and Yoram Singer. Are all layers created equal? arXiv preprint arXiv:1902.01996, 2019a.
+Hongyi Zhang, Yann Dauphin, and Tengyu Ma. Residual learning without normalization via better initialization. In Proceedings of the International Conference on Learning Representations, 2019b.
+Wenda Zhou, Victor Veitch, Morgane Austern, Ryan Adams, and Peter Orbanz. Non-vacuous generalization bounds at the imagenet scale: a PAC-Bayesian compression approach. In Proceedings of the International Conference on Learning Representations, 2019.
+
+# A PROOF OF THEREORM 3.2
+
+We start by stating the PAC-Bayes theorem which bounds the generalization error of any posterior distribution $Q$ on parameters $\Theta$ that can be reached using the training set given a prior distribution $P$ on parameters that should be chosen in advance and before observing the training set. Throughout this section given two scalar $p, q \in [0,1]$ let $\mathrm{KL}(p||q)$ denote the KL divergence between two Bernoulli distributions with success probabilities $p$ and $q$ respectively.
+
+Theorem A.1 (McAllester (1999)). For any data distribution $D$ , number of samples $m \in \mathbb{N}$ , training set $S_{m} \sim D$ , and prior distribution $P$ on parameters $\Theta$ , posterior distribution $Q$ , for any $0 < \delta$ , with probability $1 - \delta$ over the draw of training data we have that
+
+$$
+K L \left(\mathbb {E} _ {\Theta \sim Q} [ \mathcal {L} _ {S} (f _ {\Theta}) ] \Bigg | \Bigg | \mathbb {E} _ {\Theta \sim Q} [ \mathcal {L} _ {D} (f _ {\Theta}) ]\right) \leq \frac {K L (Q \| P) + \log \frac {m}{\delta}}{m - 1}
+$$
+
+where $KL$ is the Kullback-Leibler (KL) divergence (Kullback & Leibler, 1951).
+
+Following Dziugaite & Roy (2017), we use the inequality $\mathrm{KL}^{-1}(q|c) = \sup \{p\in [0,1]:\mathrm{KL}(q||p)\leq c\} \leq q + \sqrt{c / 2}$ to achieve a simple bound on the test error:
+
+$$
+\begin{array}{l} \mathbb {E} _ {\Theta \sim Q} [ \mathcal {L} _ {D} (f _ {\Theta}) ] \leq \mathrm {K L} ^ {- 1} \left(E _ {\Theta \sim Q} [ \mathcal {L} _ {S} (f _ {\Theta}) ] \Bigg | \frac {\mathrm {K L} (Q \| P) + \log \frac {m}{\delta}}{m - 1}\right) \\ \leq \mathbb {E} _ {\Theta \sim Q} [ \mathcal {L} _ {S} (f _ {\Theta}) ] + \sqrt {\frac {\mathrm {K L} (Q | | P) + \log \frac {m}{\delta}}{2 (m - 1)}}. \\ \end{array}
+$$
+
+The intuition from Figure 4 suggests that moving the parameters of each module as close as possible to the initialization value before harming performance. For such $\alpha_{i}$ , we can then define the posterior $Q_{i}$ for module $i$ to be a Gaussian distribution centered at $\theta_{i}^{\alpha}$ with covariance matrix $\sigma_{i}^{2}I$ , that is, as if we have additive noise $u_{i} \sim \mathcal{N}(0, \sigma_{i}I)$ . We use $\Theta^{\alpha}$ to refer to the case where all $\theta_{i}$ are replaced with $\theta_{i}^{\alpha_{i}}$ and matrix $U$ includes all $u_{i}$ . Then the training loss term can be decomposed as
+
+$$
+\begin{array}{l} \mathbb {E} _ {\Theta \sim Q} \left[ \mathcal {L} _ {S} \left(f _ {\Theta}\right) \right] = \mathbb {E} _ {u _ {i} \sim \mathcal {N} \left(0, \sigma_ {i} I\right)} \left[ \mathcal {L} _ {S} \left(f _ {\Theta^ {\alpha} + U}\right) \right] \\ \leq \mathcal {L} _ {S} \left(f _ {\Theta^ {F}}\right) + \left| \mathbb {E} _ {u _ {i} \sim \mathcal {N} \left(0, \sigma_ {i} I\right)} \left[ \mathcal {L} _ {S} \left(f _ {\Theta^ {\alpha} + U}\right) \right] - \mathcal {L} _ {S} \left(f _ {\Theta^ {F}}\right) \right|, \\ \end{array}
+$$
+
+where the second term on the right hand side of the inequality captures the flatness of the point $\Theta^{\alpha}$ by adding Gaussian noise and measuring the change in the loss. Therefore, searching over the posterior corresponds to finding a flat solution in the valley that connects the initial and final points. Next, we use this intuition to prove a generalization bound based on module criticality.
+
+First, we express the value of the $\widetilde{\mathcal{O}}(1)$ term in Theorem 3.2, which is equal to $\epsilon$ as follows:
+
+$$
+\epsilon = \sum_ {i} \log \left(7 m + 2 \log \left(\frac {k _ {i}}{k _ {i} \sigma_ {i} ^ {2} + \alpha_ {i} ^ {2} \left\| \theta_ {i} ^ {F} - \theta_ {i} ^ {0} \right\| _ {\mathrm {F r}} ^ {2}}\right)\right). \tag {3}
+$$
+
+Now we proceed with the proof.
+
+The KL-divergence between two $k$ -dimensional Gaussian distributions is given by the formula:
+
+$$
+\mathrm {K L} (\mathcal {N} (\mu_ {1}, \Sigma_ {1}) | | \mathcal {N} (\mu_ {P}, \Sigma_ {P})) = \frac {1}{2} \left[ \operatorname {t r} \left(\Sigma_ {2} ^ {- 1} \Sigma_ {1}\right) + (\mu_ {2} - \mu_ {1}) ^ {\top} \Sigma_ {2} ^ {- 1} (\mu_ {2} - \mu_ {1}) - k + \ln (\frac {\det \Sigma_ {2}}{\det \Sigma_ {1}}) \right].
+$$
+
+The above equation can be further simplified for Gaussian distributions with diagonal covariance matrices. Let the prior $P$ be a Gaussian distribution such that for each module $i$ , the distribution is $\mathcal{N}(\theta_i^0, \sigma_{P,i}^2 I)$ and let the posterior $Q$ be a Gaussian distribution such that for each module $i$ , the distribution is $\mathcal{N}((1 - \alpha)\theta_i^0 + \alpha\theta_i^F), \sigma_{Q,i}^2 I$ . We can then write the KL-divergence $\mathrm{KL}(Q||P)$ as
+
+$$
+\operatorname {K L} (Q | | P) = \frac {1}{2} \sum_ {i} \left[ \frac {k _ {i} \sigma_ {Q , i} ^ {2} + \alpha_ {i} ^ {2} \left\| \theta_ {i} ^ {F} - \theta_ {i} ^ {0} \right\| _ {\mathrm {F r}} ^ {2}}{\sigma_ {P , i} ^ {2}} - k _ {i} + k _ {i} \log \left(\frac {\sigma_ {P , i} ^ {2}}{\sigma_ {Q , i} ^ {2}}\right) \right]. \tag {4}
+$$
+
+Since prior should be decided before observing the training set, we are not allowed to optimize for $\sigma_{P,i}$ directly. However, one can optimize for $\sigma_{P,i}$ over a pre-defined set of values and use a union bound argument to get the generalization bound for the best $\sigma_{P,i}$ in that set. We use a covering approach suggested by Langford & Caruana (2002). For $b,\epsilon >0$ , if one chooses the variance of prior to be $\exp (-\epsilon j + b)$ for $j\in \mathbb{N}$ such that for each $j$ the bound holds with probability $1 - \frac{6}{\pi^2j^2}$ , then all bounds hold with probability $1 - \sum_{j\in \mathbb{N}}\frac{6}{\pi^2j^2} = 1 - \delta$ . We can apply the same idea to every module such that the bound holds with probability $1 - \delta \prod_{i = 1}^{d}\frac{6}{\pi^2j_i^2}$ .
+
+If we choose $\sigma_{Q,i}^2\leq 1$ then we have $\sigma_{P,i}\leq \exp \left(\frac{4m}{k_i} +1\right)$ . Otherwise, the bound holds since the right hand side is greater than one. Given (from Equation 3) $\epsilon \geq 0$ , if we choose $\sigma_{P,i}^2$ to have the form $\exp \left(\frac{4m - j_i}{k_i} +1\right)$ , for some integer $j_{i}$ , we can always find choose $j_{i}$ such that
+
+$$
+k _ {i} \sigma_ {Q, i} ^ {2} + \alpha_ {i} ^ {2} \left\| \theta_ {i} ^ {F} - \theta_ {i} ^ {0} \right\| _ {\mathrm {F r}} ^ {2} \leq k _ {i} \sigma_ {P, i} ^ {2} \leq \exp (1 / k _ {i}) \left(k _ {i} \sigma_ {Q, i} ^ {2} + \alpha_ {i} ^ {2} \left\| \theta_ {i} ^ {F} - \theta_ {i} ^ {0} \right\| _ {\mathrm {F r}} ^ {2}\right). \tag {5}
+$$
+
+Therefore, the KL-divergence can be bounded as
+
+$$
+\begin{array}{l} \mathrm {K L} (Q | | P) \leq \frac {1}{2} \sum_ {i} \left[ k _ {i} \frac {k _ {i} \sigma_ {Q , i} ^ {2} + \alpha_ {i} ^ {2} \left\| \theta_ {i} ^ {F} - \theta_ {i} ^ {0} \right\| _ {\mathrm {F r}} ^ {2}}{k _ {i} \sigma_ {Q , i} ^ {2} + \alpha_ {i} ^ {2} \left\| \theta_ {i} ^ {F} - \theta_ {i} ^ {0} \right\| _ {\mathrm {F r}} ^ {2}} - k _ {i} + k _ {i} \log \left(\frac {\sigma_ {P , i} ^ {2}}{\sigma_ {Q , i} ^ {2}}\right) \right] \\ = \frac {1}{2} \sum_ {i} \left[ k _ {i} \log \left(\frac {\sigma_ {P , i} ^ {2}}{\sigma_ {Q , i} ^ {2}}\right) \right] \\ \leq \frac {1}{2} \sum_ {i} k _ {i} \log \left(\frac {\exp \left(1 / k _ {i}\right) \left(k _ {i} \sigma_ {Q , i} ^ {2} + \alpha_ {i} ^ {2} \left\| \theta_ {i} ^ {F} - \theta_ {i} ^ {0} \right\| _ {\mathrm {F r}} ^ {2}\right)}{k _ {i} \sigma_ {Q , i} ^ {2}}\right) \\ \leq \frac {1}{2} \sum_ {i} k _ {i} \log \left(\frac {\exp \left(1 / k _ {i}\right) \left(k _ {i} \sigma_ {Q , i} ^ {2} + \alpha_ {i} ^ {2} \left\| \theta_ {i} ^ {F} - \theta_ {i} ^ {0} \right\| _ {\mathrm {F r}} ^ {2}\right)}{k _ {i} \sigma_ {Q , i} ^ {2}}\right) \\ \leq \frac {1}{2} \sum_ {i} 1 + k _ {i} \log \left(1 + \frac {\alpha_ {i} ^ {2} \left\| \theta_ {i} ^ {F} - \theta_ {i} ^ {0} \right\| _ {\mathrm {F r}} ^ {2}}{k _ {i} \sigma_ {Q , i} ^ {2}}\right). \\ \end{array}
+$$
+
+Note that in order to achieve the inequality in Equation 5, $j_{i}$ should be chosen as
+
+$$
+j _ {i} = \left\lfloor \frac {4 m}{k _ {i}} + 1 + \log \left(\frac {k _ {i}}{k _ {i} \sigma_ {Q , i} ^ {2} + \alpha_ {i} ^ {2} \left\| \theta_ {i} ^ {F} - \theta_ {i} ^ {0} \right\| _ {\mathrm {F r}} ^ {2}}\right) \right\rfloor \leq 5 m + \log \left(\frac {k _ {i}}{k _ {i} \sigma_ {Q , i} ^ {2} + \alpha_ {i} ^ {2} \left\| \theta_ {i} ^ {F} - \theta_ {i} ^ {0} \right\| _ {\mathrm {F r}} ^ {2}}\right).
+$$
+
+Given that each such bound should hold with probability $1 - \delta \prod_{i=1}^{d} \frac{6}{\pi^2 j_i^2}$ , the log term in the bound can be written as
+
+$$
+\log \frac {m}{\delta} + \sum_ {i} \log \left(\pi^ {2} j _ {i} ^ {2} / 6\right) \leq \log \frac {m}{\delta} + 2 \sum_ {i} \log \left(7 m + 2 \log \left(\frac {k _ {i}}{k _ {i} \sigma_ {Q , i} ^ {2} + \alpha_ {i} ^ {2} \left\| \theta_ {i} ^ {F} - \theta_ {i} ^ {0} \right\| _ {\mathrm {F r}} ^ {2}}\right)\right).
+$$
+
+Putting everything together proves the theorem statement.
+
+# B A DETERMINISTIC GENERALIZATION BOUND FOR CONVOLUTIONAL NETWORKS
+
+We start by stating a generalization bound given by Neyshabur et al. (2018) with a slight improvement in the constants.
+
+Lemma B.1 (Neyshabur et al. (2018)). Let $f_{\Theta}:\mathcal{X}\to \mathbb{R}^{C}$ be any predictor function with parameters $\Theta$ and $P$ be a prior distribution on parameters $\Theta$ . Then for any $\gamma, m, \delta > 0$ , with probability $1 - \delta$
+
+over the training set $S$ of size $m$ , for any parameter $\Theta$ and any perturbation distribution $Q$ over parameters such that $\mathbb{P}_{U\sim Q}\left[\max_{x\in \mathcal{X}}|f_{\Theta +U}(x) - f_{\Theta}(x)|\leq \frac{\gamma}{4}\right]\geq \frac{1}{2}$ , we have
+
+$$
+\mathcal {L} _ {D} (f _ {\Theta}) \leq \mathcal {L} _ {S, \gamma} (f _ {\Theta}) + \sqrt {\frac {2 K L (\Theta + U \| P) + 1 + \log \frac {m}{\delta}}{2 (m - 1)}}.
+$$
+
+The lemma above gives a data-independent deterministic bound which depends on the maximum change of the output function over the domain after a perturbation. We combine Lemma B.1 with Theorem 3.2 and prove a bound on the perturbation which leads to the following theorem.
+
+Theorem B.2. Let input $x$ be an $N \times N$ image whose norm is bounded by $B$ , $f_{\Theta} : \mathcal{X} \to \mathbb{R}^{C}$ be the predictor function with parameters $\Theta$ which is a DNN of depth $d$ made of convolutional blocks. Then for any margin $\gamma$ , sample size $m$ , $\delta > 0$ , with probability $1 - \delta$ over the training set $S$ , any parameter $\Theta$ and any $\alpha_{i} > 0$ such that $\max_{x \in \mathcal{X}} |f_{\Theta}(x) - f_{\Theta^{\alpha}}(x)| \leq \frac{\gamma}{8}$ , we have
+
+$$
+\mathcal {L} _ {D} (f _ {\Theta}) \leq \mathcal {L} _ {S, \gamma} (f _ {\Theta}) + \sqrt {\frac {\sum_ {i = 1} ^ {d} k _ {i} \log \left(1 + \frac {\left[ 3 2 e d B \alpha_ {i} \left\| \theta_ {i} ^ {F} - \theta_ {i} ^ {0} \right\| _ {F _ {r}} \prod_ {i \neq j} \left\| \theta_ {i} ^ {\alpha} \right\| _ {2} \sqrt {\log (4 d N ^ {2})} \right] ^ {2}}{c _ {i} \gamma^ {2}}\right) + \log \left(\frac {m}{\delta}\right) + \tilde {\mathcal {O}} (1)}{m - 1}},
+$$
+
+where $k_{i}$ is the number of parameters in module $i$ . For example, for a convolution module with kernel size $q_{i} \times q_{i}$ and number of output channels $c_{i}$ , $k_{i} = q_{i}^{2}c_{i - 1}c_{i}$ .
+
+Proof. First, we express the value of the $\tilde{\mathcal{O}}(1)$ term in Theorem B.2, which is equal to $\epsilon_{2}$ as follows:
+
+$$
+\epsilon_ {2} = 1 + \sum_ {i} \log \left(7 m + 2 \log \left(\frac {k _ {i}}{k _ {i} \gamma^ {2} / \left(1 6 e \prod_ {j \neq i} \| \theta_ {i} ^ {\alpha} \| _ {2} \log \left(4 d N ^ {2}\right)\right) ^ {2} + \alpha_ {i} ^ {2} \| \theta_ {i} ^ {F} - \theta_ {i} ^ {0} \| _ {\mathrm {F r}} ^ {2}}\right)\right). \tag {7}
+$$
+
+We note that for any $\Theta, \Theta'$ , if $\max_{x \in \mathcal{X}} \|f_{\Theta}(X) - f_{\Theta}\|_{\infty} \leq \gamma/2$ then $\mathcal{L}(f_{\Theta}) \leq \mathcal{L}_{\gamma}(f_{\Theta}')$ . The reason is that the output for each class can change by at most $\gamma/2$ and therefore the label can only change for the data points that are within $\gamma$ of the margin.
+
+We start using the assumptions on the perturbation bound. Combining the results from Theorem B.1 and Theorem 3.2, we can get the following bound.
+
+$$
+\begin{array}{l} \mathcal {L} _ {D} \left(f _ {\Theta^ {F}}\right) \leq \mathcal {L} _ {D, \frac {\gamma}{4}} \left(f _ {\Theta^ {\alpha}}\right) \tag {8} \\ \leq \mathcal {L} _ {S, \frac {3 \gamma}{4}} (f _ {\Theta^ {\alpha}}) + \sqrt {\frac {\frac {1}{2} \sum_ {i = 1} ^ {d} k _ {i} \log \left(1 + \frac {\alpha_ {i} ^ {2} \left\| \theta_ {i} ^ {F} - \theta_ {i} ^ {0} \right\| _ {\mathrm {F r}} ^ {2}}{k _ {i} \sigma_ {i} ^ {2}}\right) + \log \frac {m}{\delta} + \epsilon_ {2}}{m - 1}} \\ \leq \mathcal {L} _ {S, \gamma} (f _ {\Theta^ {\alpha}}) + \sqrt {\frac {\frac {1}{2} \sum_ {i = 1} ^ {d} k _ {i} \log \left(1 + \frac {\alpha_ {i} ^ {2} \left\| \theta_ {i} ^ {F} - \theta_ {i} ^ {0} \right\| _ {\mathrm {F r}} ^ {2}}{k _ {i} \sigma_ {i} ^ {2}}\right) + \log \frac {m}{\delta} + \epsilon_ {2}}{m - 1}} \\ \end{array}
+$$
+
+where $\epsilon_{2}$ is given above in Equation 7.
+
+Therefore, it suffices to find the value of $\sigma_{i}$ under which the assumption on norm of perturbation in function space holds and then simplify the following upper bound given the desired value of $\sigma_{i}$ .
+
+In order to find the desired value of $\sigma_{i}$ we use the following two lemmas. First we adopt the perturbation lemma by Neyshabur et al. (2018) to bound the change in the output a network based on the magnitude of the perturbation:
+
+Lemma B.3 (Neyshabur et al. (2018)). Let norm of input $x$ be bounded by $B$ . For any $B > 0$ , let $f_{\Theta} : \mathcal{X} \to \mathbb{R}^{C}$ be a neural network with ReLU activations and depth $d$ . Then for any $\Theta, x \in \mathcal{X}$ and any perturbation $U$ s.t. $\| u_i \|_2 \leq \| \theta_i \|_2$ , the change in the output of the network can be bounded as follows
+
+$$
+\left\| f _ {\Theta + U} - f _ {\Theta} \right\| _ {2} \leq e B \prod_ {i = 1} ^ {d} \left\| \theta_ {i} \right\| _ {2} \sum_ {j = 1} ^ {d} \frac {\left\| u _ {i} \right\| _ {2}}{\left\| \theta_ {i} \right\| _ {2}}. \tag {9}
+$$
+
+We next use the following lemma by Pitas et al. (2017) that bounds the magnitude of the Gaussian perturbation $u_{i}$ for each convolutional module based on the standard deviation of the perturbation.
+
+Lemma B.4 (Pitas et al. (2017)). Let $u_{i}$ be a Gaussian perturbation for each module $i$ of a convolutional model. Let $N$ be the image size, $q_{i}$ , $c_{i}$ be the kernel size and the number of output channels at module $i$ respectively. We have that
+
+$$
+\mathbb {P} \left[ \| u _ {i} \| _ {2} \geq \sigma_ {i} \big (q _ {i} (2 \sqrt {c _ {i}}) + t \big) \right] \leq 2 N ^ {2} e ^ {- \frac {t ^ {2}}{2 q _ {i} ^ {2}}}.
+$$
+
+The lemma above suggests that by taking union bounds over all modules, we can ensure that with probability $1/2$ we have that for any module $i$ , the following upper bound on the spectral norm of the perturbation holds.
+
+$$
+\left\| u _ {i} \right\| _ {2} \leq \sigma_ {i} q _ {i} (2 \sqrt {c _ {i}} + \sqrt {2 \log (4 d N ^ {2})}) \leq 2 \sigma_ {i} q _ {i} (\sqrt {c _ {i}} + \sqrt {\log (4 d N ^ {2})}) \leq 4 \sigma_ {i} q _ {i} \sqrt {c _ {i} \log (4 d N ^ {2})}.
+$$
+
+Combining this with perturbation bound in Equation 9, we have that
+
+$$
+\| f _ {\Theta^ {\alpha} + U} - f _ {\Theta^ {\alpha}} \| _ {2} \leq e B \sum_ {i = 1} ^ {d} \| u _ {i} \| _ {2} \prod_ {j \neq i} ^ {d} \left\| \theta_ {j} ^ {\alpha} \right\| _ {2} \leq 4 e B \sum_ {i = 1} ^ {d} \sigma_ {i} q _ {i} \sqrt {c _ {i} \log (4 d N ^ {2})} \prod_ {j \neq i} ^ {d} \| \theta_ {i} ^ {\alpha} \| _ {2} \leq \frac {\gamma}{8},
+$$
+
+where the last inequality can be achieved with
+
+$$
+\sigma_ {i} = \frac {\gamma}{3 2 e d B \prod_ {i = 1} ^ {d} \| \theta_ {i} ^ {\alpha} \| _ {2} q _ {i} \sqrt {c _ {i} \log (4 d N ^ {2})}}. \tag {10}
+$$
+
+Therefore, this value for $\sigma_{i}$ ensures the assumption on norm of perturbation in function space in Theorem B.2 holds and hence completes the proof.
+
+Moreover, we show how we get the value of $\epsilon_{2}$ , by showing the simplification from inserting the value for $\sigma_{i}$ from Equation 10 as follows.
+
+$$
+\begin{array}{l} \log \left(1 + \frac {\alpha_ {i} ^ {2} \left\| \theta_ {i} ^ {F} - \theta_ {i} ^ {0} \right\| _ {\mathrm {F r}} ^ {2}}{k _ {i} \sigma_ {i} ^ {2}}\right) \leq \log \left(1 + \frac {\left[ \alpha_ {i} \left\| \theta_ {i} ^ {F} - \theta_ {i} ^ {0} \right\| _ {\mathrm {F r}} \right] ^ {2}}{q _ {i} ^ {2} c _ {i} ^ {2} \sigma_ {i} ^ {2}}\right) \\ \leq \log \left(1 + \frac {\left[ 3 2 e d B \alpha_ {i} \left\| \theta_ {i} ^ {F} - \theta_ {i} ^ {0} \right\| _ {\mathrm {F r}} \prod_ {i = 1} ^ {d} \| \theta_ {i} ^ {\alpha} \| _ {2} q _ {i} \sqrt {c _ {i} \log (4 d N ^ {2})} \right] ^ {2}}{q _ {i} ^ {2} c _ {i} ^ {2} \gamma^ {2}}\right) \\ = \log \left(1 + \frac {\left[ 3 2 e d B \alpha_ {i} \left\| \theta_ {i} ^ {F} - \theta_ {i} ^ {0} \right\| _ {\mathrm {F r}} \prod_ {i = 1} ^ {d} \| \theta_ {i} ^ {\alpha} \| _ {2} \sqrt {\log (4 d N ^ {2})} \right] ^ {2}}{c _ {i} \gamma^ {2}}\right). \\ \end{array}
+$$
+
+Then, $\epsilon_{2}$ can also be simplified as follows.
+
+$$
+\begin{array}{l} \epsilon_ {2} = 1 + \sum_ {i} \log \left(7 m + 2 \log \left(\frac {k _ {i}}{k _ {i} \sigma_ {i} ^ {2} + \alpha_ {i} ^ {2} \left\| \theta_ {i} ^ {F} - \theta_ {i} ^ {0} \right\| _ {\mathrm {F r}} ^ {2}}\right)\right) \\ \leq 1 + \sum_ {i} \log \left(7 m + 2 \log \left(\frac {k _ {i}}{k _ {i} \gamma^ {2} / \left(3 2 e d B \prod_ {i = 1} ^ {d} \| \theta_ {i} ^ {\alpha} \| _ {2} q _ {i} \sqrt {c _ {i} \log (4 d N ^ {2})}\right) ^ {2} + \alpha_ {i} ^ {2} \| \theta_ {i} ^ {F} - \theta_ {i} ^ {0} \| _ {\mathrm {F r}} ^ {2}}\right)\right) \\ \leq 1 + \sum_ {i} \log \left(7 m + 2 \log \left(\frac {k _ {i}}{\gamma^ {2} / \left(3 2 e d B \prod_ {i = 1} ^ {d} \| \theta_ {i} ^ {\alpha} \| _ {2} \sqrt {\log (4 d N ^ {2})}\right) ^ {2} + \alpha_ {i} ^ {2} \left\| \theta_ {i} ^ {F} - \theta_ {i} ^ {0} \right\| _ {\mathrm {F r}} ^ {2}}\right)\right) \\ \leq 1 + \sum_ {i} \log \left(7 m + 2 \log (k _ {i}) - 4 \log \left(\alpha_ {i} \left\| \theta_ {i} ^ {F} - \theta_ {i} ^ {0} \right\| _ {\mathrm {F r}} + \gamma / 3 2 e d B \prod_ {i = 1} ^ {d} \| \theta_ {i} ^ {\alpha} \| _ {2} \sqrt {\log (4 d N ^ {2})}\right)\right). \\ \end{array}
+$$
+
+
+
+# C DETAILS ON EXPERIMENTAL SET-UP
+
+For all our experiments, we use the CIFAR10 and CIFAR100 datasets. To train our networks we used Stochastic Gradient Descent (SGD) with momentum 0.9 to minimize multi-class cross-entropy loss. On CIFAR10 each model is trained until the cross-entropy loss on the training dataset falls below 0.19. While on CIFAR100 each model is trained until the cross-entropy loss on the training dataset falls below 0.25. The ResNets, DenseNets and VGGs were trained using a stage-wise constant learning rate scheduling with a starting learning rate of 0.1 and with a decrease by a multiplicative factor of 0.2 every 60 epochs. FCN was trained with an initial learning rate of 0.1 with a decrease by a multiplicative factor of 0.2 every 200 epochs. Batch size of 128 was used for all models and weight decay with factor $5\mathrm{e - }4$ was used to train all networks.
+
+We mainly study three types of neural network architectures:
+
+- Fully Connected Networks (FCNs): The FCNs consist of 2 fully connected layers. FCN (I) contains 5000 and 1000 hidden units respectively while FCN (II) contains 10000 and 2000 hidden units respectively. Each of these hidden layers is followed by a batch normalization layer and a ReLU activation. The final output layer (that follows the ReLU activation in the second layer) has an output dimension of 10 or 100 (number of classes).
+
+- VGGs: Architectures by Simonyan & Zisserman (2015) that consists of multiple convolutional layers, followed by multiple fully connected layers and a final classifier layer (with output dimension 10 or 100). We study the VGG with 11 and 16 layers.
+
+- DenseNets: Architectures by Huang et al. (2017) that consists of multiple convolutional layers, followed by a final classifier layer (with output dimension 10 or 100). We study the DenseNet with 121 layers.
+
+- ResNets: Architectures used are ResNets V1 (He et al., 2016). All convolutional layers (except downsample convolutional layers) have kernel size $3 \times 3$ with stride 1. Downsample convolutions have stride 2. All the ResNets have five stages (0-4) where each stage has multiple residual/downsample blocks. These stages are followed by a maxpool layer and a final linear layer. Here are further details about the ResNets used in the paper:
+
+- ResNet18: ResNet18 architectures studied in the paper have 1 convolutional layer in Stage 0 (64 output channels), Stage 1 has 2 residual blocks (64 output channels), Stage 2 has one downsample block and one residual block (128 output channels), Stage 3 has one downsample block and one residual block (256 output channels) and Stage 4 again has one downsample block and a residual block (512 output channels).
+- ResNet34: ResNet34 architectures in this paper have 5 stages. Stage 0 has 1 convolutional layer with 64 output channels followed by a ReLU activation. Stage 1 has 3 residual blocks (64 output channels), Stage 2 has 1 downsample block and 3 residual blocks (128 output channels), Stage 3 has 1 downsample block and 5 residual blocks (256 output channels) and, Stage 4 has 1 downsample block and 2 residual blocks (512 output channels).
+- ResNet50: ResNet50 architectures in this paper again have 5 stages. Stage 0 has 1 convolutional layer with 64 output channels followed by a ReLU activation. Stage 1 has 1 downsample block and 2 residual blocks (256 output channels), Stage 2 has 1 down-sample block and 3 residual blocks (512 output channels), Stage 3 has 1 downsample block and 5 residual blocks (1024 output channels) and, Stage 4 has 1 downsample block and 2 residual blocks (2048 output channels).
+- ResNet101: ResNet101 architectures in this paper again have 5 stages. Stage 0 has 1 convolutional layer with 64 output channels followed by a ReLU activation. Stage 1 has 1 downsample block and 2 residual blocks (256 output channels), Stage 2 has 1 downsample block and 3 residual blocks (512 output channels), Stage 3 has 1 down-sample block and 22 residual blocks (1024 output channels) and, Stage 4 has 1 down-sample block and 2 residual blocks (2048 output channels).
+
+The ResNets, DenseNets and VGGs in the paper are trained without batch normalization.
+
+During training, images are padded with 4 pixels of zeros on all sides, then randomly flipped (horizontally) and cropped. Global mean and standard deviation are computed on all training images
+
+and applied to normalize the inputs. While training a ResNet18 on the CIFAR10 dataset with $20\%$ of the labels randomly corrupted, we do not augment the training set with images that are randomly flipped and cropped. We also do not use weight decay during training these networks.
+
+# D ADDITIONAL EXPERIMENTS
+
+In these set of experiments we compare the generalization performance of four ResNet18 architectures where we vary the number of output channels in each stage. In the ResNet18 (1x width) network the number of output channels are 16, 16, 32, 64, 128 in the five stages respectively. The other ResNet18s have their output channels scaled by factors of 2,4 and 8 in each stage. Table 4 summarizes our results for networks trained on the CIFAR10 dataset and Table 5 summarizes are results for networks trained on the CIFAR100 dataset.
+
+We find that separating these networks based on a complexity measure is a much more challenging as these four networks differ by just the channel widths at the different stages. We find that on this task all complexity measures that we studied (including ours) does poorly. It is an interesting question for future research to see if our complexity measure can be refined to separate these networks as well.
+
+Table 4: Measuring complexity of different architectures trained on CIFAR10. The ResNet18 architectures have different channel widths. The network ResNet18 (1x width) has 16,16,32,64,128 channels in the five stages.
+
+| ResNet18 (x) | GE | PFN | PSN | DtI | NoP | SoSP | PAC Bayes | Net. Criticality |
| 1x width | 6.27% | 4e17 | 1e12 | 1409 | 6.9e5 | 6.0e7 | 3.0e5 | 1.0e5 |
| 2x width | 5.13% | 8e19 | 4e13 | 2253 | 2.7e6 | 2.9e8 | 4.2e5 | 1.3e5 |
| 4x width | 4.61% | 1e22 | 4e14 | 3430 | 1.1e7 | 1.3e9 | 6.9e5 | 2.2e5 |
| 8x width | 2.88% | 1e24 | 2e15 | 5365 | 4.4e7 | 5.6e9 | 2.7e6 | 6.7e5 |
| Kendall's τ | - | -1 | -1 | -1 | -1 | -1 | -1 | -1 |
+
+Table 5: Measuring complexity of different architectures trained on CIFAR100. The ResNet18 architectures have different channel widths. The network ResNet18 (1x width) has 16,16,32,64,128 channels in the five stages.
+
+| ResNet18 (x) | GE | PFN | PSN | DtI | NoP | SoSP | PAC Bayes | Net. Criticality |
| 1x width | 30.4% | 6e18 | 3e12 | 2650 | 7.1e5 | 7.3e7 | 3.2e6 | 1.5e6 |
| 2x width | 31.8% | 1e21 | 4e13 | 4248 | 2.8e6 | 3.4e8 | 2.7e6 | 1.3e6 |
| 4x width | 30.6% | 2e22 | 9e14 | 4855 | 1.1e7 | 1.4e9 | 3.4e6 | 1.6e6 |
| 8x width | 28.4% | 3e25 | 1e18 | 9269 | 4.4e7 | 8.0e9 | 6.9e6 | 2.8e6 |
| Kendall's τ | - | -0.33 | -0.33 | -0.33 | -0.33 | -0.33 | -0.66 | -0.66 |
+
+# E FIGURES
+
+
+(a) Rewind analysis of Zhang et al. (2019a)
+
+
+(b) We rewind each module, whereas, Zhang et al. (2019a) rewind each block
+
+
+(c) The effect of rewinding on train loss
+
+
+(d) The effect of rewinding on test error
+Figure 6: Analysis of rewinding modules to initialization for the ResNet-18 architecture. Each row represents a layer in ResNet18-v1 and each column represents a particular training epoch that the module is rewound to.
+
+
+(a) Fixup initialization
+
+
+(b) Adam optimizer
+
+
+Figure 7: Criticality pattern of Resnet18 when trained with Fixup initialization and with the Adam optimizer
+Figure 8:Operator norm of difference from initialization
+
+
+(a) Rewind an ambient module
+
+
+(b) Rewind a critical module
+Figure 9: Similarity in activation patterns when an ambient or critical module is rewound. Darker green denotes higher similarity
+
+
+
+
+
+
+Figure 10: $0/1$ loss and cross-entropy loss for critical and non-critical modules, for given different values of $\sigma$ and $\alpha$ in Definition 3.1.
+
+
\ No newline at end of file
diff --git a/theintriguingroleofmodulecriticalityinthegeneralizationofdeepnetworks/images.zip b/theintriguingroleofmodulecriticalityinthegeneralizationofdeepnetworks/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..b4a84ca06f5dda886151503d942233baf5e95e11
--- /dev/null
+++ b/theintriguingroleofmodulecriticalityinthegeneralizationofdeepnetworks/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:bfd7b6e0201d4514012eb509e1a9bc18f699d1ebaecc816b56a9201fff43b78c
+size 1295255
diff --git a/theintriguingroleofmodulecriticalityinthegeneralizationofdeepnetworks/layout.json b/theintriguingroleofmodulecriticalityinthegeneralizationofdeepnetworks/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..14eae48f25c12c86b049f71408036c9eb2f22286
--- /dev/null
+++ b/theintriguingroleofmodulecriticalityinthegeneralizationofdeepnetworks/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c4ffd762ff7410c3fff3963622127c94f5722f5daf48d20c0809225f97c7a86f
+size 642031
diff --git a/thelogicalexpressivenessofgraphneuralnetworks/7872c32a-733d-4853-9486-d067a7e8f47f_content_list.json b/thelogicalexpressivenessofgraphneuralnetworks/7872c32a-733d-4853-9486-d067a7e8f47f_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..30ed662417dc589d64b74eadbecdee8284de4624
--- /dev/null
+++ b/thelogicalexpressivenessofgraphneuralnetworks/7872c32a-733d-4853-9486-d067a7e8f47f_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:725559853825263240f813ed29ee526ffa13fbccbb9c52f2af164c5d2ec56ed9
+size 147804
diff --git a/thelogicalexpressivenessofgraphneuralnetworks/7872c32a-733d-4853-9486-d067a7e8f47f_model.json b/thelogicalexpressivenessofgraphneuralnetworks/7872c32a-733d-4853-9486-d067a7e8f47f_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..dc3a4af22b47856932f86d7b15c9d9dc8d2d2bdc
--- /dev/null
+++ b/thelogicalexpressivenessofgraphneuralnetworks/7872c32a-733d-4853-9486-d067a7e8f47f_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f12d4a190af647b6768d3c177b4af023db1246568a844813f527090767efa8e5
+size 175544
diff --git a/thelogicalexpressivenessofgraphneuralnetworks/7872c32a-733d-4853-9486-d067a7e8f47f_origin.pdf b/thelogicalexpressivenessofgraphneuralnetworks/7872c32a-733d-4853-9486-d067a7e8f47f_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..85847000cc17fb56c0b1ff1bf6f27e37cd69a6fb
--- /dev/null
+++ b/thelogicalexpressivenessofgraphneuralnetworks/7872c32a-733d-4853-9486-d067a7e8f47f_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:9fe72f35f22a94a156cc1621c5a7d9ad79458f0a9d564896226685f2fe5603da
+size 422960
diff --git a/thelogicalexpressivenessofgraphneuralnetworks/full.md b/thelogicalexpressivenessofgraphneuralnetworks/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..7daed350c8259411f3f681ced337b205e8767fb8
--- /dev/null
+++ b/thelogicalexpressivenessofgraphneuralnetworks/full.md
@@ -0,0 +1,586 @@
+# THE LOGICAL EXPRESSIVENESS OF GRAPH NEURAL NETWORKS
+
+Pablo Barceló
+
+IMC, PUC & IMFD Chile
+
+Egor V. Kostylev
+
+University of Oxford
+
+Mikael Monet
+
+IMFD Chile
+
+Jorge Pérez
+
+DCC, UChile & IMFD Chile
+
+Juan Reutter
+
+DCC, PUC & IMFD Chile
+
+Juan-Pablo Silva
+
+DCC, UChile
+
+# ABSTRACT
+
+The ability of graph neural networks (GNNs) for distinguishing nodes in graphs has been recently characterized in terms of the Weisfeiler-Lehman (WL) test for checking graph isomorphism. This characterization, however, does not settle the issue of which Boolean node classifiers (i.e., functions classifying nodes in graphs as true or false) can be expressed by GNNs. We tackle this problem by focusing on Boolean classifiers expressible as formulas in the logic $\mathrm{FOC}_2$ , a well-studied fragment of first order logic. $\mathrm{FOC}_2$ is tightly related to the WL test, and hence to GNNs. We start by studying a popular class of GNNs, which we call AC-GNNs, in which the features of each node in the graph are updated, in successive layers, only in terms of the features of its neighbors. We show that this class of GNNs is too weak to capture all $\mathrm{FOC}_2$ classifiers, and provide a syntactic characterization of the largest subclass of $\mathrm{FOC}_2$ classifiers that can be captured by AC-GNNs. This subclass coincides with a logic heavily used by the knowledge representation community. We then look at what needs to be added to AC-GNNs for capturing all $\mathrm{FOC}_2$ classifiers. We show that it suffices to add readout functions, which allow to update the features of a node not only in terms of its neighbors, but also in terms of a global attribute vector. We call GNNs of this kind ACR-GNNs. We experimentally validate our findings showing that, on synthetic data conforming to $\mathrm{FOC}_2$ formulas, AC-GNNs struggle to fit the training data while ACR-GNNs can generalize even to graphs of sizes not seen during training.
+
+# 1 INTRODUCTION
+
+Graph neural networks (GNNs) (Merkwirth & Lengauer, 2005; Scarselli et al., 2009) are a class of neural network architectures that has recently become popular for a wide range of applications dealing with structured data, e.g., molecule classification, knowledge graph completion, and Web page ranking (Battaglia et al., 2018; Gilmer et al., 2017; Kipf & Welling, 2017; Schlichtkrull et al., 2018). The main idea behind GNNs is that the connections between neurons are not arbitrary but reflect the structure of the input data. This approach is motivated by convolutional and recurrent neural networks and generalize both of them (Battaglia et al., 2018). Despite the fact that GNNs have recently been proven very efficient in many applications, their theoretical properties are not yet well-understood. In this paper we make a step towards understanding their expressive power by establishing connections between GNNs and well-known logical formalisms. We believe these connections to be conceptually important, as they permit us to understand the inherently procedural behavior of some fragments of GNNs in terms of the more declarative flavor of logical languages.
+
+Two recent papers (Morris et al., 2019; Xu et al., 2019) have started exploring the theoretical properties of GNNs by establishing a close connection between GNNs and the Weisfeiler-Lehman (WL) test for checking graph isomorphism. The WL test works by constructing a labeling of the nodes of the graph, in an incremental fashion, and then decides whether two graphs are isomorphic by comparing the labeling of each graph. To state the connection between GNNs and this test, consider the simple GNN architecture that updates the feature vector of each graph node by combining it with the aggregation of the feature vectors of its neighbors. We call such GNNs aggregate-combine GNNs,
+
+or AC-GNNs. The authors of these papers independently observe that the node labeling produced by the WL test always refines the labeling produced by any GNN. More precisely, if two nodes are labeled the same by the algorithm underlying the WL test, then the feature vectors of these nodes produced by any AC-GNN will always be the same. Moreover, there are AC-GNNs that can reproduce the WL labeling, and hence AC-GNNs can be as powerful as the WL test for distinguishing nodes. This does not imply, however, that AC-GNNs can capture every node classifier—that is, a function assigning true or false to every node—that is refined by the WL test. In fact, it is not difficult to see that there are many such classifiers that cannot be captured by AC-GNNs; one simple example is a classifier assigning true to every node if and only if the graph has an isolated node. Our work aims to answer the question of what are the node classifiers that can be captured by GNN architectures such as AC-GNNs.
+
+To start answering this question, we propose to focus on logical classifiers—that is, on unary formulas expressible in first order predicate logic (FO): such a formula classifies each node $v$ according to whether the formula holds for $v$ or not. This focus gives us an opportunity to link GNNs with declarative and well understood formalisms, and to establish conclusions about GNNs drawing upon the vast amount of work on logic. For example, if one proves that two GNN architectures are captured with two logics, then one can immediately transfer all the knowledge about the relationships between those logics, such as equivalence or incomparability of expressiveness, to the GNN setting.
+
+For AC-GNNs, a meaningful starting point to measure their expressive power is the logic $\mathrm{FOC}_2$ , the two variable fragment of first order predicate logic extended with counting quantifiers of the form $\exists^{\geq N}\varphi$ , which state that there are at least $N$ nodes satisfying formula $\varphi$ (Cai et al., 1992). Indeed, this choice of $\mathrm{FOC}_2$ is justified by a classical result due to Cai et al. (1992) establishing a tight connection between $\mathrm{FOC}_2$ and WL: two nodes in a graph are classified the same by the WL test if and only if they satisfy exactly the same unary $\mathrm{FOC}_2$ formulas. Moreover, the counting capabilities of $\mathrm{FOC}_2$ can be mimicked in FO (albeit with more than just two variables), hence $\mathrm{FOC}_2$ classifiers are in fact logical classifiers according to our definition.
+
+Given the connection between AC-GNNs and WL on the one hand, and that between WL and $\mathrm{FOC}_2$ on the other hand, one may be tempted to think that the expressivity of AC-GNNs coincides with that of $\mathrm{FOC}_2$ . However, the reality is not as simple, and there are many $\mathrm{FOC}_2$ node classifiers (e.g., the trivial one above) that cannot be expressed by AC-GNNs. This leaves us with the following natural questions. First, what is the largest fragment of $\mathrm{FOC}_2$ classifiers that can be captured by AC-GNNs? Second, is there an extension of AC-GNNs that allows to express all $\mathrm{FOC}_2$ classifiers? In this paper we provide answers to these two questions. The following are our main contributions.
+
+- We characterize exactly the fragment of $\mathrm{FOC}_2$ formulas that can be expressed as AC-GNNs. This fragment corresponds to graded modal logic (de Rijke, 2000), or, equivalently, to the description logic $\mathcal{A}\mathcal{L}\mathcal{C}\mathcal{Q}$ , which has received considerable attention in the knowledge representation community (Baader et al., 2003; Baader & Lutz, 2007).
+- Next we extend the AC-GNN architecture in a very simple way by allowing global read-outs, where in each layer we also compute a feature vector for the whole graph and combine it with local aggregations; we call these aggregate-combine-readout GNNs (ACR-GNNs). These networks are a special case of the ones proposed by Battaglia et al. (2018) for relational reasoning over graph representations. In this setting, we prove that each $\mathrm{FOC}_2$ formula can be captured by an ACR-GNN.
+
+We experimentally validate our findings showing that the theoretical expressiveness of ACR-GNNs, as well as the differences between AC-GNNs and ACR-GNNs, can be observed when we learn from examples. In particular, we show that on synthetic graph data conforming to $\mathrm{FOC}_2$ formulas, AC-GNNs struggle to fit the training data while ACR-GNNs can generalize even to graphs of sizes not seen during training.
+
+# 2 GRAPH NEURAL NETWORKS
+
+In this section we describe the architecture of AC-GNNs and introduce other related notions. We concentrate on the problem of Boolean node classification: given a (simple, undirected) graph $G = (V, E)$ in which each vertex $v \in V$ has an associated feature vector $\boldsymbol{x}_v$ , we wish to classify each graph node as true or false; in this paper, we assume that these feature vectors are one-hot
+
+encodings of node colors in the graph, from a finite set of colors. The neighborhood $\mathcal{N}_G(v)$ of a node $v\in V$ is the set $\{u\mid \{v,u\} \in E\}$ .
+
+The basic architecture for GNNs, and the one studied in recent studies on GNN expressibility (Morris et al., 2019; Xu et al., 2019), consists of a sequence of layers that combine the feature vectors of every node with the multiset of feature vectors of its neighbors. Formally, let $\{\mathrm{AGG}^{(i)}\}_{i=1}^{L}$ and $\{\mathrm{COM}^{(i)}\}_{i=1}^{L}$ be two sets of aggregation and combination functions. An aggregate-combine GNN (AC-GNN) computes vectors $\boldsymbol{x}_v^{(i)}$ for every node $v$ of the graph $G$ , via the recursive formula
+
+$$
+\boldsymbol {x} _ {v} ^ {(i)} = \operatorname {C O M} ^ {(i)} \left(\boldsymbol {x} _ {v} ^ {(i - 1)}, \operatorname {A G G} ^ {(i)} \left(\{\{\boldsymbol {x} _ {u} ^ {(i - 1)} \mid u \in \mathcal {N} _ {G} (v) \}\}\right)\right), \quad \text {f o r} i = 1, \dots , L \tag {1}
+$$
+
+where each $\boldsymbol{x}_v^{(0)}$ is the initial feature vector $\boldsymbol{x}_v$ of $v$ . Finally, each node $v$ of $G$ is classified according to a Boolean classification function CLS applied to $\boldsymbol{x}_v^{(L)}$ . Thus, an AC-GNN with $L$ layers is defined as a tuple $\mathcal{A} = \left(\{\mathrm{AGG}^{(i)}\}_{i=1}^{L}, \{\mathrm{COM}^{(i)}\}_{i=1}^{L}, \mathrm{CLS}\right)$ , and we denote by $\mathcal{A}(G, v)$ the class (i.e., true or false) assigned by $\mathcal{A}$ to each node $v$ in $G$ .1
+
+There are many possible aggregation, combination, and classification functions, which produce different classes of GNNs (Hamilton et al., 2017; Kipf & Welling, 2017; Morris et al., 2019; Xu et al., 2019). A simple, yet common choice is to consider the sum of the feature vectors as the aggregation function, and a combination function as
+
+$$
+\operatorname {C O M} ^ {(i)} \left(\boldsymbol {x} _ {1}, \boldsymbol {x} _ {2}\right) = f \left(\boldsymbol {x} _ {1} \boldsymbol {C} ^ {(i)} + \boldsymbol {x} _ {2} \boldsymbol {A} ^ {(i)} + \boldsymbol {b} ^ {(i)}\right), \tag {2}
+$$
+
+where $C^{(i)}$ and $A^{(i)}$ are matrices of parameters, $b^{(i)}$ is a bias vector, and $f$ is a non-linearity function, such as relu or sigmoid. We call simple an AC-GNN using these functions. Furthermore, we say that an AC-GNN is homogeneous if all $\mathrm{AGG}^{(i)}$ are the same and all $\mathrm{COM}^{(i)}$ are the same (share the same parameters across layers). In most of our positive results we construct simple and homogeneous GNNs, while our negative results hold in general (i.e., for GNNs with arbitrary aggregation, combining, and classification functions).
+
+The Weisfeiler-Lehman (WL) test is a powerful heuristic used to solve the graph isomorphism problem (Weisfeiler & Leman, 1968), or, for our purposes, to determine whether the neighborhoods of two nodes in a graph are structurally close or not. Due to space limitations, we refer to (Cai et al., 1992) for a formal definition of the underlying algorithm, giving only its informal description: starting from a colored graph, the algorithm iteratively assigns, for a certain number of rounds, a new color to every node in the graph; this is done in such a way that the color of a node in each round has a one-to-one correspondence with its own color and the multiset of colors of its neighbors in the previous round. An important observation is that the rounds of the WL algorithm can be seen as the layers of an AC-GNN whose aggregation and combination functions are all injective (Morris et al., 2019; Xu et al., 2019). Furthermore, as the following proposition states, an AC-GNN classification can never contradict the WL test.
+
+Proposition 2.1 (Morris et al., 2019; Xu et al., 2019). If the WL test assigns the same color to two nodes in a graph, then every AC-GNN classifies either both nodes as true or both nodes as false.
+
+# 3 CONNECTION BETWEEN GNNS AND LOGIC
+
+# 3.1 LOGICAL NODE CLASSIFIERS
+
+Our study relates the power of GNNs to that of classifiers expressed in first order (FO) predicate logic over (undirected) graphs where each vertex has a unique color (recall that we call these classifiers logical classifiers). To illustrate the idea of logical node classifiers, consider the formula
+
+$$
+\alpha (x) := \operatorname {R e d} (x) \wedge \exists y \left(E (x, y) \wedge \operatorname {B l u e} (y)\right) \wedge \exists z \left(E (x, z) \wedge \operatorname {G r e e n} (z)\right). \tag {3}
+$$
+
+This formula has one free variable, $x$ , which is not bounded by any quantifier of the form $\exists$ or $\forall$ , and two quantified variables $y$ and $z$ . In general, formulas with one free variable are evaluated over nodes of a given graph. For example, the above formula evaluates to true exactly in those nodes $v$ whose color is Red and that have both a Blue and a Green neighbor. In this case, we say that node $v$ of $G$ satisfies $\alpha$ , and denote this by $(G, v) \models \alpha$ .
+
+Formally, a logical (node) classifier is given by a formula $\varphi(x)$ in FO logic with exactly one free variable. This formula classifies as true those nodes $v$ in $G$ such that $(G,v) \models \varphi$ , while all other nodes (i.e., those with $(G,v) \nmid \varphi$ ) are classified as false. We say that a GNN classifier captures a logical classifier when both classifiers coincide over every node in every possible input graph.
+
+Definition 3.1. A GNN classifier $\mathcal{A}$ captures a logical classifier $\varphi(x)$ if for every graph $G$ and node $v$ in $G$ , it holds that $\mathcal{A}(G, v) = \text{true}$ if and only if $(G, v) \models \varphi$ .
+
+# 3.2 LOGIC FOC
+
+Logical classifiers are useful as a declarative formalism, but as we will see, they are too powerful to compare them to AC-GNNs. Instead, for reasons we explain later we focus on classifiers given by formulas in $\mathrm{FOC}_2$ , the fragment of FO logic that only allows formulas with two variables, but in turn permits to use counting quantifiers.
+
+Let us briefly introduce $\mathrm{FOC}_2$ and explain why it is a restriction of FO logic. The first remark is that reducing the number of variables used in formulas drastically reduces their expressive power. Consider for example the following FO formula expressing that $x$ is a red node, and there is another node, $y$ , that is not connected to $x$ and that has at least two blue neighbors, $z_1$ and $z_2$ :
+
+$$
+\beta (x) := \operatorname {R e d} (x) \wedge \exists y \left(\neg E (x, y) \wedge \exists z _ {1} \exists z _ {2} \left[ E (y, z _ {1}) \wedge E (y, z _ {2}) \wedge z _ {1} \neq z _ {2} \wedge \operatorname {B l u e} (z _ {1}) \wedge \operatorname {B l u e} (z _ {2}) \right]\right).
+$$
+
+The formula $\beta(x)$ uses four variables, but it is possible to find an equivalent one with just three: the trick is to reuse variable $x$ and replace every occurrence of $z_2$ in $\beta(x)$ by $x$ . However, this is as far as we can go with this trick: $\beta(x)$ does not have an equivalent formula with less than three variables. In the same way, the formula $\alpha(x)$ given in Equation (3) can be expressed using only two variables, $x$ and $y$ , simply by reusing $y$ in place of $z$ .
+
+That being said, it is possible to extend the logic so that some node properties, such as the one defined by $\beta(x)$ , can be expressed with even less variables. To this end, consider the counting quantifier $\exists^{\geq N}$ for every positive integer $N$ . Analogously to how the quantifier $\exists$ expresses the existence of a node satisfying a property, the quantifier $\exists^{\geq N}$ expresses the existence of at least $N$ different nodes satisfying a property. For example, with $\exists^{\geq 2}$ we can express $\beta(x)$ by using only two variables by means of the classifier
+
+$$
+\gamma (x) := \operatorname {R e d} (x) \wedge \exists y (\neg E (x, y) \wedge \exists^ {\geq 2} x [ E (y, x) \wedge \operatorname {B l u e} (x) ]). \tag {4}
+$$
+
+Based on this idea, the logic $\mathrm{FOC}_2$ allows for formulas using all FO constructs and counting quantifiers, but restricted to only two variables. Note that, in terms of their logical expressiveness, we have that $\mathrm{FOC}_2$ is strictly less expressive than FO (as counting quantifiers can always be mimicked in FO by using more variables and disequalities), but is strictly more expressive than $\mathrm{FO}_2$ , the fragment of FO that allows formulas to use only two variables (as $\beta(x)$ belongs to $\mathrm{FOC}_2$ but not to $\mathrm{FO}_2$ ).
+
+The following result establishes a classical connection between $\mathrm{FOC}_2$ and the WL test. Together with Proposition 2.1, this provides a justification for our choice of logic $\mathrm{FOC}_2$ for measuring the expressiveness of AC-GNNs.
+
+Proposition 3.2 (Cai et al., 1992). For any graph $G$ and nodes $u, v$ in $G$ , the WL test colors $v$ and $u$ the same after any number of rounds iff $u$ and $v$ are classified the same by all $FOC_2$ classifiers.
+
+# 3.3 FOC $_2$ AND AC-GNN CLASSIFIERS
+
+Having Propositions 2.1 and 3.2, one may be tempted to combine them and claim that every $\mathrm{FOC}_2$ classifier can be captured by an AC-GNN. Yet, this is not the case as shown in Proposition 3.3 below. In fact, while it is true that two nodes are declared indistinguishable by the WL test if and only if they are indistinguishable by all $\mathrm{FOC}_2$ classifiers (Proposition 3.2), and if the former holds then such nodes cannot be distinguished by AC-GNNs (Proposition 2.1), this by no means tells us that every $\mathrm{FOC}_2$ classifier can be expressed as an AC-GNN.
+
+Proposition 3.3. There is an $FOC_{2}$ classifier that is not captured by any AC-GNN.
+
+One such $\mathrm{FOC}_2$ classifier is $\gamma(x)$ in Equation (4), but there are infinitely many and even simpler $\mathrm{FOC}_2$ formulas that cannot be captured by AC-GNNs. Intuitively, the main problem is that an AC-GNN has only a fixed number $L$ of layers and hence the information of local aggregations cannot travel further than at distance $L$ of every node along edges in the graph. For instance, the red node in $\gamma(x)$ may be farther away than the node with the blue neighbours, which means that AC-GNNs would never be able to connect this information. Actually, both nodes may even be in different connected components of a graph, in which case no number of layers would suffice.
+
+The negative result of Proposition 3.3 opens up the following important questions.
+
+1. What kind of $\mathrm{FOC}_2$ classifiers can be captured by AC-GNNs?
+2. Can we capture $\mathrm{FOC}_2$ classifiers with GNNs using a simple extension of AC-GNNs?
+
+We provide answers to these questions in the next two sections.
+
+# 4 THE EXPRESSIVE POWER OF AC-GNNS
+
+Towards answering our first question, we recall that the problem with AC-GNN classifiers is that they are local, in the sense that they cannot see across a distance greater than their number of layers. Thus, if we want to understand which logical classifiers this architecture is capable of expressing, we must consider logics built with similar limitations in mind. And indeed, in this section we show that AC-GNNs capture any $\mathrm{FOC}_2$ classifier as long as we further restrict the formulas so that they satisfy such a locality property. This happens to be a well-known restriction of $\mathrm{FOC}_2$ , and corresponds to graded modal logic (de Rijke, 2000) or, equivalently, to description logic $\mathcal{A}\mathcal{L}\mathcal{Q}$ (Baader et al., 2003), which is fundamental for knowledge representation: for instance, the OWL 2 Web Ontology Language (Motik et al., 2012; W3C OWL Working Group, 2012) relies on $\mathcal{A}\mathcal{L}\mathcal{Q}$ .
+
+The idea of graded modal logic is to force all subformulas to be guarded by the edge predicate $E$ . This means that one cannot express in graded modal logic arbitrary formulas of the form $\exists y\varphi(y)$ , i.e., whether there is some node that satisfies property $\varphi$ . Instead, one is allowed to check whether some neighbor $y$ of the node $x$ where the formula is being evaluated satisfies $\varphi$ . That is, we are allowed to express the formula $\exists y(E(x,y) \land \varphi(y))$ in the logic as in this case $\varphi(y)$ is guarded by $E(x,y)$ . We can define this fragment of FO logic using FO syntax as follows. A graded modal logic formula is either $\operatorname{Col}(x)$ , for Col a node color, or one of the following, where $\varphi$ and $\psi$ are graded modal logic formulas and $N$ is a positive integer:
+
+$$
+\neg \varphi (x), \quad \varphi (x) \wedge \psi (x), \quad \exists^ {\geq N} y (E (x, y) \wedge \varphi (y)).
+$$
+
+Notice then that the formula $\delta(x) \coloneqq \operatorname{Red}(x) \wedge \exists y (E(x, y) \wedge \operatorname{Blue}(y))$ is in graded modal logic, but the logical classifier $\gamma(x)$ in Equation (4) is not, because the use of $\neg E(x, y)$ as a guard is disallowed. As required, we can now show that AC-GNNs can indeed capture all graded modal logic classifiers.
+
+Proposition 4.1. Each graded modal logic classifier is captured by a simple homogeneous AC-GNN.
+
+The key idea of the construction is that the vectors' dimensions used by the AC-GNN to label nodes, represent the sub-formulas of the captured classifier. Thus, if a feature in a node is 1 then the node satisfies the corresponding sub-formula, and the opposite holds after evaluating $L$ layers, where $L$ is the "quantifier depth" of the classifier (which does not depend on the graph). The construction uses simple, homogeneous AC-GNNs with the truncated relu non-linearity $\max(0, \min(x, 1))$ . The formal proof of Proposition 4.1, as well as other formal statements, can be found in the Appendix. An interesting question that we leave as future work is to investigate whether the same kind of construction can be done with AC-GNNs using different aggregate and combine operators than the ones we consider here; for instance, using max instead of sum to aggregate the feature vectors of the neighbors, or using other non-linearity such as sigmoid, etc.
+
+The relationship between AC-GNNs and graded modal logic goes further: we can show that graded modal logic is the "largest" class of logical classifiers captured by AC-GNNs. This means that the only FO formulas that AC-GNNs are able to learn accurately are those in graded modal logic.
+
+Theorem 4.2. A logical classifier is captured by AC-GNNs if and only if it can be expressed in graded modal logic.
+
+The backward direction of this theorem is Proposition 4.1, while the proof of the forward direction is based on a recently communicated extension of deep results in finite model theory (Otto, 2019). We point out that the forward direction holds no matter which aggregate and combine operators are considered, i.e., this is a limitation of the architecture for AC-GNNs, not of the specific functions that one chooses to update the features.
+
+# 5 GNNS FOR CAPTURING $\mathrm{FOC}_2$
+
+# 5.1 GNNS WITH GLOBAL READOUTS
+
+In this section we tackle our second question: which kind of GNN architecture we need to capture all $\mathrm{FOC}_2$ classifiers? Recall that the main shortcoming of AC-GNNs for expressing such classifiers is their local behavior. A natural way to break such a behavior is to allow for a global feature computation on each layer of the GNN. This is called a global attribute computation in the framework of Battaglia et al. (2018). Following the recent GNN literature (Gilmer et al., 2017; Morris et al., 2019; Xu et al., 2019), we refer to this global operation as a readout.
+
+Formally, an aggregate-combine-readout GNN (ACR-GNN) extends AC-GNNs by specifying readout functions $\{\mathrm{READ}^{(i)}\}_{i = 1}^{L}$ , which aggregate the current feature vectors of all the nodes in a graph. Then, the vector $\pmb{x}_v^{(i)}$ of each node $v$ in $G$ on each layer $i$ , is computed by the following formula, generalizing Equation (1):
+
+$$
+\boldsymbol {x} _ {v} ^ {(i)} = \operatorname {C O M} ^ {(i)} \left(\boldsymbol {x} _ {v} ^ {(i - 1)}, \operatorname {A G G} ^ {(i)} \left(\{\{\boldsymbol {x} _ {u} ^ {(i - 1)} \mid u \in \mathcal {N} _ {G} (v) \}\right), \operatorname {R E A D} ^ {(i)} \left(\{\{\boldsymbol {x} _ {u} ^ {(i - 1)} \mid u \in G \}\}\right)\right). \tag {5}
+$$
+
+Intuitively, every layer in an ACR-GNN first computes (i.e., "reads out") the aggregation over all the nodes in $G$ ; then, for every node $v$ , it computes the aggregation over the neighbors of $v$ ; and finally it combines the features of $v$ with the two aggregation vectors. All the notions about AC-GNNs extend to ACR-GNNs in a straightforward way; for example, a simple ACR-GNN uses the sum as the function $\mathrm{READ}^{(i)}$ in each layer, and the combination function $\mathrm{COM}^{(i)}(\pmb{x}_1, \pmb{x}_2, \pmb{x}_3) = f(\pmb{x}_1\pmb{C}^{(i)} + \pmb{x}_2\pmb{A}^{(i)} + \pmb{x}_3\pmb{R}^{(i)} + \pmb{b}^{(i)})$ with a matrix $\pmb{R}^{(i)}$ , generalizing Equation (2).
+
+# 5.2 ACR-GNNs AND FOC $_2$
+
+To see how a readout function could help in capturing non-local properties, consider again the logical classifier $\gamma(x)$ in Equation (4), that assigns true to every red node $v$ as long as there is another node not connected with $v$ having two blue neighbors. We have seen that AC-GNNs cannot capture this classifier. However, using a single readout plus local aggregations one can implement this classifier as follows. First, define by $B$ the property "having at least 2 blue neighbors". Then an ACR-GNN that implements $\gamma(x)$ can (1) use one aggregation to store in the local feature of every node if the node satisfies $B$ , then (2) use a readout function to count how many nodes satisfying $B$ exist in the whole graph, and (3) use another local aggregation to count how many neighbors of every node satisfy $B$ . Then $\gamma$ is obtained by classifying as true every red node having less neighbors satisfying $B$ than the total number of nodes satisfying $B$ in the whole graph. It turns out that the usage of readout functions is enough to capture all non-local properties of $\mathrm{FOC}_2$ classifiers.
+
+Theorem 5.1. Each $FOC_{2}$ classifier can be captured by a simple homogeneous ACR-GNN.
+
+The construction is similar to that of Proposition 4.1 and uses simple, homogeneous ACR-GNNs—that is, the readout function is just the sum of all the local node feature vectors. Moreover, the readout functions are only used to deal with subformulas asserting the existence of a node that is not connected to the current node in the graph, just as we have done for classifier $\gamma(x)$ . As an intermediate step in the proof, we use a characterization of $\mathrm{FOC}_2$ using an extended version of graded modal logic, which was obtained by Lutz et al. (2001). We leave as a challenging open problem whether $\mathrm{FOC}_2$ classifiers are exactly the logical classifiers captured by ACR-GNNs.
+
+# 5.3 COMPARING THE NUMBER OF READOUT LAYERS
+
+The proof of Theorem 5.1 constructs GNNs whose number of layers depends on the formula being captured—that is, readout functions are used unboundedly many times in ACR-GNNs for capturing different $\mathrm{FOC}_2$ classifiers. Given that a global computation can be costly, one might wonder whether this is really needed, or if it is possible to cope with all the complexity of such classifiers by performing only few readouts. We next show that actually just one readout is enough. However, this reduction in the number of readouts comes at the cost of severely complicating the resulting GNN.
+
+Formally, an aggregate-combine GNN with final readout (AC-FR-GNN) results out of using any number of layers as in the AC-GNN definition, together with a final layer that uses a readout function, according to Equation (5).
+
+Theorem 5.2. Each $FOC_{2}$ classifier is captured by an AC-FR-GNN.
+
+The AC-FR-GNN in the proof of this theorem is not based on the idea of evaluating the formula incrementally along layers, as in the proofs of Proposition 4.1 and Theorem 5.1, and it is not simple (note that AC-FR-GNNs are never homogeneous). Instead, it is based on a refinement of the GIN architecture proposed by Xu et al. (2019) to obtain as much information as possible about the local neighborhood in graphs, followed by a readout and combine functions that use this information to deal with non-local constructs in formulas. The first component we build is an AC-GNN that computes an invertible function mapping each node to a number representing its neighborhood (how big is this neighborhood depends on the classifier to be captured). This information is aggregated so that we know for each different type of a neighborhood how many times it appears in the graph. We then use the combine function to evaluate $\mathrm{FOC}_2$ formulas by decoding back the neighborhoods.
+
+# 6 EXPERIMENTAL RESULTS
+
+We perform experiments with synthetic data to empirically validate our results. The motivation of this section is to show that the theoretical expressiveness of ACR-GNNs, as well as the differences between AC- and ACR-GNNs, can actually be observed when we learn from examples. We perform two sets of experiments: experiments to show that ACR-GNNs can learn a very simple $\mathrm{FOC}_2$ node classifier that AC-GNNs cannot learn, and experiments involving complex $\mathrm{FOC}_2$ classifiers that need more intermediate readouts to be learned. We implemented our experiments in the PyTorch Geometric library (Fey & Lenssen, 2019). Besides testing simple AC-GNNs, we also tested the GIN network proposed by Xu et al. (2019) (we consider the implementation by Fey & Lenssen (2019) and adapted it to classify nodes). Our experiments use synthetic graphs, with five initial colors encoded as one-hot features, divided in three sets: train set with 5k graphs of size up to 50-100 nodes, test set with 500 graphs of size similar to the train set, and another test set with 500 graphs of size bigger than the train set. We tried several configurations for the aggregation, combination and readout functions, and report the accuracy on the best configuration. Accuracy in our experiments is computed as the total number of nodes correctly classified among all nodes in all the graphs in the dataset. In every case we run up to 20 epochs with the Adam optimizer. More details on the experimental setting, data, and code can be found in the Appendix. We finally report results on a real benchmark (PPI) where we did not observe an improvement of ACR-GNNs over AC-GNNs.
+
+Separating AC-GNNs and ACR-GNNs We consider a very simple $\mathrm{FOC}_2$ formula defined by $\alpha(x) := \operatorname{Red}(x) \wedge \exists y \operatorname{Blue}(y)$ , which is satisfied by every red node in a graph provided that the graph contains at least one blue node. We tested with line-shaped graphs and Erdős-Renyi (E-R) random graphs with different connectivities. In every set (train and test) we consider $50\%$ of graphs not containing any blue node, and $50\%$ containing at least one blue node (around $20\%$ of nodes are in the true class in every set). For both types of graphs, already single-layer ACR-GNNs showed perfect performance (ACR-1 in Table 1). This was what we expected given the simplicity of the property being checked. In contrast, AC-GNNs and GINs (shown in Table 1 as AC- $L$ and GIN- $L$ , representing AC-GNNs and GINs with $L$ layers) struggle to fit the data. For the case of the line-shaped graph, they were not able to fit the train data even by allowing 7 layers. For the case of random graphs, the performance with 7 layers was considerably better. In a closer look at the performance for different connectivities of E-R graphs, we found an improvement for AC-GNNs when we train them with more dense graphs (details in the Appendix). This is consistent with the fact that AC-GNNs are able to move information of local aggregations to distances up to their
+
+ | Line Train | Line Test | E-R Train | E-R Test |
| | same-size | bigger | | same-size | bigger |
| AC-5 | 0.887 | 0.886 | 0.892 | 0.951 | 0.949 | 0.929 |
| AC-7 | 0.892 | 0.892 | 0.897 | 0.967 | 0.965 | 0.958 |
| GIN-5 | 0.861 | 0.861 | 0.867 | 0.830 | 0.831 | 0.817 |
| GIN-7 | 0.863 | 0.864 | 0.870 | 0.818 | 0.819 | 0.813 |
| ACR-1 | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 |
+
+Table 1: Results on synthetic data for nodes labeled by classifier $\alpha \left( x\right) \mathrel{\text{:=}} \operatorname{Red}\left( x\right) \land \exists y\operatorname{Blue}\left( y\right)$
+
+ | α1 Train | α1 Test | α2 Train | α2 Test | α3 Train | α3 Test |
| | same-size | bigger | | same-size | bigger | | same-size | bigger |
| AC | 0.839 | 0.826 | 0.671 | 0.694 | 0.695 | 0.667 | 0.657 | 0.636 | 0.632 |
| GIN | 0.567 | 0.566 | 0.536 | 0.689 | 0.693 | 0.672 | 0.656 | 0.643 | 0.580 |
| AC-FR-2 | 1.000 | 1.000 | 1.000 | 0.863 | 0.860 | 0.694 | 0.788 | 0.775 | 0.770 |
| AC-FR-3 | 1.000 | 1.000 | 0.825 | 0.840 | 0.823 | 0.604 | 0.787 | 0.767 | 0.771 |
| ACR-1 | 1.000 | 1.000 | 1.000 | 0.827 | 0.834 | 0.726 | 0.760 | 0.762 | 0.773 |
| ACR-2 | 1.000 | 1.000 | 1.000 | 0.895 | 0.897 | 0.770 | 0.800 | 0.799 | 0.771 |
| ACR-3 | 1.000 | 1.000 | 1.000 | 0.903 | 0.902 | 0.836 | 0.817 | 0.802 | 0.748 |
+
+Table 2: Results on E-R synthetic data for nodes labeled by classifiers ${\alpha }_{i}\left( x\right)$ in Equation (6)
+
+number of layers. This combined with the fact that random graphs that are more dense make the maximum distances between nodes shorter, may explain the boost in performance for AC-GNNs.
+
+Complex $\mathbf{FOC}_2$ properties In the second experiment we consider classifiers $\alpha_{i}(x)$ constructed as
+
+$$
+\alpha_ {0} (x) := \operatorname {B l u e} (x), \quad \alpha_ {i + 1} (x) := \exists^ {[ N, M ]} y (\alpha_ {i} (y) \wedge \neg E (x, y)), \tag {6}
+$$
+
+where $\exists^{[N,M]}$ stands for "there exist between $N$ and $M$ nodes" satisfying a given property. Observe that each $\alpha_{i}(x)$ is in $\mathrm{FOC}_2$ , as $\exists^{[N,M]}$ can be expressed by combining $\exists^{\geq N}$ and $\neg \exists^{\geq M + 1}$ . We created datasets with E-R dense graphs and labeled them according to $\alpha_{1}(x)$ , $\alpha_{2}(x)$ , and $\alpha_{3}(x)$ , ensuring in each case that approximately half of all nodes in our dataset satisfy every property. Our experiments show that when increasing the depth of the formula (existential quantifiers with negations inside other existential quantifiers) more layers are needed to increase train and test accuracy (see Table 2). We report ACR-GNNs performance up to 3 layers (ACR- $L$ in Table 2) as beyond that we did not see any significant improvement. We also note that for the bigger test set, AC-GNNs and GINs are unable to substantially depart from a trivial baseline of $50\%$ . We tested these networks with up to 10 layers but only report the best results on the bigger test set. We also test AC-FR-GNNs with two and three layers (AC-FR- $L$ in Table 2). As we expected, although theoretically using a single readout gives the same expressive power as using several of them (Theorem 5.2), in practice more than a single readout can actually help the learning process of complex properties.
+
+PPI We also tested AC- and ACR-GNNs on the Protein-Protein Interaction (PPI) benchmark (Zitnik & Leskovec, 2017). We chose PPI since it is a node classification benchmark with different graphs in the train set (as opposed to other popular benchmarks for node classification such as Core or Citeseer that have a single graph). Although the best results for both classes of GNNs on PPI were quite high (AC: 97.5 F1, ACR: 95.4 F1 in the test set), we did not observe an improvement when using ACR-GNNs. Chen et al. (2019) recently observed that commonly used benchmarks are inadequate for testing advanced GNN variants, and ACR-GNNs might be suffering from this fact.
+
+# 7 FINAL REMARKS
+
+Our results show the theoretical advantages of mixing local and global information when classifying nodes in a graph. Recent works have also observed these advantages in practice, e.g., Deng et al.
+
+(2018) use global-context aware local descriptors to classify objects in 3D point clouds, You et al. (2019) construct node features by computing shortest-path distances to a set of distant anchor nodes, and Haonan et al. (2019) introduced the idea of a "star node" that stores global information of the graph. As mentioned before, our work is close in spirit to that of Xu et al. (2019) and Morris et al. (2019) establishing the correspondence between the WL test and GNNs. In contrast to our work, they focus on graph classification and do not consider the relationship with logical classifiers.
+Regarding our results on the links between AC-GNNs and graded modal logic (Theorem 4.2), we point out that very recent work of Sato et al. (2019) establishes close relationships between GNNs and certain classes of distributed local algorithms. These in turn have been shown to have strong correspondences with modal logics (Hella et al., 2015). Hence, variants of our Proposition 4.1 could be obtained by combining these two lines of work (but it is not clear if this combination would yield AC-GNNs that are simple). However, these works do not investigate the impact of having non-local computations (such as the readouts that we consider), hence our results on the relationships between FO an ACR-GNNs (Theorem 5.1 and 5.2) do not follow from these.
+Morris et al. (2019) also studied $k$ -GNNs, which are inspired by the $k$ -dimensional WL test. In $k$ -GNNs, graphs are considered as structures connecting $k$ -tuples of nodes instead of just pairs of them. We plan to study how our results on logical classifiers relate to $k$ -GNNs, in particular, with respect to the logic $\mathrm{FOC}_k$ that extends $\mathrm{FOC}_2$ by allowing formulas with $k$ variables, for each fixed $k > 1$ . Recent work has also explored the extraction of finite state representations from recurrent neural networks as a way of explaining them (Weiss et al., 2018; Koul et al., 2019; Oliva & Lago-Fernandez, 2019). We would like to study how our results can be applied for extracting logical formulas from GNNs as possible explanations for their computations.
+
+# ACKNOWLEDGMENTS
+
+This work was partly funded by the Millennium Institute for Foundational Research on Data2.
+
+# REFERENCES
+
+Franz Baader and Carsten Lutz. Description logic. In Handbook of modal logic, pp. 757-819. North-Holland, 2007.
+Franz Baader, Diego Calvanese, Deborah L. McGuinness, Daniele Nardi, and Peter F. Patel-Schneider (eds.). The description logic handbook: theory, implementation, and applications. Cambridge University Press, 2003.
+Peter W. Battaglia, Jessica B. Hamrick, Victor Bapst, Alvaro Sanchez-Gonzalez, Vinicius Flores Zambaldi, Mateusz Malinowski, Andrea Tacchetti, David Raposo, Adam Santoro, Ryan Faulkner, Caglar Gulçehre, H. Francis Song, Andrew J. Ballard, Justin Gilmer, George E. Dahl, Ashish Vaswani, Kelsey R. Allen, Charles Nash, Victoria Langston, Chris Dyer, Nicolas Heess, Daan Wierstra, Pushmeet Kohli, Matthew Botvinick, Oriol Vinyals, Yujia Li, and Razvan Pascanu. Relational inductive biases, deep learning, and graph networks. CoRR, abs/1806.01261, 2018. URL http://arxiv.org/abs/1806.01261.
+Jin-Yi Cai, Martin Fürer, and Neil Immerman. An optimal lower bound on the number of variables for graph identification. Combinatorica, 12(4):389-410, 1992.
+Ting Chen, Song Bian, and Yizhou Sun. Are powerful graph neural nets necessary? A dissection on graph classification. CoRR, abs/1905.04579, 2019. URL https://arxiv.org/abs/1905.04579.
+Maarten de Rijke. A Note on graded modal logic. Studia Logica, 64(2):271-283, 2000.
+Haowen Deng, Tolga Birdal, and Slobodan Ilic. PPFnet: Global context aware local features for robust 3d point matching. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2018, Salt Lake City, UT, USA, June 18-22, 2018, pp. 195-205, 2018.
+
+Matthias Fey and Jan Eric Lenssen. Fast graph representation learning with PyTorch Geometric. CoRR, abs/1903.02428, 2019. URL https://arxiv.org/abs/1903.02428.
+Justin Gilmer, Samuel S. Schoenholz, Patrick F. Riley, Oriol Vinyals, and George E. Dahl. Neural message passing for quantum chemistry. In Proceedings of the 34th International Conference on Machine Learning, ICML 2017, Sydney, NSW, Australia, 6-11 August, 2017, pp. 1263-1272, 2017.
+William L. Hamilton, Zhitao Ying, and Jure Leskovec. Inductive representation learning on large graphs. In Advances in Neural Information Processing Systems 30: Annual Conference on Neural Information Processing Systems, NIPS 2017, Long Beach, CA, USA, December 4-9, 2017, pp. 1024-1034, 2017.
+Lu Haonan, Seth H Huang, Tian Ye, and Guo Xiuyan. Graph star net for generalized multi-task learning. arXiv preprint arXiv:1906.12330, 2019.
+Lauri Hella, Matti Järvisalo, Antti Kuusisto, Juhana Laurinharju, Tuomo Lempiäinen, Kerkko Luosto, Jukka Suomela, and Jonni Virtema. Weak models of distributed computing, with connections to modal logic. Distributed Computing, 28(1):31-53, 2015.
+Thomas N. Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. In Proceedings of the 5th International Conference on Learning Representations, ICLR 2017, Toulouse, France, April 24-26, 2017, 2017.
+Anurag Koul, Sam Greydanus, and Alan Fern. Learning finite state representations of recurrent policy networks. In Proceedings of the 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019, 2019.
+Carsten Lutz, Ulrike Sattler, and Frank Wolter. Modal logic and the two-variable fragment. In Proceedings of the International Workshop on Computer Science Logic, CSL 2001, Paris, France, September 10-13, 2001, pp. 247-261. Springer, 2001.
+Christian Merkwirth and Thomas Lengauer. Automatic generation of complementary descriptors with molecular graph networks. J. of Chemical Information and Modeling, 45(5):1159-1168, 2005.
+Christopher Morris, Martin Ritzert, Matthias Fey, William L. Hamilton, Jan Eric Lenssen, Gaurav Rattan, and Martin Grohe. Weisfeiler and Leman go neural: higher-order graph neural networks. In Proceedings of the 33rd AAAI Conference on Artificial Intelligence, AAAI 2019, Honolulu, Hawaii, USA, January 27 – February 1, 2019, pp. 4602–4609, 2019.
+Boris Motik, Bernardo Cuenca Grau, Ian Horrocks, Zhe Wu, Achille Fokoue, and Carsten Lutz. OWL 2 Web ontology language profiles (second edition). W3C recommendation, W3C, 2012. URL http://www.w3.org/TR/owl2-profiles/.
+Christian Oliva and Luis F. Lago-Fernández. On the interpretation of recurrent neural networks as finite state machines. In Part I of the Proceedings of the 28th International Conference on Artificial Neural Networks, ICANN 2019, Munich, Germany, September 17-19, 2019, pp. 312-323. Springer, 2019.
+Martin Otto. Graded modal logic and counting bisimulation. https://www2.mathematik.tu-darmstadt.de/~otto/papers/cml19.pdf, 2019.
+Ryoma Sato, Makoto Yamada, and Hisashi Kashima. Approximation Ratios of Graph Neural Networks for Combinatorial Problems. arXiv preprint arXiv:1905.10261, 2019.
+Franco Scarselli, Marco Gori, Ah Chung Tsoi, Markus Hagenbuchner, and Gabriele Monfardini. The graph neural network model. IEEE Trans. Neural Networks, 20(1):61-80, 2009.
+Michael Sejr Schlichtkrull, Thomas N. Kipf, Peter Bloem, Rianne van den Berg, Ivan Titov, and Max Welling. Modeling relational data with graph convolutional networks. In Proceedings of The Semantic Web - 15th International Conference, ESWC 2018, Heraklion, Crete, Greece, June 3-7, 2018, pp. 593-607, 2018.
+
+W3C OWL Working Group. OWL 2 Web ontology language document overview (second edition). W3C recommendation, W3C, 2012. URL https://www.w3.org/TR/owl2-overview/.
+Boris Yu. Weisfeiler and Andrei A. Leman. A Reduction of a graph to a canonical form and an algebra arising during this reduction. Nauchno-Technicheskaya Informatsia, 2(9):12-16, 1968. Translated from Russian.
+Gail Weiss, Yoav Goldberg, and Eran Yahav. Extracting automata from recurrent neural networks using queries and counterexamples. In Proceedings of the 35th International Conference on Machine Learning, ICML 2018, Stockholm, Sweden, July 10-15, 2018, pp. 5244-5253, 2018.
+Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How Powerful are graph neural networks? In Proceedings of the 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019, 2019.
+Jiaxuan You, Rex Ying, and Jure Leskovec. Position-aware graph neural networks. In Proceedings of the 36th International Conference on Machine Learning, ICML 2019, Long Beach, California, USA, June 9-15, 2019, pp. 7134-7143, 2019.
+Marinka Zitnik and Jure Leskovec. Predicting multicellular function through multi-layer tissue networks. CoRR, abs/1707.04638, 2017. URL http://arxiv.org/abs/1707.04638.
+
+# APPENDIX
+
+# A PROOF OF PROPOSITION 3.3
+
+We first recall the proposition.
+
+Proposition 3.3. There is an $FOC_{2}$ classifier that is not captured by any AC-GNN.
+
+Proof. Consider the following $\mathrm{FOC}_2$ node property $\alpha(v) \coloneqq \operatorname{Red}(v) \wedge \exists x \operatorname{Green}(x)$ . We will show by contradiction that there is no AC-GNN that captures $\alpha$ , no matter which aggregation, combining, and final classification functions are allowed. Indeed, assume that $\mathcal{A}$ is an AC-GNN capturing $\alpha$ , and let $L$ be its number of layers. Consider the graph $G$ that is a chain of $L + 2$ nodes colored Red, and consider the first node $v_0$ in that chain. Since $\mathcal{A}$ captures $\alpha$ , and since $(G, v_0) \nmid \alpha$ , we have that $\mathcal{A}$ labels $v_0$ with false, i.e., $\mathcal{A}(G, v_0) = \text{false}$ . Now, consider the graph $G'$ obtained from $G$ by coloring the last node in the chain with Green (instead of Red). Then one can easily show that $\mathcal{A}$ again labels $v_0$ by false in $G'$ . But we have $(G', v_0) \models \alpha$ , a contradiction.
+
+The above proof relies on the following weakness of AC-GNNs: if the number of layers is fixed (i.e., does not depend on the input graph), then the information of the color of a node $v$ cannot travel further than at distance $L$ from $v$ . Nevertheless, we can show that the same holds even when we consider AC-GNNs that dispose of an arbitrary number of layers (for instance, one may want to run a homogeneous AC-GNN for $f(|E|)$ layers for each graph $G = (V, E)$ , for a fixed function $f$ ). Assume again by way of contradiction that $\mathcal{A}$ is such an extended AC-GNN capturing $\alpha$ . Consider the graph $G$ consisting of two disconnected nodes $v, u$ , with $v$ colored Red and $y$ colored Green. Then, since $(G, v) \models \alpha$ , we have $\mathcal{A}(G, v) = \text{true}$ . Now consider the graph $G'$ obtained from $G$ by changing the color of $u$ from Green to Red. Observe that, since the two nodes are not connected, we will again have $\mathcal{A}(G', v) = \text{true}$ , contradicting the fact that $(G', v) \not\models \alpha$ and that $\mathcal{A}$ is supposed to capture $\alpha$ .
+
+By contrast, it is easy to see that this formula can be done with only one intermediate readout, using the technique in the proof of Theorem 5.1.
+
+# B PROOF OF PROPOSITION 4.1
+
+We first recall the proposition.
+
+Proposition 4.1. Each graded modal logic classifier is captured by a simple homogeneous AC-GNN.
+
+We first define formally the semantics of the graded modal logic (de Rijke, 2000) over simple undirected node-colored graphs (de Rijke, 2000), assuming the FO syntax introduced in the paper.
+
+Definition B.1. We define when a node $v$ in a graph $G$ satisfies a graded modal logic formula $\varphi(x)$ , written as $v \models \varphi$ in $G$ (where "in $G$ " may be omitted when clear), recursively as follows:
+
+- if $\varphi(x) = \operatorname{Col}(x)$ , then $v \models \varphi$ if and only if $\operatorname{Col}$ is the color of $v$ in $G$ ,
+- if $\varphi(x) = \varphi'(x) \wedge \varphi''(x)$ , then $v \models \varphi$ if and only if $v \models \varphi'$ and $v \models \varphi''$ , and similarly with $\neg \varphi'(x)$ , and
+- if $\varphi(x) = \exists^{\geq N}(E(x,y) \wedge \varphi'(y))$ , then $v \models \varphi$ if and only if the set of nodes $\{u \mid u \in \mathcal{N}_G(v)$ and $v \models \varphi'\}$ has cardinality at least $N$ .
+
+We can now proceed to the proof of the proposition.
+
+Proof of Proposition 4.1. Let $\varphi(x)$ be a graded modal logic formula. We will construct an AC-GNN $\mathcal{A}_{\varphi}$ that is further simple and homogeneous. Let $\mathrm{sub}(\varphi) = (\varphi_1, \varphi_2, \ldots, \varphi_L)$ be an enumeration of the sub-formulas of $\varphi$ such that if $\varphi_k$ is a subformula of $\varphi_\ell$ then $k \leq \ell$ . The idea of the construction of $\mathcal{A}_{\varphi}$ is to have feature vectors in $\mathbb{R}^L$ such that every component of those vectors represents a different formula in $\mathrm{sub}(\varphi)$ . Then $\mathcal{A}_{\varphi}$ will update the feature vector $\boldsymbol{x}_v^{(i)}$ of node $v$ ensuring that component $\ell$ of $\boldsymbol{x}_v^{(\ell)}$ gets a value 1 if and only if the formula $\varphi_\ell$ is satisfied in node $v$ .
+
+We note that $\varphi = \varphi_{L}$ and thus, the last component of each feature vector after evaluating $L$ layers in every node gets a value 1 if and only if the node satisfies $\varphi$ . We will then be able to use a final classification function CLS that simply extracts that particular component.
+
+Formally, the simple homogeneous AC-GNN $\mathcal{A}_{\varphi}$ has $L$ layers and uses the aggregation and combine functions
+
+$$
+\operatorname {A G G} (X) = \sum_ {\boldsymbol {x} \in X} \boldsymbol {x},
+$$
+
+$$
+\operatorname {C O M} (\boldsymbol {x}, \boldsymbol {y}) = \sigma (\boldsymbol {x} \boldsymbol {C} + \boldsymbol {y} \boldsymbol {A} + \boldsymbol {b}),
+$$
+
+where $A, C \in \mathbb{R}^{L \times L}$ , and $b \in \mathbb{R}^L$ are defined next, and $\sigma$ is the truncated ReLU activation defined by $\sigma(x) = \min(\max(0, x), 1)$ . The entries of the $\ell$ -th columns of $A, C$ , and $b$ depend on the sub-formulas of $\varphi$ as follows:
+
+Case 0. if $\varphi_{\ell}(x) = \operatorname{Col}(x)$ with $\operatorname{Col}$ one of the (base) colors, then $C_{\ell \ell} = 1$
+
+Case 1. if $\varphi_{\ell}(x) = \varphi_{j}(x)\wedge \varphi_{k}(x)$ then $C_{j\ell} = C_{k\ell} = 1$ and $b_{\ell} = -1$
+
+Case 2. if $\varphi_{\ell}(x) = \neg \varphi_{k}(x)$ then $C_{k\ell} = -1$ and $b_{\ell} = 1$
+
+Case 3. if $\varphi_{\ell}(x) = \exists^{\geq N}(E(x,y)\wedge \varphi_k(y))$ then $A_{k\ell} = 1$ and $b_{\ell} = -N + 1$
+
+and all other values in the $\ell$ -th columns of $A, C$ , and $b$ are 0.
+
+We now prove that $\mathcal{A}_{\varphi}$ indeed captures $\varphi$ . Let $G = (V, E)$ be a colored graph. For every node $v$ in $G$ we consider the initial feature vector $\pmb{x}_v^{(0)} = (x_1, \ldots, x_L)$ such that $x_\ell = 1$ if sub-formula $\varphi_\ell$ is the initial color assigned to $v$ , and $x_\ell = 0$ otherwise. By definition, AC-GNN $\mathcal{A}_{\varphi}$ will iterate the aggregation and combine functions defined above for $L$ rounds ( $L$ layers) to produce feature vectors $\pmb{x}_v^{(i)}$ for every node $v \in G$ and $\ell = 1, \ldots, L$ as follows:
+
+$$
+\begin{array}{l} \boldsymbol {x} _ {v} ^ {(i)} = \operatorname {C O M} \left(\boldsymbol {x} _ {v} ^ {(i - 1)}, \operatorname {A G G} \left(\left\{\left\{\boldsymbol {x} _ {u} ^ {(i - 1)} \mid u \in \mathcal {N} (v) \right\} \right\}\right)\right) \\ = \sigma \left(\boldsymbol {x} _ {v} ^ {(i - 1)} \boldsymbol {C} + \sum_ {u \in \mathcal {N} (v)} \boldsymbol {x} _ {u} ^ {(i - 1)} \boldsymbol {A} + \boldsymbol {b}\right). \tag {7} \\ \end{array}
+$$
+
+We next prove that for every $\varphi_{\ell}\in \mathrm{sub}(\varphi)$ , every $i\in \{\ell ,\dots ,L\}$ , and every node $v$ in $G$ it holds that
+
+$$
+\left(\boldsymbol {x} _ {v} ^ {(i)}\right) _ {\ell} = 1 \text {i f} v \vDash \varphi_ {\ell}, \text {a n d} \left(\boldsymbol {x} _ {v} ^ {(i)}\right) _ {\ell} = 0 \text {o t h e r w i s e}, \tag {8}
+$$
+
+where $(\pmb{x}_v^{(i)})_\ell$ is the $\ell$ -th component of $\pmb{x}_v^{(i)}$ that is, the $\ell$ -th component of $\pmb{x}_v^{(i)}$ has a 1 if and only if $v$ satisfies $\varphi_\ell$ in $G$ . In the rest of the proof we will be continuously using the value of $(\pmb{x}_v^{(i)})_\ell$ whose general expression is
+
+$$
+\left(\boldsymbol {x} _ {v} ^ {(i)}\right) _ {\ell} = \sigma \Bigg (\sum_ {k = 1} ^ {L} \left(\boldsymbol {x} _ {v} ^ {(i - 1)}\right) _ {k} C _ {k \ell} + \sum_ {u \in \mathcal {N} (v)} \sum_ {k = 1} ^ {L} \left(\boldsymbol {x} _ {u} ^ {(i - 1)}\right) _ {k} A _ {k \ell} + b _ {\ell} \Bigg). \tag {9}
+$$
+
+We proceed to prove (8) by induction on the number of sub-formulas of every $\varphi_{\ell}$ . If $\varphi_{\ell}$ has one sub-formula, then $\varphi_{\ell}(x) = \operatorname{Col}(x)$ with $\operatorname{Col}$ a base color. We next prove that $(\boldsymbol{x}_v^{(1)})_\ell = 1$ if and only if $v$ has $\operatorname{Col}$ as its initial color. Since $\varphi_{\ell}(x) = \operatorname{Col}(x)$ we know that $C_{\ell \ell} = 1$ and $C_{k\ell} = 0$ for every $k \neq \ell$ (see Case 0 above). Moreover, we know that $b_{\ell} = 0$ and $A_{k\ell} = 0$ for every $k$ . Then, from Equation (9) we obtain that
+
+$$
+(\boldsymbol {x} _ {v} ^ {(1)}) _ {\ell} = \sigma \Big (\sum_ {k = 1} ^ {L} (\boldsymbol {x} _ {v} ^ {(0)}) _ {k} C _ {k \ell} + \sum_ {\{v, u \} \in E} \sum_ {k = 1} ^ {L} (\boldsymbol {x} _ {u} ^ {(0)}) _ {k} A _ {k \ell} + b _ {\ell} \Big) = \sigma \big ((\boldsymbol {x} _ {v} ^ {(0)}) _ {\ell} \big).
+$$
+
+Then, given that $(\pmb{x}_v^{(0)})_\ell = 1$ if the initial color of $v$ is Col and $(\pmb{x}_v^{(0)})_\ell = 0$ otherwise, we have that $(\pmb{x}_v^{(1)})_\ell = 1$ if $(G,v) \models \varphi_\ell$ and $(\pmb{x}_v^{(1)})_\ell = 0$ otherwise. From this it is easy to prove that for every $i \geq 1$ the vector $(\pmb{x}_v^{(i)})_\ell$ satisfies the same property. Now assume that $\varphi_\ell$ has more than one
+
+sub-formula, and assume that for every $\varphi_{k}$ with $k < \ell$ the property (8) holds. Let $i\geq \ell$ . We are left to consider the following cases, corresponding to the cases for the shape of the formula above.
+
+Case 1. Assume that $\varphi_{\ell}(x) = \varphi_{j}(x)\wedge \varphi_{k}(x)$ . Then $C_{j\ell} = C_{k\ell} = 1$ and $b_{\ell} = -1$ . Moreover, we have $C_{m\ell} = 0$ for every $m\neq j,k$ and $A_{n\ell} = 0$ for every $n$ (see Case 2 above). Then, from Equation (9) we obtain that
+
+$$
+(\boldsymbol {x} _ {v} ^ {(i)}) _ {\ell} = \sigma \Bigg ((\boldsymbol {x} _ {v} ^ {(i - 1)}) _ {j} + (\boldsymbol {x} _ {v} ^ {(i - 1)}) _ {k} - 1 \Bigg).
+$$
+
+Since the number of each proper sub-formula of $\varphi_{\ell}$ is strictly less than both $\ell$ and $i$ , by induction hypothesis we know that $(\pmb{x}_v^{(i - 1)})_j = 1$ if and only if $v\models \varphi_{j}$ and $(\pmb{x}_v^{(i - 1)})_j = 0$ otherwise. Similarly, $(\pmb{x}_v^{(i - 1)})_k = 1$ if and only if $v\models \varphi_k$ and $(\pmb{x}_v^{(i - 1)})_k = 0$ otherwise. Now, since $(\pmb{x}_v^{(i)})_\ell = \sigma ((\pmb{x}_v^{(i - 1)})_j + (\pmb{x}_v^{(i - 1)})_k - 1)$ we have that $(\pmb{x}_v^{(i)})_\ell = 1$ if and only if $(\pmb{x}_v^{(i - 1)})_j + (\pmb{x}_v^{(i - 1)})_k - 1\geq 1$ that can only happen if $(\pmb{x}_v^{(i - 1)})_j = (\pmb{x}_v^{(i - 1)})_k = 1$ . Then $(\pmb{x}_v^{(i)})_\ell = 1$ if and only if $v\models \varphi_j$ and $v\models \varphi_k$ that is, if and only if $v\models \varphi_{\ell}$ (since $\varphi_{\ell}(x) = \varphi_{j}(x)\wedge \varphi_{k}(x)$ ), and $(\pmb{x}_v^{(i)})_\ell = 0$ otherwise. This is exactly what we wanted to prove.
+
+Case 2. Assume that $\varphi_{\ell}(x) = \neg \varphi_{k}(x)$ . Then $C_{k\ell} = -1$ and $b_{\ell} = 1$ . Moreover, we have $C_{m\ell} = 0$ for every $m \neq k$ and $A_{n\ell} = 0$ for every $n$ (see Case 2 above). Then, from Equation (9) we obtain that
+
+$$
+\left(\boldsymbol {x} _ {v} ^ {(i)}\right) _ {\ell} = \sigma \Bigg (- \left(\boldsymbol {x} _ {v} ^ {(i - 1)}\right) _ {k} + 1 \Bigg).
+$$
+
+By induction hypothesis we know that $(\pmb{x}_v^{(i - 1)})_k = 1$ if and only if $v\models \varphi_{k}$ and $(\pmb{x}_v^{(i - 1)})_k = 0$ otherwise. Since $(\pmb{x}_v^{(i)})_\ell = \sigma (-(\pmb{x}_v^{(i - 1)})_k + 1)$ we have that $(\pmb{x}_v^{(i)})_\ell = 1$ if and only if $1 - (\pmb{x}_v^{(i - 1)})_k\geq 1$ that can only happen if $(\pmb{x}_v^{(i - 1)})_k = 0$ . Then $(\pmb{x}_v^{(i)})_\ell = 1$ if and only if $v\models \varphi_{k}$ that is, if and only if $v\models \neg \varphi_{k}$ , which holds if and only if $v\models \varphi_{\ell}$ , and $(\pmb{x}_v^{(i)})_\ell = 0$ otherwise. This is exactly what we wanted to prove.
+
+Case 3. Assume that $\varphi_{\ell}(x) = \exists^{\geq N}(E(x,y)\wedge \varphi_k(y))$ . Then $A_{k\ell} = 1$ and $b_{\ell} = -N + 1$ . Moreover for every $m$ we have that $C_{m\ell} = 0$ (see Case 3 above). Then, from Equation (9) we obtain that
+
+$$
+(\boldsymbol {x} _ {v} ^ {(i)}) _ {\ell} = \sigma \Bigg (- N + 1 + \sum_ {\{u, v \} \in E} (\boldsymbol {x} _ {u} ^ {(i - 1)}) _ {k} \Bigg).
+$$
+
+By induction hypothesis we know that $(\pmb{x}_u^{(i - 1)})_k = 1$ if and only if $v\models \varphi_{k}$ and $(\pmb{x}_u^{(i - 1)})_k = 0$ otherwise. Then we can write $(\pmb{x}_v^{(i)})_\ell = \sigma (-N + 1 + m)$ where
+
+$$
+m = | \{u \mid u \in \mathcal {N} (v) \text {a n d} u \models \varphi_ {k} \} |.
+$$
+
+Thus, we have that $(\pmb{x}_v^{(i)})_\ell = 1$ if and only if $m \geq N$ , that is if and only if there exists at least $N$ nodes connected with $v$ that satisfy $\varphi_k$ , and $(\pmb{x}_v^{(i)})_\ell = 0$ otherwise. From that we obtain that $(\pmb{x}_v^{(i)})_\ell = 1$ if and only if $v \models \varphi_\ell$ since $\varphi_\ell(x) = \exists^{\geq N}(E(x,y) \wedge \varphi_k(y))$ , which is what we wanted to prove.
+
+To complete the proof we only need to add a final classification after the $L$ iterations of the aggregate and combine layers that simply classify a node $v$ as true if the component of $\pmb{x}_v^{(L)}$ corresponding to $\varphi$ holds 1.
+
+# C PROOF OF THEOREM 4.2
+
+We first recall the theorem.
+
+Theorem 4.2. A logical classifier is captured by AC-GNNs if and only if it can be expressed in graded modal logic.
+
+Note that one direction follows immediately from Proposition 4.1, so we only need to show the following proposition.
+
+Proposition C.1. If a logical classifier $\alpha$ is not equivalent to any graded modal logic formula, then there is no AC-GNN that captures $\alpha$ .
+
+To prove this proposition, we will need the following definition, which is standard in modal logics theory.
+
+Definition C.2. Let $G$ be a graph (simple, undirected and node-colored), $v$ be a node in $G$ , and $L \in \mathbb{N}$ . The unravelling of $v$ in $G$ at depth $L$ , denoted by $\mathrm{Unr}_G^L(v)$ , is the (simple undirected node-colored) graph that is the tree having
+
+- a node $(v, u_1, \ldots, u_i)$ for each path $(v, u_1, \ldots, u_i)$ in $G$ with $i \leq L$ ,
+- an edge between $(v, u_1, \ldots, u_{i-1})$ and $(v, u_1, \ldots, u_i)$ when $\{u_{i-1}, u_i\}$ is an edge in $G$ (assuming that $u_0$ is $v$ ), and
+- each node $(v, u_1, \ldots, u_i)$ colored the same as $u_i$ in $G$ .
+
+We then observe the following.
+
+Observation C.3. Let $G$ and $G'$ be two graphs, and $v$ and $v'$ be two nodes in $G$ and $G'$ , respectively. Then for every $L \in \mathbb{N}$ , the WL test assigns the same color to $v$ and $v'$ at round $L$ if and only if there is an isomorphism between $\mathrm{Unr}_G^L(v)$ and $\mathrm{Unr}_{G'}^L(v')$ sending $v$ to $v'$ .
+
+We will write $\mathrm{Unr}_G^L (v)\simeq \mathrm{Unr}_{G'}^L (v')$ to denote the existence of the isomorphism as in this observation. To prove Proposition C.1, we first rephrase Proposition 2.1 in terms of unravellings.
+
+Proposition C.4. Let $G$ and $G'$ be two graphs with nodes $v$ in $G$ and $v'$ in $G'$ such that $\mathrm{Unr}_G^L(v) \simeq \mathrm{Unr}_{G'}^L(v')$ for every $L \in \mathbb{N}$ . Then for any AC-GNN $\mathcal{A}$ , we have $\mathcal{A}(G, u) = \mathcal{A}(G', u')$ .
+
+Proof. Follows directly from Proposition 2.1 and Observation C.3. $\square$
+
+
+
+The crucial part of the proof of Proposition C.1 is the following non-trivial result, intuitively establishing that the fragment of unary FO formulas that only depend on the unravelling of a node is exactly the graded modal logic.
+
+Theorem C.5 (Otto, 2019). Let $\alpha$ be a unary FO formula. If $\alpha$ is not equivalent to a graded modal logic formula then there exist two graphs $G$ , $G'$ and two nodes $v$ in $G$ and $u'$ in $G'$ such that $\mathrm{Unr}_G^L(v) \simeq \mathrm{Unr}_{G'}^L(v')$ for every $L \in \mathbb{N}$ and such that $u \models \alpha$ in $G$ but $u' \not\models \alpha$ in $G'$ .
+
+Proof. This directly follows from the van Benthem & Rosen characterization obtained in (Otto, 2019, Theorem 2.2) for finite structures (graphs), by noticing that for the notion of graded bisimulation $\sim_{\#}$ introduced in this note, we have that $G, u \sim_{\#} G', u'$ if and only if we have that $\mathrm{Unr}_G^L(v) \simeq \mathrm{Unr}_{G'}^L(v')$ for every $L \in \mathbb{N}$ . We point out here that the fact that the edge relation in $G$ is undirected in our setting (as opposed to $E$ being directed in (Otto, 2019)), and the fact that every node can only have one color in our setting (as opposed to being able to satisfy multiple "unary predicates" in (Otto, 2019)) are inessential, and that the proof of (Otto, 2019, Theorem 2.2) carries over to this setting.
+
+We can now gather all of these to prove Proposition C.1.
+
+Proof of Proposition C.1. Let $\alpha$ be a logical classifier (i.e., a unary FO formula) that is not equivalent to any graded modal logic formula. Assume for a contradiction that there exists an AC-GNN $\mathcal{A}_{\alpha}$ that captures $\alpha$ . Since $\alpha$ is not equivalent to any graded modal logic formula, by Theorem C.5 there exist two graphs $G$ , $G'$ and two nodes $v$ in $G$ and $u'$ in $G'$ such that $\mathrm{Unr}_G^L(v) \simeq \mathrm{Unr}_{G'}^L(v')$ for every $L \in \mathbb{N}$ and such that $(\star)u \models \alpha$ in $G$ but $u' \not\models \alpha$ in $G'$ . Since we have that $\mathrm{Unr}_G^L(v) \simeq \mathrm{Unr}_{G'}^L(v')$ for every $L \in \mathbb{N}$ , by Proposition C.4 we should have that $\mathcal{A}_{\alpha}(G,u) = \mathcal{A}_{\alpha}(G',u')$ . But this contradicts $(\star)$ and the fact that $\mathcal{A}_{\alpha}$ is supposed to capture $\alpha$ .
+
+# D PROOF OF THEOREM 5.1
+
+We first recall the theorem.
+
+Theorem 5.1. Each $FOC_{2}$ classifier can be captured by a simple homogeneous ACR-GNN.
+
+To prove the theorem, we will use a characterization of the unary $\mathrm{FOC}_2$ formulas provided by (Lutz et al., 2001) that uses a specific modal logic. That logic is defined via what are called modal parameters. We adapt the definitions of (Lutz et al., 2001) to deal with simple undirected node-colored graphs.
+
+Definition D.1. A modal parameter is an expression built from the following grammar:
+
+$$
+S := \operatorname {i d} | e | S \cup S | S \cap S | \neg S.
+$$
+
+Given an undirected colored graph $G = (V, E)$ and a node $v$ of $G$ , the interpretation of $S$ on $v$ is the set $\varepsilon_S(v) \subseteq V$ defined inductively as follows:
+
+- if $S = \operatorname{id}$ then $\varepsilon_S(v) \coloneqq \{v\}$ ;
+- if $S = e$ then $\varepsilon_{S}(v) \coloneqq \{u \mid \{u, v\} \in E\}$ ;
+- if $S = S_{1} \cup S_{2}$ then $\varepsilon_{S}(v) \coloneqq \varepsilon_{S_{1}}(v) \cup \varepsilon_{S_{2}}(v)$ ;
+- if $S = S_{1} \cap S_{2}$ then $\varepsilon_{S}(v) \coloneqq \varepsilon_{S_{1}}(v) \cap \varepsilon_{S_{2}}(v)$ ;
+- if $S = \neg S'$ then $\varepsilon_S(v) \coloneqq V \setminus \varepsilon_S(v)$ .
+
+The modal logic $\mathcal{EML}\mathcal{C}$ consists of all the unary formulas that are built with the following grammar:
+
+$$
+\varphi := C \mid \varphi \wedge \varphi \mid \neg \varphi \mid \langle S \rangle^ {\geq N} \varphi ,
+$$
+
+where $C$ ranges over node colors, $S$ over modal parameters, and $N$ over $\mathbb{N}$ . The semantics of the first four constructs is defined as expected, and for an undirected colored graph $G = (V,E)$ and node $v\in V$ , we have $(G,v)\models \langle S\rangle^{\geq N}\varphi$ if and only if there exist at least $N$ nodes $u$ in $\varepsilon_{S}(v)$ such that $(G,u)\models \varphi$ .
+
+Example D.2. On an undirected graph $G = (V, E)$ , the $\mathcal{EMLCC}$ formula $\langle \neg e \rangle^{\geq 2}(\langle e \rangle^{\geq 3}\text{Green})$ holds on a node $v \in V$ if $v$ has at least two nonadjacent nodes $u$ (and since our graphs have no self-loops, $v$ could be $u$ ) such that $u$ has at least three green neighbors.
+
+The following theorem is essentially a reformulation of (Lutz et al., 2001, Theorem 1) to our context (Lutz et al. (2001) show this for $\mathrm{FO}_2$ without counting quantifiers and for $\mathcal{EMLC}$ without counting, but an inspection of the proofs reveals that the result extends to counting quantifiers).
+
+Theorem D.3 (Lutz et al., 2001, Theorem 1). For every $\mathcal{EML}\mathcal{C}$ formula, there exists an equivalent $FOC_{2}$ unary formula. Conversely, for every unary $FOC_{2}$ formula, there exists an equivalent $\mathcal{EML}\mathcal{C}$ formula.
+
+In order to simplify the proof, we will use the following lemma.
+
+Lemma D.4. Let $\varphi$ be an $\mathcal{EML}\mathcal{C}$ formula. Then there exists an $\mathcal{EML}\mathcal{C}$ formula $\varphi'$ equivalent to $\varphi$ such that each modal parameter appearing in $\varphi'$ is one of the following:
+
+a) id, thus representing the current node;
+b) $e$ , thus representing the neighbours of the current node;
+c) $\neg e \cap \neg \mathrm{id}$ , thus representing the nodes distinct from the current node and that are not neighbours of the current node;
+$d)$ id $\cup e$ thus representing the current node and its neighbors;
+e) $\neg$ id, thus representing all the nodes distinct from the current node:
+$f)\neg e$ , thus representing the nodes that are not neighbours of the current node (note that this includes the current node);
+
+$g)$ $e\cup \neg e$ thus representing all the nodes;
+$h)$ $e\cap \neg e$ , thus representing the emptyset.
+
+Proof. Let $v$ be a node in a graph $G$ , and consider the following three disjoint sets of nodes:
+
+1. the singleton set consisting of $v$ itself,
+2. the set of neighbors of $v$ ,
+3. the set of nodes that are not neighbors of $v$ and that are not $v$ .
+
+These sets can be expressed by modal parameters: the first is obtained by taking $S = \mathrm{id}$ ; the second is obtained by taking $S = e$ ; and the third is obtained by taking $S = \neg e \cap \neg \mathrm{id}$ . It is straightforward to verify by induction on $S$ that, for any modal parameter $S$ , if $\varepsilon_S(v)$ contains an element of one of the three sets, then it must contain all the elements of that set. But then, this implies that a modal parameter can only represent a (possibly empty) disjoint union of these three sets. Conversely, it is clear that any disjoint union over these three sets can be represented by a modal parameter. It is then routine to check that the 8 cases (a)-(h) are obtained as all the $2^3$ possible unions of these three sets (including the empty union, i.e., the emptyset). For instance, case (f) is the union of sets 1 and 3.
+
+Proof of Theorem 5.1. The proof is similar to that of Proposition 4.1. Let $\varphi$ be an $\mathcal{EML}\mathcal{C}$ formula equivalent to the targeted $\mathrm{FOC}_2$ unary formula that is of the form given by Lemma D.4, and let $\mathrm{sub}(\varphi) = (\varphi_1,\varphi_2,\dots ,\varphi_L)$ be an enumeration of the sub-formulas of $\varphi$ such that if $\varphi_{k}$ is a subformula of $\varphi_{\ell}$ then $k\leq \ell$ . We will build a simple homogeneous ACR-GNN $\mathcal{A}_{\varphi}$ computing feature vectors $\pmb{x}_{v}^{(i)}$ in $\mathbb{R}^L$ such that every component of those vectors represents a different formula in $\mathrm{sub}(\varphi)$ . In addition, we will also make use of global feature vectors $\pmb{x}_{G}^{(i)}$ in $\mathbb{R}^L$ . The GNN $\mathcal{A}_{\varphi}$ will update the feature vector $\pmb{x}_{v}^{(i)}$ of each node $v$ in a graph ensuring that component $\ell$ of $\pmb{x}_{v}^{(i)}$ gets a value 1 if and only if the formula $\varphi_{\ell}$ is satisfied in node $v$ (and 0 otherwise). Similarly, $\pmb{x}_{G}^{(i)}$ will be updated to make sure that every component represents the number of nodes in $G$ that satisfy the corresponding subformula. The readout and aggregate functions simply sum the input feature vectors. When $\varphi_{\ell}$ is of the form described by Cases 0-3 in the proof of Proposition 4.1, we define the $\ell$ -th columns of the matrices $A,C$ and bias $b$ as in that proof, and the $\ell$ -th column of $R$ (the matrix that multiplies the global readout feature vector) as the zero vector. We now explain how we define their $\ell$ -th columns when $\varphi_{\ell}$ is of the form $\langle S\rangle^{\ge N}\varphi_k$ , according to the 8 cases given by Lemma D.4:
+
+Case a. if $\varphi_{\ell} = \langle \mathrm{id}\rangle^{\geq N}\varphi_{k}$ , then $C_{k\ell} = 1$ if $N = 1$ and 0 otherwise;
+
+Case $b$ . if $\varphi_{\ell} = \langle e\rangle^{\geq N}\varphi_{k}$ , then $\pmb{A}_{k\ell} = 1$ and $\pmb{b}_{\ell} = -N + 1$ ;
+
+Case c. if $\varphi_{\ell} = \langle \neg e\cap \neg \mathrm{id}\rangle^{\geq N}\varphi_{k}$ , then $R_{k\ell} = 1$ and $C_{k\ell} = A_{k\ell} = -1$ and $b_{\ell} = -N + 1$ ;
+
+Case d. if $\varphi_{\ell} = \langle \mathrm{id}\cup e\rangle^{\geq N}\varphi_{k}$ , then $C_{k\ell} = 1$ and $A_{k\ell} = 1$ and $b_{\ell} = -N + 1$ ;
+
+Case e. if $\varphi_{\ell} = \langle \neg \mathrm{id}\rangle^{\geq N}\varphi_{k}$ , then $\pmb{R}_{k\ell} = 1$ and $C_{k\ell} = -1$ and $\pmb{b}_{\ell} = -N + 1$ ;
+
+Case f. if $\varphi_{\ell} = \langle \neg e\rangle^{\geq N}\varphi_{k}$ , then $R_{k\ell} = 1$ and $A_{k\ell} = -1$ and $b_{\ell} = -N + 1$
+
+Case g. if $\varphi_{\ell} = \langle e\cup \neg e\rangle^{\geq N}\varphi_{k}$ , then $R_{k\ell} = 1$ and $\pmb {b}_{\ell} = -N + 1$
+
+Case $h$ . if $\varphi_{\ell} = \langle e\cap \neg e\rangle^{\geq N}\varphi_{k}$ , then all relevant values are 0;
+
+and all other values in the $\ell$ -th columns of $A, C, R$ , and $b$ are 0. The proof then goes along the same lines as the proof of Proposition 4.1.
+
+# E PROOF OF THEOREM 5.2
+
+We first recall the theorem.
+
+Theorem 5.2. Each $FOC_{2}$ classifier is captured by an AC-FR-GNN.
+
+In the following proof we will use the machinery introduced in Appendices C and D. We will also make use of a particular AC-GNN with $L$ layers, which we call $\mathcal{A}_{\mathrm{primes}}^L$ , that maps every node $v$ in a graph $G$ to a natural number representing the complete unravelling of $v$ of depth $L$ in $G$ (note that we do not claim that this AC-GNN can be realized in practice, this construction is mostly for theoretical purposes). Let primes: $\mathbb{N} \to \mathbb{N}$ be the function such that $\mathrm{primes}(i)$ is the $i$ -th prime number indexed from 0. For instance, we have that $\mathrm{primes}(0) = 2$ , $\mathrm{primes}(1) = 3$ , etc. Now consider the function $\mathrm{f}(\cdot, \cdot)$ that has as input a pair $(c, X)$ where $c \in \mathbb{N}$ and $X$ is a multiset of numbers in $\mathbb{N}$ , and produces a number in $\mathbb{N}$ as output, defined as follows
+
+$$
+\mathrm {f} (c, \{\{x _ {1}, x _ {2}, \dots , x _ {k} \}) = 2 ^ {c} \times \prod_ {i = 1} ^ {k} \operatorname {p r i m e s} (x _ {i} + 1).
+$$
+
+It is not difficult to prove that, as defined above, $\mathrm{f}(\cdot ,\cdot)$ is an injective function. Thus using the results by Xu et al. (2019) (see the proof of their Theorem 3) we know that $\mathbf{f}$ can be used to implement the combine and aggregate operators of an AC-GNN such that for every graph $G$ , after $L$ layers, the color (natural number) assigned to every node in $G$ has a one-to-one correspondence with the color assigned to that node in the $L$ -th iteration of the WL test over $G$ . We call this AC-GNN $A_{\mathrm{primes}}^{L}$ .
+
+Observation E.1. We note that Xu et al. (2019) also constructed an injective function that has $(c, X)$ as inputs where $c \in \mathbb{N}$ and $X$ is a multiset of elements in $\mathbb{N}$ (see their Lemma 5 and Corollary 6). Nevertheless we cannot directly use that construction as it assumes the existence of a fixed $N$ such that the size of all multisets are bounded by $N$ . This would put also a bound of $N$ on the maximum number of neighbors in the input graphs. Thus we developed a new function (using an encoding based on prime numbers) to be able to deal with general graphs of unbounded degree.
+
+Proof of Theorem 5.2. Let $\alpha$ be an $\mathrm{FOC}_2$ unary formula, and let $\varphi$ be an equivalent $\mathcal{EML}\mathcal{LC}$ formula that uses only modal parameters of the form given by Lemma D.4. We construct an ACR-FR-GNN $\mathcal{A}_{\varphi}$ capturing $\varphi$ and hence $\alpha$ .
+
+Let $L$ be the quantifier depth of $\varphi$ (i.e., the deepest nesting of $\langle S\rangle^{\geq N}$ quantifiers). For a subformula $\varphi'$ of $\varphi$ , we also define the nesting depth $\mathrm{nd}_{\varphi}(\varphi')$ of $\varphi'$ in $\varphi$ to be the number of modal parameters under which $\varphi'$ is in $\varphi$ . The first $L - 1$ layers of $\mathcal{A}_{\varphi}$ are the same as those of $\mathcal{A}_{\mathrm{primes}}^{L - 1}$ , which do not use readouts. With Observation C.3 at hand and using the fact that the inverses of the aggregation and combination functions of $\mathcal{A}_{\mathrm{primes}}^{L - 1}$ are computable, this ensures that, after $L - 1$ layers, for any graph $G$ and node $v$ in $G$ , we can compute from $\mathcal{A}_{\mathrm{primes}}^{L - 1}(G,v)$ the unravelling $\mathrm{Unr}_G^{L - 1}(v)$ . Thus, we can assume without loss of generality (by modifying the last combination function for instance), that after $L - 1$ layers $\mathcal{A}_{\varphi}$ computes $\mathrm{Unr}_G^{L - 1}(v)$ in every node $v$ of $G$ . We then use a readout whose output is a natural number representing the multiset $\{\{\mathrm{Unr}_G^{L - 1}(v)\mid v\text{node in } G\}\}$ ; for instance, we can encode this multiset using the same technique that we use for $\mathcal{A}_{\mathrm{primes}}$ . Again, since this technique uses functions with computable inverses, we can assume without loss of generality that the output of this readout is actually the multiset $\{\{\mathrm{Unr}_G^{L - 1}(v)\mid v\text{node in } G\}\}$ . Finally, we use a final combination function $\mathrm{COM}^{(L)}$ , that uses only the feature of the current node and the output of the readout—that is, the final feature of a node $v$ is $\mathrm{COM}^{(L)}(\mathrm{Unr}_G^{L - 1}(v),\{\{\mathrm{Unr}_G^{L - 1}(u)\mid u\text{node in } G\})$ .
+
+We now explain how we define $\mathrm{COM}^{(L)}$ . By induction on the structure of $\varphi$ , for every subformula $\varphi'$ of $\varphi$ , we do the following: for every node $v$ in $G$ and every node $u$ in $\mathrm{Unr}_G^{L-1}(v)$ that is at depth (i.e., the distance from $v$ ) at most $\mathrm{nd}_{\varphi}(\varphi')$ in the tree $\mathrm{Unr}_G^{L-1}(v)$ , we will label $u$ by either $\varphi'$ or by $\neg \varphi'$ . We do so to ensure that $(\star)$ for every node $v$ in $G$ and every node $u = (v, u_1, \ldots, u_i)$ in $\mathrm{Unr}_G^{L-1}(v)$ , we label $u$ by $\varphi'$ if and only if $(G, u_i) \models \varphi'$ . We explain our labeling process by induction on the structure of $\varphi$ , and one can easily check in each case that $(\star)$ will hold by induction. Let $v$ be a node in $G$ and $u$ be a node in $\mathrm{Unr}_G^{L-1}(v)$ that is at depth at most $\mathrm{nd}_{\varphi}(\varphi')$ in the unravelling.
+
+Case 1. If $\varphi'$ is a color Col, we label $u$ by $\varphi'$ if $u$ is of that color, and by $\neg \varphi'$ otherwise.
+
+Case 2. If $\varphi'$ is $\varphi_1 \wedge \varphi_2$ , then observe that we have $\mathrm{nd}_{\varphi}(\varphi') = \mathrm{nd}_{\varphi}(\varphi_1) = \mathrm{nd}_{\varphi}(\varphi_2)$ , so that $u$ is at depth at most both $\mathrm{nd}_{\varphi}(\varphi_1)$ and $\mathrm{nd}_{\varphi}(\varphi_2)$ in the unravelling $\mathrm{Unr}^{L-1}(v)$ . Thus, we know that we have already labeled $u$ by either $\varphi_1$ or $\neg \varphi_1$ , and also by either $\varphi_2$ or $\neg \varphi_2$ . We then label $u$ by $\varphi'$ if $u$ is already labeled by $\varphi_1$ and $\varphi_2$ , and we label it by $\neg \varphi'$ otherwise.
+
+Case 3. The case when $\varphi^{\prime}$ is a negation is similar.
+
+Case 4. If $\varphi'$ is $\langle S\rangle^{\geq N}\varphi''$ , then we only explain the case when the modal parameter $S$ is $\neg e \land \neg \mathrm{id}$ , as the other cases work similarly. First, observe that for every node $v'$ in $G$ , we have labeled the root of $\mathrm{Unr}_G^{L-1}(v')$ by either $\varphi''$ or by $\neg \varphi''$ : this is because the root of $\mathrm{Unr}_G^{L-1}(v')$ is always at depth $0 \leq \mathrm{nd}_{\varphi}(\varphi'')$ in $\mathrm{Unr}_G^{L-1}(v')$ . Let $m$ be the number of nodes $u' \in G$ such that we have labeled the root of $\mathrm{Unr}_G^{L-1}(v')$ by $\varphi''$ . Next, note that for every children $u'$ of $u$ in $\mathrm{Unr}_G^{L-1}(v)$ , we have that $u'$ is at depth at most $\mathrm{nd}_{\varphi}(\varphi'')$ in $\mathrm{Unr}_G^{L-1}(v)$ , so that we have already labeled $u'$ by either $\varphi''$ or $\neg \varphi''$ . Let $n$ be the number of children of $u$ (in $\mathrm{Unr}_G^{L-1}(v)$ ) that we have labeled by $\varphi''$ . Then we label $u$ by $\varphi'$ if $m - n \geq N$ , and by $\neg \varphi'$ otherwise.
+
+We then simply define $\mathrm{COM}^{(L)}(\mathrm{Unr}_G^{L - 1}(v),\{\{\mathrm{Unr}_G^{L - 1}(u)\mid u\text{node in} G\}\})$ to be 1 if the root of $\mathrm{Unr}_G^{L - 1}(v)$ is labeled with $\varphi$ , and 0 otherwise, which concludes the proof.
+
+# F DETAILS ON THE EXPERIMENTAL SETTING AND RESULTS
+
+All our code and data can be accessed online at https://github.com/juanpablos/GNN-logic
+
+In all our experiments we tested different aggregate, combine and readout functions. For aggregate and readout we only consider the sum, average, and max functions. For the combine function we consider the following variants:
+
+- $\mathrm{COM}_1(\pmb{x},\pmb{y},\pmb{z}) = f(\pmb{x}\pmb{A} + \pmb{y}\pmb{B} + z\pmb{C} + \pmb{b})$
+$\mathrm{COM}_2(\pmb {x},\pmb {y},\pmb {z}) = f(\mathrm{MLP}_1(\pmb {x}) + \mathrm{MLP}_2(\pmb {y}) + \mathrm{MLP}_3(\pmb {z}) + \pmb {b}),$
+- $\mathrm{COM}_3(x,y,z) = \mathrm{MLP}(x + y + z + b)$ ,
+- $\operatorname{COM}_4(x, y, z) = \operatorname{MLP}(xA + yB + zC + b)$ .
+
+The above definitions are for ACR-GNNs. For AC-GNNs we consider similar variants but without the $z$ input. We also used batch normalization in between every GNN and MLP layer. We did not use any regularization. When processing synthetic data we use a hidden size of 64 and trained with a batch-size of 128, and the Adam optimizer with PyTorch default parameters for 50 epochs. We did not do any hyperparameter search besides changing the aggregation, combination, and readout functions. For the activation functions we always used relu. We observed a consistent pattern in which sum aggregator and readout produced better results compared with the others. This is in line with our constructions in Proposition 4.1 and Theorem 5.1. The choice of the combination function did not produce a significant difference in the performance.
+
+DATA FOR THE EXPERIMENT WITH CLASSIFIER $\alpha (x)\coloneqq \operatorname {RED}(x)\wedge \exists y\operatorname {BLUE}(y)$
+
+For training and testing we constructed three sets of graphs: (a) Train set containing 5k graphs with nodes between 50 and 100, (b) Test set, same size, containing 500 graphs with the same number of nodes as in the train set (between 50 and 100 nodes), and (c) Test set, bigger size, containing 500 graphs with nodes between 100 and 200. All graphs contain up to 5 different colors. To force the models to try to learn the formula, in every set (train and test) we consider $50\%$ of graphs not containing any blue node, and $50\%$ containing at least one blue node. The number of blue nodes in every graph is fixed to a small number (typically less than 5 nodes). Moreover, to ensure that there is a significant number of nodes satisfying the formula, we force graphs to contain at least $1/4$ of its nodes colored with red. The colors of all the other nodes are distributed randomly. With all these restrictions, every dataset that we created had at least a $18\%$ of nodes satisfying the property. We consider two classes of graphs: line graphs and Erdős-Renyi graphs.
+
+Line graphs these are connected graphs in which every node in the graph has degree 2 except for two nodes (the extreme nodes) that have degree 1. To mimic the impossibility proof in Proposition 3.3 we put the blue nodes in one of the "sides" of the line, and the red nodes in the other "side". More specifically, consider the line graph with $N$ nodes $v_{1},\ldots ,v_{N}$ such that $v_{i}$ is connected with $v_{i + 1}$ . Then, we ensure that every blue node appears in one of $v_{1},\ldots ,v_{\frac{N}{2}}$ and every red node appears in one of $v_{\frac{N}{2} +1},\ldots ,v_N$ .
+
+ | # Graphs | Avg. # Nodes | Avg. # Edges | Avg. # Positive |
| Line train | 5,000 | 75 | 74 | 18 |
| Line test | 500 | 75 | 74 | 18 |
| Line test bigger | 500 | 148 | 147 | 36 |
| Erdős-Renyi train | 5,000 | 75 | 115 | 18 |
| Erdős-Renyi test | 500 | 75 | 115 | 18 |
| Erdős-Renyi test bigger | 500 | 148 | 226 | 36 |
+
+Table 3: Synthetic data for the experiment with classifier $\alpha \left( x\right) \mathrel{\text{:=}} \operatorname{Red}\left( x\right) \land \exists y\operatorname{Blue}\left( y\right)$
+
+ | Erdős-Renyi + 20% | Erdős-Renyi + 50% | Erdős-Renyi + 100% |
| Train Acc. | Test Acc. | Train Acc. | Test Acc. | Train Acc. | Test Acc. |
| same-size | bigger | | same-size | bigger | | same-size | bigger |
| AC-2 | 0.810 | 0.807 | 0.778 | 0.829 | 0.835 | 0.791 | 0.861 | 0.864 | 0.817 |
| AC-5 | 0.940 | 0.937 | 0.901 | 0.975 | 0.971 | 0.958 | 0.994 | 0.994 | 0.993 |
| AC-7 | 0.963 | 0.961 | 0.946 | 0.983 | 0.978 | 0.981 | 0.995 | 0.995 | 0.995 |
| GIN-2 | 0.797 | 0.795 | 0.771 | 0.813 | 0.818 | 0.784 | 0.838 | 0.840 | 0.803 |
| GIN-5 | 0.838 | 0.836 | 0.819 | 0.846 | 0.847 | 0.833 | 0.841 | 0.844 | 0.838 |
| GIN-7 | 0.838 | 0.840 | 0.803 | 0.841 | 0.844 | 0.838 | 0.784 | 0.788 | 0.773 |
| ACR-1 | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 |
+
+Table 4: Detailed results for Erdős-Renyi synthetic graphs with different connectivities
+
+Erdős-Renyi graphs These are random graphs in which one specifies the number $N$ of nodes and the number $M$ of edges. For this experiment we consider as extreme cases the case in which graphs contain the same number of nodes and edges and graphs in which the number of edges is twice the number of nodes.
+
+Some statistics of the datasets are shown in Table 3.
+
+# EXPERIMENTS FOR DENSE ERDOS-RENYI GRAPHS
+
+We also took a closer look at the performance for different connectivities of random graphs (Table 4). We define the set "Erdős-Renyi + $k\%$ " as a set of graphs in which the number of edges is $k\%$ larger than the number of nodes. For example, "Erdős-Renyi + $100\%$ " contains random graphs in which the number of edges doubles the number of nodes. We see a consistent improvement in the performance of AC-GNNs and GINs when we train and test them with more dense graphs and more layers (Table 4).
+
+# DATA FOR THE EXPERIMENT WITH CLASSIFIER $\alpha_{i}(x)$ IN EQUATION (6)
+
+For this case we only consider dense Erdős-Renyi synthetic graphs. For the train set we consider graphs with nodes varying from 40 to 50 nodes and edges from 280 to 350 and similarly for the first test set. For the bigger test set, we consider graphs with nodes from 51 to 60 with edges ranging from 360 and 480. For labeling we consider the following formulas (starting from $\alpha_0(x) \coloneqq \operatorname{Blue}(x)$ ):
+
+$$
+\alpha_ {1} (x) := \exists^ {[ 8, 1 0 ]} y \big (\alpha_ {0} (y) \wedge \neg E (x, y) \big),
+$$
+
+$$
+\alpha_ {2} (x) := \exists^ {[ 1 0, 2 0 ]} y \big (\alpha_ {1} (y) \wedge \neg E (x, y) \big),
+$$
+
+$$
+\alpha_ {3} (x) := \exists^ {[ 1 0, 3 0 ]} y \big (\alpha_ {2} (y) \wedge \neg E (x, y) \big).
+$$
+
+The choices of the intervals for every classifier were for the purpose of having approximately half of the nodes in the random graphs marked as true. Statistics of the datasets are shown in Table 5.
+
+ | # Graphs | Avg. # Nodes | Avg. # Edges | Pos. α1 | Pos. α2 | Pos. α3 |
| Train | 5,000 | 45 | 315 | 47% | 63% | 57% |
| Test | 500 | 45 | 315 | 47% | 64% | 56% |
| Test bigger | 500 | 56 | 420 | 49% | 40% | 23% |
+
+Table 5: Synthetic data for the experiment with classifier ${\alpha }_{i}\left( x\right)$ in Equation (6)
+
+ | F1 Test |
| AC-2 | 97.2 ± 0.3 |
| AC-3 | 97.5 ± 0.3 |
| AC-4 | 97.5 ± 0.2 |
| ACR-2 | 93.5 ± 0.3 |
| ACR-3 | 94.2 ± 1.2 |
| ACR-4 | 95.4 ± 0.9 |
+
+Table 6: Performance of AC-GNN and ACR-GNN in the PPI benchmark
+
+# PPI EXPERIMENTS
+
+We consider the standard train/Validation/test split for this benchmark (Fey & Lenssen, 2019). We use a hidden size of 256 and the Adam optimizer for 500 epochs with early stopping when the validation set did not improve for 20 epochs. We did not do any hyperparameter search besides changing the aggregation, combination, and readout functions. As opposed to the synthetic case, in this case we observed a better performance when the average or the max functions are used for aggregation. Table 6 shows the best results for different layers (average of 10 runs). As we can see, ACR-GNNs do not imply an improvement over AC-GNNs for this benchmark.
\ No newline at end of file
diff --git a/thelogicalexpressivenessofgraphneuralnetworks/images.zip b/thelogicalexpressivenessofgraphneuralnetworks/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..c455f9df40dbf27f4da74c0ab31d4c51ac1d0667
--- /dev/null
+++ b/thelogicalexpressivenessofgraphneuralnetworks/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:44ed1bc0034a783b9241a5d8d1333434ead2c58ce2b99ff50cf435c145c502fc
+size 373233
diff --git a/thelogicalexpressivenessofgraphneuralnetworks/layout.json b/thelogicalexpressivenessofgraphneuralnetworks/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..0a798f84cf4fefabf118fd66a94d5259f1e6573c
--- /dev/null
+++ b/thelogicalexpressivenessofgraphneuralnetworks/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:70c53136262f2e2a284fd9296a785a9b4f11bf46c3e4347c71e46fd61453c430
+size 1276740
diff --git a/towardshierarchicalimportanceattributionexplainingcompositionalsemanticsforneuralsequencemodels/e2b901c3-5465-480a-9f1a-0db7550c3719_content_list.json b/towardshierarchicalimportanceattributionexplainingcompositionalsemanticsforneuralsequencemodels/e2b901c3-5465-480a-9f1a-0db7550c3719_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..7d1e3262b88fcc94b8b642cad15ed9d2e594ef41
--- /dev/null
+++ b/towardshierarchicalimportanceattributionexplainingcompositionalsemanticsforneuralsequencemodels/e2b901c3-5465-480a-9f1a-0db7550c3719_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f076ec6d0f4a26f243ee2dd3d0a6209fbe9c20ba6416913be41dddd3fd373052
+size 89119
diff --git a/towardshierarchicalimportanceattributionexplainingcompositionalsemanticsforneuralsequencemodels/e2b901c3-5465-480a-9f1a-0db7550c3719_model.json b/towardshierarchicalimportanceattributionexplainingcompositionalsemanticsforneuralsequencemodels/e2b901c3-5465-480a-9f1a-0db7550c3719_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..30844baf29f5a9101cf65247e98682309631d0d4
--- /dev/null
+++ b/towardshierarchicalimportanceattributionexplainingcompositionalsemanticsforneuralsequencemodels/e2b901c3-5465-480a-9f1a-0db7550c3719_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0ffedc83bfcc107a76df5813ab4c71e036437356b4d8902d2c0ddd1ed01cccdd
+size 108050
diff --git a/towardshierarchicalimportanceattributionexplainingcompositionalsemanticsforneuralsequencemodels/e2b901c3-5465-480a-9f1a-0db7550c3719_origin.pdf b/towardshierarchicalimportanceattributionexplainingcompositionalsemanticsforneuralsequencemodels/e2b901c3-5465-480a-9f1a-0db7550c3719_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..6fd679326133e844f309c83a94a74a0c4968a120
--- /dev/null
+++ b/towardshierarchicalimportanceattributionexplainingcompositionalsemanticsforneuralsequencemodels/e2b901c3-5465-480a-9f1a-0db7550c3719_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:693408431dbbffcac2f0115ee8fe2d5d362c8ece1c31f36e66061f3b3e1a619e
+size 1846554
diff --git a/towardshierarchicalimportanceattributionexplainingcompositionalsemanticsforneuralsequencemodels/full.md b/towardshierarchicalimportanceattributionexplainingcompositionalsemanticsforneuralsequencemodels/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..7828af934151ccbfb975e6e03c3c8ab07c8055af
--- /dev/null
+++ b/towardshierarchicalimportanceattributionexplainingcompositionalsemanticsforneuralsequencemodels/full.md
@@ -0,0 +1,334 @@
+# TOWARDS HIERARCHICAL IMPORTANCE Attribution: EXPLAINING COMPOSITIONAL SEMANTICS FOR NEURAL SEQUENCE MODELS
+
+Xisen Jin $^{\S}$ , Zhongyu Wei $^{\dagger}$ , Junyi Du $^{\S}$ , Xiangyang Xue $^{\dagger}$ , Xiang Ren $^{\S}$
+
+$\S$ University of Southern California
+†Fudan University
+{xisenjin, junyidu, xiangren}@usc.edu
+{zywei, xyxue}@fudan.edu.cn
+
+# ABSTRACT
+
+The impressive performance of neural networks on natural language processing tasks attributes to their ability to model complicated word and phrase compositions. To explain how the model handles semantic compositions, we study hierarchical explanation of neural network predictions. We identify non-additivity and context independent importance attributions within hierarchies as two desirable properties for highlighting word and phrase compositions. We show some prior efforts on hierarchical explanations, e.g. contextual decomposition, do not satisfy the desired properties mathematically, leading to inconsistent explanation quality in different models. In this paper, we start by proposing a formal and general way to quantify the importance of each word and phrase. Following the formulation, we propose Sampling and Contextual Decomposition (SCD) algorithm and Sampling and Occlusion (SOC) algorithm. Human and metrics evaluation on both LSTM models and BERT Transformer models on multiple datasets show that our algorithms outperform prior hierarchical explanation algorithms. Our algorithms help to visualize semantic composition captured by models, extract classification rules and improve human trust of models1.
+
+# 1 INTRODUCTION
+
+Recent advances in deep neural networks have led to impressive results on a range of natural language processing (NLP) tasks, by learning latent, compositional vector representations of text data (Peters et al., 2018; Devlin et al., 2018; Liu et al., 2019b). However, interpretability of the predictions given by these complex, "black box" models has always been a limiting factor for use cases that require explanations of the features involved in modeling (e.g., words and phrases) (Guidotti et al., 2018; Ribeiro et al., 2016). Prior efforts on enhancing model interpretability have focused on either constructing models with intrinsically interpretable structures (Bahdanau et al., 2015; Liu et al., 2019a), or developing post-hoc explanation algorithms which can explain model predictions without elucidating the mechanisms by which model works (Mohseni et al., 2018; Guidotti et al., 2018). Among these work, post-hoc explanation has come to the fore as they can operate over a variety of trained models while not affecting predictive performance of models. Towards post-hoc explanation, a major line of work, additive feature attribution methods (Lundberg & Lee, 2017; Ribeiro et al., 2016; Binder et al., 2016; Shrikumar et al., 2017), explain a model prediction by assigning importance scores to individual input variables. However, these methods are not ideal for explaining phrase-level importance, as phrase importance is often a non-linear combination of the importance of the words in the phrase. Contextual decomposition (CD) (Murdoch et al., 2018) and its hierarchical extension (Singh et al., 2019) go beyond the additive assumption and compute the contribution solely made by a word/phrase to the model prediction (i.e., individual contribution), by decomposing the output variables of the neural network at each layer. Using the individual contribu
+
+
+(a) Input occlusion
+
+
+(b) Additive attribution
+
+
+(c) Hierarchical
+
+
+Figure 1: Different score attribution algorithms. (a) Input occlusion assigns a negative score for the word "interesting", as the sentiment of the phrase becomes less negative after removing "interesting" from the original sentence. (b) Additive attributions assign importance scores for words "not" and "interesting" by linearly distributing contribution score of "not interesting", exemplified with Shapley Values (Shapley, 1953). Intuitively, only (c) Hierarchical explanations highlight the negative compositional effect between the words "not" and "interesting".
+
+tion scores so derived, these algorithms generate hierarchical explanation on how the model captures compositional semantics (e.g., stress or negation) in making predictions (see Figure 1 for example).
+
+However, despite contextual decomposition methods have achieved good results in practice, what reveals extra importance that emerge from combining two phrases has not been well studied. As a result, prior lines of work on contextual decomposition have focused on exploring model-specific decompositions based on their performance on visualizations. We identify the extra importance from combining two phrases can be quantified by studying how the importance of the combined phrase differs from the sum of the importance of the two component phrases on its own. Similar strategies have been studied in game theory for quantifying the surplus from combining two groups of players (Fujimoto et al., 2006). Following the definition above, the key challenge is to formulate the importance of a phrase on it own, i.e., context independent importance of a phrase. However, we show contextual decomposition do not satisfy this context independence property mathematically.
+
+To this end, we propose a formal way to quantify the importance of each individual word/phrase, and develop effective algorithms for generating hierarchical explanations based on the new formulation. To mathematically formalize and efficiently approximate context independent importance, we formulate $N$ -context independent importance of a phrase, defined as the difference of model output after masking out the phrase, marginalized over all possible $N$ words surrounding the phrase in the sentence. We propose two explanation algorithms according to our formulation, namely the Sampling and Contextual Decomposition algorithm (SCD), which overcomes the weakness of contextual decomposition algorithms, and the Sampling and OCclusion algorithm (SOC), which is simple, model-agnostic, and performs competitively against prior lines of algorithms. We experiment with both LSTM and fine-tuned Transformer models to evaluate the proposed methods. Quantitative studies involving automatic metrics and human evaluation on sentiment analysis and relation extraction tasks show that our algorithms consistently outperform competitors in the quality of explanations. Our algorithms manage to provide hierarchical visualization of compositional semantics captured by models, extract classification rules from models, and help users to trust neural networks predictions.
+
+In summary, our work makes the following contributions: (1) we identify the key challenges in generating post-hoc hierarchical explanations and propose a mathematically sound way to quantify context independent importance of words and phrases for generating hierarchical explanations; (2) we extend previous post-hoc explanation algorithm based on the new formulation of $N$ -context independent importance and develop two effective hierarchical explanation algorithms; and (3) experiments demonstrate that the proposed explanation algorithms consistently outperform the compared methods (with both LSTM and Transformer as base models) over several datasets and models.
+
+# 2 PRELIMINARIES
+
+# 2.1 POST-HOC EXPLANATIONS OF NEURAL SEQUENCE MODELS
+
+We consider a sequence of low-dimensional word embeddings $\mathbf{x}_{1:T} \coloneqq (\mathbf{x}_1, \mathbf{x}_2, \dots, \mathbf{x}_T)$ , or denoted as $\mathbf{x}$ for brevity, as the input to a neural sequence model, such as standard RNNs, LSTM (Hochreiter
+
+& Schmidhuber, 1997) and Transformers (Vaswani et al., 2017). These neural models extract hidden representations $\mathbf{h}_{1:T}$ from the input sequence $\mathbf{x}$ , and feed these hidden representations to a prediction layer to generate prediction scores in the label space (e.g., sentiment polarity of a sentence). For LSTM, we use the last hidden state $\mathbf{h}_T$ to give unnormalized prediction scores $s(\mathbf{x})\in \mathbb{R}^{d_c}$ over $d_{c}$ label classes as follows.
+
+$$
+s (\mathbf {x}) = \boldsymbol {W} _ {l} \mathbf {h} _ {T}, \tag {1}
+$$
+
+where $\mathbf{W}_l\in \mathbb{R}^{d_c\times d_h}$ is a trainable weight matrix. For Transformers, the representation corresponding to the [CLS] token at the final layer is fed to the prediction layer to generate scores $s(\mathbf{x})$
+
+Towards post-hoc explanation of $s(\mathbf{x})$ , a notable line of work, additive feature attribution methods (Ribeiro et al., 2016; Shrikumar et al., 2017; Sundararajan et al., 2017; Lundberg & Lee, 2017), measure word-level importance to the model prediction $s(\mathbf{x})$ by attributing an importance score $\phi(\mathbf{x}_i, \mathbf{x})$ to each word in the input sequence $\mathbf{x}_i \in \mathbf{x}$ . However, the additive assumption hinders these methods from explaining the complex interactions between words and compositional semantics in a sentence (e.g., modeling negation, transition, and emphasis in sentiment classification), as shown in Figure 1.
+
+# 2.2 HIERARCHICAL EXPLANATIONS VIA CONTEXTUAL DECOMPOSITION
+
+To capture non-linear compositional semantics, the line of work on contextual decomposition (CD) (Murdoch et al., 2018) designs non-additive measures of importance from individual words/phrases to the model predictions, and further extend to agglomerative contextual decomposition (ACD) algorithm (Singh et al., 2019) for generating hierarchical explanations.
+
+Given a phrase $\mathbf{p} = \mathbf{x}_{i:j}$ in the input sequence $\mathbf{x}$ , contextual decomposition (CD) attributes a score $\phi (\mathbf{p},\mathbf{x})$ as the contribution solely from $\mathbf{p}$ to the model's prediction $s(\mathbf{x})$ . Note that $\phi (\mathbf{p},\mathbf{x})$ does not equal to the sum of the scores of each word in the phrase, i.e., $\phi (\mathbf{p},\mathbf{x})\neq \sum_{\mathbf{x}_i\in \mathbf{p}}\phi (\mathbf{x}_i,\mathbf{x})$ . Starting from the input layer, CD iteratively decomposes each hidden state $\mathbf{h}$ of the model into the contribution solely made by $\mathbf{p}$ , denoted as $\beta$ , and the contributions involving the words outside the phrase $\mathbf{p}$ , denoted as $\gamma$ , with the relation $\mathbf{h} = \beta +\gamma$ holds. The algorithm also keeps the contribution from the bias term, denoted as $\zeta$ , temporally before element-wise multiplication.
+
+For a linear layer $\mathbf{h} = W_{i}\mathbf{x}_{t} + b_{i}$ with input $\mathbf{x}_t$ , when $\mathbf{x}_t$ lies in the given phrase $\mathbf{p}$ , the contribution solely from $\mathbf{x}_t$ to $\mathbf{h}$ is defined as $\beta = W_{i}\mathbf{x}_{t}$ when $\mathbf{x}_t$ is part of the phrase (i.e., $\mathbf{x}_t \in \mathbf{p}$ ), and the contribution involving other words in the sentences (denoted as $\mathbf{x} \backslash \mathbf{p}$ ) is defined as $\gamma = 0$ . The contribution of the bias term $\zeta$ is thus $\mathbf{b}_i$ . When $\mathbf{x}_t$ lies outside of the phrase, $\gamma$ is quantified as $W_{i}\mathbf{x}_{t}$ and $\beta$ is 0. In the cases when CD encounters element-wise multiplication operations $\mathbf{h} = \mathbf{h}_a \odot \mathbf{h}_b$ (e.g., in LSTMs), it eliminates the multiplicative interaction terms which involve the information outside of the phrase $\mathbf{p}$ . Specifically, suppose that $\mathbf{h}_a$ and $\mathbf{h}_b$ have been decomposed as $\mathbf{h}_a = \beta^a + \gamma^a + \zeta^a$ and $\mathbf{h}_b = \beta^b + \gamma^b + \zeta^b$ , CD computes the $\beta$ term for $\mathbf{h}_a \odot \mathbf{h}_b$ as $\beta = \beta^a \odot \beta^b + \beta^a \odot \zeta^b + \zeta^a \odot \beta^b$ .
+
+When dealing with non-linear activation $\mathbf{h}' = \sigma(\mathbf{h})$ , CD computes the contribution solely from the phrase $\mathbf{p}$ as the average activation differences caused $\beta$ supposing $\gamma$ is present or absent,
+
+$$
+\boldsymbol {\beta} ^ {\prime} = \frac {1}{2} [ \sigma (\boldsymbol {\beta} + \boldsymbol {\gamma} + \boldsymbol {\zeta}) - \sigma (\boldsymbol {\gamma} + \boldsymbol {\zeta}) ] + \frac {1}{2} [ \sigma (\boldsymbol {\beta} + \boldsymbol {\zeta}) - \sigma (\boldsymbol {\zeta}) ]. \tag {2}
+$$
+
+Following the strategies introduced above, CD decomposes all the intermediate outputs starting from the input layer, until reaching the final output of the model $\mathbf{h}_T = \boldsymbol{\beta} + \boldsymbol{\gamma}$ . The logit score $\mathbf{W}_l\beta$ is treated as the contribution of the given phrase $\mathbf{p}$ to the final prediction $s(\mathbf{x})$ .
+
+As a follow-up study, Singh et al. (2019) extends CD algorithm to other families of neural network architectures, and proposes agglomerative contextual decomposition algorithm (ACD). The decomposition of activation functions is modified as $\beta' = \sigma(\beta)$ . For a linear layer $\mathbf{h}' = \mathbf{W}\mathbf{h} + \mathbf{b}$ with its decomposition $\mathbf{h} = \boldsymbol{\beta} + \boldsymbol{\gamma}$ , the bias term $\mathbf{b}$ is decomposed proportionally and merged into the $\beta'$ term of $\mathbf{h}'$ , based on $\beta' = \mathbf{W}\boldsymbol{\beta} + |\mathbf{W}\boldsymbol{\beta}| / (|\mathbf{W}\boldsymbol{\beta}| + |\mathbf{W}\boldsymbol{\gamma}|) \cdot \mathbf{b}$ .
+
+
+(a) CD
+
+
+(b) SCD (ours)
+
+
+Figure 2: (Left) Illustration of the CD and SCD at calculating the decomposition for $\mathbf{h} = \sigma (\boldsymbol {\beta} + \boldsymbol {\gamma})$ , following Eq. 2. Red lines indicate computation that make CD explanations dependent on the words outside the give phrase. (Right) Illustration of the sampling step $\hat{\mathbf{x}}_{\delta}\sim p(\hat{\mathbf{x}}_{\delta}|\mathbf{x}_{-\delta})$ for calculating the importance of the word very in SOC and SCD, with size of context $N = 1$ . The padding operation is for SOC.
+
+# 3 METHODOLOGY
+
+In this section, we start by identifying desired properties of phrase-level importance score attribution for hierarchical explanations. We propose a measure of context-independent importance of a phrase and introduce two explanation algorithms instantiated from the proposed formulation.
+
+# 3.1 PROPERTIES OF IMPORTANCE Attribution FOR HIERARCHICAL EXPLANATION
+
+Despite the empirical success of CD and ACD, no prior works analyze what common properties a score attribution mechanism should satisfy to generate hierarchical explanations that reveal compositional semantics formed between phrases. Here we identify two properties that an attribution method should satisfy to generate informative hierarchical explanations.
+
+Non-additivity. Importance of a phrase $\phi(\mathbf{p},\mathbf{x})$ should not be a sum over the importance scores of all the component words $\mathbf{x}_i \in \mathbf{p}$ , i.e., $\phi(\mathbf{p},\mathbf{x}) \neq \sum_{\mathbf{x}_i \in \mathbf{p}} \phi(\mathbf{x}_i, \mathbf{x})$ , in contrast to the family of additive feature attribution methods. The property is also suggested by Murdoch et al. (2018).
+
+Context Independence. For deep neural networks, when two phrases combine, their importance to predicting a class may greatly change. The surplus by combining two phrases can be quantified by the difference between the importance of the combined phrase and the sum of the importance of two phrases on its own. It follows the definition of marginal interactions (Fujimoto et al., 2006) in game theory. According to the definition, the importance of two component phrases should be at least evaluated independently to each other. Formally, if we are only interested in how combining two phrases $\mathbf{p}_1$ and $\mathbf{p}_2$ contribute to a specific prediction for an input $\mathbf{x}$ , we expect for input sentences $\tilde{\mathbf{x}}$ where only $\mathbf{p}_2$ is replaced to another phrase, the importance attribution for $\mathbf{p}_1$ remains the same, i.e., $\phi (\mathbf{p}_1,\mathbf{x}) = \phi (\mathbf{p}_1,\tilde{\mathbf{x}})$ . In our bottom-up hierarchical explanation setting, we are interested in how combining a phrase and any other contextual words or phrases in the input $\mathbf{x}$ contribute. Therefore, we expect $\phi (\mathbf{p},\mathbf{x}) = \phi (\mathbf{p},\tilde{\mathbf{x}})$ given the phrase $\mathbf{p}$ in two different contexts $\mathbf{x}$ and $\tilde{\mathbf{x}}$ .
+
+Limitations of CD and ACD. Unfortunately, while CD and ACD try to construct decomposition so that $\beta$ terms represent the contributions solely from a given a phrase, the assigned importance scores by these algorithms do not satisfy the context independence property mathematically. For CD, we see the computation of $\beta$ involves the $\gamma$ term of a specific input sentence in Eq. 2 (see Figure 2(a) for visualization). Similarly, for ACD, the decomposition of the bias term involves the $\gamma$ terms of a specific input sentence. As a result, the $\beta$ terms computed by both algorithms depend on the context of the phrase $\mathbf{p}$ .
+
+Given the limitation of prior works, we start by formulating a importance measure of phrases that satisfies both non-additivity and context independence property.
+
+# 3.2 CONTEXT-INDEPENDENT IMPORTANCE
+
+Given a phrase $\mathbf{p} := \mathbf{x}_{i:j}$ appearing in a specific input $\mathbf{x}_{1:T}$ , we first relax our setting and define the importance of a phrase independent of contexts of length $N$ adjacent to it. The $N$ -context independent importance is defined as the output difference after masking out the phrase $\mathbf{p}$ , marginalized over all the possible contexts of length $N$ , denoted as $\hat{\mathbf{x}}_{\delta}$ , around $\mathbf{p}$ in the input $\mathbf{x}$ . For an intuitive example, to evaluate the context independent importance up to one word of very in the sentence The film is very interesting in a sentiment analysis model, we sample some possible adjacent words before and after the word very, and average the prediction difference after some practice of masking the word very. Figure 2 illustrates an example for the sampling and masking steps. The $N$ -context independent importance is formally written as,
+
+$$
+\phi (\mathbf {p}, \hat {\mathbf {x}}) = \mathbb {E} _ {\mathbf {x} _ {\delta}} [ s (\mathbf {x} _ {- \delta}; \hat {\mathbf {x}} _ {\delta}) - s (\mathbf {x} _ {- \delta} \backslash \mathbf {p}; \hat {\mathbf {x}} _ {\delta}) ], \tag {3}
+$$
+
+where $\mathbf{x}_{-\delta}$ denotes the resulting sequence after masking out a context of length $N$ surrounding the phrase $\mathbf{p}$ from the input $\mathbf{x}$ . Here, $\hat{\mathbf{x}}_{\delta}$ is a sequence of length $N$ sampled from a distribution $p(\hat{\mathbf{x}}_{\delta}|\mathbf{x}_{-\delta})$ , which is conditioned on the phrase $\mathbf{p}$ as well as other words in the sentence $\mathbf{x}$ . Accordingly, we use $s(\mathbf{x}_{-\delta};\hat{\mathbf{x}}_{\delta})$ to denote the model prediction score after replacing the masked-out context $\mathbf{x}_{-\delta}$ with a sampled context $\hat{\mathbf{x}}_{\delta}$ . We use $\mathbf{x} \backslash \mathbf{p}$ to denote the operation of masking out the phrase $\mathbf{p}$ from the input sentence $\mathbf{x}$ . The specific implementation of this masking out operation varies across different explanation algorithms.
+
+Following the notion of $N$ -context independent importance, we define context-independent importance of a phrase $\mathbf{p}$ by increasing the size of the context $N$ to sufficiently large (e.g., length of the sentence). The context independent importance can be equivalently written as follows.
+
+$$
+\phi^ {g} (\mathbf {p}) = \mathbb {E} _ {\mathbf {x}} [ s (\mathbf {x}) - s (\mathbf {x} \backslash \mathbf {p}) | \mathbf {p} \subseteq \mathbf {x} ]. \tag {4}
+$$
+
+While it is possible to compute the expectations in Eqs. 3 and 4 by sampling from the training set, it is common that a phrase occurs sparsely in the corpus. Therefore, we approximate the $N$ -context independent importance by sampling from a language model pretrained on the training corpus. The language model helps model a smoothed distribution of $p(\hat{\mathbf{x}}_{\delta}|\mathbf{x}_{-\delta})$ . In practice, all our explanation algorithms make use of $N$ -context independent importance following Eq. 3, where the size of the neighborhood $N$ is a parameter to be specified to approximate the context independent importance.
+
+# 3.3 SAMPLING AND CONTEXTUAL DECOMPOSITION ALGORITHM
+
+In CD, the desirable context independence property is compromised when computing decomposition of activation functions, as discussed in Section 3.1. Following the new formulation of context-independent importance introduced in Section 3.2, we present a simple modification of the contextual decomposition algorithm, and develop a new sampling and contextual decomposition (SCD) algorithm for effective generation of hierarchical explanations.
+
+SCD is a layer-wise application of our formulation. The algorithm only modifies the way to decompose activation functions in CD. Specifically, given the output $\mathbf{h} = s^{(l)}(\mathbf{x})$ at an intermediate layer $l$ with the decomposition $\mathbf{h} = \beta +\gamma$ , we decompose the activation value $\sigma (\mathbf{h})$ into $\beta^{\prime} + \gamma^{\prime}$ , with the following definition:
+
+$$
+\beta^ {\prime} = \mathbb {E} _ {\gamma \sim p (\gamma | \mathbf {x} _ {- \delta})} [ \sigma (\boldsymbol {\beta} + \boldsymbol {\gamma}) - \sigma (\boldsymbol {\gamma}) ] = \mathbb {E} _ {\mathbf {h} \sim p (\mathbf {h} | \mathbf {x} _ {- \delta})} [ \sigma (\mathbf {h}) - \sigma (\mathbf {h} - \boldsymbol {\beta}) ], \tag {5}
+$$
+
+i.e., $\beta^{\prime}$ is defined as the expected difference between the activation values when the $\beta$ term is present or absent. $\mathbf{h}$ is computed for different input sequences $\mathbf{x}$ with the contexts of the phrase $\mathbf{p}$ sampled from the distribution $p(\hat{\mathbf{x}}_{\delta}|\mathbf{x}_{-\delta})$ . Eq. 5 is a layer wise application of Eq. 4, where the masking operation is implemented with calculating $\sigma (\mathbf{h} - \boldsymbol {\beta})$ . Figure 2(b) provides a visualization for the decomposition.
+
+Algorithmic Details. To perform sampling, we first pretrain a LSTM language model from two directions on the training data. During sampling, we mask the words that are not conditioned in $p(\hat{\mathbf{x}}_{\delta}|\mathbf{x}_{-\delta})$ . Some other sampling options include performing Gibbs sampling from a masked language model (Wang et al., 2019). The algorithm then obtains a set of samples $S$ by sampling from the language model. For each sample in $S$ , the algorithm records the input of the $i$ -th non-linear activation function to obtain a sample set $S_{\mathbf{h}}^{(i)}$ . During the explanation, the $\beta$ term of the $i$ -th non-linear
+
+activation function is calculated as,
+
+$$
+\beta^ {\prime} = \frac {1}{\left| \mathcal {S} _ {\mathbf {h}} ^ {(i)} \right|} \sum_ {\mathbf {h} \in \mathcal {S} _ {\mathbf {h}} ^ {(i)}} [ \sigma (\mathbf {h}) - \sigma (\mathbf {h} - \boldsymbol {\beta}) ]. \tag {6}
+$$
+
+Some neural models such as Transformers involve operations that normalize over different dimensions of a vectors, e.g. layer normalization operations. We observe improved performance by not decomposing the normalizer of these terms when the phrase $\mathbf{p}$ is shorter than a threshold, assuming that the impact of $\mathbf{p}$ to the normalizer can be ignored. Besides, for element-wise multiplication in LSTM models, we treat them in the same way as other non-linear operations and decompose them as Eq. 5, where the decomposition of $\mathbf{h}_1\odot \mathbf{h}_2$ is written as $\beta^{\prime} = \mathbb{E}_{\gamma_{1},\gamma_{2}}[(\beta_{1} + \gamma_{1})\odot (\beta_{2} + \gamma_{2}) - \gamma_{1}\odot \gamma_{2}]$ . We avoid decomposing softmax functions.
+
+# 3.4 SAMPLING AND OCCLUSION ALGORITHM
+
+We show it is possible to fit input occlusion (Li et al., 2016) algorithm into our formulation. Input occlusion algorithm calculate the importance of $\mathbf{p}$ specific to an input sentence $\mathbf{x}$ by observing the prediction difference caused by replacing the phrase $\mathbf{p}$ with padding tokens, noted as $\mathbf{0}_{\mathbf{p}}$
+
+$$
+\phi (\mathbf {p}, \mathbf {x}) = s (\mathbf {x}) - s \left(\mathbf {x} _ {- \mathbf {p}}; \mathbf {0} _ {\mathbf {p}}\right) \tag {7}
+$$
+
+It is obvious that the importance score obtained by the input occlusion algorithm is dependent on the all the context words of $\mathbf{p}$ in $\mathbf{x}$ . To eliminate the dependence, we sample the context around the phrase $\mathbf{p}$ . This leads to the Sampling and Occlusion (SOC) algorithm, where the importance of phrases is defined as the expected prediction difference after masking the phrase for each replacement of contexts.
+
+Algorithmic Details. Similar to SCD, SOC samples neighboring words $\hat{\mathbf{x}}_{\delta}$ from a trained language model $p(\hat{\mathbf{x}}_{\delta}|\mathbf{x}_{-\delta})$ and obtain a set of neighboring word replacement $S$ . For each replacement $\hat{\mathbf{x}}_{\delta} \in S$ , the algorithm computes the model prediction differences after replacing the phrase $\mathbf{p}$ with padding tokens. The importance $\phi(\mathbf{p},\mathbf{x})$ is then calculated as the average prediction differences. Formally, the algorithm calculates,
+
+$$
+\phi (\mathbf {p}, \mathbf {x}) = \frac {1}{| \mathcal {S} |} \sum_ {\hat {\mathbf {x}} _ {\delta} \in \mathcal {S}} \left[ s \left(\mathbf {x} _ {- \delta}; \hat {\mathbf {x}} _ {\delta}\right) - s \left(\mathbf {x} _ {- \{\delta , \mathbf {p} \}}; \hat {\mathbf {x}} _ {\delta}; \mathbf {0} _ {\mathbf {p}}\right) \right]. \tag {8}
+$$
+
+Sampling and Occlusion is advantageous in that it is model-agnostic and easy to implement. The input occlusion algorithm inside Eq. 8 can also be replaced with other measures of phrase importance, such as Shapley values (Shapley, 1953), with the phrase $\mathbf{p}$ and other input words considered as players. We expect it is helpful for longer sequences when there are multiple evidences outside the context region saturating the prediction.
+
+# 4 EXPERIMENTS
+
+We evaluate explanation algorithms on both shallow LSTM models and deep fine-tuned BERT Transformer (Devlin et al., 2018) models. We use two sentiment analysis datasets, namely the Stanford Sentiment Treebank-2 (SST-2) dataset (Socher et al., 2013) and the Yelp Sentiment Polarity dataset (Zhang et al., 2015), as well as TACRED relation extraction dataset (Zhang et al., 2017) for experiments. The two tasks are modeled as binary and multi-class classification tasks respectively. For the SST-2 dataset, while it provides sentiment polarity scores for all the phrases on the nodes of the constituency parsing trees, we do not train our model on these phrases, and use these scores as the evaluation for the phrase level explanations. Our Transformer model is fine-tuned from pretrained BERT (Devlin et al., 2018) model. See Appendix A for other implementation details.
+
+Compared Methods. We compare our explanation algorithm with following baselines: Input occlusion (Li et al., 2016) and Integrated Gradient+SHAP (GradSHAP) (Lundberg & Lee, 2017); two algorithms applied for hierarchical explanations, namely Contextual Decomposition (CD) (Murdoch et al., 2018), and Agglomerative Contextual Decomposition (ACD) (Singh et al., 2019). We
+
+| Dataset | SST-2 | Yelp Polarity | TACRED |
| Model | BERT | LSTM | BERT | LSTM | BERT | LSTM |
| Metric | word ρ | phrase ρ | word ρ | phrase ρ | word ρ | word ρ | word ρ | word ρ |
| Input Occlusion | 0.2229 | 0.4081 | 0.6489 | 0.4899 | 0.3781 | 0.6935 | 0.7646 | 0.5756 |
| Direct Feed | 0.2005 | 0.4889 | 0.6798 | 0.5588 | 0.3875 | 0.7905 | 0.1986 | 0.5771 |
| GradSHAP | 0.5073 | 0.5991 | 0.7024 | 0.5402 | 0.5791 | 0.7388 | 0.2965 | 0.6651 |
| CD | 0.2334 | 0.3068 | 0.6231 | 0.4727 | 0.2645 | 0.7451 | 0.0052 | 0.6508 |
| ACD | 0.3053 | 0.3698 | 0.2495 | 0.1856 | 0.3010 | 0.5024 | 0.2027 | 0.0291 |
| Statistic | 0.5223 | 0.4741 | 0.7271 | 0.4959 | 0.7294 | 0.9094 | 0.5324 | 0.7662 |
| SCD | 0.5481 | 0.6015 | 0.7151 | 0.5664 | 0.7180 | 0.7793 | 0.7980 | 0.6823 |
| SOC | 0.6265 | 0.6628 | 0.7226 | 0.5649 | 0.6971 | 0.7683 | 0.7982 | 0.7354 |
+
+Table 1: Correlation between word & phrase importance attribution and linear model coefficients & SST-2 human annotations, achieved by baselines and our explanation algorithms.
+
+
+Figure 3: Hierarchical Explanation of a prediction by the BERT Transformer model on SST-2. We generate explanations for all the phrases on the truncated constituency parsing tree, with positive sentiments shown in red and negative sentiments shown in blue. We see our method identify positive segments in the overall negative sentence, such as "a breath of fresh air"
+
+also compare with a naive however neglected baseline in prior literature, which directly feed the given phrase to the model and take the prediction score as the importance of the phrase, noted as Direct Feed. In BERT models, Direct Feed is implemented by turning off the attention mask of words except the [CLS] token and the phrase to be explained. For our algorithms, we list the performance of corpus statistic based approach (Statistic) for approximating context independent importance in Eq. 3, Sampling and Contextual Decomposition (SCD), and Sampling and Occlusion (SOC) algorithm. In section 4.4, we also consider padding instead of sampling the context words in SCD and SOC.
+
+# 4.1 HIERARCHICAL VISUALIZATION OF IMPORTANT WORDS AND PHRASES
+
+We verify the performance of our algorithms in identifying important words and phrases captured by models. We follow the quantitative evaluation protocol proposed in CD algorithm (Murdoch et al., 2018) for evaluating word-level explanations, which computes Pearson correlation between the coefficients learned by a linear bag-of-words model and the importance scores attributed by explanation methods, also noted as the word $\rho$ . When the linear model is accurate, its coefficients could stand for general importance of words. For evaluating phrase level explanations, we notice the SST-2 dataset provides human annotated real-valued sentiment polarity for each phrase on constituency parsing trees. We generate explanations for each phrase on the parsing tree and evaluate the Pearson correlation between the ground truth scores and the importance scores assigned for phrases, also noted as the phrase $\rho$ . We draw $K = 20$ samples for $N = 10$ words adjacent to the phrase to be explained at the sampling step in our SOC and SCD algorithms. The parameter setting is trade-off between the efficiency and performance. See Section 4.4 for detailed parameter analysis.
+
+Table 1 shows word $\rho$ and phrase $\rho$ achieved by our algorithms and competitors. Generally, explanation algorithms that follow our formulations achieve highest word $\rho$ and phrase $\rho$ for all the datasets and models. SOC and SCD perform robustly on the deep Transformer model, achieving higher word
+
+
+(a) SCD
+
+
+(b) CD
+Figure 4: Extracting phrase-level classification patterns from LSTM relation extraction model with SCD. Red indicate evidence for predicting the class, and blue indicate distractor for predicting the class. By applying the agglomerative clustering algorithm and defining a threshold score, we effectively extract "a sister, O-Person" as a classification rule for the relation per:siblings. However, we see CD fails in this example.
+
+$\rho$ and phrase $\rho$ than input occlusion and contextual decomposition algorithms by a large margin. We see the simple Direct Feed method provide promising results on shallow LSTM networks, but fail in deeper Transformer models. The statistic based approximation of the context independent importance, which do not employ a trained sampler, yields competitive words $\rho$ but low phrase $\rho$ . Our analysis show that it is common that a long phrase does not exist in previously seen examples. In this case, phrase $\rho$ achieved by statistic based approximation is pushed towards that of the input occlusion algorithm.
+
+Qualitative study also shows that our explanation visualize complicated compositional semantics captured by models, such as positive segments in the negative example, and adversative conjunctions connected with "but". We present an example explanation provided by SOC algorithm in Figure 3 and Appendix.
+
+# 4.2 EXPLANATION AS CLASSIFICATION PATTERN EXTRACTION FROM MODELS
+
+We show our explanation algorithm is a nature fit for extracting phrase level classification rules from neural classifiers. With the agglomerative clustering algorithm in Singh et al. (2019), our explanation effectively identify phrase-level classification patterns without evaluating all possible phrases in the sentence even when a predefined hierarchy does not exist. Figure 4 show an example of automatically constructed hierarchy and extracted classification rules in an example in the TACRED dataset.
+
+# 4.3 ENHANCING HUMAN TRUST OF MODELS
+
+We follow the human evaluation protocol in Singh et al. (2019) and study whether our explanations help subjects to better trust model predictions. We ask subjects to rank the provided visualizations based on how they would like to trust the model. For the SST-2 dataset, we show subjects the predictions of the fine-tuned BERT model, and the explanations generated by SOC, SCD, ACD and GradSHAP algorithms for phrases. The phrase polarities are visualized in a hierarchy with the provided parsing tree of each sentence in the dataset. For the TACRED dataset, we show the explanations provided by SOC, SCD, CD and Direct Feed algorithms on the LSTM model. We binarize the importance of a phrase by calculating the difference between its importance to the predicted class and the its top importance to other classes, and the hierarchies are constructed automatically with agglomerative clustering (Singh et al., 2019). Figure 5 shows average ranking score of explanations, where 4 for the best, and 1 for the worst. On the SST-2 dataset, SOC achieves significantly higher ranking score than ACD and GradSHAP, showing a $p$ -value less than 0.05 and 0.001 respectively. On the TACRED dataset, SCD achieve the best ranking score, showing significantly better ranking score than CD and Direct Feed with a $p$ -value less than $10^{-6}$ .
+
+
+(a) SST-2
+
+
+(b) TACRED
+Figure 5: Results for human evaluation on the Transformer model trained on SST-2 sentiment analysis dataset (between SOC, SCD, ACD, GradSHAP) and the LSTM model trained on TACRED relation extraction dataset (between SOC, SCD, CD, DirectFeed).
+
+
+(a) SCD, word $\rho$ , BERT
+
+
+(b) SCD, phrase $\rho$ , BERT
+
+
+(c) SOC, word $\rho$ , BERT
+Figure 6: Word $\rho$ and phrase $\rho$ curves as the size of the context region $N$ and the number of samples $K$ change on the BERT model trained on the SST-2 dataset. Dash line notes for the performance of padding the context words instead of sampling.
+
+
+(d) SOC, phrase $\rho$ , BERT
+
+# 4.4 PARAMETER ANALYSIS
+
+Both SOC and SCD algorithms require specifying the size of the context region $N$ and the number of samples $K$ . In Figure 6 (also Figure 7 in Appendix) we show the impact of these parameters. We also plot the performance curves when we pad the contexts instead of sampling. We see sampling the context achieves much better performance than padding the context given a fixed size of the context region $N$ . We also see word $\rho$ and phrase $\rho$ increase as the number of samples $K$ increases. The overall performance also increases as the size of the context region $N$ increases at the early stage, and saturates when $N$ grows large, which is consistent with our hypothesis that words or phrases usually do not interact with the words that are far away them in the input.
+
+# 5 RELATED WORKS
+
+Interpretability of neural networks has been studied with various techniques, including probing learned features with auxiliary tasks (Tenney et al., 2019), or designing models with inherent interpretability (Bahdanau et al., 2015; Lei et al., 2016). A major line of work, local explanation algorithms, explains predictions by assigning importance scores for input features. This line of work include input occlusion (Kádár et al., 2017), gradient based algorithms (Simonyan et al., 2013; Hechtlinger, 2016; Ancona et al., 2017), additive feature attribution methods (Ribeiro et al., 2016; Shrikumar et al., 2017; Sundararajan et al., 2017), among which Shapley value based approaches (Lundberg & Lee, 2017) have been studied intensively because of its good mathematical properties. In the context of input occlusion explanations, researchers also study how to efficiently marginalize over input features to be explained (Zintgraf et al., 2017; Chang et al., 2019), while our research show extra focus could be placed on marginalizing over contexts. Regarding explanations of models with structured inputs, Chen et al. (2019) propose L-Shapley and C-Shapley for efficient approximation of Shapley values, with a similar hypothesis with us that the importance of a word is usually only strongly dependent on its neighboring contexts. Chen et al. (2018) propose a feature selection based approach for explanation in an information theoretic perspective.
+
+On the other hand, global explanation algorithms (Guidotti et al., 2018) have also been studied for identifying generally important features, such as Feature Importance Ranking Measure (Zien et al., 2009), Accumulated Local Effects (Apley, 2016), while usually restricted in the domain of tabular data. We note that the context independence property in our proposed methods implies we study hierarchical explanation as a global explanation problem (Guidotti et al., 2018). Compared with local explanation algorithms, global explanation algorithms are less studied for explaining individual predictions (Poerner et al., 2018), because they reveal the average behavior of models. However, with a hierarchical organization, we show global explanations are also powerful at explaining individual predictions, achieving better human evaluation scores and could explain compositional semantics where local explanation algorithms such as additive feature attribution algorithms totally fail. Moreover, we note that the use of explanation algorithms is not exclusive; we may apply explanation algorithms of different categories to make a more holistic explanation of model predictions.
+
+Another closely related field is statistical feature interaction detection (Hooker, 2004; Sorokina et al., 2008; Tsang et al., 2017) from learned models, which usually focus on tabular data only. An exception is (Tsang et al., 2018), which also studies word interactions in neural sequence model predictions, but does not study interactions in a phrase level.
+
+# 6 CONCLUSION
+
+In this work, we identify two desirable properties for informative hierarchical explanations of predictions, namely the non-additivity and context-independence. We propose a formulation to quantify context independent importance of words and phrases that satisfies the properties above. We revisit the prior line of works on contextual decomposition algorithms, and propose Sampling and Contextual Decomposition (SCD) algorithm and Sampling and Occlusion algorithm (SOC). Experiments on multiple datasets and models show that our explanation algorithms generate informative hierarchical explanations, help to extract classification rules from models, and enhance human trust of models.
+
+# ACKNOWLEDGEMENTS
+
+This research is based upon work supported in part by NSF SMA 18-29268 and JP Morgan AI Research Award. We would like to thank all the collaborators in USC INK research lab for their constructive feedback on the work.
+
+# REFERENCES
+
+Marco Ancona, Enea Ceolini, Cengiz Öztireli, and Markus Gross. Towards better understanding of gradient-based attribution methods for deep neural networks. arXiv preprint arXiv:1711.06104, 2017.
+Daniel W Apley. Visualizing the effects of predictor variables in black box supervised learning models. arXiv preprint arXiv:1612.08468, 2016.
+Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. In 3rd International Conference on Learning Representations, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Conference Track Proceedings, 2015. URL http://arxiv.org/abs/1409.0473.
+Alexander Binder, Grégoire Montavon, Sebastian Lapuschkin, Klaus-Robert Müller, and Wojciech Samek. Layer-wise relevance propagation for neural networks with local renormalization layers. In International Conference on Artificial Neural Networks, pp. 63-71. Springer, 2016.
+Chun-Hao Chang, Elliot Creager, Anna Goldenberg, and David Duvenaud. Explaining image classifiers by counterfactual generation. In International Conference on Learning Representations, 2019. URL https://openreview.net/forum?id=B1MXz20cYQ.
+Jianbo Chen, Le Song, Martin J. Wainwright, and Michael I. Jordan. Learning to explain: An information-theoretic perspective on model interpretation. In ICML, 2018.
+
+Jianbo Chen, Le Song, Martin J. Wainwright, and Michael I. Jordan. L-shapley and c-shapley: Efficient model interpretation for structured data. In International Conference on Learning Representations, 2019. URL https://openreview.net/forum?id=S1E3Ko09F7.
+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.
+Katsushige Fujimoto, Ivan Kojadinovic, and Jean-Luc Marichal. Axiomatic characterizations of probabilistic and cardinal-probabilistic interaction indices. Games and Economic Behavior, 55 (1):72-99, 2006.
+Riccardo Guidotti, Anna Monreale, Salvatore Ruggieri, Franco Turini, Fosca Giannotti, and Dino Pedreschi. A survey of methods for explaining black box models. ACM computing surveys (CSUR), 51(5):93, 2018.
+Yotam Hechtlinger. Interpretation of prediction models using the input gradient. arXiv preprint arXiv:1611.07634, 2016.
+Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural computation, 9(8): 1735-1780, 1997.
+Giles Hooker. Discovering additive structure in black box functions. In Proceedings of the tenth ACM SIGKDD international conference on Knowledge discovery and data mining, pp. 575-580, 2004.
+Akos Kádár, Grzegorz Chrupa, and Afra Alishahi. Representation of linguistic form and function in recurrent neural networks. Computational Linguistics, 43(4):761-780, 2017.
+Tao Lei, Regina Barzilay, and Tommi S. Jaakkola. Rationalizing neural predictions. In EMNLP, 2016.
+Jiwei Li, Will Monroe, and Dan Jurafsky. Understanding neural networks through representation erasure. arXiv preprint arXiv:1612.08220, 2016.
+Hui Liu, Qingyu Yin, and William Yang Wang. Towards explainable NLP: A generative explanation framework for text classification. In Proceedings of the 57th Conference of the Association for Computational Linguistics, pp. 5570-5581, Florence, Italy, July 2019a. Association for Computational Linguistics. URL https://www.aclweb.org/anthology/P19-1560.
+Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov. Roberta: A robustly optimized bert pretraining approach. arXiv preprint arXiv:1907.11692, 2019b.
+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.
+Sina Mohseni, Niloofar Zarei, and Eric D Ragan. A survey of evaluation methods and measures for interpretable machine learning. arXiv preprint arXiv:1811.11839, 2018.
+W James Murdoch, Peter J Liu, and Bin Yu. Beyond word importance: Contextual decomposition to extract interactions from lstms. In ICLR, 2018.
+Jeffrey Pennington, Richard Socher, and Christopher Manning. Glove: Global vectors for word representation. In Proceedings of the 2014 conference on empirical methods in natural language processing (EMNLP), pp. 1532-1543, 2014.
+Matthew E Peters, Mark Neumann, Mohit Iyyer, Matt Gardner, Christopher Clark, Kenton Lee, and Luke Zettlemoyer. Deep contextualized word representations. arXiv preprint arXiv:1802.05365, 2018.
+Nina Poerner, Hinrich Schütze, and Benjamin Roth. Evaluating neural network explanation methods using hybrid documents and morphological agreement. arXiv preprint arXiv:1801.06422, 2018.
+
+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, San Francisco, CA, USA, August 13-17, 2016, pp. 1135-1144, 2016.
+Lloyd S Shapley. A value for n-person games. Contributions to the Theory of Games, 2(28):307-317, 1953.
+Avanti Shrikumar, Peyton Greenside, and Anshul Kundaje. Learning important features through propagating activation differences. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 3145-3153. JMLR.org, 2017.
+Karen Simonyan, Andrea Vedaldi, and Andrew Zisserman. Deep inside convolutional networks: Visualising image classification models and saliency maps. arXiv preprint arXiv:1312.6034, 2013.
+Chandan Singh, W James Murdoch, and Bin Yu. Hierarchical interpretations for neural network predictions. In ICLR, 2019.
+Richard Socher, Alex Perelygin, Jean Wu, Jason Chuang, Christopher D Manning, Andrew Ng, and Christopher Potts. Recursive deep models for semantic compositionality over a sentiment treebank. In Proceedings of the 2013 conference on empirical methods in natural language processing, pp. 1631-1642, 2013.
+Daria Sorokina, Rich Caruana, Mirek Riedewald, and Daniel Fink. Detecting statistical interactions with additive groves of trees. In Proceedings of the 25th international conference on Machine learning, pp. 1000-1007. ACM, 2008.
+Mukund Sundararajan, Ankur Taly, and Qiqi Yan. Axiomatic attribution for deep networks. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 3319-3328. JMLR.org, 2017.
+Ian Tenney, Dipanjan Das, and Ellie Pavlick. Bert rediscovers the classical nlp pipeline. In Association for Computational Linguistics, 2019. URL https://arxiv.org/abs/1905.05950.
+Michael Tsang, Dehua Cheng, and Yan Liu. Detecting statistical interactions from neural network weights. arXiv preprint arXiv:1705.04977, 2017.
+Michael Tsang, Youbang Sun, Dongxu Ren, and Yan Liu. Can i trust you more? model-agnostic hierarchical explanations. ArXiv, abs/1812.04801, 2018.
+Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in neural information processing systems, pp. 5998-6008, 2017.
+Alex Wang, Kyunghyun Cho, and CIFAR Azrieli Global Scholar. Bert has a mouth, and it must speak: Bert as a markov random field language model. *NAACL HLT* 2019, pp. 30, 2019.
+Xiang Zhang, Junbo Zhao, and Yann LeCun. Character-level convolutional networks for text classification. In Advances in neural information processing systems, pp. 649-657, 2015.
+Yuhao Zhang, Victor Zhong, Danqi Chen, Gabor Angeli, and Christopher D. Manning. Position-aware attention and supervised data improve slot filling. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing (EMNLP 2017), pp. 35-45, 2017. URL https://nlp.stanford.edu/pubs/zhang2017tacred.pdf.
+Alexander Zien, Nicole Kramer, Soren Sonnenburg, and Gunnar Ratsch. The feature importance ranking measure. In Joint European Conference on Machine Learning and Knowledge Discovery in Databases, pp. 694-709. Springer, 2009.
+Luisa M Zintgraf, Taco S Cohen, Tameem Adel, and Max Welling. Visualizing deep neural network decisions: Prediction difference analysis. In ICLR, 2017.
+
+
+(a) SCD, word $\rho$ , LSTM
+
+
+(b) SCD, phrase $\rho$ , LSTM
+
+
+(c) SOC, word $\rho$ , LSTM
+Figure 7: Word $\rho$ and phrase $\rho$ curve as the size of the context region $N$ and the number of samples $K$ change on LSTM trained on the SST-2 dataset. Dash line notes for the performance of padding the context words instead of sampling.
+
+
+(d) SOC, phrase $\rho$ , LSTM
+
+# A IMPLEMENTATION DETAILS
+
+Our LSTM classifiers use 1 layer unidirectional LSTM and the number of hidden units is set to 128, 500, and 300 for SST-2, Yelp, and TACRED dataset respectively. For all models, we load the pretrained 300-dimensional Glove word vectors (Pennington et al., 2014). The language model sampler is also built on LSTM and have the same parameter settings as the classifiers. Our Transformer models are fine-tuned from pretrained BERT models (Devlin et al., 2018), which have 12 layers and 768 hidden units of per representation. On three datasets, LSTM models achieve $82\%$ accuracy, $95\%$ accuracy, and 0.64 F1 score on average. The fine-tuned BERT models achieve $92\%$ accuracy, $96\%$ accuracy, and 0.68 F1 score on average. We use the same parameter settings between LSTM classifiers and language models on three datasets. Following Murdoch et al. (2018), we randomly sample a subset (set to 500 instances) of sentences of length at most 40 words for explanation on Yelp dataset, and also for TACRED dataset. On TACRED dataset, we generate explanations only for correctly predicted instances with a label other than no Relation.
+
+# B PERFORMANCE ON ADVERSARIAL MODELS
+
+For computing context independent importance of a phrase, an intuitive and simple alternative approach, which is nevertheless neglected in prior literature, is to only feed the input to the model and treat the prediction score as the explanation. In Table 1, while the score of the Direct Feed is lower than that of the best performing algorithms, the score is rather competitive.
+
+The potential risk of this explanation is that it assumes model performs reasonably on incomplete sentence fragments that are significantly out of the data distribution. As a result, the explanation of short phrases can be misleading. To simulate the situation, we train a LSTM model on inversed labels on isolate words, in addition to the original training instances. The model could achieve the same accuracy as the original LSTM model. However, the word $\rho$ and the phrase $\rho$ of Direct Feed drop by a large margin, showing a word $\rho$ of -0.38 and 0.09. SOC and SCD are still robust on the adverse LSTM model, both showing a word $\rho$ and phrase $\rho$ of more than 0.60 and 0.55.
+
+The masking operation could also cause performance drop because the masked sentence can be out of data distribution when explaining long phrases. For SOC, the risk can be resolved by implementing the masking operation of the phrase $\mathbf{p}$ by another round of sampling from a language model conditioned on its context $\mathbf{x}_{-\mathbf{p}}$ , but we do not find empirical evidence showing that it improves performance.
+
+# C EXPLANATION HEATMAPS
+
+| Model | BERT | LSTM |
| Metric | word ρavg | phrase ρavg | word ρavg | phrase ρavg |
| Input Occlusion | 0.2947 | 0.4365 | 0.7150 | 0.4968 |
| GradSHAP | 0.5444 | 0.6078 | 0.7360 | 0.5449 |
| CD | 0.3642 | 0.3755 | 0.6962 | 0.4777 |
| ACD | 0.3023 | 0.3913 | 0.3210 | 0.2110 |
| SCD | 0.5601 | 0.6072 | 0.7348 | 0.5685 |
| SOC | 0.6282 | 0.6706 | 0.7430 | 0.5675 |
+
+
+
+
+
+
+Figure 8: More examples about rule extraction from LSTM models trained on TACRED relation extraction dataset with SOC. Red indicate evidence for predicting the class, and blue indicate distractor for predicting the class. By applying the agglomerative clustering algorithm and defining a threshold score, we effectively extract classification rules from LSTM models. The ground truth label noted on the top
+
+Table 2: Correlation between averaged word & phrase importance attribution and linear model coefficients and human annotations over all 2210 test instances in SST-2 dataset. The relative performance is similar to the case without score averaging as shown in Table 1.
+
+| Dataset | Label | Pattern |
| SST-2 | Positive | frighteningly evocative; insight and honesty |
| Negative | neither funny nor provocative; kill the suspense |
| TACRED | person:age | [PERSON], [NUMBER], was; a [NUMBER] man |
| organization:top-member | chief engineer of the [ORGANIZATION] |
| person:origin | [Nationality] citizen; tribal member from [COUNTRY] |
+
+Table 3: Phrase-level classification patterns extracted from models. We show the results of SCD and SOC respectively for the SST-2 and the TACRED dataset.
+
+
+(a) SOC
+
+
+(b) SCD
+
+
+(c) CD
+
+
+(d) GradSHAP
+Figure 9: Explanation heatmaps generated by SOC, SCD, CD, and GradSHAP on a negatively predicted sentence by BERT Transformer model in SST-2 dataset. Only SOC and SCD captures adversarial conjunction connected by "but".
\ No newline at end of file
diff --git a/towardshierarchicalimportanceattributionexplainingcompositionalsemanticsforneuralsequencemodels/images.zip b/towardshierarchicalimportanceattributionexplainingcompositionalsemanticsforneuralsequencemodels/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..2c4494b1d7b282a57d4786b23c9b50bf88e463ce
--- /dev/null
+++ b/towardshierarchicalimportanceattributionexplainingcompositionalsemanticsforneuralsequencemodels/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:37da076e6182f23d92c3c7b8bcd70b3ec496b1fba26c980f3e195a0633d97267
+size 616803
diff --git a/towardshierarchicalimportanceattributionexplainingcompositionalsemanticsforneuralsequencemodels/layout.json b/towardshierarchicalimportanceattributionexplainingcompositionalsemanticsforneuralsequencemodels/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..ebaa5cb62b19b04acd0b6c6cb78df2e30ab20c0f
--- /dev/null
+++ b/towardshierarchicalimportanceattributionexplainingcompositionalsemanticsforneuralsequencemodels/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ad0bdd1504c3d30d3b2e903ae5c7a91b23afb27b2ef532166eacee58a41a9821
+size 547322
diff --git a/trainingindividuallyfairmlmodelswithsensitivesubspacerobustness/1dcb5f8c-4afd-485c-b726-07a39b231098_content_list.json b/trainingindividuallyfairmlmodelswithsensitivesubspacerobustness/1dcb5f8c-4afd-485c-b726-07a39b231098_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..6b5c22af0fbcacc8d4b1671ceacb2203cd2351e6
--- /dev/null
+++ b/trainingindividuallyfairmlmodelswithsensitivesubspacerobustness/1dcb5f8c-4afd-485c-b726-07a39b231098_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c845cb62d4bcd11a48f8be2e3108072f147be9f6a12d54b829fb02366f47e2cc
+size 128172
diff --git a/trainingindividuallyfairmlmodelswithsensitivesubspacerobustness/1dcb5f8c-4afd-485c-b726-07a39b231098_model.json b/trainingindividuallyfairmlmodelswithsensitivesubspacerobustness/1dcb5f8c-4afd-485c-b726-07a39b231098_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..4446ca0f3f61e281803094b5d893bf75b8b85668
--- /dev/null
+++ b/trainingindividuallyfairmlmodelswithsensitivesubspacerobustness/1dcb5f8c-4afd-485c-b726-07a39b231098_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e1a700aa7ce1e581d0eb1f1648221e0172bf27cc67d2bc844afc42de530f8f62
+size 152025
diff --git a/trainingindividuallyfairmlmodelswithsensitivesubspacerobustness/1dcb5f8c-4afd-485c-b726-07a39b231098_origin.pdf b/trainingindividuallyfairmlmodelswithsensitivesubspacerobustness/1dcb5f8c-4afd-485c-b726-07a39b231098_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..56de69bb1f19c0c1642b66984375a4230e380d77
--- /dev/null
+++ b/trainingindividuallyfairmlmodelswithsensitivesubspacerobustness/1dcb5f8c-4afd-485c-b726-07a39b231098_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:19be67bc7be508015b677bbbbd0de200d1489503872c7b2639269324f55527e0
+size 963520
diff --git a/trainingindividuallyfairmlmodelswithsensitivesubspacerobustness/full.md b/trainingindividuallyfairmlmodelswithsensitivesubspacerobustness/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..11c9fc98ed303796c45150b9a2695d8c9f08abd4
--- /dev/null
+++ b/trainingindividuallyfairmlmodelswithsensitivesubspacerobustness/full.md
@@ -0,0 +1,617 @@
+# TRAINING INDIVIDUALLY FAIR ML MODELS WITH SENSITIVE SUBSPACE ROBUSTNESS
+
+Mikhail Yurochkin
+
+IBM Research
+
+MIT-IBM Watson AI Lab
+
+mikhail.yurochkin@ibm.com
+
+Amanda Bower†, Yuekai Sun‡
+
+Department of Mathematics
+
+Department of Statistics
+
+University of Michigan
+
+{amandarg,yuekai}@umich.edu
+
+# ABSTRACT
+
+We consider training machine learning models that are fair in the sense that their performance is invariant under certain sensitive perturbations to the inputs. For example, the performance of a resume screening system should be invariant under changes to the gender and/or ethnicity of the applicant. We formalize this notion of algorithmic fairness as a variant of individual fairness and develop a distributionally robust optimization approach to enforce it during training. We also demonstrate the effectiveness of the approach on two ML tasks that are susceptible to gender and racial biases.
+
+# 1 INTRODUCTION
+
+Machine learning (ML) models are gradually replacing humans in high-stakes decision making roles. For example, in Philadelphia, an ML model classifies probationers as high or low-risk (Metz & Satariano, 2020). In North Carolina, "analytics" is used to report suspicious activity and fraud by Medicaid patients and providers (Metz & Satariano, 2020). Although ML models appear to eliminate the biases of a human decision maker, they may perpetuate or even exacerbate biases in the training data (Barocas & Selbst, 2016). Such biases are especially objectionable when it adversely affects underprivileged groups of users (Barocas & Selbst, 2016).
+
+In response, the scientific community has proposed many mathematical definitions of algorithmic fairness and approaches to ensure ML models satisfy the definitions. Unfortunately, this abundance of definitions, many of which are incompatible (Kleinberg et al., 2016; Chouldechova, 2017), has hindered the adoption of this work by practitioners. There are two types of formal definitions of algorithmic fairness: group fairness and individual fairness. Most recent work on algorithmic fairness considers group fairness because it is more amenable to statistical analysis (Ritov et al., 2017). Despite their prevalence, group notions of algorithmic fairness suffer from certain shortcomings. One of the most troubling is there are many scenarios in which an algorithm satisfies group fairness, but its output is blatantly unfair from the point of view of individual users (Dwork et al., 2011).
+
+In this paper, we consider individual fairness instead of group fairness. Intuitively, an individually fair ML model treats similar users similarly. Formally, an ML model is a map $h: \mathcal{X} \to \mathcal{Y}$ , where $\mathcal{X}$ and $\mathcal{Y}$ are the input and output spaces. The leading notion of individual fairness is metric fairness (Dwork et al., 2011); it requires
+
+$$
+d _ {y} \left(h \left(x _ {1}\right), h \left(x _ {2}\right)\right) \leq L d _ {x} \left(x _ {1}, x _ {2}\right) \text {f o r a l l} x _ {1}, x _ {2} \in \mathcal {X}, \tag {1.1}
+$$
+
+where $d_x$ and $d_y$ are metrics on the input and output spaces and $L \geq 0$ is a Lipschitz constant. The fair metric $d_x$ encodes our intuition of which samples should be treated similarly by the ML model. We emphasize that $d_x(x_1, x_2)$ being small does not imply $x_1$ and $x_2$ are similar in all respects. Even if $d_x(x_1, x_2)$ is small, $x_1$ and $x_2$ may differ in certain problematic ways, e.g. in their protected/sensitive attributes. This is why we refer to pairs of samples $x_1$ and $x_2$ such that $d_x(x_1, x_2)$ is small as comparable instead of similar.
+
+Despite its benefits, individual fairness was dismissed as impractical because there is no widely accepted fair metric for many ML tasks. Fortunately, there is a line of recent work on learning the
+
+fair metric from data (Ilvento, 2019; Wang et al., 2019). In this paper, we consider two data-driven choices of the fair metric: one for problems in which the sensitive attribute is reliably observed, and another for problems in which the sensitive attribute is unobserved (see Appendix B).
+
+The rest of this paper is organized as follows. In Section 2, we cast individual fairness as a form of robustness: robustness to certain sensitive perturbations to the inputs of an ML model. This allows us to leverage recent advances in adversarial ML to train individually fair ML models. More concretely, we develop an approach to audit ML models for violations of individual fairness that is similar to adversarial attacks (Goodfellow et al., 2014) and an approach to train ML models that passes such audits (akin to adversarial training (Madry et al., 2017)). We justify the approach theoretically (see Section 3) and empirically (see Section 4).
+
+# 2 FAIRNESS THROUGH (DISTRIBUTIONAL) ROBUSTNESS
+
+To motivate our approach, imagine an auditor investigating an ML model for unfairness. The auditor collects a set of audit data and compares the output of the ML model on comparable samples in the audit data. For example, to investigate whether a resume screening system is fair, the auditor may collect a stack of resumes and change the names on the resumes of Caucasian applicants to names more common among the African-American population. If the system performs worse on the edited resumes, then the auditor may conclude the model treats African-American applicants unfairly. Such investigations are known as correspondence studies, and a prominent example is Bertrand & Mullainathan's celebrated investigation of racial discrimination in the labor market. In a correspondence study, the investigator looks for inputs that are comparable to the training examples (the edited resumes in the resume screening example) on which the ML model performs poorly. In the rest of this section, we formulate an optimization problem to find such inputs.
+
+# 2.1 FAIR WASSERSTEIN DISTANCES
+
+Recall $\mathcal{X}$ and $\mathcal{Y}$ are the spaces of inputs and outputs. To keep things simple, we assume that the ML task at hand is a classification task, so $\mathcal{Y}$ is discrete. We also assume that we have a fair metric $d_{x}$ of the form
+
+$$
+d _ {x} (x _ {1}, x _ {2}) ^ {2} \triangleq \langle x _ {1} - x _ {2}, \Sigma (x _ {1} - x _ {2}) \rangle^ {\frac {1}{2}},
+$$
+
+where $\Sigma \in \mathbf{S}_{+}^{d\times d}$ . For example, suppose we are given a set of $K$ "sensitive" directions that we wish the metric to ignore; i.e. $d(x_{1},x_{2})\ll 1$ for any $x_{1}$ and $x_{2}$ such that $x_{1} - x_{2}$ falls in the span of the sensitive directions. These directions may be provided by a domain expert or learned from data (see Section 4 and Appendix B). In this case, we may choose $\Sigma$ as the orthogonal complement projector of the span of the sensitive directions. We equip $\mathcal{X}$ with the fair metric and $\mathcal{Z}\triangleq \mathcal{X}\times \mathcal{Y}$ with
+
+$$
+d _ {z} \left(\left(x _ {1}, y _ {1}\right), \left(x _ {2}, y _ {2}\right)\right) \triangleq d _ {x} \left(x _ {1}, x _ {2}\right) + \infty \cdot \mathbf {1} \left\{y _ {1} \neq y _ {2} \right\}.
+$$
+
+We consider $d_{z}^{2}$ as a transport cost function on $\mathcal{Z}$ . This cost function encodes our intuition of which samples are comparable for the ML task at hand. We equip the space of probability distributions on $\mathcal{Z}$ with the fair Wasserstein distance
+
+$$
+W (P, Q) = \inf _ {\Pi \in \mathcal {C} (P, Q)} \int_ {\mathcal {Z} \times \mathcal {Z}} c (z _ {1}, z _ {2}) d \Pi (z _ {1}, z _ {2}),
+$$
+
+where $\mathcal{C}(P, Q)$ is the set of couplings between $P$ and $Q$ . The fair Wasserstein distance inherits our intuition of which samples are comparable through the cost function; i.e. the fair Wasserstein distance between two probability distributions is small if they are supported on comparable areas of the sample space.
+
+# 2.2 AUDITING ML MODELS FOR ALGORITHMIC BIAS
+
+To investigate whether an ML model performs disparately on comparable samples, the auditor collects a set of audit data $\{(x_i,y_i)\}_{i = 1}^n$ and solves the optimization problem
+
+$$
+\max _ {P: W \left(P, P _ {n}\right) \leq \epsilon} \int_ {\mathcal {Z}} \ell (z, h) d P (z), \tag {2.1}
+$$
+
+where $\ell : \mathcal{Z} \times \mathcal{H} \to \mathbf{R}_{+}$ is a loss function, $h$ is the ML model, $P_{n}$ is the empirical distribution of the audit data, and $\epsilon > 0$ is a small tolerance parameter. We interpret $\epsilon$ as a moving budget that the auditor may expend to discover discrepancies in the performance of the ML model. This budget forces
+
+the auditor to avoid moving samples to incomparable areas of the sample space. We emphasize that equation 2.1 detects aggregate violations of individual fairness. In other words, although the violations that the auditor's problem detects are individual in nature, the auditor's problem is only able to detect aggregate violations. We summarize the implicit notion of fairness in equation 2.1 in a definition.
+
+Definition 2.1 (distributionally robustly fair (DRF)). An ML model $h: \mathcal{X} \to \mathcal{Y}$ is $(\epsilon, \delta)$ -distributionally robustly fair (DRF) WRT the fair metric $d_x$ iff
+
+$$
+\max _ {P: W \left(P, P _ {n}\right) \leq \epsilon} \int_ {\mathcal {Z}} \ell (z, h) d P (z) \leq \delta . \tag {2.2}
+$$
+
+Although equation 2.1 is an infinite-dimensional optimization problem, it is possible to solve it exactly by appealing to duality. Blanchet & Murthy showed that the dual of equation 2.1 is
+
+$$
+\sup _ {P: W \left(P, P _ {n}\right) \leq \epsilon} \mathbb {E} _ {P} \left[ \ell (Z, h) \right] = \inf _ {\lambda \geq 0} \left\{\lambda \epsilon + \mathbb {E} _ {P _ {n}} \left[ \ell_ {\lambda} ^ {c} (Z, h) \right] \right\}, \tag {2.3}
+$$
+
+$$
+\ell_ {\lambda} ^ {c} ((x _ {i}, y _ {i}), h) \triangleq \sup _ {x \in \mathcal {X}} \ell ((x, y _ {i}), \theta) - \lambda d _ {x} (x, x _ {i}).
+$$
+
+This is a univariate optimization problem, and it is amenable to stochastic optimization. We describe a stochastic approximation algorithm for equation 2.3 in Algorithm 1. Inspecting the algorithm, we see that it is similar to the PGD algorithm for adversarial attack.
+
+Algorithm 1 stochastic gradient method for equation 2.3
+Require: starting point $\hat{\lambda}_1$ , step sizes $\alpha_t > 0$
+1: repeat
+2: draw mini-batch $(x_{t_1}, y_{t_1}), \ldots, (x_{t_B}, y_{t_B}) \sim P_n$
+3: $x_{t_b}^* \gets \arg \max_{x \in \mathcal{X}} \ell((x, y_{t_b}), h) - \lambda d_x(x_{t_b}, x)$ , $b \in [B]$
+4: $\hat{\lambda}_{t+1} \gets \max \{0, \hat{\lambda}_t - \alpha_t (\epsilon - \frac{1}{B} \sum_{b=1}^{B} d_x(x_{t_b}, x_{t_b}^*))\}$
+5: until converged
+
+It is known that the optimal point of equation 2.1 is the discrete measure $\frac{1}{n}\sum_{i = 1}^{n}\delta_{(T_{\lambda}(x_i),y_i)}$ , where $T_{\lambda}:\mathcal{X}\to \mathcal{X}$ is the unfair map
+
+$$
+T _ {\lambda} \left(x _ {i}\right) \leftarrow \arg \max _ {x \in \mathcal {X}} \ell \left(\left(x, y _ {i}\right), h\right) - \lambda d _ {x} ^ {2} \left(x, x _ {i}\right). \tag {2.4}
+$$
+
+We call $T_{\lambda}$ an unfair map because it reveals unfairness in the ML model by mapping samples in the audit data to comparable areas of the sample space that the system performs poorly on. We note that $T_{\lambda}$ may map samples in the audit data to areas of the sample space that are not represented in the audit data, thereby revealing disparate treatment in the ML model not visible in the audit data alone. We emphasize that $T_{\lambda}$ more than reveals disparate treatment in the ML model; it localizes the unfairness to certain areas of the sample space.
+
+We present a simple example to illustrating fairness through robustness (a similar example appeared in Hashimoto et al. (2018)). Consider the binary classification dataset shown in Figure 1. There are two subgroups of observations in this dataset, and (sub)group membership is the protected attribute (e.g. the smaller group contains observations from a minority subgroup). In Figure 1a we see the decision heatmap of a vanilla logistic regression, which performs poorly on the blue minority subgroup. The two subgroups are separated in the horizontal direction, so the horizontal direction is the sensitive direction. Figure 1b shows that such classifier is unfair with respect to the corresponding fair metric, i.e. the unfair map equation 2.4 leads to significant loss increase by transporting mass along the horizontal direction with very minor change of the vertical coordinate.
+
+Comparison with metric fairness Before moving on to training individually fair ML models, we compare DRF with metric fairness equation 1.1. Although we concentrate on the differences between the two definitions here, they are more similar than different: both formalize the intuition that the outputs of a fair ML model should perform similarly on comparable inputs. That said, there are two main differences between the two definitions. First, instead of requiring the output of the ML model to be similar on all inputs comparable to a training example, we require the output to be similar to the training label. Thus DRF not only enforces similarity of the output on comparable inputs, but also accuracy of the ML model on the training data. Second, DRF considers differences
+
+
+(a) unfair classifier
+
+
+(b) unfair map
+
+
+(c) classifier from SenSR
+Figure 1: Figure (a) depicts a binary classification dataset in which the minority group shown on the right of the plot is underrepresented. This tilts the logistic regression decision boundary in favor of the majority group on the left. Figure (b) shows the unfair map of the logistic regression decision boundary. It maps samples in the minority group towards the majority group. Figure (c) shows an algorithmically fair classifier that treats the majority and minority groups identically.
+
+between datasets instead of samples by replacing the fair metric on inputs with the fair Wasserstein distance induced by the fair metric. The main benefits of this modifications are (i) it is possible to optimize equation 2.1 efficiently, (ii) we can show this modified notion of individual fairness generalizes.
+
+# 2.3 FAIR TRAINING WITH SENSITIVE SUBSPACE ROBUSTNESS
+
+We cast the fair training problem as training supervised learning systems that are robust to sensitive perturbations. We propose solving the minimax problem
+
+$$
+\inf _ {h \in \mathcal {H}} \sup _ {P: W (P, P _ {n}) \leq \epsilon} \mathbb {E} _ {P} [ \ell (Z, h) ] = \inf _ {h \in \mathcal {H}} \inf _ {\lambda \geq 0} \lambda \epsilon + \mathbb {E} _ {P _ {n}} [ \ell_ {\lambda} ^ {c} (Z, h) ], \tag {2.5}
+$$
+
+where $\ell_{\lambda}^{c}$ is defined in equation 2.3. This is an instance of a distributionally robust optimization (DRO) problem, and it inherits some of the statistical properties of DRO. To see why equation 2.5 encourages individual fairness, recall the loss function is a measure of the performance of the ML model. By assessing the performance of an ML model by its worse-case performance on hypothetical populations of users with perturbed sensitive attributes, minimizing equation 2.5 ensures the system performs well on all such populations. In our toy example, minimizing equation 2.5 implies learning a classifier that is insensitive to perturbations along the horizontal (i.e. sensitive) direction. In Figure 1c this is achieved by the algorithm we describe next.
+
+To keep things simple, we assume the hypothesis class is parametrized by $\theta \in \Theta \subset \mathbf{R}^d$ and replace the minimization with respect to $\mathcal{H}$ by minimization with respect to $\theta$ . In light of the similarities between the DRO objective function and adversarial training, we borrow algorithms for adversarial training (Madry et al., 2017) to solve equation 2.5 (see Algorithm 2).
+
+# Algorithm 2 Sensitive Subspace Robustness (SenSR)
+
+Require: starting point $\hat{\theta}_{1}$ , step sizes $\alpha_{t},\beta_{t} > 0$
+
+1: repeat
+2: sample mini-batch $(x_{1},y_{1}),\ldots ,(x_{B},y_{B})\sim P_{n}$
+3: $x_{t_b}^* \gets \arg \max_{x \in \mathcal{X}} \ell((x, y_{t_b}), \theta) - \hat{\lambda}_t d_x(x_{t_b}, x), b \in [B]$
+4: $\hat{\lambda}_{t + 1}\gets \max \{0,\hat{\lambda}_t - \alpha_t(\epsilon -\frac{1}{B}\sum_{b = 1}^B d_x(x_{t_b},x_{t_b}^*))\}$
+5: $\hat{\theta}_{t + 1}\gets \hat{\theta}_t - \frac{\beta_t}{B}\sum_{b = 1}^B\partial_\theta \ell ((x_{t_b}^*,y_{t_b}),\hat{\theta}_t)$
+6: until converged
+
+Related work Our approach to fair training is an instance of distributionally robust optimization (DRO). In DRO, the usual sample-average approximation of the expected cost function is replaced by $\widehat{L}_{\mathrm{DRO}}(\theta) \triangleq \sup_{P \in \mathcal{U}} \mathbb{E}_P[\ell(Z, \theta)]$ , where $\mathcal{U}$ is a (data dependent) uncertainty set of probability distributions. The uncertainty set may be defined by moment or support constraints (Chen et al., 2007; Delage & Ye, 2010; Goh & Sim, 2010), $f$ -divergences (Ben-Tal et al., 2012; Lam & Zhou,
+
+2015; Miyato et al., 2015; Namkoong & Duchi, 2016), and Wasserstein distances (Shafieezadeh-Abadeh et al., 2015; Blanchet et al., 2016; Esfahani & Kuhn, 2015; Lee & Raginsky, 2017; Sinha et al., 2017). Most similar to our work is Hashimoto et al. (2018): they show that DRO with a $\chi^2$ -neighborhood of the training data prevents representation disparity, i.e. minority groups tend to suffer higher losses because the training algorithm ignores them. One advantage of picking a Wasserstein uncertainty set is the set depends on the geometry of the sample space. This allows us to encode the correct notion of individual fairness for the ML task at hand in the Wasserstein distance.
+
+Our approach to fair training is also similar to adversarial training (Madry et al., 2017), which hardens ML models against adversarial attacks by minimizing adversarial losses of the form $\sup_{u\in \mathcal{U}}\ell (z + u,\theta)$ , where $\mathcal{U}$ is a set of allowable perturbations (Szegedy et al., 2013; Goodfellow et al., 2014; Papernot et al., 2015; Carlini & Wagner, 2016; Kurakin et al., 2016). Typically, $\mathcal{U}$ is a scaled $\ell_p$ -norm ball: $\mathcal{U} = \{u:\| u\| _p\leq \epsilon \}$ . Most similar to our work is Sinha et al. (2017): they consider an uncertainty set that is a Wasserstein neighborhood of the training data.
+
+There are a few papers that consider adversarial approaches to algorithmic fairness. Zhang et al. (2018) propose an adversarial learning method that enforces equalized odds in which the adversary learns to predict the protected attribute from the output of the classifier. Edwards & Storkey (2015) propose an adversarial method for learning classifiers that satisfy demographic parity. Madras et al. (2018) generalize their method to learn classifiers that satisfy other (group) notions of algorithmic fairness. Garg et al. (2019) propose to use adversarial logit pairing (Kannan et al., 2018) to achieve fairness in text classification using a pre-specified list of counterfactual tokens.
+
+# 3 SENSR TRAINS INDIVIDUALLY FAIR ML MODELS
+
+One of the main benefits of our approach is it provably trains individually fair ML models. Further, it is possible for the learner to certify that an ML model is individually fair a posteriori. As we shall see, both are consequences of uniform convergence results for the DR loss class. More concretely, we study how quickly the uniform convergence error
+
+$$
+\delta_ {n} \triangleq \sup _ {\theta \in \Theta} \left\{\left| \sup _ {P: W _ {*} (P, P _ {n}) \leq \epsilon} \mathbb {E} _ {P} [ \ell (Z, \theta) ] - \sup _ {P: W (P, P _ {n}) \leq \epsilon} \mathbb {E} _ {P} [ \ell (Z, \theta) ] \right| \right\}, \tag {3.1}
+$$
+
+where $W_{*}$ is the Wasserstein distance on $\Delta(\mathcal{Z})$ with a transportation cost function $c_{*}$ that is possibly different from $c$ , vanishes. We permit some discrepancy in the (transportation) cost function to study the effect of a data-driven choice of $c$ . In the rest of this section, we regard $c_{*}$ as the exact cost function and $c$ as a cost function learned from human supervision. We start by stating our assumptions on the ML task:
+
+(A1) the feature space $\mathcal{X}$ is bounded: $D\triangleq \max \{\mathrm{diam}(\mathcal{X}),\mathrm{diam}_{*}(\mathcal{X})\} < \infty$
+(A2) the functions in the loss class $\mathcal{L} = \{\ell (\cdot ,\theta):\theta \in \Theta \}$ are non-negative and bounded: $0\leq \ell (z,\theta)\leq M$ for all $z\in \mathcal{Z}$ and $\theta \in \Theta$ , and $L$ -Lipschitz with respect to $d_{x}$ ..
+
+$$
+\sup _ {\theta \in \Theta} \left\{\sup _ {(x _ {1}, y), (x _ {2}, y) \in \mathcal {Z}} \left| \ell \left(\left(x _ {1}, y\right), \theta\right) - \ell \left(\left(x _ {2}, y\right), \theta\right) \right| \right\} \leq L d _ {x} \left(x _ {1}, x _ {2}\right);
+$$
+
+(A3) the discrepancy in the (transportation) cost function is uniformly bounded:
+
+$$
+\sup _ {(x _ {1}, y), (x _ {2}, y) \in \mathcal {Z}} | c ((x _ {1}, y), (x _ {2}, y)) - c _ {*} ((x _ {1}, y), (x _ {2}, y)) | \leq \delta_ {c} D ^ {2}.
+$$
+
+Assumptions A1 and A2 are standard (see (Lee & Raginsky, 2017, Assumption 1, 2, 3)) in the DRO literature. We emphasize that the constant $L$ in Assumption A2 is not the constant $L$ in the definition of metric fairness; it may be much larger. Thus most models that satisfy the conditions of the loss class are not individually fair in a meaningful sense.
+
+Assumption A3 deserves further comment. Under A1, A3 is mild. For example, if the exact fair metric is
+
+$$
+d _ {x} \left(x _ {1}, x _ {2}\right) = \left(x _ {1} - x _ {2}\right) ^ {T} \Sigma_ {*} \left(x _ {1} - x _ {2}\right) ^ {\frac {1}{2}},
+$$
+
+then the error in the transportation cost function is at most
+
+$$
+\begin{array}{l} \left| c \left(\left(x _ {1}, y\right), \left(x _ {2}, y\right)\right) - c _ {*} \left(\left(x _ {1}, y\right), \left(x _ {2}, y\right)\right) \right| \\ = \left| \left(x _ {1} - x _ {2}\right) ^ {T} \Sigma \left(x _ {1} - x _ {2}\right) - \left(x _ {1} - x _ {2}\right) ^ {T} \Sigma_ {*} \left(x _ {1} - x _ {2}\right) \right| \\ \leq D ^ {2} \frac {\| \Sigma - \Sigma_ {*} \| _ {2}}{\lambda_ {\min} (\Sigma_ {*})}, \\ \end{array}
+$$
+
+We see that the error in the transportation cost function vanishes in the large-sample limit as long as $\Sigma$ is a consistent estimator of $\Sigma_{*}$ .
+
+We state the uniform convergence result in terms of the entropy integral of the loss class: $\mathfrak{C}(\mathcal{L}) = \int_0^\infty \sqrt{\log N_\infty(\mathcal{F},r)} dr$ , where $N_{\infty}(\mathcal{L},r)$ as the $r$ -covering number of the loss class in the uniform metric. The entropy integral is a measure of the complexity of the loss class.
+
+Proposition 3.1 (uniform convergence). Under Assumptions A1-A3, equation 3.1 satisfies
+
+$$
+\delta_ {n} \leq \frac {4 8 \mathfrak {C} (\mathcal {L})}{\sqrt {n}} + \frac {4 8 L D ^ {2}}{\sqrt {n \epsilon}} + \frac {L \delta_ {c} D ^ {2}}{\sqrt {\epsilon}} + M \left(\frac {\log \frac {2}{t}}{2 n}\right) ^ {\frac {1}{2}} \tag {3.2}
+$$
+
+with probability at least $1 - t$ .
+
+We note that Proposition 3.1 is similar to the generalization error bounds by Lee & Raginsky (2017). The main novelty in Proposition 3.1 is allowing error in the transportation cost function. We see that the discrepancy in the transportation cost function may affect the rate at which the uniform convergence error vanishes: it affects the rate if $\delta_c$ is $\omega_P\left(\frac{1}{\sqrt{n}}\right)$ .
+
+A consequence of uniform convergence is SenSR trains individually fair classifiers (if there are such classifiers in the hypothesis class). By individually fair ML model, we mean an ML model that has a small gap
+
+$$
+\sup _ {P: W _ {*} (P, P _ {*}) \leq \epsilon} \mathbb {E} _ {P} \left[ \ell (Z, \theta) \right] - \mathbb {E} _ {P _ {*}} \left[ \ell (Z, \theta) \right], \tag {3.3}
+$$
+
+The gap is the difference between the optimal value of the auditor's optimization problem equation 2.1 and the (non-robust) risk. A small gap implies the auditor cannot significantly increase the loss by moving samples from $P_{*}$ to comparable samples.
+
+Proposition 3.2. Under the assumptions A1-A3, as long as there is $\bar{\theta} \in \Theta$ such that
+
+$$
+\sup _ {P: W _ {*} (P, P _ {*}) \leq \epsilon} \mathbb {E} _ {P} \left[ \ell (Z, \bar {\theta}) \right] \leq \delta^ {*} \tag {3.4}
+$$
+
+for some $\delta^{*} > 0$ , $\hat{\theta} \in \arg \min_{\theta \in \Theta} \sup_{P: W(P, P_n) \leq \epsilon} \mathbb{E}_P\left[\ell(Z, h)\right]$ satisfies
+
+$$
+\sup _ {P: W _ {*} (P, P _ {*}) \leq \epsilon} \mathbb {E} _ {P} \left[ \ell (Z, \hat {\theta}) \right] - \mathbb {E} _ {P _ {*}} \left[ \ell (Z, \hat {\theta}) \right] \leq \delta^ {*} + 2 \delta_ {n},
+$$
+
+where $\delta_{n}$ is the uniform convergence error equation 3.1.
+
+Proposition 3.2 guarantees Algorithm 2 trains an individually fair ML model. More precisely, if there are models in $\mathcal{H}$ that are (i) individually fair and (ii) achieve small test error, then Algorithm 2 trains such a model. It is possible to replace equation 3.4 with other conditions, but a condition to its effect cannot be dispensed with entirely. If there are no individually fair models in $\mathcal{H}$ , then it is not possible for equation 2.5 to learn an individually fair model. If there are individually fair models in $\mathcal{H}$ , but they all perform poorly, then the goal of learning an individually fair model is futile.
+
+Another consequence of uniform convergence is equation 3.3 is close to its empirical counterpart
+
+$$
+\sup _ {P: W \left(P, P _ {n}\right) \leq \epsilon} \mathbb {E} _ {P} \left[ \ell (Z, \theta) \right] - \mathbb {E} _ {P _ {n}} \left[ \ell (Z, \theta) \right]. \tag {3.5}
+$$
+
+In other words, the gap generalizes. This implies equation 3.5 is a certificate of individual fairness; i.e. it is possible for practitioners to check whether an ML model is individually fair by evaluating equation 3.5.
+
+Proposition 3.3. Under the assumptions A1-A3, for any $\epsilon >0$
+
+$$
+\begin{array}{l} \sup _ {\theta \in \Theta} \left\{\sup _ {P: W (P, P _ {n}) \leq \epsilon} \mathbb {E} _ {P} \left[ \ell (Z, \theta) \right] - \mathbb {E} _ {P _ {n}} \left[ \ell (Z, \theta) \right] - \left(\sup _ {P: W (P, P _ {*}) \leq \epsilon} \mathbb {E} _ {P} \left[ \ell (Z, \theta) \right] - \mathbb {E} _ {P _ {*}} \left[ \ell (Z, \theta) \right]\right) \right\} \\ \leq 2 \delta_ {n} w. p. a t l e a s t 1 - t. \\ \end{array}
+$$
+
+# 4 COMPUTATIONAL RESULTS
+
+In this section, we present results from using SenSR to train individually fair ML models for two tasks: sentiment analysis and income prediction. We pick these two tasks to demonstrate the efficacy of SenSR on problems with structured (income prediction) and unstructured (sentiment analysis) inputs and in which the sensitive attribute (income prediction) is observed and unobserved (sentiment analysis). We refer to Appendix C and D for the implementation details.
+
+Table 1: Sentiment prediction experiments over 10 restarts
+
+ | Acc.,% | Race gap | Gend. gap | Cuis. gap |
| SenSR | 94±1 | 0.30±.05 | 0.19±.03 | 0.23±.05 |
| SenSR-E | 93±1 | 0.11±.04 | 0.04±.03 | 1.11±.15 |
| Baseline | 95±1 | 7.01±.44 | 5.59±.37 | 4.10±.44 |
| Project | 94±1 | 1.00±.56 | 1.99±.58 | 1.70±.41 |
| Sinha+ | 94±1 | 3.88±.26 | 1.42±.29 | 1.33±.18 |
| Bolukb.+ | 94±1 | 6.85±.53 | 4.33±.46 | 3.44±.29 |
+
+
+Figure 2: Box-plots of sentiment scores
+
+# 4.1 FAIR SENTIMENT PREDICTION WITH WORD EMBEDDINGS
+
+Problem formulation We study the problem of classifying the sentiment of words using positive (e.g. 'smart') and negative (e.g. 'anxiety') words compiled by Hu & Liu (2004). We embed words using 300-dimensional GloVe (Pennington et al., 2014) and train a one layer neural network with 1000 hidden units. Such classifier achieves $95\%$ test accuracy, however it entails major individual fairness violation. Consider an application of this sentiment classifier to summarizing customer reviews, tweets or news articles. Human names are typical in such texts and should not affect the sentiment score, hence we consider fair metric between any pair of names to be 0. Then sentiment score for all names should be the same to satisfy the individual fairness. To make a connection to group fairness, following the study of Caliskan et al. (2017) that reveals the biases in word embeddings, we evaluate the fairness of our sentiment classifier using male and female names typical for Caucasian and African-American ethnic groups. We emphasize that to satisfy individual fairness, the sentiment of any name should be the same.
+
+Comparison metrics To evaluate the gap between two groups of names, $\mathcal{N}_0$ for Caucasian (or female) and $\mathcal{N}_1$ for African-American (or male), we report $\frac{1}{|\mathcal{N}_0|}\sum_{n\in \mathcal{N}_0}(h(n)_1 - h(n)_0) - \frac{1}{|\mathcal{N}_1|}\sum_{n\in \mathcal{N}_1}(h(n)_1 - h(n)_0)$ , where $h(n)_k$ is logits for class $k$ of name $n$ ( $k = 1$ is the positive class). We use list of names provided in Caliskan et al. (2017), which consists of 49 Caucasian and 45 African-American names, among those 48 are female and 46 are male. The gap between African-American and Caucasian names is reported as Race gap, while the gap between male and female names is reported as Gend. gap in Table 1. As in Speer (2017), we also compare sentiment difference of two sentences: "Let's go get Italian food" and "Let's go get Mexican food", i.e. cuisine gap (abbreviated Cuis. gap in Table 1), as a test of generalization beyond names. To embed these sentences we average their word embeddings.
+
+Sensitive subspace We consider embeddings of 94 names that we use for evaluation as sensitive directions, which may be regarded as utilizing the expert knowledge, i.e. these names form a list of words that an expert believes should be treated equally. Fair metric is then defined using an orthogonal complement projector of the span of sensitive directions as we discussed in Section 2.1. When expert knowledge is not available, or we wish to achieve general fairness for names, we utilize a side dataset of popular baby names in New York City. The dataset has 11k names, however only 32 overlap with the list of names used for evaluation. Embeddings of these names define a group of comparable samples that we use to learn sensitive directions with SVD (see Appendix B.2 and Algorithm 3 for details). We take top 50 singular vectors to form the sensitive subspace. It is worth noting that, unlike many existing approaches in the fairness literature, we do not use any protected attribute information. Our algorithm only utilizes training words, their sentiments and a vanilla list of names.
+
+Results From the box-plots in Figure 2, we see that both race and gender gaps are significant when using the baseline neural network classifier. It tends to predict Caucasian names as "positive", while the median for African-American names is negative; the median sentiment for female names is higher than that for male names. We considered three other approaches to this problem: the algorithm of Bolukbasi et al. (2016) for pre-processing word embeddings; pre-processing via projecting
+
+Table 2: Summary of Adult classification experiments over 10 restarts
+
+ | B-Acc,% | S-Con. | GR-Con. | GapRMSG | GapRRMS | GapmaxG | GapmaxR |
| SenSR | 78.9 | .934 | .984 | .068 | .055 | .087 | .067 |
| Baseline | 82.9 | .848 | .865 | .179 | .089 | .216 | .105 |
| Project | 82.7 | .868 | 1.00 | .145 | .064 | .192 | .086 |
| Adv. Debias. | 81.5 | .807 | .841 | .082 | .070 | .110 | .078 |
| CoCL | 79.0 | - | - | .163 | .080 | .201 | .109 |
+
+out the sensitive subspace that we used for training SenSR (this is analogous to Prost et al. (2019)); training a distributionally robust classifier with Euclidean distance cost (Sinha et al., 2017). All approaches improved upon the baseline, however only SenSR can be considered individually fair. Our algorithm practically eliminates gender and racial gaps and achieves the notion of individual fairness as can be seen from almost equal predicted sentiment score for all names. We remark that using expert knowledge (i.e. evaluation names) allowed SenSR-E (E for expert) to further improve both group and individual fairness. However we warn practitioners that if the expert knowledge is too specific, generalization outside of the expert knowledge may not be very good. In Table 1 we report results averaged across 10 repetitions with $90\% / 10\%$ train/test splits, where we also verify that accuracy trade-off with the baseline is minor. In the right column we present the generalization check, i.e. comparing a pair of sentences unrelated to names. Utilizing expert knowledge led to a fairness over-fitting effect, however we still see improvement over other methods. When utilizing SVD of a larger dataset of names we observe better generalization. Our generalization check suggests that fairness over-fitting is possible, therefore datasets and procedure for verifying fairness generalization are needed.
+
+# 4.2 ADULT
+
+Problem formulation Demonstrating the broad applicability of SenSR outside of natural language processing tasks, we apply SenSR to a classification task on the Adult (Dua & Graff, 2017) data set to predict whether an individual makes at least \(50k based on features like gender and occupation for approximately 45,000 individuals. Models that predict income without fairness considerations can contribute to the problem of differences in pay between genders or races for the same work. Throughout this section, gender (male or female) and race (Caucasian or non-Caucasian) are binary.
+
+Comparison metrics Arguably a classifier is individually unfair if the classifications for two data points that are the same on all features except demographic features are different. Therefore, to assess individual fairness, we report spouse consistency (S-Con.) and gender and race consistency (GR-Con.), which are measures of how often classifications change only because of differences in demographic features. For S-Con (resp. GR-con), we make 2 (resp. 4) copies of every data point where the only difference is that one is a husband and the other is a wife (resp. difference is in gender and race). S-Con (resp. GR-Con) is the fraction of corresponding pairs (resp. quadruples) that have the same classification. We also report various group fairness measures proposed by De-Arteaga et al. (2019) with respect to race or gender based on true positive rates, i.e. the ability of a classifier to correctly identify a given class. See Appendix D.5 for the definitions. We report $\mathrm{Gap}_R^{\mathrm{RMS}}$ , $\mathrm{Gap}_G^{\mathrm{RMS}}$ , $\mathrm{Gap}_R^{\mathrm{max}}$ , and $\mathrm{Gap}_G^{\mathrm{max}}$ where $R$ refers to race, and $G$ refers to gender. We use balanced accuracy (B-acc) instead of accuracy² to measure predictive ability since only 25% of individuals make at least $50k.
+
+Sensitive subspace Let $\{(x_i, x_{g_i})\}_{i=1}^m$ be the set of features $x_i \in \mathbb{R}^D$ of the data except the coordinate for gender is zeroed and where $x_{g_i}$ indicates the gender of individual $i$ . For $\gamma > 0$ , let $w_g = \arg \min_{w \in \mathbb{R}^D} \frac{1}{m} \sum_{i=1}^m -x_{g_i}(w^T x_i) + \log(1 + e^{w^T x_i}) + \gamma \| w \|_2$ , i.e. $w_g$ is the learned hyperplane that classifies gender given by regularized logistic regression. Let $e_g \in \mathbb{R}^D$ (resp. $e_r$ ) be the vector that is 1 in the gender (resp. race) coordinate and 0 elsewhere. Then the sensitive subspace is the span of $[w_g, e_g, e_r]$ . See Appendix B.1 for details.
+
+Results See Table 2 for the average $^3$ of each metric on the test sets over ten $80\% / 20\%$ train/test splits for Baseline, Project (projecting features onto the orthogonal complement of the sensitive subspace before training), CoCL (De-Arteaga et al., 2019), Adversarial Debiasing (Zhang et al., 2018), and SenSR. With the exception of CoCL (De-Arteaga et al., 2019), each classifier is a 100 unit single hidden layer neural network. The Baseline clearly exhibits individual and group fairness violations. While SenSR has the lowest B-acc, SenSR is the best by a large margin for S-Con and has the best group fairness measures. We expect SenSR to do well on GR-consistency since the sensitive subspace includes the race and gender directions. However, SenSR's individually fair performance generalizes: the sensitive directions do not directly use the husband and wife directions, yet SenSR performs well on S-Con. Furthermore, SenSR outperforms Project on S-Con and group fairness measures illustrating that SenSR does much more than just ignoring the sensitive subspace. CoCL only barely improves group fairness compared to the baseline with a significant drop in B-acc and while Adversarial Debiasing also improves group fairness, it is worse than the baseline on individual fairness measures illustrating that group fairness does not imply individual fairness.
+
+# 5 SUMMARY
+
+We consider the task of training ML systems that are fair in the sense that their performance is invariant under certain perturbations in a sensitive subspace. This notion of fairness is a variant of individual fairness (Dwork et al., 2011). One of the main barriers to the adoption of individual fairness is the lack of consensus on a fair metric for many ML tasks. To circumvent this issue, we consider two approaches to learning a fair metric from data: one for problems in which the sensitive attribute is observed, and another for problems in which the sensitive attribute is unobserved. Given a data-driven choice of fair metric, we provide an algorithm that provably trains individually fair ML models.
+
+# ACKNOWLEDGMENTS
+
+This work was supported by the National Science Foundation under grants DMS-1830247 and DMS-1916271.
+
+# REFERENCES
+
+Solon Barocas and Andrew D. Selbst. Big Data's Disparate Impact. SSRN Electronic Journal, 2016. ISSN 1556-5068. doi: 10.2139/ssrn.2477899.
+Rachel K. E. Bellamy, Kuntal Dey, Michael Hind, Samuel C. Hoffman, Stephanie Houde, Kalapriya Kannan, Pranay Lohia, Jacquelyn Martino, Sameep Mehta, Aleksandra Mojsilovic, Seema Nagar, Karthikeyan Natesan Ramamurthy, John Richards, Diptikalyan Saha, Prasanna Sattigeri, Moninder Singh, Kush R. Varshney, and Yunfeng Zhang. AI Fairness 360: An extensible toolkit for detecting, understanding, and mitigating unwanted algorithmic bias, October 2018. URL https://arxiv.org/abs/1810.01943.
+Aharon Ben-Tal, Dick den Hertog, Anja De Waegenaere, Bertrand Melenberg, and Gijs Rennen. Robust Solutions of Optimization Problems Affected by Uncertain Probabilities. Management Science, 59(2):341-357, November 2012. ISSN 0025-1909. doi: 10.1287/mnsc.1120.1641.
+Marianne Bertrand and Sendhil Mullainathan. Are Emily and Greg More Employable Than Lakisha and Jamal? A Field Experiment on Labor Market Discrimination. American Economic Review, 94(4):991-1013, September 2004. ISSN 0002-8282. doi: 10.1257/0002828042002561.
+Jose Blanchet and Karthyek R. A. Murthy. Quantifying Distributional Model Risk via Optimal Transport. arXiv:1604.01446 [math, stat], April 2016.
+Jose Blanchet, Yang Kang, and Karthyek Murthy. Robust Wasserstein Profile Inference and Applications to Machine Learning. arXiv:1610.05627 [math, stat], October 2016.
+
+Tolga Bolukbasi, Kai-Wei Chang, James Y Zou, Venkatesh Saligrama, and Adam T Kalai. Man is to computer programmer as woman is to homemaker? debiasing word embeddings. In Advances in neural information processing systems, pp. 4349-4357, 2016.
+Aylin Caliskan, Joanna J. Bryson, and Arvind Narayanan. Semantics derived automatically from language corpora contain human-like biases. Science, 356(6334):183-186, April 2017. ISSN 0036-8075, 1095-9203. doi: 10.1126/science.aal4230.
+Nicholas Carlini and David Wagner. Towards Evaluating the Robustness of Neural Networks. arXiv:1608.04644 [cs], August 2016.
+Xin Chen, Melvyn Sim, and Peng Sun. A Robust Optimization Perspective on Stochastic Programming. Operations Research, 55:1058-1071, 2007. doi: 10.1287/opre.1070.0441.
+Alexandra Chouldechova. Fair prediction with disparate impact: A study of bias in recidivism prediction instruments. arXiv:1703.00056 [cs, stat], February 2017.
+Maria De-Arteaga, Alexey Romanov, Hanna Wallach, Jennifer Chayes, Christian Borgs, Alexandra Chouldechova, Sahin Geyik, Krishnaram Kenthapadi, and Adam Tauman Kalai. Bias in bios: A case study of semantic representation bias in a high-stakes setting. arXiv preprint arXiv:1901.09451, 2019.
+Erick Delage and Yinyu Ye. Distributionally Robust Optimization Under Moment Uncertainty with Application to Data-Driven Problems. Operations Research, 58:595-612, 2010. doi: 10.1287/opre.1090.0741.
+Dheeru Dua and Casey Graff. UCI machine learning repository, 2017. URL http://archive.ics.uci.edu/ml.
+Cynthia Dwork, Moritz Hardt, Toniann Pitassi, Omer Reingold, and Rich Zemel. Fairness Through Awareness. arXiv:1104.3913 [cs], April 2011.
+Harrison Edwards and Amos Storkey. Censoring Representations with an Adversary. arXiv:1511.05897 [cs, stat], November 2015.
+Peyman Mohajerin Esfahani and Daniel Kuhn. Data-driven Distributionally Robust Optimization Using the Wasserstein Metric: Performance Guarantees and Tractable Reformulations. May 2015.
+Sahaj Garg, Vincent Perot, Nicole Limtiaco, Ankur Taly, Ed H Chi, and Alex Beutel. Counterfactual fairness in text classification through robustness. In Proceedings of the 2019 AAAI/ACM Conference on AI, Ethics, and Society, pp. 219-226. ACM, 2019.
+Joel Goh and Melvyn Sim. Distributionally Robust Optimization and Its Tractable Approximations. Operations Research, 58(4-part-1):902-917, August 2010. ISSN 0030-364X, 1526-5463. doi: 10.1287/opre.1090.0795.
+Ian J. Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and Harnessing Adversarial Examples. December 2014.
+Tatsunori B. Hashimoto, Megha Srivastava, Hongseok Namkoong, and Percy Liang. Fairness Without Demographics in Repeated Loss Minimization. arXiv:1806.08010 [cs, stat], June 2018.
+Minqing Hu and Bing Liu. Mining and summarizing customer reviews. In Proceedings of the tenth ACM SIGKDD international conference on Knowledge discovery and data mining, pp. 168-177. ACM, 2004.
+Christina Ilvento. Metric Learning for Individual Fairness. arXiv:1906.00250 [cs, stat], June 2019.
+Harini Kannan, Alexey Kurakin, and Ian Goodfellow. Adversarial logit pairing. arXiv preprint arXiv:1803.06373, 2018.
+Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
+
+Jon Kleinberg, Sendhil Mullainathan, and Manish Raghavan. Inherent Trade-Offs in the Fair Determination of Risk Scores. arXiv:1609.05807 [cs, stat], September 2016.
+Alexey Kurakin, Ian Goodfellow, and Samy Bengio. Adversarial Machine Learning at Scale. November 2016.
+H. Lam and Enlu Zhou. Quantifying uncertainty in sample average approximation. In 2015 Winter Simulation Conference (WSC), pp. 3846-3857, December 2015. doi: 10.1109/WSC.2015.7408541.
+Jaeho Lee and Maxim Raginsky. Minimax Statistical Learning with Wasserstein Distances. arXiv:1705.07815 [cs], May 2017.
+David Madras, Elliot Creager, Toniann Pitassi, and Richard Zemel. Learning Adversarially Fair and Transferable Representations. arXiv:1802.06309 [cs, stat], February 2018.
+Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards Deep Learning Models Resistant to Adversarial Attacks. arXiv:1706.06083 [cs, stat], June 2017.
+Cade Metz and Adam Satariano. An Algorithm That Grants Freedom, or Takes It Away. The New York Times, February 2020. ISSN 0362-4331.
+Takeru Miyato, Shin-ichi Maeda, Masanori Koyama, Ken Nakae, and Shin Ishii. Distributional Smoothing with Virtual Adversarial Training. arXiv:1507.00677 [cs, stat], July 2015.
+Hongseok Namkoong and John C. Duchi. Stochastic Gradient Methods for Distributionally Robust Optimization with F-divergences. In Proceedings of the 30th International Conference on Neural Information Processing Systems, NIPS'16, pp. 2216-2224, Barcelona, Spain, 2016. Curran Associates Inc. ISBN 978-1-5108-3881-9.
+Nicolas Papernot, Patrick McDaniel, Somesh Jha, Matt Fredrikson, Z. Berkay Celik, and Ananthram Swami. The Limitations of Deep Learning in Adversarial Settings. November 2015.
+Jeffrey Pennington, Richard Socher, and Christopher Manning. Glove: Global vectors for word representation. In Proceedings of the 2014 conference on empirical methods in natural language processing (EMNLP), pp. 1532-1543, 2014.
+Flavien Prost, Nithum Thain, and Tolga Bolukbasi. Debiasing embeddings for reduced gender bias in text classification. arXiv preprint arXiv:1908.02810, 2019.
+Ya'acov Ritov, Yuekai Sun, and Ruofei Zhao. On conditional parity as a notion of nondiscrimination in machine learning. arXiv:1706.08519 [cs, stat], June 2017.
+Soroosh Shafieezadeh-Abadeh, Peyman Mohajerin Esfahani, and Daniel Kuhn. Distributionally Robust Logistic Regression. September 2015.
+Aman Sinha, Hongseok Namkoong, and John Duchi. Certifying Some Distributional Robustness with Principled Adversarial Training. arXiv:1710.10571 [cs, stat], October 2017.
+Robyn Speer. How to make a racist ai without really trying, 2017.
+Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, and Rob Fergus. Intriguing properties of neural networks. December 2013.
+Hanchen Wang, Nina Grgic-Hlaca, Preethi Lahoti, Krishna P. Gummadi, and Adrian Weller. An Empirical Study on Learning Fairness Metrics for COMPAS Data with Human Supervision. arXiv:1910.10255 [cs], October 2019.
+Brian Hu Zhang, Blake Lemoine, and Margaret Mitchell. Mitigating Unwanted Biases with Adversarial Learning. arXiv:1801.07593 [cs], January 2018.
+
+# A PROOFS
+
+# A.1 PROOF OF PROPOSITION 3.1
+
+By the duality result of Blanchet & Murthy (2016), for any $\epsilon > 0$ ,
+
+$$
+\begin{array}{l} \sup _ {P: W _ {*} (P, P _ {*}) \leq \epsilon} \mathbb {E} _ {P} [ \ell (Z, \theta) ] - \sup _ {P: W (P, P _ {n}) \leq \epsilon} \mathbb {E} _ {P} [ \ell (Z, \theta) ] \\ = \inf _ {\lambda \geq 0} \left\{\lambda \epsilon + \mathbb {E} _ {P _ {*}} \left[ \ell_ {\lambda} ^ {c _ {*}} (Z, \theta) \right] \right\} - \lambda_ {n} \epsilon + \mathbb {E} _ {P _ {n}} \left[ \ell_ {\lambda_ {n}} ^ {c} (Z, \theta) \right] \\ \leq \mathbb {E} _ {P _ {*}} \left[ \ell_ {\lambda_ {n}} ^ {c _ {*}} (Z, \theta) \right] - \mathbb {E} _ {P _ {n}} \left[ \ell_ {\lambda_ {n}} ^ {c} (Z, \theta) \right], \\ \end{array}
+$$
+
+where $\lambda_{n}\in \arg \min_{\lambda \geq 0}\lambda \epsilon +\mathbb{E}_{P_{n}}\big[\ell_{\lambda}^{c}(Z,\theta)\big]$ . By assumption A3,
+
+$$
+\begin{array}{l} \left| \ell_ {\lambda_ {n}} ^ {c _ {*}} (z, \theta) - \ell_ {\lambda_ {n}} ^ {c} (z, \theta) \right| \\ = \left| \sup _ {x _ {2} \in \mathcal {X}} \ell \left(\left(x _ {2}, y\right), \theta\right) - \lambda_ {n} c _ {*} \left(\left(x, y\right), \left(x _ {2}, y\right)\right) - \sup _ {x _ {2} \in \mathcal {X}} \ell \left(\left(x _ {2}, y\right), \theta\right) - \lambda_ {n} c \left(\left(x, y\right), \left(x _ {2}, y\right)\right) \right| \\ \leq \sup _ {x _ {2} \in \mathcal {X}} \lambda_ {n} | c _ {*} ((x, y), (x _ {2}, y)) - c ((x, y), (x _ {2}, y)) | \\ \leq \lambda_ {n} \delta_ {c} \cdot D ^ {2}. \\ \end{array}
+$$
+
+This implies
+
+$$
+\begin{array}{l} \sup _ {P: W _ {*} (P, P _ {*}) \leq \epsilon} \mathbb {E} _ {P} [ \ell (Z, \theta) ] - \sup _ {P: W (P, P _ {n}) \leq \epsilon} \mathbb {E} _ {P} [ \ell (Z, \theta) ] \\ \leq \mathbb {E} _ {P _ {*}} \left[ \ell_ {\lambda_ {n}} ^ {c _ {*}} (Z, \theta) \right] - \mathbb {E} _ {P _ {n}} \left[ \ell_ {\lambda_ {n}} ^ {c _ {*}} (Z, \theta) \right] + \lambda_ {n} \delta_ {c} D ^ {2}. \\ \end{array}
+$$
+
+This bound is crude; it is possible to obtain sharper bounds under additional assumptions on the loss and transportation cost functions. We avoid this here to keep the result as general as possible.
+
+Similarly,
+
+$$
+\begin{array}{l} \sup _ {P: W (P, P _ {n}) \leq \epsilon} \mathbb {E} _ {P} [ \ell (Z, \theta) ] - \sup _ {P: W _ {*} (P, P _ {*}) \leq \epsilon} \mathbb {E} _ {P} [ \ell (Z, \theta) ] \\ \leq \mathbb {E} _ {P _ {n}} \left[ \ell_ {\lambda_ {*}} ^ {c} (Z, \theta) \right] - \mathbb {E} _ {P _ {*}} \left[ \ell_ {\lambda_ {*}} ^ {c *} (Z, \theta) \right] \\ \leq \mathbb {E} _ {P _ {n}} \left[ \ell_ {\lambda_ {*}} ^ {c _ {*}} (Z, \theta) \right] - \mathbb {E} _ {P _ {*}} \left[ \ell_ {\lambda_ {*}} ^ {c _ {*}} (Z, \theta) \right] + \lambda_ {*} \delta_ {c} D ^ {2}, \\ \end{array}
+$$
+
+where $\lambda_{*}\in \arg \min_{\lambda \geq 0}\{\lambda \epsilon +\mathbb{E}_{P_{*}}\left[\ell_{\lambda}^{c_{*}}(Z,\theta)\right]\}$
+
+Lemma A.1 (Lee & Raginsky (2017)). Let $\tilde{\lambda} \in \arg \min_{\lambda \geq 0} \lambda \epsilon + \mathbb{E}_P[\ell_\lambda^c(Z, \theta)]$ . As long as the function in the loss class are $L$ -Lipschitz with respect to $d_x$ (see Assumption A2), $\tilde{\lambda} \leq \frac{L}{\sqrt{\epsilon}}$ .
+
+Proof. By the optimality of $\tilde{\lambda}$
+
+$$
+\begin{array}{l} \tilde {\lambda} \epsilon \leq \tilde {\lambda} \epsilon + \mathbb {E} _ {P} \left[ \sup _ {x _ {2} \in \mathcal {X}} \ell \left(\left(x _ {2}, Y\right), \theta\right) - \tilde {\lambda} d _ {x} (X, x _ {2}) ^ {2} - \ell \left(\left(X, Y\right), \theta\right) \right] \\ = \tilde {\lambda} \epsilon + \mathbb {E} _ {P} \left[ \ell_ {\tilde {\lambda}} ^ {c} (Z, \theta) - \ell (Z, \theta) \right] \\ \leq \lambda \epsilon + \mathbb {E} _ {P} \left[ \ell_ {\lambda} ^ {c} (Z, \theta) - \ell (Z, \theta) \right] \\ = \lambda \epsilon + \mathbb {E} _ {P} \left[ \sup _ {x _ {2} \in \mathcal {X}} \ell ((x _ {2}, Y), \theta) - \ell ((X, Y), \theta) - \lambda d _ {x} (X, x _ {2}) ^ {2} \right] \\ \end{array}
+$$
+
+for any $\lambda \geq 0$ . By Assumption A2, the right side is at most
+
+$$
+\begin{array}{l} \tilde {\lambda} \epsilon \leq \lambda \epsilon + \mathbb {E} _ {P} \left[ \sup _ {x _ {2} \in \mathcal {X}} L d _ {x} (X, x _ {2}) - \lambda d _ {x} (X, x _ {2}) ^ {2} \right] \\ \leq \lambda \epsilon +\sup_{t\geq 0}Lt - \lambda t^{2} \\ \end{array}
+$$
+
+We minimize the right side WRT $t$ (set $t = \frac{L}{2\lambda}$ ) and $\lambda$ (set $\lambda = \frac{L}{2\sqrt{\epsilon}}$ ) to obtain $\tilde{\lambda}\epsilon \leq L\sqrt{\epsilon}$ .
+
+By Lemma A.1, we have
+
+$$
+\sup _ {P: W _ {*} (P, P _ {*}) \leq \epsilon} \mathbb {E} _ {P} \left[ \ell (Z, \theta) \right] - \sup _ {P: W (P, P _ {n}) \leq \epsilon} \mathbb {E} _ {P} \left[ \ell (Z, \theta) \right] \leq \mathbb {E} _ {P _ {*}} \left[ \ell_ {\lambda_ {n}} ^ {c _ {*}} (Z, \theta) \right] - \mathbb {E} _ {P _ {n}} \left[ \ell_ {\lambda_ {n}} ^ {c _ {*}} (Z, \theta) \right] + \frac {L \delta_ {c} D ^ {2}}{\sqrt {\epsilon}}
+$$
+
+$$
+\sup _ {P: W (P, P _ {n}) \leq \epsilon} \mathbb {E} _ {P} \left[ \ell (Z, \theta) \right] - \sup _ {P: W _ {*} (P, P _ {*}) \leq \epsilon} \mathbb {E} _ {P} \left[ \ell (Z, \theta) \right] \leq \mathbb {E} _ {P _ {n}} \left[ \ell_ {\lambda_ {*}} ^ {c _ {*}} (Z, \theta) \right] - \mathbb {E} _ {P _ {*}} \left[ \ell_ {\lambda_ {*}} ^ {c _ {*}} (Z, \theta) \right] + \frac {L \delta_ {c} D ^ {2}}{\sqrt {\epsilon}}.
+$$
+
+We combine the preceding bounds to obtain
+
+$$
+\begin{array}{l} \left| \sup _ {P: W (P, P _ {n}) \leq \epsilon} \mathbb {E} _ {P} [ \ell (Z, \theta) ] - \sup _ {P: W _ {*} (P, P _ {*}) \leq \epsilon} \mathbb {E} _ {P} [ \ell (Z, \theta) ] \right| \\ \leq \sup _ {f \in \mathcal {L} ^ {c _ {*}}} \left| \int_ {\mathcal {Z}} f (z) d (P _ {n} - P _ {*}) (z) \right| + \frac {L \delta_ {c} D ^ {2}}{\sqrt {\epsilon}}, \\ \end{array}
+$$
+
+where $\mathcal{L}^{c_{*}} = \{\ell_{\lambda}^{c_{*}}(\cdot ,\theta):\lambda \in [0,\frac{L}{\sqrt{\epsilon}} ],\theta \in \Theta \}$ is the DR loss class. In the rest of the proof, we bound $\sup_{f\in \mathcal{L}^{c_*}}\Big|\int_{\mathcal{Z}}f(z)d(P_+ - P_n)(z)\Big|$ with standard techniques from statistical learning theory. Assumption A2 implies the functions in $\mathcal{F}$ are bounded:
+
+$$
+0 \leq \ell ((x _ {1}, y _ {1}), \theta) - \overbrace {\lambda d _ {e} (x _ {1} , x _ {1})} ^ {} \leq \ell_ {\lambda} ^ {c} (z _ {1}, \theta) \leq \sup _ {x _ {2} \in \mathcal {X}} \ell ((x _ {2}, y _ {1}), \theta) \leq M.
+$$
+
+This implies has bounded differences, so $\delta_{n}$ concentrates sharply around its expectation. By the bounded-differences inequality and a symmetrization argument,
+
+$$
+\sup _ {f \in \mathcal {L} ^ {c _ {*}}} \left| \int_ {\mathcal {Z}} f (z) d \left(P _ {n} - P _ {*}\right) (z) \right| \leq 2 \Re_ {n} \left(\mathcal {L} ^ {c _ {*}}\right) + M \left(\frac {\log \frac {2}{t}}{2 n}\right) ^ {\frac {1}{2}}
+$$
+
+WP at least $1 - t$ , where $\Re_n(\mathcal{F})$ is the Rademacher complexity of $\mathcal{F}$ :
+
+$$
+\mathfrak {R} _ {n} (\mathcal {F}) = \mathbb {E} \left[ \sup _ {f \in \mathcal {F}} \frac {1}{n} \sum_ {i = 1} ^ {n} \sigma_ {i} f (Z _ {i}) \right].
+$$
+
+Lemma A.2. The Rademacher complexity of the DR loss class is at most
+
+$$
+\mathfrak {R} _ {n} (\mathcal {L} ^ {c}) \leq \frac {2 4 \mathfrak {C} (\mathcal {L})}{\sqrt {n}} + \frac {2 4 L D ^ {2}}{\sqrt {n \epsilon}}.
+$$
+
+Proof. To study the Rademacher complexity of $\mathcal{L}^c$ , we first show that the $\mathcal{L}^c$ -indexed Rademacher process $X_{f}\triangleq \frac{1}{n}\sum_{i = 1}^{n}\sigma_{i}f(Z_{i})$ is sub-Gaussian WRT to a pseudometric. Let $f_{1} = \ell_{\lambda_{1}}^{c}(\cdot ,\theta_{1})$ and $f_{2} = \ell_{\lambda_{2}}^{c}(\cdot ,\theta_{2})$ . Define
+
+$$
+d _ {\mathcal {L} ^ {c}} (f _ {1}, f _ {2}) \triangleq | | \ell (\cdot , \theta_ {1}) - \ell (\cdot , \theta_ {2}) | | _ {\infty} + D ^ {2} | \lambda_ {1} - \lambda_ {2} |.
+$$
+
+We check that $X_{f}$ is sub-Gaussian WRT $d_{\mathcal{L}^c}$ :
+
+$$
+\begin{array}{l} \mathbb {E} \left[ \exp \left(t \left(X _ {f _ {1}} - X _ {f _ {2}}\right)\right) \right] \\ = \mathbb {E} \left[ \exp \left(\frac {t}{n} \sum_ {i = 1} ^ {n} \sigma_ {i} \left(\ell_ {\lambda_ {1}} ^ {c} \left(Z _ {i}, \theta_ {1}\right) - \ell_ {\lambda_ {2}} ^ {c} \left(Z _ {i}, \theta_ {2}\right)\right)\right) \right] \\ = \mathbb {E} \left[ \exp \left(\frac {t}{n} \sigma \left(\ell_ {\lambda_ {1}} ^ {c} (Z, \theta_ {1}) - \ell_ {\lambda_ {2}} ^ {c} (Z, \theta_ {2})\right)\right) \right] ^ {n} \\ = \mathbb {E} \left[ \exp \left(\frac {t}{n} \sigma (\sup _ {x _ {1} \in \mathcal {X}} \inf _ {x _ {2} \in \mathcal {X}} \ell ((x _ {1}, Y), \theta_ {1}) - \lambda_ {1} d _ {x} (x _ {1}, X) ^ {2} - \ell ((x _ {2}, Y), \theta_ {2}) + \lambda_ {2} d _ {x} (X, x _ {2}) ^ {2}))\right) \right] ^ {n} \\ = \mathbb {E} \left[ \exp \left(\frac {t}{n} \sigma (\sup _ {x _ {1} \in \mathcal {X}} \ell ((x _ {1}, Y), \theta_ {1}) - \ell ((x _ {1}, Y), \theta_ {2}) + (\lambda_ {2} - \lambda_ {1}) d _ {x} (x _ {1}, X) ^ {2}))\right) \right] ^ {n} \\ \leq \exp \left(\frac {1}{2} t ^ {2} d _ {\mathcal {L} ^ {c}} \left(f _ {1}, f _ {2}\right)\right). \\ \end{array}
+$$
+
+Let $N(\mathcal{L}^c,d_{\mathcal{L}^c},\epsilon)$ be the $\epsilon$ -covering number of $(\mathcal{L}^c,d_{\mathcal{L}^c})$ . We observe
+
+$$
+N \left(\mathcal {L} ^ {c}, d _ {\mathcal {L} ^ {c}}, \epsilon\right) \leq N \left(\mathcal {L}, \| \cdot \| _ {\infty}, \frac {\epsilon}{2}\right) \cdot N \left(\left[ 0, \frac {L}{\sqrt {\epsilon}} \right], | \cdot |, \frac {\epsilon}{2 D ^ {2}}\right) \tag {A.1}
+$$
+
+By Dudley's entropy integral,
+
+$$
+\begin{array}{l} \Re_ {n} (\mathcal {L} ^ {c}) \leq \frac {1 2}{\sqrt {n}} \int_ {0} ^ {\infty} \log N (\mathcal {L} ^ {c}, d _ {\mathcal {L} ^ {c}}, \epsilon) ^ {\frac {1}{2}} d \epsilon \\ \leq \frac {1 2}{\sqrt {n}} \int_ {0} ^ {\infty} \left(\log N (\mathcal {L}, \| \cdot \| _ {\infty}, \frac {\epsilon}{2}) + N \left([ 0, \frac {L}{\sqrt {\epsilon}} ], | \cdot |, \frac {\epsilon}{2 D ^ {2}}\right)\right) ^ {\frac {1}{2}} d \epsilon \\ \leq \frac {1 2}{\sqrt {n}} \left(\int_ {0} ^ {\infty} \log N (\mathcal {L}, \| \cdot \| _ {\infty}, \frac {\epsilon}{2}) ^ {\frac {1}{2}} d \epsilon + \int_ {0} ^ {\infty} N \left([ 0, \frac {L}{\sqrt {\epsilon}} ], | \cdot |, \frac {\epsilon}{2 D ^ {2}}\right) ^ {\frac {1}{2}} d \epsilon\right) \\ \leq \frac {2 4 \mathfrak {C} (\mathcal {L})}{\sqrt {n}} + \frac {2 4 L D ^ {2}}{\sqrt {n \epsilon}} \int_ {0} ^ {\frac {1}{2}} \log \left(\frac {1}{\epsilon}\right) d \epsilon \\ \end{array}
+$$
+
+where we recalled equation A.1 in the second step. We evaluate the integral on the right side to arrive at the stated bound: $\int_0^{\frac{1}{2}}\log (\frac{1}{\epsilon})d\epsilon < 1$
+
+By Lemma A.2,
+
+$$
+\sup _ {f \in \mathcal {L} ^ {c _ {*}}} \left| \int_ {\mathcal {Z}} f (z) d (P _ {n} - P _ {*}) (z) \right| \leq \frac {4 8 \mathfrak {C} (\mathcal {L})}{\sqrt {n}} + \frac {4 8 L D ^ {2}}{\sqrt {n \epsilon}} + M (\frac {\log \frac {2}{t}}{2 n}) ^ {\frac {1}{2}},
+$$
+
+which implies
+
+$$
+\begin{array}{l} \left| \sup _ {P: W (P, P _ {n}) \leq \epsilon} \mathbb {E} _ {P} [ \ell (Z, \theta) ] - \sup _ {P: W _ {*} (P, P _ {*}) \leq \epsilon} \mathbb {E} _ {P} [ \ell (Z, \theta) ] \right| \\ \leq \frac {4 8 \mathfrak {C} (\mathcal {L})}{\sqrt {n}} + \frac {4 8 L D ^ {2}}{\sqrt {n \epsilon}} + \frac {L \delta_ {c} D ^ {2}}{\sqrt {\epsilon}} + M (\frac {\log \frac {2}{t}}{2 n}) ^ {\frac {1}{2}}. \\ \end{array}
+$$
+
+WP at least $1 - t$
+
+# A.2 PROOFS OF PROPOSITIONS 3.2 AND 3.3
+
+Proof of Proposition 3.2. It is enough to show
+
+$$
+\sup _ {P: W _ {*} (P, P _ {*}) \leq \epsilon} \mathbb {E} _ {P} \left[ \ell (Z, \hat {\theta}) \right] \leq \delta^ {*} + 2 \delta_ {n}
+$$
+
+because the loss function is non-negative. We have
+
+$$
+\begin{array}{l} \sup _ {P: W _ {*} (P, P _ {*}) \leq \epsilon} \mathbb {E} _ {P} \left[ \ell (Z, \hat {\theta}) \right] \leq \sup _ {P: W (P, P _ {n}) \leq \epsilon} \mathbb {E} _ {P} \left[ \ell (Z, \hat {\theta}) \right] + \delta_ {n} \\ \leq \sup _ {P: W (P, P _ {n}) \leq \epsilon} \mathbb {E} _ {P} \left[ \ell (Z, \bar {\theta}) \right] + \delta_ {n} \\ \leq \sup _ {P: W _ {*} (P, P _ {*}) \leq \epsilon} \mathbb {E} _ {P} \left[ \ell (Z, \bar {\theta}) \right] + 2 \delta_ {n} \\ \leq \delta^ {*} + 2 \delta_ {n}. \\ \end{array}
+$$
+
+Proof of Proposition 3.3.
+
+$$
+\begin{array}{l} \sup _ {P: W _ {*} (P, P _ {n}) \leq \epsilon} \left(\mathbb {E} _ {P} \left[ \ell (Z, \theta) \right] - \mathbb {E} _ {P _ {n}} \left[ \ell (Z, \theta) \right]\right) - \sup _ {P: W (P, P _ {*}) \leq \epsilon} \left(\mathbb {E} _ {P} \left[ \ell (Z, \theta) \right] - \mathbb {E} _ {P _ {*}} \left[ \ell (Z, \theta) \right]\right) \\ = \sup _ {P: W _ {*} (P, P _ {*}) \leq \epsilon} \mathbb {E} _ {P} [ \ell (Z, \theta) ] - \sup _ {P: W (P, P _ {n}) \leq \epsilon} \mathbb {E} _ {P} [ \ell (Z, \theta) ] + \mathbb {E} _ {P _ {*}} [ \ell (Z, \theta) ] - \mathbb {E} _ {P _ {n}} [ \ell (Z, \theta) ] \\ \leq \delta_ {n} + \mathbb {E} _ {P _ {*}} [ \ell (Z, \theta) ] - \mathbb {E} _ {P _ {n}} [ \ell (Z, \theta) ] \\ \end{array}
+$$
+
+The loss function is bounded, so it is possible to bound $\mathbb{E}_{P_*}\big[\ell (Z,\theta)\big] - \mathbb{E}_{P_n}\big[\ell (Z,\theta)\big]$ by standard uniform convergence results on bounded loss classes.
+
+# B DATA-DRIVEN FAIR METRICS
+
+# B.1 LEARNING THE FAIR METRIC FROM OBSERVATIONS OF THE SENSITIVE ATTRIBUTE
+
+Here we assume the sensitive attribute is discrete and is observed for a small subset of the training data. Formally, we assume this subset of the training data has the form $\{(X_i, K_i, Y_i)\}$ , where $K_i$ is the sensitive attribute of the $i$ -th subject. To learn the sensitive subspace, we fit a softmax regression model to the data
+
+$$
+\mathbb {P} (K _ {i} = l \mid X _ {i}) = \frac {\exp (a _ {l} ^ {T} X _ {i} + b _ {l})}{\sum_ {l = 1} ^ {k} \exp (a _ {l} ^ {T} X _ {i} + b _ {l})}, l = 1, \ldots , k,
+$$
+
+and take the span of $A = [a_{1} \ldots a_{k}]$ as the sensitive subspace to define the fair metric as
+
+$$
+d _ {x} \left(x _ {1}, x _ {2}\right) ^ {2} = \left(x _ {1} - x _ {2}\right) ^ {T} \left(I - P _ {\operatorname {r a n} (A)}\right) \left(x _ {1} - x _ {2}\right). \tag {B.1}
+$$
+
+This approach readily generalizes to sensitive attributes that are not discrete-valued: replace the softmax model by an appropriate generalized linear model.
+
+In many applications, the sensitive attribute is part of a user's demographic information, so it may not be available due to privacy restrictions. This does not preclude the proposed approach because the sensitive attribute is only needed to learn the fair metric and is neither needed to train the classifier nor at test time.
+
+# B.2 LEARNING THE FAIR METRIC FROM COMPARABLE SAMPLES
+
+In this section, we consider the task of learning a fair metric from supervision in a form of comparable samples. This type of supervision has been considered in the literature on debiasing learned representations. For example, method of Bolukbasi et al. (2016) for removing gender bias in word embeddings relies on sets of words whose embeddings mainly vary in a gender subspace (e.g. (king, queen)).
+
+To keep things simple, we focus on learning a generalized Mahalanobis distance
+
+$$
+d _ {x} \left(x _ {1}, x _ {2}\right) = \left(\varphi \left(x _ {1}\right) - \varphi \left(x _ {2}\right)\right) ^ {T} \widehat {\Sigma} \left(\varphi \left(x _ {1}\right) - \varphi \left(x _ {2}\right)\right) ^ {\frac {1}{2}}, \tag {B.2}
+$$
+
+where $\varphi(x): \mathcal{X} \to \mathbf{R}^d$ is a known feature map and $\widehat{\Sigma} \in \mathbf{S}_+^{d \times d}$ is a covariance matrix. Our approach is based on a factor model
+
+$$
+\varphi_ {i} = A _ {*} u _ {i} + B _ {*} v _ {i} + \epsilon_ {i},
+$$
+
+where $\varphi_{i} \in \mathbf{R}^{d}$ is the learned representation of $x_{i}$ , $u_{i} \in \mathbf{R}^{K}$ (resp. $v_{i} \in \mathbf{R}^{L}$ ) is the sensitive/irrelevant (resp. relevant) attributes of $x_{i}$ to the task at hand, and $\epsilon_{i}$ is an error term. For example, in Bolukbasi et al. (2016), the learned representations are the embeddings of words in the vocabulary, and the sensitive attribute is the gender bias of the words. The sensitive and relevant attributes are generally unobserved.
+
+Recall our goal is to obtain $\widehat{\Sigma}$ so that equation B.2 is small whenever $v_{1} \approx v_{2}$ . One possible choice of $\widehat{\Sigma}$ is the projection matrix onto the orthogonal complement of $\operatorname{ran}(A)$ , which we denote by $P_{\operatorname{ran}(A)}$ . Indeed,
+
+$$
+\begin{array}{l} d _ {x} \left(x _ {1}, x _ {2}\right) ^ {2} = \left(\varphi_ {1} - \varphi_ {2}\right) ^ {T} \left(I - P _ {\operatorname {r a n} (A)}\right) \left(\varphi_ {1} - \varphi_ {2}\right) (B.3) \\ \approx \left(v _ {1} - v _ {2}\right) ^ {T} B _ {*} ^ {T} \left(I - P _ {\operatorname {r a n} (A)}\right) B _ {*} \left(v _ {1} - v _ {2}\right), (B.4) \\ \end{array}
+$$
+
+which is small whenever $v_{1} \approx v_{2}$ . Although $\operatorname{ran}(A)$ is unknown, it is possible to estimate it from the learned representations and groups of comparable samples by factor analysis.
+
+The factor model attributes variation in the learned representations to variation in the sensitive and relevant attributes. We consider two samples comparable if their relevant attributes are similar. In other words, if $\mathcal{I} \subset [n]$ is (the indices of) a group of comparable samples, then
+
+$$
+H \Phi_ {\mathcal {I}} = H U _ {\mathcal {I}} A _ {*} ^ {T} + H V _ {\mathcal {I}} B _ {*} ^ {T} + H E _ {\mathcal {I}} \approx H U _ {\mathcal {I}} A _ {*} ^ {T} + H E _ {\mathcal {I}}, \tag {B.5}
+$$
+
+where $H = I_{|\mathcal{I}|} - \frac{1}{|\mathcal{I}|} 1_{|\mathcal{I}|} 1_{|\mathcal{I}|}^T$ is the centering or de-meaning matrix and the rows of $\Phi_{\mathcal{I}}$ (resp. $U_{\mathcal{I}}$ , $V_{\mathcal{I}}$ ) are $\varphi_i$ (resp. $u_i, v_i$ ). If this group of samples have identical relevant attributes, i.e. $V_{\mathcal{I}} = 1_{|\mathcal{I}|} v^T$ for some $v$ , then $HV_{\mathcal{I}}$ vanishes exactly. As long as $u_i$ and $\epsilon_i$ are uncorrelated (e.g. $\mathbb{E}[u_i \epsilon_i^T] = 0$ ), equation B.5 implies
+
+$$
+\mathbb {E} \big [ \Phi_ {\mathcal {I}} ^ {T} H \Phi_ {\mathcal {I}} \big ] \approx A \mathbb {E} \big [ U _ {\mathcal {I}} ^ {T} H U _ {\mathcal {I}} \big ] A ^ {T} + \mathbb {E} \big [ E _ {\mathcal {I}} ^ {T} H E _ {\mathcal {I}} \big ],
+$$
+
+This suggests estimating $\operatorname{ran}(A)$ from the learned representations and groups of comparable samples by factor analysis. We summarize our approach in Algorithm 3.
+
+Algorithm 3 estimating $\widehat{\Sigma}$ for the fair metric
+1: Input: $\{\varphi_i\}_{i=1}^n$ , comparable groups $\mathcal{I}_1, \ldots, \mathcal{I}_G$
+2: $\widehat{A}^T \in \arg \min_{W_g, A} \left\{ \frac{1}{2} \sum_{g=1}^{G} \|H_g \Phi_{\mathcal{I}_g} - W_g A^T\|_F^2 \right\}$
+3: $Q \gets \operatorname{qr}(\widehat{A})$
+4: $\widehat{\Sigma} \gets I_d - QQ^T$
+
+# C SENSR IMPLEMENTATION DETAILS
+
+This section is to accompany the implementation of the SenSR algorithm and is best understood by reading it along with the code implemented using TensorFlow. We discuss choices of learning rates and few specifics of the code. Words in italics correspond to variables in the code and following notation in parentheses defines corresponding name in Table 3, where we summarize all hyperparameter choices.
+
+Handling class imbalance Datasets we study have imbalanced classes. To handle it, on every epoch $(E)$ (i.e. number of epochs) we subsample a batch_size(B) training samples enforcing equal number of observations per class. This procedure can be understood as data augmentation.
+
+Perturbations specifics Our implementation of SenSR algorithm has two inner optimization problems — subspace perturbation and full perturbation (when $\epsilon > 0$ ). Subspace perturbation can be viewed as an initialization procedure for the attack. We implement both using Adam optimizer (Kingma & Ba, 2014) inside the computation graph for better efficiency, i.e. defining corresponding perturbation parameters as Variables and re-setting them to zeros after every epoch. This is in contrast with a more common strategy in the adversarial robustness implementations, where perturbations (i.e. attacks) are implemented using tf.trainings with respect to the input data defined as a Placeholder.
+
+Learning rates As mentioned above, in addition to regular Adam optimizer for learning the parameters we invoke two more for the inner optimization problems of SenSR. We use same learning rate of 0.001 for the parameters optimizer, however different learning rates across datasets for subspace_step(s) and full_step(f). Two other related parameters are number of steps of the inner optimizations: subspace_epoch(se) and full_epoch(fe). We observed that setting subspace perturbation learning rate too small may prevent our algorithm from reducing unfairness, however setting it big does not seem to hurt. On the other hand, learning rate for full perturbation should not be set too big as it may prevent algorithm from solving the original task. Note that full perturbation learning rate should be smaller than perturbation budget $\text{eps}(\epsilon)$ — we always use $\epsilon / 10$ . In general, malfunctioning behaviors are immediately noticeable during training and can be easily corrected, therefore we did not need to use any hyperparameter optimization tools.
+
+Table 3: SenSR hyperparameter choices in the experiments
+
+ | E | B | s | se | ε | f | fe |
| Sentiment | 4K | 1K | 0.1 | 10 | 0.1 | 0.01 | 10 |
| Adult | 12K | 1K | 10 | 50 | 10-3 | 10-4 | 40 |
+
+Table 4: Summary of Adult classification experiments over 10 restarts
+
+ | Accuracy | B-TPR | GapRMS | GapR | Gapmax | GapR |
| SenSR | .787±.003 | .789±.003 | .068±.004 | .055±.003 | .087±.005 | .067±.004 |
| Baseline | .813±.001 | .829±.001 | .179±.004 | .089±.003 | .216±.003 | .105±.003 |
| Project | .813±.001 | .827±.001 | .145±.004 | .064±.003 | .192±.004 | .086±.004 |
| Adv. Debias. | .812±.001 | .815±.002 | .082±.005 | .070±.006 | .110±.006 | .078±.005 |
| CoCL | - | .790 | .163 | .080 | .201 | .109 |
+
+# D ADDITIONAL ADULT EXPERIMENT DETAILS
+
+# D.1 PREPROCESSING
+
+The continuous features in Adult are the following: age, fnlwgt, capital-gain, capital-loss, hours-per-week, and education-num. The categorical features are the following: workclass, education, marital-status, occupation, relationship, race, sex, native-country. See Dua & Graff (2017) for a description of each feature. We remove fnlwgt and education but keep education-num, which is a integer representation of education. We do not use native-country, but use race and sex as predictive features. We treat race as binary: individuals are either White or non-White. For every categorical feature, we use one hot encoding. For every continuous feature, we standardize, i.e., subtract the mean and divide by the standard deviation. We remove anyone with missing data leaving 45,222 individuals.
+
+This data is imbalanced: $25\%$ make at least $\$ 50\mathrm{k}$ per year. Furthermore, there is demographic imbalance with respect to race and gender as well as class imbalance on the outcome when conditioning on race or gender: $86\%$ of individuals are white of which $26\%$ make at least $\$ 50\mathrm{k}$ a year; $67\%$ of individuals are male of which $31\%$ make at least $\$ 50\mathrm{k}$ a year; $11\%$ of females make at least $\$ 50\mathrm{k}$ a year; and $15\%$ of non-whites make at least $\$ 50\mathrm{k}$ a year.
+
+# D.2 FULL EXPERIMENTAL RESULTS
+
+See Tables 4 and 5 for the full experiment results. The tables report the average and the standard error for each metric on the test set for 10 train and test splits.
+
+# D.3 SENSITIVE SUBSPACE
+
+To learn the hyperplane that classifies females and males, we use our implementation of regularized logistic regression with a batch size of 5k, 5k epochs, and $.1\ell_{2}$ regularization.
+
+Table 5: Summary of individual fairness metrics in Adult classification experiments over 10 restarts
+
+ | Spouse Consistency | Gender and Race Consistency |
| SenSR | .934±.012 | .984±.000 |
| Baseline | .848±.008 | .865±.004 |
| Project | .868±.005 | 1±0 |
| Adv. Debias. | .807±.002 | .841±.012 |
+
+# D.4 HYPERPARAMETERS AND TRAINING
+
+For each model, we use the same 10 train/test splits where use $80\%$ of the data for training. Because of the class imbalance, each minibatch is sampled so that there are an equal number of training points from both the "income at least $\$50$ k class" and the "income below $\$50$ k class."
+
+# D.4.1 BASELINE, PROJECT, AND SENSR
+
+See Table 3 for the hyperparameters we used when training Baseline, Project, and SenSR (Baseline and Project use a subset). Hyperparameters are defined in Appendix C.
+
+# D.4.2 ADVESARIAL DEBIASING
+
+We used Zhang et al. (2018)'s adversarial debiasing implementation in IBM's AIF360 package (Bellamy et al., 2018) where the source code was modified so that each mini-batch is balanced with respect to the binary labels just as we did with our experiments and dropout was not used. Hyperparameters are the following: adversary loss weight $= .001$ , num epochs $= 500$ , batch size $= 1000$ , and privileged groups are defined by binary gender and binary race.
+
+# D.5 GROUP FAIR METRICS
+
+Let $\mathcal{C}$ be a set of classes, $A$ be a binary protected attribute and $Y, \hat{Y} \in \mathcal{C}$ be the true class label and the predicted class label. Then for $a \in \{0,1\}$ and $c \in \mathcal{C}$ define $\mathrm{TPR}_{a,c} = \mathbb{P}(\hat{Y} = c | A = a, Y = c)$ ; $\mathrm{Gap}_{A,c} = \mathrm{TPR}_{0,c} - \mathrm{TPR}_{1,c}$ ; $\mathrm{Gap}_A^{\mathrm{RMS}} = \sqrt{\frac{1}{|C|} \sum_{c \in C} \mathrm{Gap}_{A,c}^2}$ ; $\mathrm{Gap}_A^{\max} = \arg \max_{c \in C} |\mathrm{Gap}_{A,c}|$ ; Balanced $\mathrm{Acc} = \frac{1}{|C|} \sum_{c \in C} \mathbb{P}(\hat{Y} = c | Y = c)$ .
+
+For Adult, we report $\mathrm{Gap}_R^{\mathrm{RMS}}$ , $\mathrm{Gap}_G^{\mathrm{RMS}}$ , $\mathrm{Gap}_R^{\max}$ , and $\mathrm{Gap}_G^{\max}$ where $\mathcal{C}$ is composed of the two classes that correspond to whether someone made at least $50k, $R$ refers to race, and $G$ refers to gender.
\ No newline at end of file
diff --git a/trainingindividuallyfairmlmodelswithsensitivesubspacerobustness/images.zip b/trainingindividuallyfairmlmodelswithsensitivesubspacerobustness/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..1126100cb36cf5410d9c6893b69f47213afd8e3c
--- /dev/null
+++ b/trainingindividuallyfairmlmodelswithsensitivesubspacerobustness/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:30770ca1bd9378836de0b78a3c616c3b7d21f153207394f35e12ada01a219012
+size 750037
diff --git a/trainingindividuallyfairmlmodelswithsensitivesubspacerobustness/layout.json b/trainingindividuallyfairmlmodelswithsensitivesubspacerobustness/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..c90a92b7729bf486c9dc50551bd5d71e48751d74
--- /dev/null
+++ b/trainingindividuallyfairmlmodelswithsensitivesubspacerobustness/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:06b5d3f0398202cfe0954fa743ef38066a2c0d635776b8f893666afa9414194f
+size 694832
diff --git a/tranquilcloudsneuralnetworksforlearningtemporallycoherentfeaturesinpointclouds/d889453a-a257-482b-9304-c7b0f13e490e_content_list.json b/tranquilcloudsneuralnetworksforlearningtemporallycoherentfeaturesinpointclouds/d889453a-a257-482b-9304-c7b0f13e490e_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..a12ac42d0867d4b584e43028b2b2905604e6bc20
--- /dev/null
+++ b/tranquilcloudsneuralnetworksforlearningtemporallycoherentfeaturesinpointclouds/d889453a-a257-482b-9304-c7b0f13e490e_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:99ad73cadcb6c5fe448f65d21f0ee5d3466edeaf49a8f99616500f8f7980ab29
+size 92291
diff --git a/tranquilcloudsneuralnetworksforlearningtemporallycoherentfeaturesinpointclouds/d889453a-a257-482b-9304-c7b0f13e490e_model.json b/tranquilcloudsneuralnetworksforlearningtemporallycoherentfeaturesinpointclouds/d889453a-a257-482b-9304-c7b0f13e490e_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..e5a17fd8a71ee343b9a3c5890f1208b36ec6ac49
--- /dev/null
+++ b/tranquilcloudsneuralnetworksforlearningtemporallycoherentfeaturesinpointclouds/d889453a-a257-482b-9304-c7b0f13e490e_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ffc9d46d3aa1819626c53166993f413b3609664cb1217a098617e758ff068dec
+size 107074
diff --git a/tranquilcloudsneuralnetworksforlearningtemporallycoherentfeaturesinpointclouds/d889453a-a257-482b-9304-c7b0f13e490e_origin.pdf b/tranquilcloudsneuralnetworksforlearningtemporallycoherentfeaturesinpointclouds/d889453a-a257-482b-9304-c7b0f13e490e_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..ce1c917447fa2d5f5c376360f1e69d2ddcc13e2d
--- /dev/null
+++ b/tranquilcloudsneuralnetworksforlearningtemporallycoherentfeaturesinpointclouds/d889453a-a257-482b-9304-c7b0f13e490e_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:48ab40e14c36d38f9115fb02485d9aefa21dda7d616c5091b04972afc07646c3
+size 23589793
diff --git a/tranquilcloudsneuralnetworksforlearningtemporallycoherentfeaturesinpointclouds/full.md b/tranquilcloudsneuralnetworksforlearningtemporallycoherentfeaturesinpointclouds/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..33bb8b9d00e23d1d70f3bd5aaaf2fe035ec834bd
--- /dev/null
+++ b/tranquilcloudsneuralnetworksforlearningtemporallycoherentfeaturesinpointclouds/full.md
@@ -0,0 +1,324 @@
+# TRANQUIL CLOUDS: NEURAL NETWORKS FOR LEARNING TEMPORALLY COHERENT FEATURES IN POINT CLOUDS
+
+Lukas Prantl
+
+Department of Computer Science
+
+Technical University of Munich
+
+Munich, Germany
+
+Nuttapong Chentanez
+
+NVIDIA
+
+Bangkok, Thailand
+
+Stefan Jeschke
+
+NVIDIA
+
+Vienna, Austria
+
+Nils Thuerey
+
+Department of Computer Science
+
+Technical University of Munich
+
+Munich, Germany
+
+# ABSTRACT
+
+Point clouds, as a form of Lagrangian representation, allow for powerful and flexible applications in a large number of computational disciplines. We propose a novel deep-learning method to learn stable and temporally coherent feature spaces for points clouds that change over time. We identify a set of inherent problems with these approaches: without knowledge of the time dimension, the inferred solutions can exhibit strong flickering, and easy solutions to suppress this flickering can result in undesirable local minima that manifest themselves as halo structures. We propose a novel temporal loss function that takes into account higher time derivatives of the point positions, and encourages mingling, i.e., to prevent the aforementioned halos. We combine these techniques in a super-resolution method with a truncation approach to flexibly adapt the size of the generated positions. We show that our method works for large, deforming point sets from different sources to demonstrate the flexibility of our approach.
+
+# 1 INTRODUCTION
+
+Deep learning methods have proven themselves as powerful computational tools in many disciplines, and within it a topic of strongly growing interest is deep learning for point-based data sets. These Lagrangian representations are challenging for learning methods due to their unordered nature, but are highly useful in a variety of settings from geometry processing and 3D scanning to physical simulations, and since the seminal work of Qi Charles et al. (2017), a range of powerful inference tasks can be achieved based on point sets. Despite their success, interestingly, no works so far have taken into account time. Our world, and the objects within it, naturally move and change over time, and as such it is crucial for flexible point-based inference to take the time dimension into account. In this context, we propose a method to learn temporally stable representations for point-based data sets, and demonstrate its usefulness in the context of super-resolution.
+
+An inherent difficulty of point-based data is their lack of ordering, which makes operations such as convolutions, which are easy to perform for Eulerian data, unexpectedly difficult. Several powerful approaches for point-based convolutions have been proposed (Qi et al., 2017; Hermosilla et al., 2018; Hua et al., 2018), and we leverage similar neural network architectures in conjunction with the permutation-invariant Earth Mover's Distance (EMD) to propose a first formulation of a loss for temporal coherence.
+
+In addition, several works have recognized the importance of training point networks for localized patches, in order to avoid having the network to rely on a full view of the whole data-set for tasks that are inherently local, such as normal estimation (Qi Charles et al., 2017), and super-resolution (Yu et al., 2018a). This also makes it possible to flexibly process inputs of any size without being limited by memory requirements. Later on we will demonstrate the importance of such a patch-based approach with sets of changing cardinality in our setting. A general challenge here is to deal with varying input sizes, and for super-resolution tasks, also varying output sizes. Thus, in summary we target an extremely challenging learning problem: we are facing permutation-invariant inputs and targets of varying size, that dynamically move and deform over time. In order to enable deep learning approaches in this context, we make the following key contributions: Permutation invariant loss terms for temporally coherent point set generation; A Siamese training setup and generator architecture for point-based super-resolution with neural networks; Enabling improved output variance by allowing for dynamic adjustments of the output size; The identification of a specialized form of mode collapse for temporal point networks, together with a loss term to remove them. We demonstrate that these contributions together make it possible to infer stable solutions for dynamically moving point clouds with millions of points.
+
+More formally, we show that our learning approach can be used for generating a point set with an increased resolution from a given set of input points. The generated points should provide an improved discretization of the underlying ground truth shape represented by the initial set of points. For the increase, we will target a factor of two to three per spatial dimension. Thus, the network has the task to estimate the underlying shape, and to generate suit
+
+able sampling positions as output. This is generally difficult due to the lack of connectivity and ordering, and in our case, positions that move over time in combination with a changing number of input points. Hence it is crucial that the network is able to establish a temporally stable latent space representation. Although we assume that we know correspondences over time, i.e., we know which point at time $t$ moved to a new location at time $t + \Delta t$ , the points can arbitrarily change their relative position and density over the course of their movement, leading to a substantially more difficult inference problem than for the static case.
+
+
+Figure 1: Our algorithm upsamples an input point cloud (a) in a temporally coherent manner. Three exemplary outputs are shown in yellow in (b).
+
+
+
+
+
+
+
+# 2 RELATED WORK
+
+Deep learning with static point sets was first targeted in PointNet (Qi Charles et al., 2017) via order-invariant networks, while PointNet++ (Qi et al., 2017) extended this concept to generate features for localized groups similar to a convolution operation for grid-based data. This concept can be hierarchically applied to the generated groups, in order to extract increasingly abstract and global features. Afterwards, the extracted features can be interpolated back to the original point cloud. The goal to define point convolutions has been explored and extended in several works. The MCNN approach (Hermosilla et al., 2018) phrased convolution in terms of a Monte Carlo integration. PointCNN (Hua et al., 2018) defined a pointwise convolution operator using nearest neighbors, while extension-restriction operators for mapping between a point cloud function and a volumetric function were used in Atzmon et al. (2018). The PU-Net (Yu et al., 2018a) proposed a network for upsampling point clouds, and proposed a similar hierarchical network structure of PointNets along the lines of PointNet++ to define convolutions. Being closer to our goals, we employ this approach for convolutional operations in our networks below. We do not employ the edge-aware variant of the PU-Net (Yu et al., 2018b) here, to keep it as simple and general as possible as we focus on temporal changes in our work.
+
+Permutation invariance is a central topic for point data, and was likewise targeted in other works (Ravanbakhsh et al., 2016; Zaheer et al., 2017). The Deep Kd-network (Klokov and Lempitsky, 2017) defined a hierarchical convolution on point clouds via kd-trees. PointProNets (Roveri et al., 2018) employed deep learning to generate dense sets of points from sparse and noisy input points for 3D reconstruction applications. PCPNet (Guerrero et al., 2018), as another multi-scale variant of
+
+PointNet, has demonstrated high accuracy for estimating local shape properties such as normal or curvature. P2PNet (Yin et al., 2018) used a bidirectional network and extends PointNet++ to learn a transformation between two point clouds with the same cardinality.
+
+Recently, the area of point-based learning has seen a huge rise in interest. One focus here are 3D segmentation problems, where numerous improvements were proposed, e.g., by SPLATNet (Su et al., 2018), SGPN (Wang et al., 2018a), SpiderCNN (Xu et al., 2018), PointConv (Wu et al., 2018), SONET(Li et al., 2018a) and 3DRNN (Ye et al., 2018). Other networks such as Flex Convolution (Groh et al., 2018), the SuperPoint Graph (Landrieu and Simonovsky, 2018), and the fully convolutional network (Rethage et al., 2018) focused on large scale segmentation. Additional areas of interest are shape classification (Wang et al., 2018b; Lei et al., 2018; Zhang and Rabbat, 2018; Skouson, 2018) and object detection (Simon et al., 2018; Zhou and Tuzel, 2018), and hand pose tracking (Ge et al., 2018). Other works have targeted rotation and translation invariant inference (Thomas et al., 2018), and point cloud autoencoders (Yang et al., 2018; Deng et al., 2018). A few works have also targeted generative models based on points, e.g., for point cloud generation (Sun et al., 2018), and with adversarial approaches (Li et al., 2018b). It is worth noting here that despite the huge interest, the works above do not take into account temporally changing data, which is the focus of our work. A notable exception is an approach for scene flow (Liu et al., 2018), in order to estimate 3D motion directly on the basis of point clouds. This work is largely orthogonal to ours, as it does not target generative point-based models.
+
+# 3 METHODOLOGY
+
+We assume an input point cloud $X = \{x_{1}, x_{2}, \dots, x_{k}\}$ of size $k \in [1, k_{max}]$ . It consists of points $x_{i} \in \mathbb{R}^{d}$ , where $d$ includes 3 spatial coordinates and optionally additional features. Our goal is to let the network $f_{s}(X)$ infer a function $\tilde{Y}$ which approximates a desired super-resolution output point cloud $Y = \{y_{1}, y_{2}, \dots, y_{n}\}$ of size $n \in [1, n_{max}]$ with $y_{i} \in \mathbb{R}^{3}$ , i.e. $f_{s}(X) = \tilde{Y} \approx Y$ . For now we assume that the number of output points $n$ is defined by multiplying $k$ with a user-defined upsampling factor $r$ , i.e. $n = rk$ . Figure 2a) illustrates the data flow in our super-resolution network schematically. We treat the upsampling problem as a local one, i.e., we assume that the inference problem can be solved based on a spatially constrained neighborhood. This allows us to work with individual patches extracted from input point clouds. At the same time, it makes it possible to upsample adaptively, for example, by limiting the inference to relevant areas, such as complex surface structures. For the patch extraction we use a fixed spatial radius and normalize point coordinates within each patch to lie in the range of $[-1, 1]$ .
+
+Our first building block is a measure for how well two point clouds represent the same object or scene by formulating an adequate spatial loss function. Following Achlioptas et al. (2017), we base our spatial loss $\mathcal{L}_S$ on the Earth Mover's Distance (EMD), which solves an assignment problem to obtain a differentiable bijective mapping $\phi : \tilde{y} \to y$ . With $\phi$ we can minimize differences in position for arbitrary orderings of the points clouds via:
+
+$$
+\mathcal {L} _ {S} = \min _ {\phi : \tilde {y} \rightarrow y} \sum_ {\tilde {y} _ {i} \in \tilde {Y}} \| \tilde {y} _ {i} - \phi (\tilde {y} _ {i}) \| _ {2} ^ {2} \tag {1}
+$$
+
+# 3.1 TEMPORAL COHERENCE
+
+When not taking temporal coherence explicitly into account, the highly nonlinear and ill-posed nature of the super-resolution problem can cause strong variations in the output even for very subtle changes in the input. This results in significant temporal artifacts that manifest themselves as flickering. In order to stabilize the output while at the same time keeping the network structure as small and simple as possible, we propose the following training setup. Given a sequence of high resolution point clouds $Y^{t}$ with $t$ indicating time, we can compute a velocity $V^{t} = \{v_{1}^{t}, v_{2}^{t}, \dots, v_{k}^{t}\}$ , where $v_{i}^{t} \in \mathbb{R}^{3}$ . For
+
+
+Figure 2: a) Schematic overview of $f_{s}(X)$ . Black arrows represent scalar data. Point data is depicted as colored arrows with the color indicating data cardinality (brown = k, red = $k_{max}$ , green = $n_{max}$ , blue = n, and purple = $\tilde{n}$ ). b) Siamese network setup for temporal loss calculation.
+
+this we use a finite difference $(y_i^{t + 1} - y_i^t)$ , where we assume, without loss of generality, $\Delta t = 1$ , i.e. the time step is normalized to one. For training, the low resolution inputs $X$ can now be generated from $Y$ via down-sampling by a factor of $r$ , which yields a subset of points with velocities. Details of our data generation process will be given below.
+
+To train a temporally coherent network with the $Y^{t}$ sequences, we employ a Siamese setup shown in Figure 2b. We evaluate the network several times (3 times in practice) with the same set of weights, and moving inputs, in order to enforce the output to behave consistently. In this way we avoid recurrent architectures that would have to process the high resolution outputs multiple times. In addition, we can compute temporal derivatives from the input points, and use them to control the behavior of the generated output.
+
+Under the assumption of slowly moving inputs, which theoretically could be ensured for training, a straightforward way to enforce temporal coherence would be to minimize the movement of the generated positions over consecutive time steps in terms of an $L_{2}$ norm:
+
+$$
+\mathcal {L} _ {2 V} = \sum_ {i = 1} ^ {n} \| \tilde {y} _ {i} ^ {t + 1} - \tilde {y} _ {i} ^ {t} \| _ {2} ^ {2}. \tag {2}
+$$
+
+While this reduces flickering, it does not constrain the change of velocities, i.e., the acceleration. This results in a high frequency jittering of the generated point positions. The jitter can be reduced by also including the previous state at time step $t - 1$ to constrain the acceleration in terms of its $L_{2}$ norm:
+
+$$
+\mathcal {L} _ {2 A} = \sum_ {i = 1} ^ {n} \| \tilde {y} _ {i} ^ {t + 1} - 2 \tilde {y} _ {i} ^ {t} + \tilde {y} _ {i} ^ {t - 1} \| _ {2} ^ {2} \tag {3}
+$$
+
+However, a central problem of a direct temporal constraint via Equations (2) and (3) is that it consistently leads to a highly undesirable clustering of generated points around the center point. This is caused by the fact that the training procedure as described so far is unbalanced, as it only encourages minimizing changes. The network cannot learn to reconstruct realistic, larger motions in this way, but rather can trivially minimize the loss by contracting all outputs to a single point. For this reason, we instead use the estimated velocity of the ground truth point cloud sequence with a forward difference in time, to provide the network with a reference. By using the EMD-based mapping $\phi$ established for the spatial loss in Equation (1), we can formulate the temporal constraint in a permutation invariant manner as
+
+$$
+\mathcal {L} _ {E V} = \sum_ {i = 1} ^ {n} \| \left(\tilde {y} _ {i} ^ {t + 1} - \tilde {y} _ {i} ^ {t}\right) - \left(\phi \left(\tilde {y} _ {i} ^ {t + 1}\right) - \phi \left(\tilde {y} _ {i} ^ {t}\right)\right) \| _ {2} ^ {2}. \tag {4}
+$$
+
+Intuitively, this means the generated outputs should mimic the motion of the closest ground truth points. As detailed for the $L_{2}$ -based approaches above, it makes sense to also take the ground truth acceleration into account to minimize rapid changes of velocity over time. We can likewise formulate this in a permutation invariant way w.r.t. ground truth points via:
+
+$$
+\mathcal {L} _ {E A} = \sum_ {i = 1} ^ {n} \| \left(\tilde {y} _ {i} ^ {t + 1} - 2 \tilde {y} _ {i} ^ {t} + \tilde {y} _ {i} ^ {t - 1}\right) - \left(\phi \left(\tilde {y} _ {i} ^ {t + 1}\right) - 2 \phi \left(\tilde {y} _ {i} ^ {t}\right) + \phi \left(\tilde {y} _ {i} ^ {t - 1}\right)\right) \| _ {2} ^ {2}. \tag {5}
+$$
+
+We found that a combination of $\mathcal{L}_{EV}$ and $\mathcal{L}_{EA}$ together with the spatial loss $\mathcal{L}_S$ from Eq. 1 provides the best results, as we will demonstrate below. First, we will introduce the additional loss terms of our algorithm.
+
+# 3.2 VARIABLE POINT CLOUD SIZES
+
+Existing network architectures are typically designed for processing a fixed amount of input and output points. However, in many cases, and especially for a localized inference of super-resolution, the number of input and output points varies significantly. While we can safely assume that no patch exceeds the maximal number of inputs $k_{max}$ (this can be ensured by working on a subset), it can easily happen that a certain spatial region has fewer points. Simply including more distant points could guarantee that we have a full set of samples, but this would mean the network has to be invariant to scaling, and to produce features at different spatial scales. Instead, we train our
+
+
+
+
+
+
+
+
+
+
+Figure 3: An illustration of the relationship between input and output size. (a,b,d) show histograms of point set sizes for: (a,b) the input set; (c) the ground truth target sets; and (d) the network output, i.e. $r$ times larger than the input. The latter deviates from the ground truth in (c), but follows its overall structure. This is confirmed in (b), which shows a heat map visualization of input vs. ground truth output size. The diagonal structure of the peak confirms the approximately linear relationship.
+
+
+Figure 4: The effect of our variable output handling for exemplary patches. In red the ground truth target, in blue the inferred solution. Left (a) with fixed output size, and on the right (b) with the proposed support for variable output sizes. The latter approximates the shape of the red ground truth points significantly better. (a) leads to rather uniform shapes that, e.g., cover empty space above the ground truth in both examples.
+
+network for a fixed spatial size, and ensure that it can process varying numbers of inputs. For inputs with fewer than $k_{max}$ points, we pad the input vector to have a fixed size. Here, we ensure that the padding values are not misinterpreted by the network as being point data. Therefore, we pad $X$ with $p \in \{-2\}^d$ , which represents a value outside the regular patch coordinate range $[-1, 1]$ : $\bar{X} = \{x_1, x_2, \dots, x_k, \underbrace{p, p, \dots, p}_{k_{max} - k}\}$ . The first convolutional layer in our network now filters out the
+
+padded entries using the following mask: $M_{in} = \{m_{i\in [0,k]}\} = \{\underbrace{1,1,\dots,1}_{k},\underbrace{0,0,\dots,0}_{k_{max} - k}\}$ . The entries
+
+of $p$ allow us to compute the mask on the fly throughout the whole network, without having to pass through $k$ . For an input of size $k$ , our network has the task to generate $\tilde{n} = rk$ points. As the size of the network output is constant with $rk_{max}$ , the outputs are likewise masked with $M_{out}$ to truncate it to length $\tilde{n}$ for all loss calculations, e.g., the EMD mappings. Thus, as shown in Figure 2a, $\tilde{n}$ is used to truncate the point cloud $\tilde{Y} = \{\bar{y}_1, \bar{y}_2, \dots, \bar{y}_{n_{max}}\}$ via a mask $M_{out}$ to form the final output $\tilde{Y} = \{\bar{y}_i | i \in [1, \tilde{n}] \}$ .
+
+Note that in Sec. 3.1, we have for simplicity assumed that $n = rk$ , however, in practice the number of ground truth points $n$ varies. As such, $\tilde{n}$ only provides an approximation of the true number of target points in the ground truth data. While the approximation is accurate for planar surfaces and volumes, it is less accurate in the presence of detailed surface structures that are smaller than the spatial frequency of the low-resolution data.
+
+We have analyzed the effect of this approximation in Fig. 3. The histograms show that the strongly varying output counts are an important factor in practice, and Fig. 4 additionally shows the improvement in terms of target shape that results from incorporating variable output sizes. In general, $\tilde{n}$ provides a good approximation for our data sets. However, as there is a chance to infer an improved estimate of the correct output size based on the input points, we have experimented with training a second network to predict $\tilde{n}$ in conjunction with a differentiable output masking. While this could be an interesting feature for future applications, we have not found it to significantly improve results. As such, the evaluations and results below will use the analytic calculation, i.e., $\tilde{n} = rk$ .
+
+# 3.3 PREVENTING HALO ARTIFACTS
+
+For each input point the network generates $r$ output points, which can be seen as individual groups $g$ : $\psi(g) = \{\tilde{Y}_i | i \in [rg + 1, (r + 1)g]\}$ . These groups of size $r$ in the output are strongly related to the input points they originate from. Networks that focus on maintaining temporal coherence for the dynamically changing output tend to slide into local minima where $r$ output points are attached as a
+
+
+Figure 5: Ablation study for our temporal loss formulation. Black points indicate targets, while green points are generated (both shown as time average). a) Result from previous work; b) With $L_{2V}$ loss; c) the proposed velocity loss $L_{EV}$ ; d) our full loss formulation with $L_{EV} + L_{EA}$ . While (a) has difficulties approximating the target shape and the flickering output is visible as blurred positions, the additional loss terms (esp. in (c) and (d)) provide stable results that closely approximate the targets. Note that (b) leads to an undesirably static motion near the bottom of the patch. As the input points here are moving the output should mimic this motion, like (c,d).
+
+
+
+
+
+
+
+fixed structure to the input point location. This manifests itself as visible static halo-like structures that move along with the input. Although temporal coherence is good in this case, these cluster-like structures lead to gaps and suboptimal point distributions in the output, particularly over time. These structures can be seen as a form of temporal mode collapse that can be observed in other areas of deep learning, such as GANs. To counteract this effect, we introduce an additional mingling loss term to prevent the formation of clusters by pushing the individual points of a group apart:
+
+$$
+\mathcal {L} _ {M} = \frac {1}{\left\lceil \frac {\tilde {n}}{r} \right\rceil} \sum_ {i} ^ {\left\lceil \frac {\tilde {n}}{r} \right\rceil} \frac {| \psi (i) |}{\sum_ {\tilde {y} _ {g} \in \psi (i)} \| \frac {\sum_ {| \psi (i) |} \psi (i)}{| \psi (i) |} - \tilde {y} _ {g} \| _ {2}} \tag {6}
+$$
+
+Note that in contrast to previously used repulsion losses (Yu et al., 2018a), $\mathcal{L}_M$ encourages points to globally mix rather than just locally repelling each other. While a repulsion term can lead to a deterioration of the generated outputs, our formulation preserves spatial structure and temporal coherence while leading to well distributed points, as is illustrated in Fig. 6.
+
+
+Figure 6: Left, a result without the mingling loss from Eq. 6, right with (a single point group highlighted in orange). The former has many repeated copies of a single pattern, which the mingling loss manages to distribute as can be seen in the right picture.
+
+In combination with the spatial and temporal terms from above, this leads to our final loss function $\mathcal{L}_{final} = \mathcal{L}_S + \gamma \mathcal{L}_{EV} + \mu \mathcal{L}_{EA} + \nu \mathcal{L}_M$ , with weighting terms $\gamma, \mu, \nu$ .
+
+# 4 EVALUATION AND RESULTS
+
+We train our network in a fully supervised manner with simulated data. To illustrate the effect of our temporal loss functions, we employ it in conjunction with established network architectures from previous work (Qi Charles et al., 2017; Yu et al., 2018a). Details of the data generation and network architectures are given in the appendix. We first discuss our data generation and training setup, then illustrate the effects of the different terms of our loss function, before showing results for more complex 3D data sets. As our results focus on temporal coherence, which is best seen in motion, we refer readers to the supplemental materials at https://ge.in.tum.de/publications/2020-iclr-prantl/ in order to fully evaluate the resulting quality.
+
+Ablation Study We evaluate the effectiveness of our loss formulation with a two dimensional ablation study. An exemplary patch of this study is shown in Fig. 5. In order to compare our method to previous work, we have trained a previously proposed method for point-cloud super-resolution, the PU-Net (Yu et al., 2018a) which internally uses a PointNet++ (Qi et al., 2017), with our data set, the only difference being that we use zero-padding here. This architecture will be used in the following comparisons with previous work. Fig. 5a) shows a result generated with this network. As this figure contains an average of multiple frames to indicate temporal stability, the blurred regions, esp. visible on the right side of Fig. 5a), indicate erroneous motions in the output. For this network the difficulties of temporally changing data and varying output sizes additionally lead to a suboptimal approximation
+
+ | \( \mathcal{L}_S \) | \( \mathcal{L}_N \) | \( \mathcal{L}_M \) | \( \mathcal{L}_{2V} \) | \( \mathcal{L}_{2A} \) | \( \mathcal{L}_{EV} \) | \( \mathcal{L}_{EA} \) |
| 2D Previous work | 0.0784 | 0.329 | 5.499 | 0.1 | 0.402 | 0.107 | 0.214 |
| 2D With \( \mathcal{L}_{2V} \) | 0.044 | 0.00114 | 2.197 | 1.1e-05 | 4.2e-05 | 0.00197 | 0.00276 |
| 2D Only \( \mathcal{L}_{EV} \) | 0.0453 | 0.00114 | 2.713 | 2.6e-05 | 6.0e-06 | 6.15e-04 | 5.27e-04 |
| 2D Full | 0.0487 | 0.00116 | 3.0307 | 2.1e-05 | 1.0e-06 | 6.52e-04 | 1.46e-04 |
| 3D Previous work | 0.0948 | 0.494 | 10.558 | 0.325 | 1.299 | 0.19 | 0.365 |
| 3D Full | 0.0346 | 0.00406 | 3.848 | 8.04e-04 | 2.0e-06 | 0.00179 | 7.09e-04 |
+
+Table 1: Quantitative results for the different terms of our loss functions, first for our 2D ablation study and then for our 3D versions. The first three columns contain spatial, the next four temporal metrics. $\mathcal{L}_N = \| \tilde{n} -n\| _2^2$ is given as a measure of accuracy in terms of the size of the generated outputs (it is not part of the training).
+
+
+Figure 7: Illustrations of the latent spaces learned by our networks. (a) shows averaged latent space values for 100 random patch sequences of our 2D data set. The green curve shows our method with temporal coherence loss, while the pink curve was generated without it. The same data is shown in frequency space in (b), where the red curve represents the frequency of the data with temporal loss, and the blue curve the frequency of the data without. This graph highlights the reduced amount of high frequency changes in the latent space with temporal loss, esp. in frequency space, where the red curve almost entirely lies below the blue one. (c) contains frequency information for the latent space content of the same 100 patch sequences, but in a random order. In this case, the blue and red curve both contain significant amounts of high-frequencies. I.e., our method reliably identifies strongly changing inputs.
+
+
+
+
+
+of the target points, that is also visible in terms of an increased $\mathcal{L}_S$ loss in Table 1. While Fig. 5b) significantly reduces motions, and leads to an improved shape as well as $\mathcal{L}_S$ loss, its motions are overly constrained. E.g., at the bottom of the shown patch, the generated points should follow the black input points, but in (b) the generated points stay in place. In addition, the lack of permutation invariance leads to an undesirable clustering of generated points in the patch center. Both problems are removed with $\mathcal{L}_{EV}$ in Fig. 5c), which still contains small scale jittering motions, unfortunately. These are removed by $\mathcal{L}_{EA}$ in Fig. 5d), which shows the result of our full algorithm. The success of our approach for dynamic output sizes is also shown in the $\mathcal{L}_N$ column of Table 1, which contains an $L_{2}$ error w.r.t. ground truth size of the outputs.
+
+Temporally Coherent Features A central goal of our work is to enable the learning of features that remain stable over time. To shed light on how our approach influences the established latent space, we analyze its content for different inputs. The latent space in our case consists of a 256-dimensional vector that contains the features extracted by the first set of layers of our network. Fig. 7 contains a qualitative example for 100 randomly selected patch sequences from our test data set, where we collect input data by following the trajectory of each patch center for 50 time steps to extract coherent data sets. Fig. 7a) shows the averaged latent space content over time for these sequences. While the model trained with temporal coherence (green curve) is also visually smoother, the difference becomes clearer when considering temporal frequencies. We measure averaged frequencies of the latent space dimensions over time, as shown in Fig. 7b,c). We quantify the differences by calculating the integral of the frequency spectrum $\tilde{f}$ , weighted by the frequency $x$ to emphasize high frequencies, i.e., $\int_{x} x \cdot \tilde{f}(x) dx$ . Hence, small values are preferred. As shown in Fig. 7b), the version trained without our loss formulations contains significantly more high frequency content. This is also reflected in the weighted integrals, which are 36.56 for the method without temporal loss, and 16.98 for the method with temporal loss. To verify that our temporal model actually establishes a stable temporal latent space instead of ignoring temporal information altogether, we evaluate the temporal frequencies for the same 100 inputs as above, but with a randomized order over time. In this case, our model correctly identifies the incoherent inputs, and yields similarly high frequencies as the regular model with 28.44 and 35.24, respectively. More details in Appendix C.
+
+
+Figure 8: Evaluation of the temporal stability for generated point clouds, in red with our temporal loss formulation, in blue without. Graph (a) shows the temporal change of the point density (1st derivative), while (b) shows the 2nd derivative. In (c) and (d) the error of the 1st and 2nd derivatives of the positions w.r.t. ground-truth reference points is shown.
+
+
+
+
+
+
+
+In addition, we evaluated the changes of generated outputs over time w.r.t. ground truth motion. For this we mapped the generated point clouds $\tilde{Y}^t = \{\tilde{y}_1^t,\tilde{y}_2^t,\dots,\tilde{y}_n^t\}$ for 100 frames to evenly and dense sampled ground-truth points on the original mesh $Y^{t} = \{y_{1}^{t},y_{2}^{t},\dots,y_{n}^{t}\}$ (the moving man shown in Fig. 1). This gives us a dense correlation between the data and the generated point clouds. For the mapping we used an assignment based on nearest neighbors: $\gamma :\tilde{y}\rightarrow y$ . Using $\gamma$ we divide $\tilde{Y}^t$ into $n$ subsets $\hat{Y}_i = \{\tilde{y}_j|\gamma (\tilde{y}_j) = y_i\}$ which correlate with the corresponding ground-truth points. For each subset we can now compute the mean position $\frac{1}{|\hat{Y}_i|}\sum_{\hat{y}\in \hat{Y}_i}\hat{y}$ and the sample density $|\hat{Y}_i|$ measured by the number of points assigned to a ground-truth sample position. The temporal change of these values are of particular interest. The change of the mean positions should correspond to the ground-truth changes, while the change of the density should be one. We have evaluated the error of the first and second derivative of positions, as well as the first and second derivative of density (see Fig. 8 and Table 2). As can be seen from the plots, our method leads to clear improvements for all measured quantities. The individual spikes that are visible for both versions in the position errors (c,d) most likely correspond to sudden changes of the input motions for which our networks undershoots by producing a smooth version of the motion.
+
+ | w/o | with |
| Velocity | 0.043 | 0.024 |
| Acceleration | 0.078 | 0.043 |
| Variance of 1st Derivative | 0.016 | 0.00013 |
| Variance of 2nd Derivative | 0.038 | 0.00017 |
+
+Table 2: Measurements averaged over 100 frames for a version of our network without temporal loss ("w/o") and with our full temporal loss formulation ("with"). The left table shows the results for the error evaluation of the velocity and the acceleration, whereas in the right table one can see the variance of the density derivatives.
+
+3D Results Our patch-based approach currently relies on a decomposition of the input volumes into patches over time, as outlined in Appendix A. As all of the following results involve temporal data, full sequences are provided in the accompanying video. We apply our method to several complex 3D models to illustrate its performance. Fig. 9 shows the input as well as several frames generated with our method for an animation of a spider. Our method produces an even and temporally stable reconstruction of the object. In comparison, Fig. 9b) shows the output from the previous work architecture (Yu et al., 2018a). It exhibits uneven point distributions and outliers, e.g., above the legs of the spider, in addition to uneven motions.
+
+A second example for a moving human figure is shown in Fig. 1. In both examples, our network covers the target shape much more evenly despite using much fewer points, as shown in Table 3. Thanks to the flexible output size of our network, it can adapt to sparsely covered regions by generating correspondingly fewer outputs. The previous work architecture, with its fixed output size, needs to concentrate the fixed number of output points within the target shape, leading to an unnecessarily large point count. In order to demonstrate the flexibility of our method, we also apply it to a volumetric moving point cloud obtained from a liquid simulation. Thanks to the patch-based evaluation of our network, it is agnostic to the overall size of the input volume. In this way, it can be used to generate coherent sets with millions of points. These examples also highlight our method's capabilities for generalization. While the 3D model was only trained on data from physics simulations, as outlined above, it learns stable features that can be flexibly applied to volumetric as well as to surface-based data. The metrics in Table 1 show that for both 2D and 3D cases, our method leads to significantly improved quality, visible in lower loss values for spatial as well as temporal terms.
+
+
+
+
+
+
+
+
+
+
+Figure 9: Our method applied to an animation of a moving spider. (a) Input point cloud, (b) three frames of our method, (c) a detail from previous work (top) and our method (bottom). Note that our method at the bottom preserves the shape with fewer outliers, and leads to a more even distribution of points, despite generating fewer points in total (see Table 3).
+
+ | Input points | P.W., output points | P.W., factor | Ours, output points | Ours, factor |
| Spider | 7,900 | 3,063,704 | 387.81 | 251,146 | 31.79 |
| Moving person | 10,243 | 5,224,536 | 510.06 | 367,385 | 35.87 |
| Liquid | 513,247 | - | - | 6,430,984 | 12.53 |
+
+Table 3: Point counts for the 3D examples of our video. Input counts together with output counts for previous work (P.W.) and our proposed network are shown. Factor columns contain increase in point set size from in- to output. As previous work cannot handle flexible output counts, a fixed number of points is generated per patch, leading to a huge number of redundant points. However, our network flexibly adapts the output size and leads to a significantly smaller number of generated points that cover the object or volume more evenly.
+
+Another interesting field of application for our algorithm are physical simulations. Complex simulations such as fluids, often employ particle-based representations. On the one hand, the volume data is much larger than surface-based data, which additionally motivates our dynamic output. On the other hand, time stability plays a very important role for physical phenomena. Our method produces detailed outputs for liquids, as can be seen in our supplemental video.
+
+Convergence graphs for the different versions are shown in Fig. 12 of the supplemental material. These graphs show that our method not only successfully leads to very low errors in terms of temporal coherence, but also improves spatial accuracy. The final values of $\mathcal{L}_S$ for the 2D case are below 0.05 for our algorithm, compared to almost 0.08 for previous work. For 3D, our approach yields 0.04 on average, in contrast to ca. 0.1 for previous work.
+
+# 5 CONCLUSION
+
+We have proposed a first method to infer temporally coherent features for point clouds. This is made possible by a novel loss function for temporal coherence in combination with enabling flexible truncation of the results. In addition we have shown that it is crucial to prevent static patterns as easy-to-reach local minima for the network, which we avoid with the proposed a mingling loss term. Our super-resolution results above demonstrate that our approach takes an important first step towards flexible deep learning methods for dynamic point clouds.
+
+Looking ahead, our method could also be flexibly combined with other network architectures or could be adopted for other applications. Specifically, a combination with PSGN (Fan et al., 2016) could be used to generate point clouds from image sequences instead of single images. Other conceivable applications could employ methods like Dahnert et al. (2019) with our approach for generating animated meshes. Due to the growing popularity and ubiquity of scanning devices it will, e.g., be interesting to investigate classification tasks of 3D scans over time as future work. Apart from that, physical phenomena such as elastic bodies and fluids (Li et al., 2019) can likewise be represented in a Lagrangian manner, and pose interesting challenges and complex spatio-temporal changes.
+
+# ACKNOWLEDGMENTS
+
+This work is supported by grant TH 2034/1-1 of the Deutsche Forschungsgemeinschaft (DFG).
+
+# REFERENCES
+
+R Qi Charles, Hao Su, Mo Kaichun, and Leonidas Guibas. Pointnet: Deep learning on point sets for 3d classification and segmentation. pages 77-85, 07 2017. doi: 10.1109/CVPR.2017.16.
+Charles Ruizhongtai Qi, Li Yi, Hao Su, and Leonidas J Guibas. Pointnet++: Deep hierarchical feature learning on point sets in a metric space. In Advances in Neural Information Processing Systems, pages 5099-5108. Curran Associates, Inc., 2017.
+Pedro Hermosilla, Tobias Ritschel, Pere-Pau Vázquez, Àlvar Vinacua, and Timo Ropinski. Monte carlo convolution for learning on non-uniformly sampled point clouds. ACM Trans. Graph., 37(6): 235:1-235:12, December 2018. doi: 10.1145/3272127.3275110.
+Binh-Son Hua, Minh-Khoi Tran, and Sai-Kit Yeung. Pointwise convolutional neural networks. In Computer Vision and Pattern Recognition (CVPR), 2018.
+Lequan Yu, Xianzhi Li, Chi-Wing Fu, Daniel Cohen-Or, and Pheng-Ann Heng. Pu-net: Point cloud upsampling network. In CVPR, 2018a.
+Matan Atzmon, Haggai Maron, and Yaron Lipman. Point convolutional neural networks by extension operators. ACM Trans. Graph., 37(4):71:1-71:12, July 2018. doi: 10.1145/3197517.3201301.
+Lequan Yu, Xianzhi Li, Chi-Wing Fu, Daniel Cohen-Or, and Pheng-Ann Heng. Ec-net: an edge-aware point set consolidation network. In European Conference on Computer Vision, pages 398-414. Springer, 2018b.
+Siamak Ravanbakhsh, Jeff G. Schneider, and Barnabás Póczos. Deep learning with sets and point clouds. CoRR, abs/1611.04500, 2016.
+Manzil Zaheer, Satwik Kottur, Siamak Ravanbakhsh, Barnabás Póczos, Ruslan R. Salakhutdinov, and Alexander J. Smola. Deep sets. In Advances in Neural Information Processing Systems, pages 3394-3404, 2017.
+Roman Klokov and Victor S. Lempitsky. Escape from cells: Deep kd-networks for the recognition of 3d point cloud models. In IEEE International Conference on Computer Vision, ICCV 2017, Venice, Italy, October 22-29, 2017, pages 863-872, 2017. doi: 10.1109/ICCV.2017.99.
+Riccardo Roveri, A. Cengiz Öztireli, Ioana Pandele, and Markus Gross. Pointpronets: Consolidation of point clouds with convolutional neural networks. Computer Graphics Forum, 37(2):87-99, 2018. doi: 10.1111/cgf.13344.
+Paul Guerrero, Yanir Kleiman, Maks Ovsjanikov, and Niloy J. Mitra. PCPNet: Learning local shape properties from raw point clouds. Computer Graphics Forum, 37(2):75-85, 2018. doi: 10.1111/cgf.13343.
+Kangxue Yin, Hui Huang, Daniel Cohen-Or, and Hao Zhang. P2p-net: Bidirectional point displacement net for shape transform. ACM Trans. Graph., 37(4):152:1-152:13, July 2018. doi: 10.1145/3197517.3201288.
+Hang Su, Varun Jampani, Deqing Sun, Subhransu Maji, Evangelos Kalogerakis, Ming-Hsuan Yang, and Jan Kautz. Splatnet: Sparse lattice networks for point cloud processing. In CVPR, pages 2530-2539. IEEE Computer Society, 2018.
+Weiyue Wang, Ronald Yu, Qiangui Huang, and Ulrich Neumann. Sgpn: Similarity group proposal network for 3d point cloud instance segmentation. pages 2569-2578, 06 2018a. doi: 10.1109/CVPR.2018.00272.
+Yifan Xu, Tianqi Fan, Mingye Xu, Long Zeng, and Yu Qiao. SpiderCNN: Deep learning on point sets with parameterized convolutional filters. In ECCV (8), volume 11212 of Lecture Notes in Computer Science, pages 90-105. Springer, 2018.
+Wenxuan Wu, Zhongang Qi, and Fuxin Li. Pointconv: Deep convolutional networks on 3d point clouds. CoRR, abs/1811.07246, 2018.
+
+Jiaxin Li, Ben M. Chen, and Gim Hee Lee. So-net: Self-organizing network for point cloud analysis. In CVPR, 2018a.
+Xiaoqing Ye, Jiamao Li, Hexiao Huang, Liang Du, and Xiaolin Zhang. 3d recurrent neural networks with context fusion for point cloud semantic segmentation. In ECCV, 2018.
+F. Groh, P. Wieschollek, and H. P. A. Lensch. Flex-convolution (million-scale point-cloud learning beyond grid-worlds). In Computer Vision - ACCV 2018 - 14th Asian Conference on Computer Vision, December 2018.
+Loic Landrieu and Martin Simonovsky. Large-scale point cloud semantic segmentation with superpoint graphs. In CVPR, 2018.
+Dario Rethage, Johanna Wald, Jürgen Sturm, Nassir Navab, and Federico Tombari. Fully convolutional point networks for large-scale point clouds. In Computer Vision - ECCV 2018, pages 625-640. Springer International Publishing, 2018.
+Yue Wang, Yongbin Sun, Ziwei Liu, Sanjay E. Sarma, Michael M. Bronstein, and Justin M. Solomon. Dynamic graph cnn for learning on point clouds. CoRR, abs/1801.07829, 2018b.
+Huan Lei, Naveed Akhtar, and Ajmal Mian. Spherical convolutional neural network for 3d point clouds. CoRR, abs/1805.07872, 2018.
+Yingxue Zhang and Michael G. Rabbat. A graph-cnn for 3d point cloud classification. 2018 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pages 6279-6283, 2018.
+Mark B. Skouson. Ursa: A neural network for unordered point clouds using constellations. CoRR, abs/1808.04848, 2018.
+Martin Simon, Stefan Milz, Karl Amende, and Horst-Michael Groß. Complex-yolo: Real-time 3d object detection on point clouds. CoRR, abs/1803.06199, 2018.
+Yin Zhou and Oncel Tuzel. Voxelnet: End-to-end learning for point cloud based 3d object detection. In CVPR, 2018.
+Liuhao Ge, Yujun Cai, Junwu Weng, and Junsong Yuan. Hand pointnet: 3d hand pose estimation using point sets. In CVPR, 2018.
+Nathaniel Thomas, Tess Smidt, Steven M. Kearnes, Lusann Yang, Li Li, Kai Kohlhoff, and Patrick Riley. Tensor field networks: Rotation- and translation-equivariant neural networks for 3d point clouds. CoRR, abs/1802.08219, 2018.
+Yaoqing Yang, Chen Feng, Yiru Shen, and Dong Tian. Foldingnet: Point cloud auto-encoder via deep grid deformation. In CVPR, 2018.
+Haowen Deng, Tolga Birdal, and Slobodan Ilic. Ppfnet: Global context aware local features for robust 3d point matching. In CVPR, pages 195-205. IEEE Computer Society, 2018.
+Yongbin Sun, Yue Wang, Ziwei Liu, Joshua E. Siegel, and Sanjay E. Sarma. Pointgrow: Autoregressively learned point cloud generation with self-attention. CoRR, abs/1810.05591, 2018.
+Chun-Liang Li, Manzil Zaheer, Yonghui Zhang, Barnabás Póczos, and Ruslan Salakhutdinov. Point cloud gan. CoRR, abs/1810.05795, 2018b.
+Xingyu Liu, Charles Ruizhongtai Qi, and Leonidas J. Guibas. Learning scene flow in 3d point clouds. CoRR, abs/1806.01411, 2018.
+Panos Achlioptas, Olga Diamanti, Ioannis Mitliagkas, and Leonidas J. Guibas. Representation learning and adversarial generation of 3d point clouds. CoRR, abs/1707.02392, 2017.
+Haoqiang Fan, Hao Su, and Leonidas J. Guibas. A point set generation network for 3d object reconstruction from a single image. CoRR, abs/1612.00603, 2016. URL http://arxiv.org/abs/1612.00603.
+
+Manuel Dahnert, Angela Dai, Leonidas Guibas, and Matthias Nießner. Joint embedding of 3d scan and cad objects. In ICCV 2019, 2019.
+Yunzhu Li, Jiajun Wu, Russ Tedrake, Joshua B Tenenbaum, and Antonio Torralba. Learning particle dynamics for manipulating rigid bodies, deformable objects, and fluids. In ICLR, 2019.
+Markus Ihmsen, Jens Cornelis, Barbara Solenthaler, Christopher Horvath, and Matthias Teschner. Implicit incompressible sph. IEEE Transactions on Visualization and Computer Graphics, 20(3): 426-435, 2014.
+
+# Tranquil Clouds: Neural Networks for Learning Temporally Coherent Features in Point Clouds, Supplemental Material
+
+A TRAINING AND EVALUATION MODALITIES
+
+Data Generation We employ a physical simulation to generate our input and output pairs for training. This has the advantage that it leads to a large variety of complex motions, and gives full control of the generation process. More specifically, we employ the IISPH (Ihmsen et al., 2014) algorithm, a form of Lagrangian fluid simulator that efficiently generates incompressible liquid volumes. These simulations also have the advantage that they inherently control the density of the point sampling thanks to their volume conserving properties. In order to generate input pairs for training, we randomly sample regions near the surface and extract points with a given radius around a central point. This represents the high-resolution target. To compute the low-resolution input, we downsample the points with a Poisson-disk sampling to compute a point set with the desired larger spacing. In order to prevent aliasing from features below the coarse resolution, we perform a pass of surface fairing and smoothing before downsampling. Due to the large number of patches that can be extracted from these simulations, we did not find it necessary to additionally augment the generated data sets. Examples of the low- and high-resolution pairs are shown in the supplemental material.
+
+Below we will demonstrate that models trained with this data can be flexibly applied to moving surface data as well as new liquid configurations. The surface data is generated from animated triangle meshes that were resampled with bicubic interpolation in order to match a chosen average per-point area. This pattern was generated once and then propagated over time with the animation. When applying our method to new liquid simulations, we do not perform any downsampling, but rather use all points of a low-resolution simulation directly, as a volumetric re-sampling over time is typically error prone, and gives incoherent low resolution inputs.
+
+Given a moving point cloud, we decompose it into temporally coherent patches in the following manner: We start by sampling points via a Poisson-disk sampling in a narrow band around the surface, e.g., based on a signed distance function computed from the input cloud. These points will persist as patch centers over time, unless they move too close to others, or too far away from the surface, which triggers their deletion. In addition, we perform several iterations for every new frame to sample new patches for points in the input cloud that are outside all existing patches. Note that this resampling of patches over time happens instantaneously in our implementation. While a temporal fading could easily be added, we have opted for employing transitions without fading, in order to show as much of the patch content as possible.
+
+Network Architecture and Training Our architecture heavily relies on a form of hierarchical point-based convolutions. I.e., the network extracts features for a subset of the points and their nearest neighbors. For the point convolution, we first select a given number of group centers that are evenly distributed points from a given input cloud. For each group center, we then search for a certain number of points within a chosen radius (a fraction of the [-1,1] range). This motivates our choice for a coordinate far outside the regular range for the padded points from Sec. 3.2. They are too far away from all groups by construction, so they are filtered out without any additional overhead. In this way, both feature extraction and grouping operations work flexibly with the varying input sizes. Each group is then processed by a PointNet-like sub-structure (Qi Charles et al., 2017), yielding one feature vector per group.
+
+The result is a set of feature vectors and the associated group position, which can be interpreted as a new point cloud to repeatedly apply a point convolution. In this way, the network extracts increasingly abstract and global features. The last set of features is then interpolated back to the original points of the input. Afterwards a sub-pixel convolution layer is used to scale up the point cloud extended with features and finally the final position vectors are generated with the help of two additional shared, fully-connected layers. While we keep the core network architecture unmodified to allow for comparisons with previous work, an important distinction of our approach is the input and output masking, as described in Sec. 3.2.
+
+Our point data was generated with a mean point spacing, i.e., Poisson disk radius, of 0.5 units. For the 2D tests, an upscaling factor of $r = 9$ was used. For this purpose, patches with a diameter of 5 were extracted from the low-resolution data and patches with a diameter of 15 from the high-resolution
+
+data. We used the thresholds $k_{max} = 100$ and $n_{max} = 900$ . For the loss, we used $\gamma = 10$ , $\mu = 10$ , and $\nu = 0.001$ . The network was trained with 5 epochs for a data set with 185k pairs, and a batch size of 16, the learning rate was 0.001 with a decay of 0.003. For the 3D results below, the scaling factor $r$ was set to 8. The diameter of the patches was 6 for the low-resolution data and 12 for the high-resolution data, with $k_{max} = 1280$ and $n_{max} = 10240$ . The loss parameters were $\gamma = \mu = 5$ , with $\nu = 0.001$ . Learning rate and decay were the same for training, but instead we used 10 epochs with 54k patches in 3D, and a batch size of 4.
+
+# B NETWORK ARCHITECTURE DETAILS
+
+The input feature vector is processed in the first part of our network, which consists of four point convolutions. We use $(n_g,r_g,[l_1,\dots,l_d])$ to represent a level with $n_g$ groups of radius $r_g$ and $[l_1,\dots,l_d]$ the $d$ fully-connected layers with the width $l_i(i = 1,\dots,d)$ . The parameters we use are $(k_{max},0.25,[32,32,64])$ , $(k_{max}/2,0.5,[64,64,128])$ , $(k_{max}/4,0.6,[128,128,256])$ and $(k_{max}/8,0.7,[256,256,512])$ . We then use interpolation layers to distribute the features of each convolution level among the input points. In this step, we reduce the output of each convolution layer with one shared, fully-connected layer per level, to a size of 64 and then distribute the features to all points of the input point cloud depending on their position. This extends the points of our original point cloud with 256 features. Fig. 11 shows a visual overview of the data flow in our network.
+
+Afterwards, we process the data in $r$ separate branches consisting of two shared, fully interconnected layers with 256 and 128 nodes. The output is then processed with two shared fully-connected layers of 64 and 3 nodes. Finally, we add our resulting data to the input positions that have been repeated $r$ times. This provides an additional skip connection which leads to slightly more stable results. All convolution layers and fully interconnected layers use a tanh() activation function.
+
+For the input feature vector, we make use of additional data fields in conjunction with the point positions. Our network also accepts additional features such as velocity, density and pressure of the SPH simulations used for data generation. For inputs from other sources, those values could be easily computed with suitable SPH interpolation kernels. In practice, we use position, velocity and pressure fields. Whereas the first two are important (as mentioned in Sec. 3.1), the pressure fields turned out to have negligible influence.
+
+# C FREQUENCY EVALUATION OF LATENT SPACE
+
+In this section we give details for the frequency evaluation of Sec. 4. In order to measure the stability of the latent space against temporal changes, we evaluated the latent space of our network with and without temporal loss, once for 100 ordered patch sequences and once for 100 un-ordered ones. The central latent space of our network consists of the features generated by the point-convolution layers in the first part of the network and is 256 dimensional (see Fig. 11). To obtain information about its general behavior, we average the latent space components over all 100 patch sequences, subtract the mean, and normalize the resulting vector w.r.t. maximum value for each data set. The result is a time sequence of scalar values representing the mean deviations of the latent space. The Fourier transform of these vectors $\tilde{f}$ , are shown in Fig. 7, and were used to compute the weighted frequency content $\int_{x} x \cdot \tilde{f}(x) dx$ . Here, large values indicate strong temporal changes of the latent space dimensions. The resulting values are given in the main document, and highlight the stability of the latent space learned by our method.
+
+# D TRAINING DATA AND GRAPHS
+
+Two examples with ground truth points and down-sampled input versions are shown in Fig. 10.
+
+Additionally, Fig. 12 shows loss graphs for the different versions shown in the main text: 2D previous work, our full algorithm in 2D, as well as both cases for 3D. The mingling loss $\mathcal{L}_M$ is only shown as reference for the previous work versions, but indicates the strong halo-like patterns forming for the architectures based on previous work.
+
+
+Figure 10: Examples from our synthetic data generation process. In both sections (a) and (b) a high resolution reference frame is shown in purple, and in green the down-sampled low resolution frames generated from it. The training data is generated by sampled patches from these volumes.
+
+
+Figure 11: An overview of our network architecture. The first row shows the hierarchical point convolutions, while the bottom rows illustrate the processing of extracted features until the final output point coordinates are generated.
+
+
+Figure 12: Convergence plots for the training runs of our different 2D and 3D versions. The combined loss only illustrates convergence behavior for each method separately, as weights and terms differ across the four variants. $\mathcal{L}_M$ for previous work is not minimized, and only given for reference.
\ No newline at end of file
diff --git a/tranquilcloudsneuralnetworksforlearningtemporallycoherentfeaturesinpointclouds/images.zip b/tranquilcloudsneuralnetworksforlearningtemporallycoherentfeaturesinpointclouds/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..b97a156c14dae22c252dd4000d4bd52e7181d6b6
--- /dev/null
+++ b/tranquilcloudsneuralnetworksforlearningtemporallycoherentfeaturesinpointclouds/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c2d58c4912dc95efac653fa1503b736ac88072cb02be05a8a368b7e29d8e8a28
+size 665733
diff --git a/tranquilcloudsneuralnetworksforlearningtemporallycoherentfeaturesinpointclouds/layout.json b/tranquilcloudsneuralnetworksforlearningtemporallycoherentfeaturesinpointclouds/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..c4b796f09f3062c1ae2d3dd11d8c69311dc554a3
--- /dev/null
+++ b/tranquilcloudsneuralnetworksforlearningtemporallycoherentfeaturesinpointclouds/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:18ff53735ca3f2959e042f9db0c9b57c73a077ddf17cbf1150d61ce6623e72d3
+size 451065
diff --git a/truthorbackpropagandaanempiricalinvestigationofdeeplearningtheory/c871675d-cd82-4d13-b742-c623a29115c9_content_list.json b/truthorbackpropagandaanempiricalinvestigationofdeeplearningtheory/c871675d-cd82-4d13-b742-c623a29115c9_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..d842cb044f9f71949d385645b96c0369896bc0ac
--- /dev/null
+++ b/truthorbackpropagandaanempiricalinvestigationofdeeplearningtheory/c871675d-cd82-4d13-b742-c623a29115c9_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:75a2c8303c5d7f7d964201565f172ff85ea7e66f25f20563f96177e1ad8a649d
+size 108660
diff --git a/truthorbackpropagandaanempiricalinvestigationofdeeplearningtheory/c871675d-cd82-4d13-b742-c623a29115c9_model.json b/truthorbackpropagandaanempiricalinvestigationofdeeplearningtheory/c871675d-cd82-4d13-b742-c623a29115c9_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..33325f58b7dbbe7dfe063552ed16357f89411d55
--- /dev/null
+++ b/truthorbackpropagandaanempiricalinvestigationofdeeplearningtheory/c871675d-cd82-4d13-b742-c623a29115c9_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:6bfe655f696e47f9270650bee8749c52e4b3559a80ed3b33ff2d1bc3dc7b2f37
+size 130933
diff --git a/truthorbackpropagandaanempiricalinvestigationofdeeplearningtheory/c871675d-cd82-4d13-b742-c623a29115c9_origin.pdf b/truthorbackpropagandaanempiricalinvestigationofdeeplearningtheory/c871675d-cd82-4d13-b742-c623a29115c9_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..d40db57ca2196f373455429cbf538905ec7bd1ce
--- /dev/null
+++ b/truthorbackpropagandaanempiricalinvestigationofdeeplearningtheory/c871675d-cd82-4d13-b742-c623a29115c9_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:60cf0292f44a15ba2389334de1d2acb7d0f64395babb4d796280c5559b36d24d
+size 687010
diff --git a/truthorbackpropagandaanempiricalinvestigationofdeeplearningtheory/full.md b/truthorbackpropagandaanempiricalinvestigationofdeeplearningtheory/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..80b28a44fb6a2dc3ff4375c37c1609280c39fec4
--- /dev/null
+++ b/truthorbackpropagandaanempiricalinvestigationofdeeplearningtheory/full.md
@@ -0,0 +1,413 @@
+# TRUTH OR BACK PROPAGANDA? AN EMPIRICAL INVESTIGATION OF DEEP LEARNING THEORY
+
+# Micah Goldblum*
+
+Department of Mathematics
+University of Maryland
+goldblum@umd.edu
+
+# Jonas Geiping*
+
+Department of Computer Science and Electrical Engineering
+University of Siegen
+jonas.geiping@uni-siegen.de
+
+# Avi Schwarzschild
+
+Department of Mathematics
+University of Maryland
+avi1@umd.edu
+
+# Michael Moeller
+
+Department of Computer Science and Electrical Engineering
+University of Siegen
+michael.moeller@uni-siegen.de
+
+# Tom Goldstein
+
+Department of Computer Science
+University of Maryland
+tomq@umd.edu
+
+# ABSTRACT
+
+We empirically evaluate common assumptions about neural networks that are widely held by practitioners and theorists alike. In this work, we: (1) prove the widespread existence of suboptimal local minima in the loss landscape of neural networks, and we use our theory to find examples; (2) show that small-norm parameters are not optimal for generalization; (3) demonstrate that ResNets do not conform to wide-network theories, such as the neural tangent kernel, and that the interaction between skip connections and batch normalization plays a role; (4) find that rank does not correlate with generalization or robustness in a practical setting.
+
+# 1 INTRODUCTION
+
+Modern deep learning methods are descended from such long-studied fields as statistical learning, optimization, and signal processing, all of which were built on mathematically rigorous foundations. In statistical learning, principled kernel methods have vastly improved the performance of SVMs and PCA (Suykens & Vandewalle, 1999; Scholkopf et al., 1997), and boosting theory has enabled weak learners to generate strong classifiers (Schapire, 1990). Optimizers in deep learning are borrowed from the field of convex optimization, where momentum optimizers (Nesterov, 1983) and conjugate gradient methods provably solve ill-conditioned problems with high efficiency (Hestenes & Stiefel, 1952). Deep learning harnesses foundational tools from these mature parent fields.
+
+Despite its rigorous roots, deep learning has driven a wedge between theory and practice. Recent theoretical work has certainly made impressive strides towards understanding optimization and generalization in neural networks. But doing so has required researchers to make strong assumptions and study restricted model classes.
+
+In this paper, we seek to understand whether deep learning theories accurately capture the behaviors and network properties that make realistic deep networks work. Following a line of previous work, such as Swirszcz et al. (2016), Zhang et al. (2016), Balduzzi et al. (2017) and Santurkar et al. (2018), we put the assumptions and conclusions of deep learning theory to the test using experiments with both toy networks and realistic ones. We focus on the following important theoretical issues:
+
+- Local minima: Numerous theoretical works argue that all local minima of neural loss functions are globally optimal or that all local minima are nearly optimal. In practice, we find highly suboptimal local minima in realistic neural loss functions, and we discuss reasons why suboptimal local minima exist in the loss surfaces of deep neural networks in general.
+- Weight decay and parameter norms: Research inspired by Tikhonov regularization suggests that low-norm minima generalize better, and for many, this is an intuitive justification for simple regularizers like weight decay. Yet for neural networks, it is not at all clear which form of $\ell_2$ -regularization is optimal. We show this by constructing a simple alternative: biasing solutions toward a non-zero norm still works and can even measurably improve performance for modern architectures.
+- Neural tangent kernels and the wide-network limit: We investigate theoretical results concerning neural tangent kernels of realistic architectures. While stochastic sampling of the tangent kernels suggests that theoretical results on tangent kernels of multi-layer networks may apply to some multi-layer networks and basic convolutional architectures, the predictions from theory do not hold for practical networks, and the trend even reverses for ResNet architectures. We show that the combination of skip connections and batch normalization is critical for this trend in ResNets.
+- Rank: Generalization theory has provided guarantees for the performance of low-rank networks. However, we find that regularization which encourages high-rank weight matrices often outperforms that which promotes low-rank matrices. This indicates that low-rank structure is not a significant force behind generalization in practical networks. We further investigate the adversarial robustness of low-rank networks, which are thought to be more resilient to attack, and we find empirically that their robustness is often lower than the baseline or even a purposefully constructed high-rank network.
+
+# 2 LOCAL MINIMA IN LOSS LANDSCAPES: DO SUBOPTIMAL MINIMA EXIST?
+
+It is generally accepted that "in practice, poor local minima are rarely a problem with large networks." (LeCun et al., 2015). However, exact theoretical guarantees for this statement are elusive. Various theoretical studies of local minima have investigated spin-glass models (Choromanska et al., 2014), deep linear models (Laurent & Brecht, 2018; Kawaguchi, 2016), parallel subnetworks (Haefele & Vidal, 2017), and dense fully connected models (Nguyen et al., 2018) and have shown that either all local minima are global or all have a small optimality gap. The apparent scarcity of poor local minima has lead practitioners to develop the intuition that bad local minima ("bad" meaning high loss value and suboptimal training performance) are practically non-existent.
+
+To further muddy the waters, some theoretical works prove the existence of local minima. Such results exist for simple fully connected architectures (Swirszcz et al., 2016), single-layer networks (Liang et al., 2018; Yun et al., 2018), and two-layer ReLU networks (Safran & Shamir, 2017). For example, (Yun et al., 2019) show that local minima exist in single-layer networks with univariate output and unique datapoints. The crucial idea here is that all neurons are activated for all datapoints at the suboptimal local minima. Unfortunately, these existing analyses of neural loss landscapes require strong assumptions (e.g. random training data, linear activation functions, fully connected layers, or extremely wide network widths) — so strong, in fact, that it is reasonable to question whether these results have any bearing on practical neural networks or describe the underlying cause of good optimization performance in real-world settings.
+
+In this section, we investigate the existence of suboptimal local minima from a theoretical perspective and an empirical one. If suboptimal local minima exist, they are certainly hard to find by standard methods (otherwise training would not work). Thus, we present simple theoretical results that inform us on how to construct non-trivial suboptimal local minima, concretely generalizing previous constructions, such as those by (Yun et al., 2019). Using experimental methods inspired by theory, we easily find suboptimal local minima in the loss landscapes of a range of classifiers.
+
+Trivial local minima are easy to find in ReLU networks - consider the case where bias values are sufficiently low so that the ReLUs are "dead" (i.e. inputs to ReLUs are strictly negative). Such a point is trivially a local minimum. Below, we make a more subtle observation that multilayer perceptrons (MLPs) must have non-trivial local minima, provided there exists a linear classifier that
+
+performs worse than the neural network (an assumption that holds for virtually any standard benchmark problem). Specifically, we show that MLP loss functions contain local minima where they behave identically to a linear classifier on the same data.
+
+We now define a family of low-rank linear functions which represent an MLP. Let "rank- $s$ affine function" denote an operator of the form $G(\mathbf{x}) = A\mathbf{x} + \mathbf{b}$ with $\mathrm{rank}(A) = s$ .
+
+Definition 2.1. Consider a family of functions, $\{F_{\phi}:\mathbb{R}^{m}\to \mathbb{R}^{n}\}_{\phi \in \mathbb{R}^{P}}$ parameterized by $\phi$ . We say this family has rank- $s$ affine expression if for all rank- $s$ affine functions $G:\mathbb{R}^m\rightarrow \mathbb{R}^n$ and finite subsets $\Omega \subset \mathbb{R}^m$ , there exists $\phi$ with $F_{\phi}(\mathbf{x}) = G(\mathbf{x}), \forall \mathbf{x}\in \Omega$ . If $s = \min(n,m)$ we say that this family has full affine expression.
+
+We investigate a family of L-layer MLPs with ReLU activation functions, $\{F_{\phi}:\mathbb{R}^{m}\to$ $\mathbb{R}^n\}_{\phi \in \Phi}$ , and parameter vectors $\phi$ , i.e., $\phi = (A_1,\mathbf{b}_1,A_2,\mathbf{b}_2,\ldots ,A_L,\mathbf{b}_L)$ , $F_{\phi}(\mathbf{x}) =$ $H_{L}(f(H_{L - 1}\dots f(H_{1}(\mathbf{x}))))$ , where $f$ denotes the ReLU activation function and $H_{i}(\mathbf{z}) = A_{i}\mathbf{z} + \mathbf{b}_{i}$ . Let $A_{i}\in \mathbb{R}^{n_{i}\times n_{i - 1}}$ , $\mathbf{b}_i\in \mathbb{R}^{n_i}$ with $n_0 = m$ and $n_L = n$ .
+
+Lemma 1. Consider a family of $L$ -layer multilayer perceptrons with ReLU activations $\{F_{\phi}:\mathbb{R}^m\to \mathbb{R}^n\}_{\phi \in \Phi}$ , and let $s = \min_i n_i$ be the minimum layer width. Such a family has rank- $s$ affine expression.
+
+Proof. The idea of the proof is to use the singular value decomposition of any rank- $s$ affine function to construct the MLP layers and pick a bias large enough for all activations to remain positive. See Appendix A.1.
+
+The ability of MLPs to represent linear networks allows us to derive a theorem which implies that arbitrarily deep MLPs have local minima at which the performance of the underlying model on the training data is equal to that of a (potentially low-rank) linear model. In other words, neural networks inherit the local minima of elementary linear models.
+
+Theorem 1. Consider a training set, $\{(\mathbf{x}_i,y_i)\}_{i = 1}^N$ , a family $\{F_{\phi}\}_{\phi}$ of MLPs with $s = \min_{i}n_{i}$ being the smallest width. Consider a parameterized affine function $G_{A,\mathbf{b}}$ solving
+
+$$
+\min _ {A, \mathbf {b}} \mathcal {L} \left(G _ {A, \mathbf {b}}; \left\{\left(\mathbf {x} _ {i}, y _ {i}\right) \right\} _ {i = 1} ^ {N}\right), \quad \text {s u b j e c t t o r a n k} (A) \leq s, \tag {1}
+$$
+
+for a continuous loss function $\mathcal{L}$ . Then, for each local minimum, $(A',\mathbf{b}')$ , of the above training problem, there exists a local minimum, $\phi'$ , of the MLP loss $\mathcal{L}(F_{\phi};\{(\mathbf{x}_i,y_i)\}_{i=1}^N)$ with the property that $F_{\phi'}(\mathbf{x}_i) = G_{A',\mathbf{b}'}(\mathbf{x}_i)$ for $i = 1,2,\ldots,N$ .
+
+Proof. See appendix A.2.
+
+The proof of the above theorem constructs a network in which all activations of all training examples are positive, generalizing previous constructions of this type such as Yun et al. (2019) to more realistic architectures and settings. Another paper has employed a similar construction concurrently to our own work (He et al., 2020). We do expect that the general problem in expressivity occurs every time the support of the activations coincides for all training examples, as the latter reduces the deep network to an affine linear function (on the training set), which relates to the discussion in Balduzzi et al. (2017). We test this hypothesis below by initializing deep networks with biases of high variance.
+
+Remark 2.1 (CNN and more expressive local minima). Note that the above constructions of Lemma 1 and Theorem 1 are not limited to MLPs and could be extended to convolutional neural networks with suitably restricted linear mappings $G_{\phi}$ by using the convolution filters to represent identities and using the bias to avoid any negative activations on the training examples. Moreover, shallower MLPs can similarly be embedded into deeper MLPs recursively by replicating the behavior of each linear layer of the shallow MLP with several layers of the deep MLP. Linear classifiers, or even shallow MLPs, often have higher training loss than more expressive networks. Thus, we can use the idea of Theorem 1 to find various suboptimal local minima in the loss landscapes of neural networks. We confirm this with subsequent experiments.
+
+We find that initializing a network at a point that approximately conforms to Theorem 1 is enough to get trapped in a bad local minimum. We verify this by training a linear classifier on CIFAR-10 with
+
+Table 1: Local minima for MLPs generated via various initializations. We show loss, euclidean norm of the gradient vector, and minimum eigenvalue of the Hessian before and after training. We use 500 iterations of the power method on a shifted Hessian matrix computed on the full dataset to find the minimum eigenvalue. The experiment in the last row is trained with no momentum (NM).
+
+| Init. Type | At Initialization | After training |
| Loss | Grad. | Min. EV | Loss | Grad. | Min. EV |
| Default | 4.5963 | 0.5752 | -1.5549 | 0.0061 | 0.0074 | 0.0007 |
| Lemma 1 | 1.5702 | 0.0992 | 0.03125 | 1.5699 | 0.0414 | 0.0156 |
| Bias+20 | 31.204 | 343.99 | -1.7421 | 2.3301 | 0.0090 | 0.0005 |
| Bias ∈ U(-50, 50) | 51.445 | 378.36 | -430.49 | 2.3153 | 0.0048 | 0.0000 |
| Bias ∈ U(-10, 10) NM | 12.209 | 42.454 | -47.733 | 0.2198 | 0.0564 | 0.0013 |
+
+weight decay, (which has a test accuracy of $40.53\%$ , loss of 1.57, and gradient norm of 0.00375 w.r.t to the logistic regression objective). We then initialize a multilayer network as described in Lemma 1 to approximate this linear classifier and recompute these statistics on the full network (see Table 1). When training with this initialization, the gradient norm drops further, moving parameters even closer to the linear minimizer. The final training result still yields positive activations for the entire training dataset.
+
+Moreover, any isolated local minimum of a linear network results in many local minima of an MLP $F_{\phi'}$ , as the weights $\phi'$ constructed in the proof of Theorem 1 can undergo transformations such as scaling, permutation, or even rotation without changing $F_{\phi'}$ as a function during inference, i.e. $F_{\phi'}(\mathbf{x}) = F_{\phi}(\mathbf{x})$ for all $\mathbf{x}$ for an infinite set of parameters $\phi$ , as soon as $F$ has at least one hidden layer.
+
+While our first experiment initializes a deep MLP at a local minimum it inherited from a linear one to empirically illustrate our findings of Theorem 1, Table 1 also illustrates that similarly bad local minima are obtained when choosing large biases (third row) and choosing biases with large variance (fourth row) as conjectured above. To significantly reduce the bias, however, and still obtain a subpar optimum, we need to rerun the experiment with SGD without momentum, as shown in the last row, reflecting common intuition that momentum is helpful to move away from bad local optima.
+
+Remark 2.2 (Sharpness of sub-optimal local optima). An interesting additional property of minima found using the previously discussed initializations is that they are "sharp". Proponents of the sharp-flat hypothesis for generalization have found that minimizers with poor generalization live in sharp attracting basins with low volume and thus low probability in parameter space (Keskar et al., 2016; Huang et al., 2019), although care has to be taken to correctly measure sharpness (Dinh et al., 2017). Accordingly, we find that the maximum eigenvalue of the Hessian at each suboptimal local minimum is significantly higher than those at near-global minima. For example, the maximum eigenvalue of the initialization by Lemma 1 in Table 1 is estimated as 113,598.85 after training, whereas that of the default initialization is only around 24.01. While our analysis has focused on sub-par local optima in training instead of global minima with sub-par generalization, both the scarcity of local optima during normal training and the favorable generalization properties of neural networks seem to correlate with their sharpness.
+
+In light of our finding that neural networks trained with unconventional initialization reach suboptimal local minima, we conclude that poor local minima can readily be found with a poor choice of hyperparameters. Suboptimal minima are less scarce than previously believed, and neural networks avoid these because good initializations and stochastic optimizers have been fine-tuned over time. Fortunately, promising theoretical directions may explain good optimization performance while remaining compatible with empirical observations. The approach followed by Du et al. (2019) analyzes the loss trajectory of SGD, showing that it avoids bad minima. While this work assumes (unrealistically) large network widths, this theoretical direction is compatible with empirical studies, such as Goodfellow et al. (2014), showing that the training trajectory of realistic deep networks does not encounter significant local minima.
+
+# 3 WEIGHT DECAY: ARE SMALL $\ell_2$ -NORM SOLUTIONS BETTER?
+
+Classical learning theory advocates regularization for linear models, such as SVM and linear regression. For SVM, $\ell_2$ regularization endows linear classifiers with a wide-margin property (Cortes & Vapnik, 1995), and recent work on neural networks has shown that minimum norm neural network interpolators benefit from over-parametrization (Hastie et al., 2019). Following the long history of explicit parameter norm regularization for linear models, weight decay is used for training nearly all high performance neural networks (He et al., 2015a; Chollet, 2016; Huang et al., 2017; Sandler et al., 2018).
+
+In combination with weight decay, all of these cutting-edge architectures also employ batch normalization after convolutional layers (Ioffe & Szegedy, 2015). With that in mind, van Laarhoven (2017) shows that the regularizing effect of weight decay is counteracted by batch normalization, which removes the effect of shrinking weight matrices. Zhang et al. (2018) argue that the synergistic interaction between weight decay and batch norm arises because weight decay plays a large role in regulating the effective learning rate of networks, since scaling down the weights of convolutional layers amplifies the effect of each optimization step, effectively increasing the learning rate. Thus, weight decay increases the effective learning rate as the regularizer drags the parameters closer and closer towards the origin. The authors also suggest that data augmentation and carefully chosen learning rate schedules are more powerful than explicit regularizers like weight decay.
+
+Other work echos this sentiment and claims that weight decay and dropout have little effect on performance, especially when using data augmentation (Hernández-García & König, 2018). Hoffer et al. (2018) further study the relationship between weight decay and batch normalization, and they develop normalization with respect to other norms. Shah et al. (2018) instead suggest that minimum norm solutions may not generalize well in the over-parametrized setting.
+
+We find that the difference between performance of standard network architectures with and without weight decay is often statistically significant, even with a high level of data augmentation, for example, horizontal flips and random crops on CIFAR-10 (see Tables 2 and 3). But is weight decay the most effective form of $\ell_2$ regularization? Furthermore, is the positive effect of weight decay because the regularizer promotes small norm solutions? We generalize weight decay by biasing the $\ell_2$ norm of the weight vector towards other values using the following regularizer, which we call norm-bias:
+
+$$
+R _ {\mu} (\phi) = \left| \left(\sum_ {i = 1} ^ {P} \phi_ {i} ^ {2}\right) - \mu^ {2} \right|. \tag {2}
+$$
+
+$R_0$ is equivalent to weight decay, but we find that we can further improve performance by biasing the weights towards higher norms (see Tables 2 and 3). In our experiments on CIFAR-10 and CIFAR-100, networks are trained using weight decay coefficients from their respective original papers. ResNet-18 and DenseNet are trained with $\mu^2 = 2500$ and norm-bias coefficient 0.005, and MobileNetV2 is trained with $\mu^2 = 5000$ and norm-bias coefficient 0.001. $\mu$ is chosen heuristically by first training a model with weight decay, recording the norm of the resulting parameter vector, and setting $\mu$ to be slightly higher than that norm in order to avoid norm-bias leading to a lower parameter norm than weight decay. While we find that weight decay improves results over a nonregularized baseline for all three models, we also find that models trained with large norm bias (i.e., large $\mu$ ) outperform models trained with weight decay.
+
+These results lend weight to the argument that explicit parameter norm regularization is in fact useful for training networks, even deep CNNs with batch normalization and data augmentation. However, the fact that norm-biased networks can outperform networks trained with weight decay suggests that any benefits of weight decay are unlikely to originate from the superiority of small-norm solutions.
+
+To further investigate the effect of weight decay and parameter norm on generalization, we also consider models without batch norm. In this case, weight decay directly penalizes the norm of the linear operators inside a network, since there are no batch norm coefficients to compensate for the effect of shrinking weights. Our goal is to determine whether small-norm solutions are superior in this setting where the norm of the parameter vector is more meaningful.
+
+In our first experiment without batch norm, we experience improved performance training an MLP with norm-bias (see Table 3). In a state-of-the-art setting, we consider ResNet-20 with Fixup initialization, a ResNet variant that removes batch norm and instead uses a sophisticated initialization
+
+that solves the exploding gradient problem (Zhang et al., 2019). We observe that weight decay substantially improves training over SGD with no explicit regularization — in fact, ResNets with this initialization scheme train quite poorly without explicit regularization and data normalization. Still, we find that norm-bias with $\mu^2 = 1000$ and norm-bias coefficient 0.0005 achieves better results than weight decay (see Table 3). This once again refutes the theory that small-norm parameters generalize better and brings into doubt any relationship between classical Tikhonov regularization and weight decay in neural networks. See Appendix A.5 for a discussion concerning the final parameter norms of Fixup networks as well as additional experiments on CIFAR-100, a harder image classification dataset.
+
+Table 2: ResNet-18, DenseNet-40, and MobileNetV2 models trained on non-normalized CIFAR-10 data with various regularizers. Numerical entries are given by $\overline{m} (\pm s)$ , where $\overline{m}$ is the average accuracy over 10 runs, and $s$ represents standard error.
+
+| Model | No weight decay (%) | Weight decay (%) | Norm-bias (%) |
| ResNet | 93.46 (±0.05) | 94.06 (±0.07) | 94.86 (±0.05) |
| DenseNet | 89.26 (±0.08) | 92.27 (±0.06) | 92.49 (±0.06) |
| MobileNetV2 | 92.88 (±0.06) | 92.88 (±0.09) | 93.50 (±0.09) |
+
+Table 3: ResNet-18, DenseNet-40, MobileNetV2, ResNet-20 with Fixup initialization, and a 4-layer multi-layer perceptron (MLP) trained on normalized CIFAR-10 data with various regularizers. Numerical entries are given by $\overline{m} (\pm s)$ , where $\overline{m}$ is the average accuracy over 10 runs, and $s$ represents standard error.
+
+| Model | No weight decay (%) | Weight decay (%) | Norm-bias (%) |
| ResNet | 93.40 (±0.04) | 94.76 (±0.03) | 94.99 (±0.05) |
| DenseNet | 90.78 (±0.08) | 92.26 (±0.06) | 92.46 (±0.04) |
| MobileNetV2 | 92.84 (±0.05) | 93.64 (±0.05) | 93.64 (±0.03) |
| ResNet Fixup | 10.00 (±0.00) | 91.42 (±0.04) | 91.55 (±0.07) |
| MLP | 58.88 (±0.10) | 58.95 (±0.07) | 59.13 (±0.09) |
+
+# 4 KERNEL THEORY AND THE INFINITE-WIDTH LIMIT
+
+In light of the recent surge of works discussing the properties of neural networks in the infinite-width limit, in particular, connections between infinite-width deep neural networks and Gaussian processes, see Lee et al. (2017), several interesting theoretical works have appeared. The wide network limit and Gaussian process interpretations have inspired work on the neural tangent kernel (Jacot et al., 2018), while Lee et al. (2019) and Bietti et al. (2018) have used wide network assumptions to analyze the training dynamics of deep networks. The connection of deep neural networks to kernel-based learning theory seems promising, but how closely do current architectures match the predictions made for simple networks in the large-width limit?
+
+We focus on the Neural Tangent Kernel (NTK), developed in Jacot et al. (2018). Theory dictates that, in the wide-network limit, the neural tangent kernel remains nearly constant as a network trains. Furthermore, neural network training dynamics can be described as gradient descent on a convex functional, provided the NTK remains nearly constant during training (Lee et al., 2019). In this section, we experimentally test the validity of these theoretical assumptions.
+
+Fixing a network architecture, we use $\mathcal{F}$ to denote the function space parametrized by $\phi \in \mathbb{R}^p$ . For the mapping $F: \mathbb{R}^p \to \mathcal{F}$ , the NTK is defined by
+
+$$
+\Phi (\phi) = \sum_ {p = 1} ^ {P} \partial_ {\phi_ {p}} F (\phi) \otimes \partial_ {\phi_ {p}} F (\phi), \tag {3}
+$$
+
+where the derivatives $\partial_{\phi_p}F(\phi)$ are evaluated at a particular choice of $\phi$ describing a neural network. The NTK can be thought of as a similarity measure between images; given any two images as input, the NTK returns an $n\times n$ matrix, where $n$ is the dimensionality of the feature embedding of the neural network. We sample entries from the NTK by drawing a set of $N$ images $\{x_i\}$ from a dataset,
+
+and computing the entries in the NTK corresponding to all pairs of images in our image set. We do this for a random neural network $f: \mathbb{R}^m \to \mathbb{R}^n$ and computing the tensor $\Phi(\phi) \in R^{N \times N \times n \times n}$ of all pairwise realizations, restricted to the given data:
+
+$$
+\Phi (\phi) _ {i j k l} = \sum_ {p = 1} ^ {P} \partial_ {\phi_ {p}} f \left(\mathbf {x} _ {i}, \phi\right) _ {k} \cdot \partial_ {\phi_ {p}} f \left(\mathbf {x} _ {j}, \phi\right) _ {l} \tag {4}
+$$
+
+By evaluating Equation 4 using automatic differentiation, we compute slices from the NTK before and after training for a large range of architectures and network widths. We consider image classification on CIFAR-10 and compare a two-layer MLP, a four-layer MLP, a simple 5-layer ConvNet, and a ResNet. We draw 25 random images from CIFAR-10 to sample the NTK before and after training. We measure the change in the NTK by computing the correlation coefficient of the (vectorized) NTK before and after training. We do this for many network widths, and see what happens in the wide network limit. For MLPs we increase the width of the hidden layers, for the ConvNet (6-Layer, Convolutions, ReLU, MaxPooling), we increase the number of convolutional filters, for the ResNet we consider the WideResnet (Zagoruyko & Komodakis, 2016) architecture, where we increase its width parameter. We initialize all models with uniform He initialization as discussed in He et al. (2015b), departing from specific Gaussian initializations in theoretical works to analyze the effects for modern architectures and methodologies.
+
+
+(a)
+
+
+(b)
+
+
+(c)
+
+
+(d)
+Figure 1: (a) The relative norm of the neural tangent kernel as a function of the number of parameters is shown for several networks. This figure highlights the difference between the behavior of ResNets and other architectures. Figure 1c visualizes the same data in a logarithmic scale. (b) The correlation of the neural tangent kernel before and after training. We expect this coefficient to converge toward 1 in the infinite-width limit for multi-layer networks as in Jacot et al. (2018). We do not observe this trend for ResNets as is clear from the curve corresponding to the WideResNet. (d) The average norm of parameter change decreases for simple architectures but stays nearly constant for the WideResNet.
+
+The results are visualized in Figure 1, where we plot parameters of the NTK for these different architectures, showing how the number of parameters impacts the relative change in the NTK $(||\Phi_1 - \Phi_0|| / ||\Phi_0||)$ , where $\Phi_0 / \Phi_1$ denotes the sub-sampled NTK before/after training) and correlation coefficient $(\mathrm{Cov}(\Phi_1,\Phi_0) / \sigma (\Phi_1) / \sigma (\Phi_0))$ . Jacot et al. (2018) predicts that the NTK should change very little during training in the infinite-width limit.
+
+At first glance, it might seem that these expectations are hardly met for our (non-infinite) experiments. Figure 1a and Figure 1c show that the relative change in the NTK during training (and also
+
+the magnitude of the NTK) is rapidly increasing with width and remains large in magnitude for a whole range of widths of convolutional architectures. The MLP architectures do show a trend toward small changes in the NTK, yet convergence to zero is slower in the 4-Layer case than in the 2-Layer case.
+
+However, a closer look shows that almost all of the relative change in the NTK seen in Figure 1c is explained by a simple linear re-scaling of the NTK. It should be noted that the scaling of the NTK is strongly effected by the magnitude of parameters at initialization. Within the NTK theory of Lee et al. (2017), a linear rescaling of the NTK during training corresponds simply to a change in learning rate, and so it makes more sense to measure similarity using a scale-invariant metric.
+
+Measuring similarity between sub-sampled NTKs using the scale-invariant correlation coefficient, as in Figure 1b, is more promising. Surprisingly, we find that, as predicted in Jacot et al. (2018), the NTK changes very little (beyond a linear rescaling) for the wide ConvNet architectures. For the dense networks, the predicted trend toward small changes in the NTK also holds for most of the evaluated widths, although there is a dropoff at the end which may be an artifact of the difficulty of training these wide networks on CIFAR-10. For the Wide Residual Neural Networks, however, the general trend toward higher correlation in the wide network limit is completely reversed. The correlation coefficient decreases as network width increases, suggesting that the neural tangent kernel at initialization and after training becomes qualitatively more different as network width increases. The reversal of the correlation trend seems to be a property which emerges from the interaction of batch normalization and skip connections. Removing either of these features from the architecture leads to networks which have an almost constant correlation coefficient for a wide range of network widths, see Figure 6 in the appendix, calling for the consideration of both properties in new formulations of the NTK.
+
+In conclusion, we see that although the NTK trends towards stability as the width of simple architectures increases, the opposite holds for the highly performant Wide ResNet architecture. Even further, neither the removal of batch normalization or the removal of skip connections fully recover the positive NTK trend. While we have hope that kernel-based theories of neural networks may yield guarantees for realistic (albeit wide) models in the future, current results do not sufficiently describe state-of-the-art architectures. Moreover, the already good behavior of models with unstable NTKs is an indicator that good optimization and generalization behaviors do not fundamentally hinge on the stability of the NTK.
+
+# 5 RANK:DO NETWORKS WITH LOW-RANK LAYERS GENERALIZE BETTER?
+
+State-of-the-art neural networks are highly over-parameterized, and their large number of parameters is a problem both for learning theory and for practical use. In the theoretical setting, rank has been used to tighten bounds on the generalization gap of neural networks. Generalization bounds from Harvey et al. (2017) are improved under conditions of low rank and high sparsity (Neyshabur et al., 2017) of parameter matrices, and the compressibility of low-rank matrices (and other low-dimensional structure) can be directly exploited to provide even stronger bounds (Arora et al., 2018). Further studies show a tendency of stochastic gradient methods to find low-rank solutions (Ji & Telgarsky, 2018). The tendency of SGD to find low-rank operators, in conjunction with results showing generalization bounds for low-rank operators, might suggest that the low-rank nature of these operators is important for generalization.
+
+Langenberg et al. (2019) claim that low-rank networks, in addition to generalizing well to test data, are more robust to adversarial attacks. Theoretical and empirical results from the aforementioned paper lead the authors to make two major claims. First, the authors claim that networks which undergo adversarial training have low-rank and sparse matrices. Second, they claim that networks with low-rank and sparse parameter matrices are more robust to adversarial attacks. We find in our experiments that neither claim holds up in practical settings, including ResNet-18 models trained on CIFAR-10.
+
+We test the generalization and robustness properties of neural networks with low-rank and high-rank operators by promoting low-rank or high-rank parameter matrices in late epochs. We employ the regularizer introduced in Sedghi et al. (2018) to create the protocols RankMin, to find low-rank parameters, and RankMax, to find high-rank parameters. RankMin involves fine-tuning a pre-trained
+
+| Model | Training method | Clean Test Accuracy (%) | Robust (%)
+ε = 8/255 | Robust (%)
+ε = 1/255 |
| ResNet-18 | Natural | 94.66 | 0.00 | 31.98 |
| RankMax | 93.66 | 0.00 | 22.01 |
| RankMin | 94.44 | 0.00 | 31.53 |
| Adversarial | 79.37 | 35.38 | 74.27 |
| RankMaxAdv | 80.00 | 35.55 | 74.92 |
| RankMinAdv | 78.34 | 33.68 | 73.19 |
| ResNet-18 w/o skips | Natural | 92.95 | 0.01 | 31.34 |
| RankMax | 91.71 | 0.00 | 18.81 |
| RankMin | 92.42 | 0.00 | 30.37 |
| Adversarial | 79.57 | 35.95 | 74.88 |
| RankMaxAdv | 79.43 | 36.45 | 74.87 |
| RankMinAdv | 78.52 | 33.97 | 73.64 |
+
+Table 4: Result presented here are from experiments with CIFAR-10 data and two of the architectures we studied. Robust accuracy is measured with 20-step PGD attacks with the $\epsilon$ values specified at the top of the column.
+
+
+(a) Effective rank of naturally trained models.
+
+
+(b) Effective rank of adversarially trained models.
+Figure 2: This plot shows the effective rank of each filter for the ResNet-18 models. The filters are indexed on the $x$ -axis, so moving to the right is like moving through the layers of the network. Our routines designed to manipulate the rank have exactly the desired effect as shown here.
+
+model by replacing linear operators with their low-rank approximations, retraining, and repeating this process. Similarly, RankMax involves fine-tuning a pre-trained model by clipping singular values from the SVD of parameter matrices in order to find high-rank approximations. We are able to manipulate the rank of matrices without strongly affecting the performance of the network. We use both natural training and 7-step projected gradient descent (PGD) adversarial training routines (Madry et al., 2017). The goal of the experiment is to observe how the rank of weight matrices impacts generalization and robustness. We start by attacking naturally trained models with the standard PGD adversarial attack with $\epsilon = 8 / 255$ . Then, we move to the adversarial training setting and test the effect of manipulating rank on generalization and on robustness.
+
+In order to compare our results with Langenberg et al. (2019), we borrow the notion of effective rank, denoted by $r(W)$ for some matrix $W$ . This continuous relaxation of rank is defined as follows. $r(W) = \frac{\|W\|_{*}}{\|W\|_{F}}$ where $\| \cdot \|_{*}$ , $\| \cdot \|_{1}$ , and $\| \cdot \|_{F}$ are the nuclear norm, the 1-norm, and the Frobenius norm, respectively. Note that the singular values of convolution operators can be found quickly with a method from Sedghi et al. (2018), and that method is used here.
+
+In our experiments we investigate two architectures, ResNet-18 and ResNet-18 without skip connections. We train on CIFAR-10 and CIFAR-100, both naturally and adversarially. Table 4 shows that RankMin and RankMax achieve similar generalization on CIFAR-10. More importantly, when adversarially training, a setting when robustness is undeniably the goal, we see the RankMax outperforms both RankMin and standard adversarial training in robust accuracy. Figure 2 confirms that
+
+these two training routines do, in fact, control effective rank. Experiments with CIFAR-100 yield similar results and are presented in Appendix A.7. It is clear that increasing rank using an analogue of rank minimizing algorithms does not harm performance. Moreover, we observe that adversarial robustness does not imply low-rank operators, nor do low-rank operators imply robustness. The findings in Ji & Telgarsky (2018) are corroborated here as the black dots in Figures 2 show that initializations are higher in rank than the trained models. Our investigation into what useful intuition in practical cases can be gained from the theoretical work on the rank of CNNs and from the claims about adversarial robustness reveals that rank plays little to no role in the performance of CNNs in the practical setting of image classification.
+
+# 6 CONCLUSION
+
+This work highlights the gap between deep learning theory and observations in the real-world setting. We underscore the need to carefully examine the assumptions of theory and to move past the study of toy models, such as deep linear networks or single-layer MLPs, whose traits do not describe those of the practical realm. First, we show that realistic neural networks on realistic learning problems contain suboptimal local minima. Second, we show that low-norm parameters may not be optimal for neural networks, and in fact, biasing parameters to a non-zero norm during training improves performance on several popular datasets and a wide range of networks. Third, we show that the wide-network trends in the neural tangent kernel do not hold for ResNets and that the interaction between skip connections and batch normalization play a large role. Finally, we show that low-rank linear operators and robustness are not correlated, especially for adversarially trained models.
+
+# ACKNOWLEDGMENTS
+
+This work was supported by the AFOSR MURI Program, the National Science Foundation DMS directorate, and also the DARPA YFA and L2M programs. Additional funding was provided by the Sloan Foundation.
+
+# REFERENCES
+
+Sanjeev Arora, Rong Ge, Behnam Neyshabur, and Yi Zhang. Stronger generalization bounds for deep nets via a compression approach. In International Conference on Machine Learning, pp. 254-263, 2018.
+David Balduzzi, Marcus Frean, Lennox Leary, J. P. Lewis, Kurt Wan-Duo Ma, and Brian McWilliams. The Shattered Gradients Problem: If resnets are the answer, then what is the question? arXiv:1702.08591 [cs, stat], February 2017. URL http://arxiv.org/abs/1702.08591.
+Alberto Bietti, Grégoire Mialon, Dexiong Chen, and Julien Mairal. A Kernel Perspective for Regularizing Deep Neural Networks. arXiv:1810.00363 [cs, stat], September 2018. URL http://arxiv.org/abs/1810.00363.
+François Chollet. Xception: Deep Learning with Depthwise Separable Convolutions. arXiv:1610.02357 [cs], October 2016. URL http://arxiv.org/abs/1610.02357.
+Anna Choromanska, Mikael Henaff, Michael Mathieu, Gérard Ben Arous, and Yann LeCun. The Loss Surfaces of Multilayer Networks. arXiv:1412.0233 [cs], November 2014. URL http://arxiv.org/abs/1412.0233.
+Corinna Cortes and Vladimir Vapnik. Support-vector networks. Machine learning, 20(3):273-297, 1995.
+Laurent Dinh, Razvan Pascanu, Samy Bengio, and Yoshua Bengio. Sharp Minima Can Generalize For Deep Nets. arXiv:1703.04933 [cs], March 2017. URL http://arxiv.org/abs/1703.04933.
+
+Simon Du, Jason Lee, Haochuan Li, Liwei Wang, and Xiyu Zhai. Gradient Descent Finds Global Minima of Deep Neural Networks. In International Conference on Machine Learning, pp. 1675-1685, May 2019. URL http://proceedings.mlr.press/v97/du19c.html.
+Ian J. Goodfellow, Oriol Vinyals, and Andrew M. Saxe. Qualitatively characterizing neural network optimization problems. arXiv:1412.6544 [cs, stat], December 2014. URL http://arxiv.org/abs/1412.6544.
+B. D. Haeffele and R. Vidal. Global Optimality in Neural Network Training. In 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 4390-4398, July 2017. doi: 10.1109/CVPR.2017.467.
+Nick Harvey, Christopher Liaw, and Abbas Mehrabian. Nearly-tight vc-dimension bounds for piecewise linear neural networks. CoRR, abs/1703.02930, 2017. URL http://arxiv.org/abs/1703.02930.
+Trevor Hastie, Andrea Montanari, Saharon Rosset, and Ryan J Tibshirani. Surprises in high-dimensional ridgeless least squares interpolation. arXiv preprint arXiv:1903.08560, 2019.
+Fengxiang He, Bohan Wang, and Dacheng Tao. Piecewise linear activations substantially shape the loss surfaces of neural networks. International Conference of Learning Representations, 2020.
+Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep Residual Learning for Image Recognition. arXiv:1512.03385 [cs], December 2015a. URL http://arxiv.org/abs/1512.03385.
+Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Delving Deep into Rectifiers: Surpassing Human-Level Performance on ImageNet Classification. arXiv:1502.01852 [cs], February 2015b. URL http://arxiv.org/abs/1502.01852.
+Alex Hernández-García and Peter König. Do deep nets really need weight decay and dropout? arXiv:1802.07042 [cs], February 2018. URL http://arxiv.org/abs/1802.07042.
+Magnus Rudolph Hestenes and Eduard Stiefel. Methods of conjugate gradients for solving linear systems, volume 49. NBS Washington, DC, 1952.
+Elad Hoffer, Ron Banner, Itay Golan, and Daniel Soudry. Norm matters: Efficient and accurate normalization schemes in deep networks. arXiv:1803.01814 [cs, stat], March 2018. URL http://arxiv.org/abs/1803.01814.
+Gao Huang, Zhuang Liu, Laurens Van Der Maaten, and Kilian Q Weinberger. Densely connected convolutional networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 4700-4708, 2017.
+W Ronny Huang, Zeyad Emam, Micah Goldblum, Liam Fowl, Justin K Terry, Furong Huang, and Tom Goldstein. Understanding generalization through visualizations. arXiv preprint arXiv:1906.03291, 2019.
+Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv preprint arXiv:1502.03167, 2015.
+Arthur Jacot, Franck Gabriel, and Clément Hongler. Neural Tangent Kernel: Convergence and Generalization in Neural Networks. arXiv:1806.07572 [cs, math, stat], June 2018. URL http://arxiv.org/abs/1806.07572.
+Ziwei Ji and Matus Telgarsky. Gradient descent aligns the layers of deep linear networks. arXiv preprint arXiv:1810.02032, 2018.
+Kenji Kawaguchi. Deep Learning without Poor Local Minima. arXiv:1605.07110 [cs, math, stat], May 2016. URL http://arxiv.org/abs/1605.07110.
+Nitish Shirish Keskar, Dheevatsa Mudigere, Jorge Nocedal, Mikhail Smelyanskiy, and Ping Tak Peter Tang. On Large-Batch Training for Deep Learning: Generalization Gap and Sharp Minima. arXiv:1609.04836 [cs, math], September 2016. URL http://arxiv.org/abs/1609.04836.
+
+Peter Langenberg, Emilio Rafael Balda, Arash Behboodi, and Rudolf Mathar. On the effect of low-rank weights on adversarial robustness of neural networks. CoRR, abs/1901.10371, 2019. URL http://arxiv.org/abs/1901.10371.
+Thomas Laurent and James Brecht. Deep linear networks with arbitrary loss: All local minima are global. In International Conference on Machine Learning, pp. 2908-2913, 2018.
+Yann LeCun, Yoshua Bengio, and Geoffrey Hinton. Deep learning. Nature, 521(7553):436-444, May 2015. ISSN 1476-4687. doi: 10.1038/nature14539.
+Jaehoon Lee, Yasaman Bahri, Roman Novak, Samuel S. Schoenholz, Jeffrey Pennington, and Jascha Sohl-Dickstein. Deep Neural Networks as Gaussian Processes. arXiv:1711.00165 [cs, stat], October 2017. URL http://arxiv.org/abs/1711.00165.
+Jaehoon Lee, Lechao Xiao, Samuel S. Schoenholz, Yasaman Bahri, Roman Novak, Jascha Sohl-Dickstein, and Jeffrey Pennington. Wide Neural Networks of Any Depth Evolve as Linear Models Under Gradient Descent. arXiv:1902.06720 [cs, stat], February 2019. URL http://arxiv.org/abs/1902.06720.
+Shiyu Liang, Ruoyu Sun, Yixuan Li, and R. Srikant. Understanding the Loss Surface of Neural Networks for Binary Classification. arXiv:1803.00909 [cs, stat], February 2018. URL http://arxiv.org/abs/1803.00909.
+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.
+Yurii Nesterov. A method for unconstrained convex minimization problem with the rate of convergence o $(1 / \mathbf{k}^{\wedge}2)$ . In Doklady AN USSR, volume 269, pp. 543-547, 1983.
+Behnam Neyshabur, Srinadh Bhojanapalli, David McAllester, and Nathan Srebro. A pac-bayesian approach to spectrally-normalized margin bounds for neural networks. CoRR, abs/1707.09564, 2017. URL http://arxiv.org/abs/1707.09564.
+Quynh Nguyen, Mahesh Chandra Mukkamala, and Matthias Hein. On the loss landscape of a class of deep neural networks with no bad local valleys. arXiv:1809.10749 [cs, stat], September 2018. URL http://arxiv.org/abs/1809.10749.
+Itay Safran and Ohad Shamir. Spurious Local Minima are Common in Two-Layer ReLU Neural Networks. arXiv:1712.08968 [cs, stat], December 2017. URL http://arxiv.org/abs/1712.08968.
+Mark Sandler, Andrew Howard, Menglong Zhu, Andrey Zhmoginov, and Liang-Chieh Chen. *Mobilenetv2: Inverted residuals and linear bottlenecks*. In *Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition*, pp. 4510-4520, 2018.
+Shibani Santurkar, Dimitris Tsipras, Andrew Ilyas, and Aleksander Madry. How Does Batch Normalization Help Optimization? arXiv:1805.11604 [cs, stat], May 2018. URL http://arxiv.org/abs/1805.11604.
+Robert E Schapire. The strength of weak learnability. Machine learning, 5(2):197-227, 1990.
+Bernhard Scholkopf, Alexander Smola, and Klaus-Robert Müller. Kernel principal component analysis. In International conference on artificial neural networks, pp. 583-588. Springer, 1997.
+Hanie Sedghi, Vineet Gupta, and Philip M Long. The singular values of convolutional layers. arXiv preprint arXiv:1805.10408, 2018.
+Vatsal Shah, Anastasios Kyrillidis, and Sujay Sanghavi. Minimum norm solutions do not always generalize well for over-parameterized problems. arXiv preprint arXiv:1811.07055, 2018.
+Johan AK Suykens and Joos Vandewalle. Least squares support vector machine classifiers. Neural processing letters, 9(3):293-300, 1999.
+
+Grzegorz Swirszcz, Wojciech Marian Czarnecki, and Razvan Pascanu. Local minima in training of neural networks. arXiv:1611.06310 [cs, stat], November 2016. URL http://arxiv.org/abs/1611.06310.
+Twan van Laarhoven. L2 Regularization versus Batch and Weight Normalization. arXiv:1706.05350 [cs, stat], June 2017. URL http://arxiv.org/abs/1706.05350.
+Chulhee Yun, Suvrit Sra, and Ali Jadbabaie. Small nonlinearities in activation functions create bad local minima in neural networks. arXiv:1802.03487 [cs, math, stat], February 2018. URL http://arxiv.org/abs/1802.03487.
+Chulhee Yun, Suvrit Sra, and Ali Jabbabaie. Small nonlinearities in activation functions create bad local minima in neural networks. In International Conference on Learning Representations, 2019. URL https://openreview.net/forum?id=rke_YiRCT7.
+Sergey Zagoruyko and Nikos Komodakis. Wide Residual Networks. arXiv:1605.07146 [cs], May 2016. URL http://arxiv.org/abs/1605.07146.
+Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning requires rethinking generalization. arXiv:1611.03530 [cs], November 2016. URL http://arxiv.org/abs/1611.03530.
+Guodong Zhang, Chaoqi Wang, Bowen Xu, and Roger Grosse. Three Mechanisms of Weight Decay Regularization. arXiv:1810.12281 [cs, stat], October 2018. URL http://arxiv.org/abs/1810.12281.
+Hongyi Zhang, Yann N. Dauphin, and Tengyu Ma. Fixup Initialization: Residual Learning Without Normalization. arXiv:1901.09321 [cs, stat], January 2019. URL http://arxiv.org/abs/1901.09321.
+
+# A APPENDIX
+
+# A.1 PROOF OF LEMMA 1
+
+Lemma 1. Consider a family of $L$ -layer multilayer perceptrons with ReLU activations $\{F_{\phi}:\mathbb{R}^{m}\to \mathbb{R}^{n}\}$ and let $s = \min_{i}n_{i}$ be the minimum layer width. Then this family has rank- $s$ affine expression.
+
+Proof. Let $G$ be a rank- $s$ affine function, and $\Omega \subset \mathbb{R}^m$ be a finite set. Let $G(\mathbf{x}) = A\mathbf{x} + \mathbf{b}$ with $A = U\Sigma V$ being the singular value decomposition of $A$ with $U \in \mathbb{R}^{n\times s}$ and $V \in \mathbb{R}^{s\times m}$ .
+
+We define
+
+$$
+A _ {1} = \left[ \begin{array}{c} \Sigma V \\ \mathbf {0} \end{array} \right]
+$$
+
+where $\mathbf{0}$ is a (possibly void) $(n_{1} - s)\times m$ matrix of all zeros, and $b_{1} = c\mathbf{1}$ for $c = \max_{\mathbf{x}_i\in \Omega ,1\leq j\leq n_1}|(A_1\mathbf{x}_i)_j| + 1$ and $\mathbf{1}\in \mathbb{R}^{n_1}$ being a vector of all ones. We further choose $A_{l}\in \mathbb{R}^{n_{l}\times n_{l - 1}}$ to have an $s\times s$ identity matrix in the upper left, and fill all other entries with zeros. This choice is possible since $n_l\geq s$ for all $l$ . We define $\mathbf{b}_l = \left[\mathbf{0}\quad c\mathbf{1}\right]^T\in \mathbb{R}^{n_l}$ where $\mathbf{0}\in \mathbb{R}^{1\times s}$ is a vector of all zeros and $\mathbf{1}\in \mathbb{R}^{1\times (n_l - s)}$ is a (possibly void) vector of all ones.
+
+Finally, we choose $A_{L} = [U \quad \mathbf{0}]$ , where now $\mathbf{0}$ is a (possibly void) $n \times (n_{L-1} - s)$ matrix of all zeros, and $\mathbf{b}_{L} = -cA_{L}\mathbf{1} + \mathbf{b}$ for $\mathbf{1} \in \mathbb{R}^{n_{L-1}}$ being a vector of all ones.
+
+Then one readily checks that $F_{\phi}(\mathbf{x}) = G(\mathbf{x})$ holds for all $x \in \Omega$ . Note that all entries of all activations are greater or equal to $c > 0$ , such that no ReLU ever maps an entry to zero.
+
+# A.2 PROOF OF THEOREM 1
+
+Theorem 1. Consider a training set, $\{(\mathbf{x}_i,y_i)\}_{i = 1}^N$ , a family $\{F_{\phi}\}$ of MLPs with $s = \min_{i}n_{i}$ being the smallest width. Consider the training of a rank-s linear classifier $G_{A,\mathbf{b}}$ , i.e.,
+
+$$
+\min _ {A, \mathbf {b}} \mathcal {L} \left(G _ {A, \mathbf {b}}; \left\{\left(\mathbf {x} _ {i}, y _ {i}\right) \right\} _ {i = 1} ^ {N}\right), \quad \text {s u b j e c t t o r a n k} (A) \leq s, \tag {5}
+$$
+
+for any continuous loss function $\mathcal{L}$ . Then for each local minimum, $(A',\mathbf{b}')$ , of the above training problem, there exists a local minimum, $\phi'$ , of $\mathcal{L}(F_{\phi};\{(\mathbf{x}_i,y_i)\}_{i=1}^N)$ with the property that $F_{\phi'}(\mathbf{x}_i) = G_{A',\mathbf{b}'}(\mathbf{x}_i)$ for $i = 1,2,\ldots,N$ .
+
+Proof. Based on the definition of a local minimum, there exists an open ball $D$ around $(A',\mathbf{b}')$ such that
+
+$$
+\mathcal {L} \left(G _ {A ^ {\prime}, \mathbf {b} ^ {\prime}}; \left\{\left(\mathbf {x} _ {i}, y _ {i}\right) \right\} _ {i = 1} ^ {N}\right) \leq \mathcal {L} \left(G _ {A, \mathbf {b}}; \left\{\left(\mathbf {x} _ {i}, y _ {i}\right) \right\} _ {i = 1} ^ {N}\right) \quad \forall (A, \mathbf {b}) \in D \text {w i t h} \operatorname {r a n k} (A) \leq s. \tag {6}
+$$
+
+First, we use the same construction as in the proof of Lemma 1 to find a function $F_{\phi'}$ with $F_{\phi'}(\mathbf{x}_i) = G_{A',\mathbf{b}'}(\mathbf{x}_i)$ for all training example $\mathbf{x}_i$ . Because the mapping $\phi \mapsto F_{\phi}(\mathbf{x}_i)$ is continuous (not only for the entire network $F$ but also for all subnetworks), and because all activations of $F_{\phi'}$ are greater or equal to $c > 0$ , there exists an open ball $B(\phi', \delta_1)$ around $\phi'$ such that the activations of $F_{\phi}$ remain positive for all $\mathbf{x}_i$ and all $\phi \in B(\phi', \delta_1)$ .
+
+Consequently, the restriction of $F_{\phi}$ to the training set remains affine linear for $\phi \in B(\phi', \delta_1)$ . In other words, for any $\phi \in B(\phi', \delta_1)$ we can write
+
+$$
+F _ {\phi} (\mathbf {x} _ {i}) = A (\phi) \mathbf {x} _ {i} + \mathbf {b} (\phi) \qquad \forall \mathbf {x} _ {i},
+$$
+
+by defining $A(\phi) = A_{L}A_{L - 1}\ldots A_{1}$ and $\mathbf{b}(\phi) = \sum_{l = 1}^{L}A_{L}A_{L - 1}\ldots A_{l + 1}\mathbf{b}_{l}$ . Note that due to $s = \min_i n_i$ , the resulting $A(\phi)$ satisfies $\mathrm{rank}(A(\phi))\leq s$ .
+
+After restricting $\phi$ to an open ball $B(\phi', \delta_2)$ , for $\delta_2 \leq \delta_1$ sufficiently small, the above $(A(\phi), \mathbf{b}(\phi))$ satisfy $(A(\phi), \mathbf{b}(\phi)) \in D$ for all $\phi \in B(\phi', \delta_2)$ . On this set, we, however, already know that the loss can only be greater or equal to $\mathcal{L}(F_{\phi'}; \{(\mathbf{x}_i, y_i)\}_{i=1}^N)$ due to equation 6. Thus, $\phi'$ is a local minimum of the underlying loss function.
+
+# A.3 ADDITIONAL COMMENTS REGARDING THEOREM 1
+
+Note that our theoretical and experimental results do not contradict theoretical guarantees for deep linear networks (Kawaguchi, 2016; Laurent & Brecht, 2018) which show that all local minima are global. A deep linear network with $s = \min(n, m)$ is equivalent to a linear classifier, and in this case, the local minima constructed by Theorem 1 are global. However, this observation shows that Theorem 1 characterizes the gap between deep linear and deep nonlinear networks; the global minima predicted by linear network theories are inherited as (usually suboptimal) local minima when ReLU's are added. Thus, linear networks do not accurately describe the distribution of minima in non-linear networks.
+
+# A.4 ADDITIONAL RESULTS FOR SUBOPTIMAL LOCAL OPTIMA
+
+Table 5 shows more experiments. As above in the previous experiment, we use gradient descent to train a full ResNet-18 architecture on CIFAR-10 until convergence from different initializations. We find that essentially the same results appear for the deeper architecture, initializing with very high bias leads to highly non-optimal solutions. In this case even solutions that are equally bad as a zero-norm initialization.
+
+Further results on CIFAR-100 are shown in Tables 6 and 7. These experiments with MLP and ResNet-18 show the same trends as explained above, thus confirming that the results are not specific to the CIFAR-10 dataset.
+
+# A.5 DETAILS CONCERNING LOW-NORM REGULARIZATION EXPERIMENTS
+
+Our experiments comparing regularizers all run for 300 epochs with an initial learning rate of 0.1 and decreases by a factor of 10 at epochs 100, 175, 225, and 275. We use the SGD optimizer with momentum 0.9.
+
+We also tried negative weight decay coefficients, which leads to ResNet-18 CIFAR-10 performance above $90\%$ while blowing up parameter norm, but this performance is still suboptimal and is not informative concerning the optimality of minimum norm solutions. One might wonder if high norm-bias coefficients lead to even lower parameter norm than low weight decay coefficients. This
+
+Table 5: Local minima for ResNet-18 and CIFAR-10 generated via initialization and trained by vanilla gradient descent, showing loss, euclidean norm of the gradient vector.
+
+| Init. Type | At Initialization | After training |
| Loss | Grad. | Loss | Grad. |
| Default | 2.30312 | 0.05000 | 0.00014 | 0.01410 |
| Zero | 2.30258 | 0.00025 | 2.30259 | 0.00013 |
| Bias+20 | 12.95754 | 590.12170 | 2.30658 | 0.00004 |
| Bias ∈ U(-10, 10) | 12.96790 | 214.68600 | 2.30260 | 0.00123 |
| Bias ∈ U(-50, 50) | 84.67800 | 1190.23500 | 2.30260 | 0.00702 |
+
+Table 6: Local minima for ResNet-18 and CIFAR-100 generated via initialization and trained by vanilla gradient descent, showing loss, euclidean norm of the gradient vector
+
+| Init. Type | At Initialization | After training |
| Loss | Grad. | Loss | Grad. |
| Default | 4.60591 | 0.02346 | 0.00030 | 0.00466 |
| Zero | 4.60517 | 0.00019 | 4.60517 | 0.00003 |
| Bias+20 | 34.37053 | 655.51569 | 4.60517 | 0.00015 |
| Bias ∈ U(-100, 100) | 178.74391 | 2615.72534 | 4.60517 | 0.00003 |
+
+Table 7: Local minima for MLP and CIFAR-100 generated via initialization and trained by vanilla gradient descent, showing loss, euclidean norm of the gradient vector.
+
+| Init. Type | At Initialization | After training |
| Loss | Grad. | Loss | Grad. |
| Default | 4.60670 | 0.16154 | 0.02579 | 0.01482 |
| Zero | 4.60517 | 0.00019 | 4.60517 | 0.00011 |
| Bias+10 | 15.77286 | 359.65710 | 4.60517 | 0.00079 |
| Bias ∈ U(-5,5) | 8.69149 | 63.59983 | 2.15917 | 0.09718 |
| Bias ∈ U(-10,10) | 13.02693 | 158.78347 | 2.58368 | 0.09233 |
+
+question may not be meaningful in the case of networks with batch normalization. In the case of ResNet-20 with Fixup, which does not contain running mean and standard deviation, the average parameter $\ell_2$ norm after training with weight decay is 24.51 while that of models trained with norm-bias is 31.62. Below, we perform the same tests on CIFAR-100, a substantially more difficult dataset. Weight decay coefficients are chosen to be ones used in the original paper for the corresponding architecture. Norm-bias coefficient/ $\mu^2$ is chosen to be $8100 / 0.005$ , $7500 / 0.001$ , and $2000 / 0.0005$ for ResNet-18, DenseNet-40, and ResNet-20 with Fixup, respectively, using the same heuristic as described in the main body.
+
+Table 8: ResNet-18, DenseNet-40, and ResNet-20 with Fixup initialization trained on normalized CIFAR-100 data with various regularizers. Numerical entries are given by $\overline{m} (\pm s)$ , where $\overline{m}$ is the average accuracy over 10 runs, and $s$ represents standard error.
+
+| Model | No weight decay (%) | Weight decay (%) | Norm-bias (%) |
| ResNet | 71.73 (±0.25) | 74.66 (±0.17) | 75.90 (±0.16) |
| DenseNet | 65.61 (±0.33) | 68.98 (±0.25) | 69.24 (±0.11) |
| ResNet Fixup | 1.000 (±0.00) | 65.08 (±0.30) | 65.58 (±0.17) |
+
+# A.6 DETAILS ON THE NEURAL TANGENT KERNEL EXPERIMENT
+
+For further reference, we include details on the NTK sampling during training epochs in Figure 3. We see that the parameter norm (Right) behaves normally (all of these experiments are trained with a standard weight decay parameter of 0.0005), yet the NTK norm (Left) rapidly increases. Most of this increase, however is scaling of the kernel, as the correlation plot (Middle) is much less drastic. We do see that most change happens in the very first epochs of training, whereas the kernel only changes slowly later on.
+
+
+Figure 3: Plotting the evolution of NTK parameters during training epochs. Left: Norm of the NTK Tensor, Middle: Correlation of current NTK iterate versus initial NTK. Right: Reference plot of the network parameter norms.
+
+
+
+
+
+
+Figure 4: The similarity coefficient of the neural tangent kernel after training with its initialization. We expect this coefficient to converge toward 1 in the infinite-width limit for multi-layer networks. Also shown is the direct relative difference of the NTK norms, which behaves similarly to the normalized direct difference from figure 1.
+
+
+
+
+Figure 5: For reference we record the test accuracy of all models from 1 in the left plot and the relative change in parameters in the right plot.
+
+
+
+
+Figure 6: The correlation coefficient of the neural tangent kernel after training with its initialization for different WideResNet variants - namely WideResNet without batch normalizations and WideResNet without skip connections. We interestingly find that removing either of both properties, which are widely regarding as beneficial for neural network training, stabilizes the trend seen in the default WideResNet. However both variants hardly converge toward 1, even when sampling very wide ResNets.
+
+
+
+# A.7 DETAILS ON RANKMIN AND RANKMAX
+
+We employ routines to promote both low-rank and high-rank parameter matrices. We do this by computing approximations to the linear operators at each layer. Since convolutional layers are linear operations, we know that there is a matrix whose dimensions are the number of parameters in the input to the convolution and the number of parameters in the output of the convolution. In order to compute low-rank approximations of these operators, one could write down the matrix corresponding to the convolution, and then compute a low-rank approximation using a singular value decomposition (SVD). In order to make this problem computationally tractable we used the method for computing singular values of convolution operators derived in Sedghi et al. (2018). We were then able to do low-rank approximation in the classical sense, by setting each singular value below some threshold to zero. In order to compute high-rank operators, we clipped the singular values so that when mulitplying the SVD factors, we set each singular value to be equal to the minimum of some chosen constant and the true singular value. It is important to note here that these approximations to the convolutional layers, when done naively, can return convolutions with larger filters. To be precise, an $n \times n$ filter will map to a $k \times k$ filter through our rank modifications, where $k \geq n$ . We follow the method in Sedghi et al. (2018), where these filters are pruned back down by only using $n \times n$ entries in the output.
+
+When naturally training ResNet-18 and Skipless ResNet-18 models, we train with a batch size of 128 for 200 epochs with the learning rate initiated to 0.01 and decreasing by a factor of 10 at epochs 100, 150, 175, and 190 (for both CIFAR-10 and CIFAR-100). When adversariably training these two models on CIFAR-10 data, we use the same hyperparameters. However, in order to adversarially train on CIFAR-100, we train ResNet-18 with a batch size of 256 for 300 epochs with an initial learning rate of 0.1 and a decrease by a factor of 10 at epochs 200 and 250. For adversarially training Skipless ResNet-18 on CIFAR-100, we use a batch size of 256 for 350 epochs with an
+
+initial learning rate of 0.1 and a decrease by a factor of 10 at epochs 200, 250, and 300. Adversarial training is done with an $\ell_{\infty}$ 7-step PGD attack with a step size of $2/255$ , and $\epsilon = 8/255$ . For all of the training described above we augment the data with random crops and horizontal flips.
+
+During 15 additional epochs of training we manipulate the rank as follows. RankMin and RankMax protocols are employed periodically in the last 15 epochs taking care to make sure that the loss remains small. For these last epochs, the learning rate starts at 0.001 and decreases by a factor of 10 after the third and fifth epochs of the final 15 epochs. As shown in Table 10, we test the accuracy of each model on clean test data from the corresponding dataset, as well as on adversarial examples generated with 20-step PGD with $\epsilon = 8 / 255$ (with step size equal to $2 / 255$ ) and $\epsilon = 1 / 255$ (with step size equal to .25/255).
+
+When training multi-layer perceptrons on CIFAR-10, we train for 100 epochs with learning rate initialized to 0.01 and decreasing by a factor of 10 at epochs 60, 80 and 90. Then, we train the network for 8 additional epochs, during which RankMin and RankMax networks undergo rank manipulation.
+
+Table 9: Results from rank experiments with a multi-layer perceptron and CIFAR-10.
+MLP and CIFAR-10
+
+| Training method | Training Accuracy (%) | Clean Accuracy (%) | Robust (%)
+ε = 8/255 | Robust (%)
+ε = 1/255 |
| Naturally Trained | 100.00 | 58.79 | 3.76 | 28.94 |
| RankMax | 99.97 | 58.19 | 3.72 | 26.63 |
| RankMin | 100.00 | 58.06 | 3.76 | 28.48 |
+
+Table 10: Results from rank experiments on CIFAR-100. Robust accuracy is measured with 20-step PGD attacks with the $\epsilon$ values specified at the top of the column.
+ResNet-18 and CIFAR-100
+
+| Training method | Training Accuracy (%) | Clean Accuracy (%) | Robust (%) ε = 8/255 | Robust (%) ε = 1/255 |
| Naturally Trained | 99.97 | 73.08 | 0.00 | 17.5 |
| RankMax | 99.90 | 72.67 | 0.00 | 16.95 |
| RankMin | 99.92 | 72.57 | 0.00 | 17.63 |
| Adversarily Trained | 99.92 | 50.88 | 17.81 | 45.99 |
| RankMaxAdv | 99.73 | 51.04 | 16.80 | 45.74 |
| RankMinAdv | 99.91 | 50.22 | 16.64 | 45.03 |
+
+ResNet-18 w/o skip connections and CIFAR-100
+
+| Training method | Training Accuracy (%) | Clean Accuracy (%) | Robust (%)
+ε = 8/255 | Robust (%)
+ε = 1/255 |
| Naturally Trained | 99.96 | 72.13 | 0.01 | 13.7 |
| RankMax | 99.82 | 71.35 | 0.04 | 11.74 |
| RankMin | 99.90 | 71.28 | 0.00 | 13.53 |
| Adversarially Trained | 99.92 | 50.47 | 17.62 | 45.18 |
| RankMaxAdv | 99.90 | 50.93 | 17.72 | 45.78 |
| RankMinAdv | 99.91 | 49.37 | 16.77 | 44.41 |
\ No newline at end of file
diff --git a/truthorbackpropagandaanempiricalinvestigationofdeeplearningtheory/images.zip b/truthorbackpropagandaanempiricalinvestigationofdeeplearningtheory/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..99c2024171833eb7e16f802c35aeddd1f8172ca3
--- /dev/null
+++ b/truthorbackpropagandaanempiricalinvestigationofdeeplearningtheory/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:2cfbaf83566d60d4c798a59d64e0736fd8a92259083e269a8e6531537b2fca1f
+size 713512
diff --git a/truthorbackpropagandaanempiricalinvestigationofdeeplearningtheory/layout.json b/truthorbackpropagandaanempiricalinvestigationofdeeplearningtheory/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..93e25100ca6fc6bb18a9cc3a8208d80cd3bb35ca
--- /dev/null
+++ b/truthorbackpropagandaanempiricalinvestigationofdeeplearningtheory/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:fece48710d8bf8e383fd0b294dcd3ff13733d94e4147a5f9d239f33f2a9f21cb
+size 570835
diff --git a/unbiasedcontrastivedivergencealgorithmfortrainingenergybasedlatentvariablemodels/9dcfe91d-1a52-4518-be1a-6170223fc0aa_content_list.json b/unbiasedcontrastivedivergencealgorithmfortrainingenergybasedlatentvariablemodels/9dcfe91d-1a52-4518-be1a-6170223fc0aa_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..86e9eea6a583a6ba04fc91deadb65fed42887c3e
--- /dev/null
+++ b/unbiasedcontrastivedivergencealgorithmfortrainingenergybasedlatentvariablemodels/9dcfe91d-1a52-4518-be1a-6170223fc0aa_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:571ae39ffa6c817352e19e4d35bfd3bd90911c8c5cc95045a9796a8e35ec4121
+size 112295
diff --git a/unbiasedcontrastivedivergencealgorithmfortrainingenergybasedlatentvariablemodels/9dcfe91d-1a52-4518-be1a-6170223fc0aa_model.json b/unbiasedcontrastivedivergencealgorithmfortrainingenergybasedlatentvariablemodels/9dcfe91d-1a52-4518-be1a-6170223fc0aa_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..5b0c32066ef80510c2fc3189973999f11020c614
--- /dev/null
+++ b/unbiasedcontrastivedivergencealgorithmfortrainingenergybasedlatentvariablemodels/9dcfe91d-1a52-4518-be1a-6170223fc0aa_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:1530adb475feb16357bc28ce2b5d1182beb9d86b288e68033f019340ff422918
+size 132879
diff --git a/unbiasedcontrastivedivergencealgorithmfortrainingenergybasedlatentvariablemodels/9dcfe91d-1a52-4518-be1a-6170223fc0aa_origin.pdf b/unbiasedcontrastivedivergencealgorithmfortrainingenergybasedlatentvariablemodels/9dcfe91d-1a52-4518-be1a-6170223fc0aa_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..9a88d8a63af7024e07ce8f296e1845e2db29da7b
--- /dev/null
+++ b/unbiasedcontrastivedivergencealgorithmfortrainingenergybasedlatentvariablemodels/9dcfe91d-1a52-4518-be1a-6170223fc0aa_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:337afbcecc6f442ec0a9f32a6ba475be293551e1f7c0259c1c26c2ebfa428ded
+size 4232432
diff --git a/unbiasedcontrastivedivergencealgorithmfortrainingenergybasedlatentvariablemodels/full.md b/unbiasedcontrastivedivergencealgorithmfortrainingenergybasedlatentvariablemodels/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..2f2db1fd13a4b3823810711ddf052995356c93ab
--- /dev/null
+++ b/unbiasedcontrastivedivergencealgorithmfortrainingenergybasedlatentvariablemodels/full.md
@@ -0,0 +1,479 @@
+# UNBIASED CONTRASTIVE DIVERGENCE ALGORITHM FOR TRAINING ENERGY-BASED LATENT VARIABLE MODELS
+
+Yixuan Qiu
+
+Department of Statistics and Data Science
+
+Carnegie Mellon University
+
+Pittsburgh, PA 15213, USA
+
+yixuanq@andrew.cmu.edu
+
+Lingsong Zhang & Xiao Wang
+
+Department of Statistics
+
+Purdue University
+
+West Lafayette, IN 47907, USA
+
+{lingsong, wangxiao}@purdue.edu
+
+# ABSTRACT
+
+The contrastive divergence algorithm is a popular approach to training energy-based latent variable models, which has been widely used in many machine learning models such as the restricted Boltzmann machines and deep belief nets. Despite its empirical success, the contrastive divergence algorithm is also known to have biases that severely affect its convergence. In this article we propose an unbiased version of the contrastive divergence algorithm that completely removes its bias in stochastic gradient methods, based on recent advances on unbiased Markov chain Monte Carlo methods. Rigorous theoretical analysis is developed to justify the proposed algorithm, and numerical experiments show that it significantly improves the existing method. Our findings suggest that the unbiased contrastive divergence algorithm is a promising approach to training general energy-based latent variable models.
+
+# 1 INTRODUCTION
+
+Energy-based latent variable models cover a broad class of generative models that are frequently used to characterize sophisticated distributions of high-dimensional data. Popular examples of this class include the restricted Boltzmann machines (RBM, Smolensky, 1986; Hinton, 2012), deep belief nets (Hinton et al., 2006), and exponential family harmoniums (Welling et al., 2005), among many others. Energy-based models are complementary to directed generative models such as the variational autoencoders (Kingma & Welling, 2014), and have gained great success in synthesizing realistic data samples (Xie et al., 2016; 2018b). They can also be combined with directed models to build more sophisticated structures (Xie et al., 2018a). In this article we focus on the energy-based latent variable model, whose general form can be expressed in terms of the joint distribution of a visible random vector, $\mathbf{v} \in \mathbb{V} \subset \mathbb{R}^p$ , and a hidden or latent random vector, $\mathbf{h} \in \mathbb{H} \subset \mathbb{R}^r$ , with the density function
+
+$$
+p (\boldsymbol {v}, \boldsymbol {h}; \boldsymbol {\theta}) = \frac {1}{Z (\boldsymbol {\theta})} \exp \{- E (\boldsymbol {v}, \boldsymbol {h}; \boldsymbol {\theta}) \}, \tag {1}
+$$
+
+where $\theta \in \Theta$ is the unknown parameter vector, $E(\pmb{v},\pmb{h};\pmb{\theta})$ is the energy function, and $Z(\pmb{\theta})$ is a normalizing constant to ensure that $p(\pmb{v},\pmb{h};\pmb{\theta})$ is a legitimate probability density or mass function. The model distribution, $p_{\mathbf{v}}(\pmb{v};\pmb{\theta})$ , is defined to be the marginal distribution of $p(\pmb{v},\pmb{h};\pmb{\theta})$ .
+
+Similar to many other machine learning models, the standard approach to estimating the parameter vector $\theta$ is the maximum likelihood method. It can be shown that the derivative of the log-likelihood function can be expressed as the difference of two expectations, and hence Monte Carlo methods, especially the Markov chain Monte Carlo (MCMC, Gilks et al., 1995), can be used to approximate the gradient. Various optimization techniques, such as the stochastic gradient method (SG, Robbins & Monro, 1951; Bottou, 2010), can then proceed to iteratively update the parameter estimate. This strategy, though elegant in theory, is not without limitations. In particular, MCMC estimators are typically consistent in the limiting case, but biased on finite steps, so one needs to run MCMC for a long time to obtain an accurate gradient, which would take tremendous amount of computing time.
+
+To reduce the computational complexity, Hinton (2002) proposed a simple and fast algorithm, called the contrastive divergence (CD) algorithm. The basic idea of CD is to truncate MCMC at the $k$ -th step, and use the resulting approximate gradient to update $\theta$ , where $k$ is a fixed integer as small as one. Such an approach is usually referred to as the CD- $k$ algorithm. The simplicity and computational efficiency of CD makes it widely used in many popular energy-based models, and there was also numerous empirical evidence to illustrate the effectiveness of CD. More recently, the CD idea is applied to directed generative models (Ruiz & Titsias, 2019), where CD is used to define a loss function that combines variational inference and MCMC.
+
+However, the success of CD also raised a lot of questions regarding its convergence properties. Both theoretical and empirical results show that CD in general does not converge to a local minimum of the likelihood function (Carreira-Perpinan & Hinton, 2005), and diverges even in some simple models (Schulz et al., 2010; Fischer & Igel, 2010). The main issue of CD is that the truncation of MCMC produces a biased stochastic gradient for the log-likelihood function in every iteration, and such uncontrolled biases may be accumulated to distort the true ascent direction. Due to this reason, the training of energy-based models has been a longstanding challenge in machine learning research.
+
+In this article, we propose a new unbiased contrastive divergence (UCD) algorithm based on recent advances in unbiased MCMC theory, which offers new possibilities for solving the model training problem. In the seminal work Glynn & Rhee (2014), the authors developed an unbiased estimator for the expectation with respect to the invariant distribution of a Markov chain. More recently, this estimator was further extended to the MCMC setting by Jacob et al. (2017), using a technique called coupling. At a high level, by carefully designing the MCMC algorithm, one is able to get an unbiased MCMC estimator with only finite number of Markov transitions.
+
+Under the framework of Glynn & Rhee (2014) and Jacob et al. (2017), the proposed UCD algorithm is a Gibbs-sampler-based training method for energy-based latent variable models. We prove that the stochastic gradient generated by UCD is unbiased with a finite variance, which implies the convergence of SG based on it. Similar to CD- $k$ , UCD generates Markov chains to compute the gradient, but the chain in UCD stops at a random time, instead of a fixed one as in CD- $k$ . The theoretical analysis indicates that the stopping time has a finite expectation, so on average the computation can be completed in finite time. Besides theoretical justifications, our numerical experiments show that UCD significantly improves existing training algorithms, suggesting that it is a promising approach with a solid convergence guarantee. The implementation of the UCD algorithm is available at https://github.com/yixuan/cdtau. The highlights of this article are as follows:
+
+- We develop a new training algorithm for general energy-based latent variable models that include many popular models (e.g. RBM) as special cases. To our best knowledge, this is the first algorithm that has a solid convergence guarantee for such models.
+- The proposed algorithm resolves a longstanding problem of the CD algorithm, the bias in approximating the gradient. In particular, our method is completely unbiased, and theoretical justifications are developed to guarantee its convergence.
+- We have tailored a specialized algorithm for RBM, which is shown to significantly reduce the computational cost.
+
+# 2 A BRIEF REVIEW OF CONTRASTIVE DIVERGENCE
+
+In this section we briefly review the CD algorithm, and point out some of its weaknesses that have been studied in the existing literature. For a single observation $\pmb{v}$ , the marginal data log-likelihood function is $\ell(\pmb{\theta};\pmb{v}) = \log\{p_{\mathbf{v}}(\pmb{v};\pmb{\theta})\} = \log\{\int p(\pmb{v},\pmb{h};\pmb{\theta})\mathrm{d}\pmb{h}\}$ . Assume that $E(\pmb{v},\pmb{h};\pmb{\theta})$ is continuously differentiable for $\pmb{\theta}$ , and then with $n$ data points $\mathcal{D} = (\mathbf{v}_1,\dots,\mathbf{v}_n)$ , the derivative of the log-likelihood function $\ell(\pmb{\theta};\mathcal{D}) = \sum \ell(\pmb{\theta};\mathbf{v}_i)$ , also known as the score function, can be written as
+
+$$
+\frac {\partial \ell (\boldsymbol {\theta} ; \mathcal {D})}{\partial \boldsymbol {\theta}} = - n \left[ \mathbb {E} _ {(\mathbf {v}, \mathbf {h}) \sim p (\mathcal {D}) p (\mathbf {h} | \mathbf {v}; \boldsymbol {\theta})} \left\{\frac {\partial E (\mathbf {v} , \mathbf {h} ; \boldsymbol {\theta})}{\partial \boldsymbol {\theta}} \right\} - \mathbb {E} _ {(\mathbf {v}, \mathbf {h}) \sim p (\mathbf {v}, \mathbf {h}; \boldsymbol {\theta})} \left\{\frac {\partial E (\mathbf {v} , \mathbf {h} ; \boldsymbol {\theta})}{\partial \boldsymbol {\theta}} \right\} \right], \tag {2}
+$$
+
+where $p(\mathcal{D})$ stands for the empirical distribution of $\mathcal{D}$ , and $p(\boldsymbol{h}|\boldsymbol{v};\boldsymbol{\theta})$ is the conditional distribution of the latent variable $\mathbf{h}$ given $\mathbf{v} = \mathbf{v}$ . A simple derivation of (2) can be found in Fischer & Igel (2014). Throughout this article we denote $\mathbf{x} = (\mathbf{v},\mathbf{h}) \in \mathbb{X} \coloneqq \mathbb{V} \times \mathbb{H}$ and $f(\boldsymbol{x};\boldsymbol{\theta}) = \partial E(\boldsymbol{v},\boldsymbol{h};\boldsymbol{\theta}) / \partial \boldsymbol{\theta}$ . Then
+
+the two expectations in (2) can be abbreviated as $\mathbb{E}_{\mathcal{D}}\{f(\mathbf{x};\pmb {\theta})\}$ and $\mathbb{E}_{\mathcal{M}}\{f(\mathbf{x};\pmb {\theta})\}$ , respectively, where $\mathcal{M}:= p(\boldsymbol {v},\boldsymbol {h};\boldsymbol{\theta})$ is the complete model distribution.
+
+In many cases, for example the RBM model, $\mathbb{E}_{\mathcal{D}}\{f(\mathbf{x};\pmb {\theta})\}$ has a closed form, so the major computational difficulty comes from the $\mathbb{E}_{\mathcal{M}}\{f(\mathbf{x};\pmb {\theta})\}$ term. A common scheme to approximate this expectation is to run a Markov chain $\xi_0\to \xi_1\to \dots$ with $\mathcal{M}$ as the invariant distribution, and then under mild conditions we have $\lim_{t\to \infty}\mathbb{E}\{f(\xi_t;\pmb {\theta})\} = \mathbb{E}_{\mathcal{M}}\{f(\mathbf{x};\pmb {\theta})\}$ . Of course, such a limit cannot be reached in finite steps, so the CD- $k$ algorithm truncates the Markov chain at the $k$ -th step, resulting in the following approximation:
+
+$$
+\Delta (\boldsymbol {\theta}) := - \left[ \mathbb {E} _ {\mathcal {D}} \left\{f (\mathbf {x}; \boldsymbol {\theta}) \right\} - f \left(\xi_ {k}; \boldsymbol {\theta}\right) \right]. \tag {3}
+$$
+
+It is easy to see that $\Delta (\pmb {\theta})\approx n^{-1}\partial \ell (\pmb {\theta};\mathcal{D}) / \partial \pmb{\theta}$ is a stochastic approximation to the true gradient, so one can use SG to update $\pmb{\theta}$ via the iteration $\pmb{\theta}_{i + 1} = \pmb{\theta}_i + \alpha_i\Delta (\pmb {\theta}_i)$ , where $\pmb{\theta}_i$ is the parameter estimate in the $i$ -th iteration, and $\alpha_{i}$ is the step size.
+
+Despite its simplicity, various research articles have pointed out the weaknesses of the CD- $k$ algorithm. For instance, Sutskever & Tieleman (2010) gave an example to show that $\mathbb{E}\{\Delta(\theta)\}$ is not the gradient of any objective function, and Schulz et al. (2010); Fischer & Igel (2014) studied numerical experiments in which CD- $k$ does not converge at all for small $k$ values. Carreira-Perpinan & Hinton (2005) considered the fixed points of $\Delta(\theta)$ , the $\theta$ values such that $\mathbb{E}\{\Delta(\theta)\} = 0$ , and showed that they do not match the fixed points of $\partial \ell(\theta; \mathcal{D}) / \partial \theta$ in general. This implies that even if CD- $k$ converges, the resulting parameter estimate may not be a local minimum of the likelihood function.
+
+Another variant of CD is the persistent contrastive divergence (PCD, Tieleman, 2008; Tieleman & Hinton, 2009), which has been reported to improve CD in many numerical experiments. However, it is still an approximation method, and its convergence properties are more difficult to analyze, as the stochastic gradients generated by PCD become correlated across iterations. In fact, Schulz et al. (2010); Fischer & Igel (2010) also gave examples in which PCD failed to converge. There are also some other training methods as extensions to CD, such as the multi-grid method (Gao et al., 2018) and the short-run MCMC (Nijkamp et al., 2019), but all these methods inherit the bias of CD.
+
+To summarize, it is surprising that virtually none of the popular training methods for energy-based models, including CD and PCD, provide a solid convergence guarantee. The major defects of CD stem from the fact that $\Delta (\pmb {\theta})$ is a biased estimator for the true log-likelihood gradient, and SG may fail with uncontrolled bias accumulation. To this end, the ultimate solution is to design a training algorithm that completely removes the bias of CD.
+
+# 3 THE UNBIASED CONTRASTIVE DIVERGENCE ALGORITHM
+
+# 3.1 UNBIASED MCMC ESTIMATORS
+
+Since CD highly relies on the MCMC method, the main ingredient of the proposed UCD algorithm is the theory of unbiased MCMC developed by Glynn & Rhee (2014) and Jacob et al. (2017). Consider the second term in (2), namely, $\mathbb{E}_{\mathcal{M}}\{f(\mathbf{x};\boldsymbol {\theta})\}$ . In what follows we omit the dependence on $\pmb{\theta}$ for brevity if no confusion is caused. If a Markov chain $\{\xi_t\}$ satisfies $\mathbb{E}\{f(\xi_t)\} \to \mathbb{E}_{\mathcal{M}}\{f(\mathbf{x})\}$ as $t\rightarrow \infty$ , then under some regularity conditions, we can express the limit as a telescoping sum,
+
+$$
+\mathbb {E} _ {\mathcal {M}} \{f (\mathbf {x}) \} = \mathbb {E} \{f (\xi_ {k}) \} + \sum_ {t = k + 1} ^ {\infty} [ \mathbb {E} \{f (\xi_ {t}) \} - \mathbb {E} \{f (\xi_ {t - 1}) \} ]
+$$
+
+for any fixed $k \geq 0$ . Now assume that there exists another Markov chain $\{\eta_t\}$ such that $\xi_t$ and $\eta_t$ have the same marginal distributions for all $t \geq 0$ , and $\xi_t = \eta_{t-1}$ for all $t \geq \tau$ , where $\tau$ is some random time. If we allow the exchange of expectation and summation, then we would get
+
+$$
+\mathbb {E} _ {\mathcal {M}} \{f (\mathbf {x}) \} = \mathbb {E} \left[ f (\xi_ {k}) + \sum_ {t = k + 1} ^ {\infty} \left\{f (\xi_ {t}) - f (\eta_ {t - 1}) \right\} \right] = \mathbb {E} \left[ f (\xi_ {k}) + \sum_ {t = k + 1} ^ {\tau - 1} \left\{f (\xi_ {t}) - f (\eta_ {t - 1}) \right\} \right],
+$$
+
+where the first identity holds since $\mathbb{E}\{f(\xi_t)\} = \mathbb{E}\{f(\eta_t)\}$ for all $t\geq 0$ , and the second one is due to the fact that $\xi_{t} = \eta_{t - 1}$ for $t\geq \tau$ . As a consequence, the quantity $f(\xi_k) + \sum_{t = k + 1}^{\tau -1}\{f(\xi_t) - f(\eta_{t - 1})\}$ is an unbiased estimator for $\mathbb{E}_{\mathcal{M}}\{f(\mathbf{x})\}$ . Such an idea seems rather simple, but the construction of the chain $\{\eta_t\}$ , which we describe in the next section, is a highly non-trivial task.
+
+# 3.2 COUPLING OF MARKOV CHAINS
+
+Let $\mathcal{M}_t$ denote the marginal distribution of a Markov chain $\{\xi_t\}$ at the $t$ -th step. By construction, $\mathcal{M}_t$ converges to $\mathcal{M}$ as $t \to \infty$ . To develop the unbiased estimator $H_k(\xi, \eta)$ , the second chain $\{\eta_t\}$ must satisfy two conditions: (1) marginally $\eta_t \sim \mathcal{M}_t$ ; (2) $\{\xi_t\}$ and the lag-one sequence $\{\eta_{t-1}\}$ will meet and stay identical after some random time $\tau$ . Condition (1) can be trivially met if $\{\xi_t\}$ and $\{\eta_t\}$ are sampled independently. However, in this way the probability that $\xi_t = \eta_{t-1}$ may be extremely small, or even be zero for continuous random variables. Therefore, a special joint distribution for $(\xi_t, \eta_{t-1})$ needs to be assigned subject to $\xi_t \sim \mathcal{M}_t$ and $\eta_{t-1} \sim \mathcal{M}_{t-1}$ . Such a pair of random variables under the marginal distribution constraints is called a coupling, and for our purpose we attempt to seek a coupling scheme such that $P(\xi_t = \eta_{t-1}) > 0$ . Figure 1 illustrates the coupling process of two Markov chains $\{\xi_t\}$ and $\{\eta_{t-1}\}$ .
+
+
+Figure 1: An illustration of the coupling process. $\{\xi_t\}$ and $\{\eta_t\}$ start from the same value, and have the same marginal distribution $\mathcal{M}_t$ at each step. The two chains are correlated in such a way that the event $\xi_{t} = \eta_{t - 1}$ occurs with a positive probability for each $t$ . After a random time $\tau$ ( $\tau = 5$ in the illustration), $\{\xi_t\}$ meets $\{\eta_{t - 1}\}$ and they stay identical afterwards.
+
+To implement such a coupling, first let $\{\xi_t\}$ and $\{\eta_t\}$ start from the same initial value $\xi_0 = \eta_0$ and additionally draw $\xi_1 \sim \mathcal{T}(\cdot|\xi_0)$ , where $\mathcal{T}(\pmb{y}|\pmb{x})$ stands for the transition density function from state $\pmb{x}$ to state $\pmb{y}$ . Next, we need to draw $(\xi_2, \eta_1)$ such that marginally $\xi_2 \sim \mathcal{M}_2$ and $\eta_1 \sim \mathcal{M}_1$ , which can be a difficult task as $\mathcal{M}_t$ may not have closed forms. Fortunately, it is much simplified for Markov chains: due to the Markov property, $\xi_2$ and $\eta_1$ will have the requested marginal distributions if we sample $\xi_2|\xi_1 \sim \mathcal{T}(\cdot|\xi_1)$ and $\eta_1|\eta_0 \sim \mathcal{T}(\cdot|\eta_0)$ conditional on $\xi_1$ and $\eta_0$ . That is, the coupling of Markov chains can be achieved by the coupling of one-step transitions, which is a much simpler task. Define two density functions $p(\cdot) = \mathcal{T}(\cdot|\xi_1)$ and $q(\cdot) = \mathcal{T}(\cdot|\eta_0)$ , and then the problem reduces to drawing a coupling $(\xi, \eta)$ such that $\xi \sim p(\cdot)$ , $\eta \sim q(\cdot)$ , and $P(\xi = \eta) > 0$ , which can be accomplished via the maximal coupling technique (Appendix A.1).
+
+Specific to our problem (2), we need to sample $\mathbf{x} = (\mathbf{v},\mathbf{h})$ from $p(\boldsymbol {v},\boldsymbol {h};\boldsymbol {\theta})$ . In energy-based latent variable models, the most widely-used MCMC method is the Gibbs sampler (Geman & Geman, 1984), which sequentially updates one block of $\mathbf{x}$ based on the conditional distribution of this block given the rest. As an example, in RBM models $\mathbf{v}|\{\mathbf{h} = \mathbf{h}\}$ and $\mathbf{h}|\{\mathbf{v} = \mathbf{v}\}$ follow multivariate Bernoulli distributions with independent components, which are very easy to sample from. The coupling for Gibbs samplers was briefly mentioned in Jacob et al. (2017) as a special case of the Metropolis-Hastings scheme (Metropolis et al., 1953; Hastings, 1970), but next we show that some specific structure of Gibbs samplers can be utilized to simplify the process.
+
+For simplicity and clarity, we assume that the Gibbs sampler for $\mathcal{M}$ follows the natural division of blocks $\mathbf{x} = (\mathbf{v},\mathbf{h})$ . That is, one can easily sample from the two transition distributions $\mathcal{T}_v(\boldsymbol {v}|\boldsymbol {h}):= p(\boldsymbol {v}|\boldsymbol {h};\boldsymbol {\theta})$ and $\mathcal{T}_h(\boldsymbol {h}|\boldsymbol {v}):=p(\boldsymbol {h}|\boldsymbol {v};\boldsymbol {\theta})$ . The more sophisticated cases, for example $\mathbf{h}$ consists of multiple layers $\mathbf{h} = (\mathbf{h}_1,\dots ,\mathbf{h}_L)$ , can be dealt with similarly. In Algorithm 1, we describe the steps to sample two coupled chains $\{\xi_t = (\pmb {v}_t,\pmb {h}_t)\}$ and $\{\eta_t = (\pmb {v}_t',\pmb {h}_t')\}$ based on the Gibbs sampler.
+
+Three remarks are made for Algorithm 1: (1) The meeting event (line 4) only depends on the $\mathcal{T}_v$ transition density. To verify this, note that at the $t$ -th step, we need to draw $\xi_t|\xi_{t-1} \sim \mathcal{T}(\cdot|\xi_{t-1})$ and $\eta_{t-1}|\eta_{t-2} \sim \mathcal{T}(\cdot|\eta_{t-2})$ , where $\mathcal{T}(\tilde{\boldsymbol{v}},\tilde{\boldsymbol{h}}|\boldsymbol{v},\boldsymbol{h}) = \mathcal{T}_v(\tilde{\boldsymbol{v}}|\boldsymbol{h})\mathcal{T}_h(\tilde{\boldsymbol{h}}|\tilde{\boldsymbol{v}})$ is the transition density for a full update cycle. It is easy to show that $\mathcal{T}(\tilde{\boldsymbol{v}},\tilde{\boldsymbol{h}}|\boldsymbol{v}',\boldsymbol{h}') / \mathcal{T}(\tilde{\boldsymbol{v}},\tilde{\boldsymbol{h}}|\boldsymbol{v},\boldsymbol{h}) = \mathcal{T}_v(\tilde{\boldsymbol{v}}|\boldsymbol{h}') / \mathcal{T}_v(\tilde{\boldsymbol{v}}|\boldsymbol{h})$ , so the $\mathcal{T}_h$ part cancels in the ratio. (2) Once $\xi_t$ and $\eta_{t-1}$ meet, they stay identical afterwards, because by then $\mathcal{T}_v(\cdot|\boldsymbol{h}_{t-2}') = \mathcal{T}_v(\cdot|\boldsymbol{h}_{t-1})$ , and the event in line 4 always happens. (3) Line 7 is a rejection sampling step. In our numerical experiments we find that very few samples are rejected, so its cost is tiny.
+
+Algorithm 1 Coupling method for the Gibbs sampler
+Input: Densities $\mathcal{T}_v(\pmb{v}|\pmb{h})$ and $\mathcal{T}_h(\pmb{h}|\pmb{v})$ , initial values $\xi_0 = (\pmb{v}_0,\pmb{h}_0) = \eta_0 = (\pmb{v}_0',\pmb{h}_0')$ , $T_{\mathrm{max}}$
+Output: Coupled chains $\{\xi_t\}$ and $\{\eta_t\}$
+1: Sample $\pmb{v}_1 \sim \mathcal{T}_v(\cdot|\pmb{h}_0)$ and $\pmb{h}_1 \sim \mathcal{T}_h(\cdot|\pmb{v}_1)$ . Set $\xi_1 = (\pmb{v}_1,\pmb{h}_1)$
+2: for $t = 2,3,\ldots$ do
+3: Sample $\pmb{v}_t \sim \mathcal{T}_v(\cdot|\pmb{h}_{t-1}),\pmb{h}_t \sim \mathcal{T}_h(\cdot|\pmb{v}_t)$ , and $U \sim \mathrm{Uniform}(0,1)$
+4: if $U \leq \mathcal{T}_v(\pmb{v}_t|\pmb{h}_{t-2}') / \mathcal{T}_v(\pmb{v}_t|\pmb{h}_{t-1})$ or $t \geq T_{\mathrm{max}}$ (maximum stopping time) then
+5: Set $\xi_t = (\pmb{v}_t,\pmb{h}_t)$ , $\eta_{t-1} = \xi_t$
+6: else
+7: Sample $\pmb{v}_{t-1}' \sim \mathcal{T}_v(\cdot|\pmb{h}_{t-2}',\pmb{h}_{t-1}' \sim \mathcal{T}_h(\cdot|\pmb{v}_{t-1}')$ , and $U' \sim \mathrm{Uniform}(0,1)$ until $U' > \mathcal{T}_v(\pmb{v}_{t-1}'|\pmb{h}_{t-1}) / \mathcal{T}_v(\pmb{v}_{t-1}'|\pmb{h}_{t-2}')$
+8: Set $\xi_t = (\pmb{v}_t,\pmb{h}_t)$ , $\eta_{t-1} = (\pmb{v}_{t-1}',\pmb{h}_{t-1}')$
+9: end if
+10: end for
+
+# 3.3 UNBIASED CONTRASTIVE DIVERGENCE
+
+The technical tools introduced in Sections 3.1 and 3.2 enable us to develop a new algorithm to train model (1). Recall that the true gradient of the log-likelihood function is given by (2). The first term, $\mathbb{E}_{\mathcal{D}}\{f(\mathbf{x};\boldsymbol {\theta})\}$ , can be computed exactly, and the second term, $\mathbb{E}_{\mathcal{M}}\{f(\mathbf{x};\boldsymbol {\theta})\}$ , is approximated by an unbiased estimator $\tilde{g}_2(\pmb {\theta})\coloneqq f(\xi_k) + \sum_{t = k + 1}^{\tau -1}\{f(\xi_t) - f(\eta_{t - 1})\}$ , where the coupled Markov chains $\{\xi_t\}$ and $\{\eta_t\}$ are generated by Algorithm 1. Assume that the parameter vector $\pmb{\theta}$ lies in a closed convex set $\Theta$ , and let $\mathcal{P}_{\Theta}(\cdot)$ denote the projection onto $\Theta$ . Putting the pieces together, Algorithm 2 illustrates the UCD algorithm for training energy-based latent variable models. The initial chain length $k$ can be any fixed number, and in this article we take $k = 1$ for all the numerical experiments.
+
+Algorithm 2 UCD Algorithm for estimating $\theta$
+Input: $T,\{\alpha_{i}\} ,k$ , initial value $\theta_0$
+Output: Parameter estimate for $\pmb{\theta}$
+1: for $i = 0,1,\dots ,T - 1$ do
+2: Draw one data point $\pmb {v}\sim p(\mathcal{D})$ , and sample $\pmb {h}\sim p(\pmb {h}|\pmb {v};\pmb {\theta}_i)$
+3: Set $\xi_0 = \eta_0 = (v,h)$ , and run Algorithm 1 with $\pmb {\theta} = \pmb {\theta}_i$ until $\xi_{\tau_i} = \eta_{\tau_i - 1}$
+4: $\tilde{g} (\pmb {\theta})\gets -\mathbb{E}_{\mathbf{h}\sim p(\pmb {h}|\pmb {v};\pmb {\theta})}\{f(\pmb {v},\mathbf{h};\pmb {\theta})\} +f(\xi_k) + \sum_{t = k + 1}^{\tau_i - 1}\{f(\xi_t) - f(\eta_{t - 1})\}$
+5: $\pmb{\theta}_{i + 1}\gets \mathcal{P}_{\Theta}(\pmb{\theta}_i + \alpha_i\cdot \tilde{g} (\pmb{\theta}_i))$
+6: end for
+7: return $\hat{\pmb{\theta}} = T^{-1}\sum_{i = 1}^{T}\pmb{\theta}_{i}$
+
+Next, we analyze the theoretical property of Algorithm 2 and state the conditions for it to converge. As a standard setting, we assume that the Markov chains generated by the Gibbs sampler are $\varphi$ -irreducible and aperiodic (Meyn & Tweedie, 2012). This is a very mild assumption that every practical Gibbs sampler should satisfy. Then we make the following two assumptions that guarantee the convergence of Gibbs samplers.
+
+Assumption 1. (Drift condition) There exist a pair of functions $r: \mathbb{V} \to [1, +\infty)$ , $l: \mathbb{H} \to [1, +\infty)$ and constants $\gamma_1, \gamma_2, L_1, L_2 > 0$ such that $\gamma_1 \gamma_2 < 1$ and
+
+$$
+\mathbb {E} _ {\mathbf {v} \sim p (\boldsymbol {v} | \boldsymbol {h}; \boldsymbol {\theta})} r (\mathbf {v}) \leq \gamma_ {1} l (\boldsymbol {h}) + L _ {1}, \quad \mathbb {E} _ {\mathbf {h} \sim p (\boldsymbol {h} | \boldsymbol {v}; \boldsymbol {\theta})} l (\mathbf {h}) \leq \gamma_ {2} r (\boldsymbol {v}) + L _ {2}, \quad \forall \boldsymbol {v} \in \mathbb {V}, \boldsymbol {h} \in \mathbb {H}, \boldsymbol {\theta} \in \Theta .
+$$
+
+Also, there exist constants $c > 0$ and $D > 0$ such that $|f(\pmb{x};\pmb{\theta})|^{2 + c} \leq l(\pmb{h})$ and $\mathbb{E}_{\mathbf{h} \sim p_{\mathbf{h}}(\pmb{h};\pmb{\theta})} l(\mathbf{h}) \leq D$ for all $\pmb{x} = (\pmb{v}, \pmb{h}) \in \mathbb{X}$ and $\pmb{\theta} \in \Theta$ .
+
+Assumption 2. (Minorization condition) There exist constants $d > 2(\gamma_2L_1 + L_2) / (1 - \gamma_1\gamma_2), \varepsilon > 0$ , and a density function $q(\cdot)$ such that $p(\pmb{v}|\pmb{h};\pmb{\theta}) \geq \varepsilon q(\pmb{v})$ for all $\pmb{h} \in \mathbb{D}$ , $\pmb{v} \in \mathbb{V}$ , and $\pmb{\theta} \in \Theta$ , where $\mathbb{D} = \{\pmb{h} \in \mathbb{H} : l(\pmb{h}) \leq d\}$ .
+
+In the following theorem we show three important facts about the proposed stochastic gradient $\tilde{g} (\theta)$ (1) $\tilde{g} (\theta)$ is unbiased for the true score function; (2) it has a bounded second moment uniformly in $\pmb{\theta}$ (3) in expectation it can be computed in finite time.
+
+Theorem 1. Under Assumptions 1 and 2, there exist constants $D_{1}, D_{2} > 0$ such that $\mathbb{E}\{\tilde{g}(\pmb{\theta})\} = \partial \ell(\pmb{\theta}; \pmb{v}) / \partial \pmb{\theta}$ , $\mathbb{E}\left[\{\tilde{g}_{2}(\pmb{\theta})\^{2}\right] \leq D_{1}$ , and $\mathbb{E}(\tau_{i}) \leq D_{2}$ for all $\pmb{\theta} \in \Theta$ and $i = 1, 2, \dots, T - 1$ .
+
+Theorem 1 provides the building blocks for the convergence analysis of Algorithm 2. With the unbiased gradient estimator and the bounded second moment, we establish a solid convergence guarantee for the proposed algorithm. As a typical setting, in the following corollary we consider a convex log-likelihood function.
+
+Corollary 1. Assume that $\ell(\pmb{\theta};\pmb{v})$ is convex and $L$ -Lipschitz continuous in $\pmb{\theta} \in \Theta$ , and $\Theta$ is a closed and bounded convex set. Then by choosing $\alpha_{i} = \alpha_{0} / \sqrt{i}$ for some constant $\alpha_{0} > 0$ , we have $\ell^{*} - \ell(\hat{\pmb{\theta}}; \pmb{v}) \leq \mathcal{O}(1 / \sqrt{T})$ , where $\ell^{*}$ is the maximum value of $\ell(\pmb{\theta}; \pmb{v})$ .
+
+The proof Corollary 1 is standard, see for example Bottou (2010); Bottou et al. (2018). When the log-likelihood function is nonconvex as in the RBM model, there are also other versions of the convergence result for SG, for example Theorem 4.10 of Bottou et al. (2018). Such directions can be studied separately and are omitted here.
+
+Finally, we shall point out an important special case of Theorem 1, i.e., if the Markov chain $\{\xi_t\}$ has finite states, then the two assumptions are automatically satisfied. This shows that many widely-used models, for example RBM, can directly use the UCD algorithm without the need to find such $r(\cdot)$ and $l(\cdot)$ functions. We summarize this useful fact in the following corollary.
+
+Corollary 2. If $\mathbb{X}$ is a finite state space and $\Theta$ is compact, then Assumptions 1 and 2 hold, and Theorem 1 applies.
+
+# 4 TRAINING RESTRICTED BOLTZMANN MACHINES
+
+RBM is one of the most popular and widely-used energy models in machine learning, defined by the energy function $E(\boldsymbol{v}, \boldsymbol{h}; \boldsymbol{\theta}) = -\boldsymbol{v}^{\mathrm{T}} \boldsymbol{b} - \boldsymbol{v}^{\mathrm{T}} \boldsymbol{W} \boldsymbol{h} - \boldsymbol{h}^{\mathrm{T}} \boldsymbol{c}$ , where $\boldsymbol{v} \in \{0, 1\}^{m}$ , $\boldsymbol{h} \in \{0, 1\}^{n}$ , and $\boldsymbol{\theta} = (\boldsymbol{W}, \boldsymbol{b}, \boldsymbol{c})$ are model parameters. The Gibbs sampler for RBM has a nice structure: let $\sigma(\boldsymbol{x}) = 1 / (1 + \exp(-\boldsymbol{x}))$ be the sigmoid function, and then $\mathbf{v} | \{\mathbf{h} = \boldsymbol{h}\} \sim \text{Bernoulli}(\sigma(\boldsymbol{W} \boldsymbol{h} + \boldsymbol{b}))$ and $\mathbf{h} | \{\mathbf{v} = \boldsymbol{v}\} \sim \text{Bernoulli}(\sigma(\boldsymbol{W}^{\mathrm{T}} \mathbf{v} + \boldsymbol{c}))$ . The coupling method in Algorithm 1 directly works for RBM, but here we show an improved version that is tailored for RBM and is more efficient.
+
+Let $\pmb{u}, \pmb{p} \in \mathbb{R}^r$ , and the notation $\pmb{y} = \mathbf{1}\{\pmb{u} \leq \pmb{p}\}$ stands for a binary vector such that $y_{i} = 1$ if $u_{i} \leq p_{i}$ and $y_{i} = 0$ otherwise. Also let $\mathcal{T}_v(\pmb{v}|\pmb{h}) = \prod_{i=1}^{m} p_i^{v_i}(1 - p_i)^{1 - v_i}$ denote the transition density from $\mathbf{h}$ to $\mathbf{v}$ , where $\pmb{p} = (p_1, \dots, p_m)^{\mathrm{T}} = \sigma(\pmb{W}\pmb{h} + \pmb{b})$ . Then the specialized coupling method for RBM is given in Algorithm 3.
+
+Algorithm 3 Coupling method for RBM
+Input: Model parameters $W, b, c$ , step- $t$ states $\xi_{t} = (v_{t}, h_{t})$ , $\eta_{t-1} = (v_{t-1}', h_{t-1}')$
+Output: New states $\xi_{t+1} = (v_{t+1}, h_{t+1})$ , $\eta_{t} = (v_{t}', h_{t}')$
+1: Sample $U_{1} \sim \mathrm{Uniform}(0, 1)$ , $Z_{1} \sim \mathrm{Uniform}([0, 1]^{m})$ , and set $v_{t+1} = 1\{Z_{1} \leq \sigma(Wh_{t} + b)\}$
+2: if $U_{1} \leq \mathcal{T}_{v}(v_{t+1}|h_{t-1}') / \mathcal{T}_{v}(v_{t+1}|h_{t})$ then
+3: Set $v_{t}' = v_{t+1}$
+4: else
+5: repeat
+6: Sample $U_{2} \sim \mathrm{Uniform}(0, 1)$ , $U_{2}' \sim \mathrm{Uniform}(0, 1)$ , $Z_{2} \sim \mathrm{Uniform}([0, 1]^{m})$
+7: if $v_{t+1}$ has not been accepted then
+8: Propose $v_{t+1} = 1\{Z_{2} \leq \sigma(Wh_{t} + b)\}$ , accept if $U_{2} > \mathcal{T}_{v}(v_{t+1}|h_{t-1}') / \mathcal{T}_{v}(v_{t+1}|h_{t})$
+9: end if
+10: if $v_{t}'$ has not been accepted then
+11: Propose $v_{t}' = 1\{Z_{2} \leq \sigma(Wh_{t-1}' + b)\}$ , accept if $U_{2}' > \mathcal{T}_{v}(v_{t}'|h_{t}) / \mathcal{T}_{v}(v_{t}'|h_{t-1}')$
+12: end if
+13: until $v_{t+1}$ and $v_{t}'$ are both accepted
+14: end if
+15: Sample $Z_{3} \sim \mathrm{Uniform}([0, 1]^{n})$
+16: Set $h_{t+1} = 1\{Z_{3} \leq \sigma(W^{\mathrm{T}}v_{t+1} + c)\}$ , $h_{t}' = 1\{Z_{3} \leq \sigma(W^{\mathrm{T}}v_{t}' + c)\}$
+
+The intuition behind Algorithm 3 is the following: line 2 indicates that it is also a maximal coupling method, so the probability $P(\xi_{t + 1} = \eta_t)$ is the same as Algorithm 1. However, in the event $\{\xi_{t + 1} \neq \eta_t\}$ , $\xi_{t + 1}$ and $\eta_t$ are independent in Algorithm 1 but correlated in Algorithm 3, achieved by the use of common random variates $Z_2$ and $Z_3$ . The correlation between $\xi_{t + 1}$ and $\eta_t$ helps to make $P(\xi_{t + 2} = \eta_{t + 1})$ larger, thus accelerating the meeting of $\{\xi_t\}$ and $\{\eta_{t - 1}\}$ . A more rigorous justification of this algorithm is given in Appendix A.2.
+
+Finally, it is known that in the gradient expression (2), $f(\mathbf{x};\pmb {\theta}) = (\sigma (\pmb {W}\pmb {h} + \pmb {b})\pmb{h}^{\mathrm{T}},\sigma (\pmb {W}\pmb {h} + \pmb {b}),\pmb {h})$ for RBM, corresponding to the parameters $\pmb {\theta} = (\pmb {W},\pmb {b},\pmb {c})$ . With the coupled chains $\{\xi_t\}$ and $\{\eta_{t - 1}\}$ , RBM can then be trained using UCD given by Algorithm 2.
+
+# 5 RELATED WORK
+
+In this section we highlight the novelty of our article and clarify its overlap with prior art. In literature there were several attempts to prove the convergence of CD in special cases, or to reduce the bias of CD using other sampling techniques, all with undesirable results. For example, Yuille (2005) gave conditions for CD to converge, which unfortunately can hardly be satisfied in any realistic models. Jiang et al. (2018) showed a convergence result of CD for the exponential families, but consequently the model is restrictive and does not include the latent variable model. Krause et al. (2018) used importance sampling to estimate the normalizing constant, which is consistent with a large sample. However, it still induces a bias in the finite case, and the bias heavily depends on the choice of the importance weights. In contrast, the UCD method proposed in this article directly fixes the bias of CD, and hence bypasses the challenges in algorithm convergence.
+
+Unbiased MCMC is a relatively new topic in statistics and machine learning. Some background knowledge in this article, for example Section 3.1, is taken from Jacob et al. (2017), which established a general framework for unbiased MCMC. Our new contributions are in the following aspects. First, we have developed Algorithm 1 and Theorem 1 exclusively for the Gibbs sampler, taking into account the special structure of Gibbs MCMC. Second, our theoretical results, including Theorem 1 and Corollary 2, have more practical assumptions than the ones in Jacob et al. (2017). For example, one of their key assumptions is that $\mathbb{E}\{|f(\xi_t)|^{2 + c}\}$ is uniformly bounded for every finite step, which is quite abstract and hard to verify in practice compared with our Assumption 1. Third, Jacob et al. (2017) studied MCMC with a fixed target distribution, whereas we need to control the variance of estimators that evolve with parameter updates. Finally, in Section 4 we develop a specialized coupling algorithm for RBM, which is shown to be more efficient than the general one.
+
+Another related work is the Markov chain Las Vegas method1 (MCLV, Savarese et al., 2018), which also constructs an unbiased estimator for the score function of RBM. The main differences bewteen our method and MCLV are as follows: (1) MCLV is based on the regeneration theory of Markov chains, whereas UCD is built upon the coupling technique. (2) MCLV is exclusively designed for RBM, but UCD applies to a broader range of models. (3) In its current state, MCLV cannot handle continuous random variables, but UCD can. More comprehensive comparisons between MCLV and UCD are left for future exploration.
+
+# 6 NUMERICAL EXPERIMENTS
+
+# 6.1 BARS-AND-STRIPES DATA
+
+We compare CD- $k$ , PCD, and the proposed UCD algorithm for training RBM models on different data sets. In the first experiment we reproduce the results for the bars-and-stripes (BAS) data that have been studied by Schulz et al. (2010); Fischer & Igel (2010; 2014). It is a small data set with 36 data points and 16 binary variables, and is fit by a small model with 16 hidden units. However, it is one of the most important benchmark data sets for RBM since its log-likelihood value can be evaluated exactly, and it demonstrates the divergence of CD-based training algorithms. In our study, $k$ is set to 1 for CD (more experiments with larger $k$ are given in Appendix B.1), and each algorithm is run for 100 times, accounting for the randomness in the training process. A common learning
+
+rate $\alpha = 0.01$ is set, and 1000 parallel Markov chains are used to approximate the gradient in each iteration. The results are shown in Figure 2.
+
+
+Figure 2: Left: exact log-likelihood values in each iteration. The shaded bands stand for the $2.5\%$ and $97.5\%$ quantiles across 100 runs, and the three trajectories in darker colors are sample learning curves in one run. Middle: average stopping time $\tau$ for UCD in each iteration. Right: average number of rejected samples in the coupling algorithm for UCD.
+
+
+
+
+
+Figure 2 shows the following findings. First, we reproduce the results in Fischer & Igel (2014) that CD and PCD fail to converge to the true maximum likelihood value. In contrast, UCD does converge. Second, UCD has an adaptive choice of the stopping time in the Markov chain, compared to the fixed $k$ in CD. In the BAS data, the stopping time has a steep increase around the 1200th iteration. Interestingly, this is exactly where CD begins to fail. An interpretation of this phenomenon is that UCD automatically uses a large MCMC sample for parameter values that result in a "hard" distribution. An even more surprising fact is that the average stopping time $\tau$ for UCD is 2.40, making it computationally more efficient than the CD-20 algorithm, where 20 is the smallest $k$ such that CD- $k$ training is comparable to UCD (see Appendix B.1 for more discussions). Third, the cost of the rejection sampling step in UCD (line 7 of Algorithm 1) is tiny, as the number of rejected samples rarely goes above two. Finally, UCD does not see a massive increase in the variance. In fact, at the end of training the quantile band for UCD is much narrower than those of CD and PCD. All these findings further highlight the advantages of UCD.
+
+# 6.2 SIMULATED RBM DATA
+
+In the second example we show that the findings for the BAS data can be observed in other model settings. We simulate a data set from an RBM model with 200 visible units and 20 hidden units, where the entries of weight and bias parameters are all generated from a $\mathcal{N}(0,1)$ distribution. The sample size of the simulated data set is 1000, and we fit an RBM model using 100 hidden units, which is larger than the true model since we intend to mimic the common practice of overparameterization in RBM training. We use a common learning rate $\alpha = 0.2$ and 1000 Markov chains in each iteration for all three algorithms. The log-likelihood values are approximated by Monte Carlo averages. The result is given in Figure 3, which shows similar patterns to the BAS data: CD and PCD eventually diverge, whereas UCD follows the typical behavior of SG. Additional experiments and discussions are given in Appendix B.2.
+
+
+Figure 3: Approximate log-likelihood values for each algorithm on the simulated RBM data set.
+
+# 6.3 FASHION-MNIST DATA
+
+Next we consider the Fashion-MNIST data set $^2$ , a replacement for the well-known but overused MNIST data set of handwritten digits (LeCun et al., 1990). Each data point in Fashion-MNIST contains 784 values within $[0,1]$ , representing a $28 \times 28$ greyscale image. The whole data set contains 60000 images, and we binarize the data by treating original values as probabilities and sampling from a Bernoulli distribution for each element. On the binarized data, we fit an RBM with 1000 hidden units, and train the model with different algorithms using a mini-batch size of 1000 and a learning rate $\alpha = 0.1$ . For each training algorithm, 1000 parallel Markov chains are used to compute the gradient. Figure 4 demonstrates the training trajectories of the three algorithms.
+
+
+Figure 4: Approximate log-likelihood values for each algorithm on the Fashion-MNIST data set.
+
+The training patterns for CD and PCD are surprising: the log-likelihood values of CD are decreasing, and PCD seems to bounce back and forth among three different paths. In fact, in Appendix B.3 we show that CD- $k$ does not converge even if $k$ is as large as 30, whereas the average stopping time for UCD is about 27. These results further demonstrate the superior performance of UCD.
+
+# 7 DISCUSSION
+
+In this article we use the unbiased MCMC technique to estimate the score function of energy-based latent variable models, which effectively fixes the bias of CD algorithms. Both the theoretical analysis and the numerical experiments at different scales demonstrate that the impact of bias elimination is huge.
+
+It is expected that UCD may have slightly larger variance compared with CD and PCD, but we emphasize that the value of UCD is not a simple question of bias and variance trade-off. This is because for MCMC-based methods, the variance can always be reduced by running more independent Markov chains and taking the average, while removing the bias is highly non-trivial. Moreover, in the context of SG methods, bias is typically more harmful than variance, as the former may lead to divergence of the algorithm.
+
+In terms of computational cost, it is true that UCD is in general slower than CD-1 or PCD, but it is comparable to or even faster than CD- $k$ that achieves a similar log-likelihood level. Therefore, UCD is not meant to completely replace CD or PCD, but rather to serve as an important addition to the existing training algorithms. In practice, a very useful technique is to first run the fast CD-1 or PCD to the near-optimum, and then proceed with UCD for guaranteed convergence.
+
+# REFERENCES
+
+Léon Bottou. Large-scale machine learning with stochastic gradient descent. In Proceedings of COMPSTAT'2010, pp. 177-186. Springer, 2010. 1, 3.3
+Léon Bottou, Frank E Curtis, and Jorge Nocedal. Optimization methods for large-scale machine learning. SIAM Review, 60(2):223-311, 2018. 3.3
+
+Miguel Á. Carreira-Perpínán and Geoffrey E. Hinton. On contrastive divergence learning. In Proceedings of the Tenth International Workshop on Artificial Intelligence and Statistics, 2005. 1, 2
+Asja Fischer and Christian Igel. Empirical analysis of the divergence of gibbs sampling based learning algorithms for restricted boltzmann machines. In International Conference on Artificial Neural Networks, pp. 208-217. Springer, 2010. 1, 2, 6.1
+Asja Fischer and Christian Igel. Training restricted boltzmann machines: An introduction. Pattern Recognition, 47(1):25-39, 2014. 2, 2, 6.1, 6.1
+Ruiqi Gao, Yang Lu, Junpei Zhou, Song-Chun Zhu, and Ying Nian Wu. Learning generative convnets via multi-grid modeling and sampling. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 9155-9164, 2018. 2
+Stuart Geman and Donald Geman. Stochastic relaxation, gibbs distributions, and the bayesian restoration of images. IEEE Transactions on Pattern Analysis and Machine Intelligence, PAMI-6 (6):721-741, 1984. 3.2
+Walter R Gilks, Sylvia Richardson, and David Spiegelhalter. Markov Chain Monte Carlo in Practice. Chapman and Hall/CRC, 1995. 1
+Peter W Glynn and Chang-han Rhee. Exact estimation for markov chain equilibrium expectations. Journal of Applied Probability, 51(A):377-389, 2014. 1, 3.1
+W. Keith Hastings. Monte carlo sampling methods using markov chains and their applications. Biometrika, 57(1):97-109, 1970. 3.2
+Geoffrey E Hinton. Training products of experts by minimizing contrastive divergence. Neural computation, 14(8):1771-1800, 2002. 1
+Geoffrey E Hinton. A practical guide to training restricted boltzmann machines. In Neural networks: Tricks of the trade, pp. 599-619. Springer, 2012. 1
+Geoffrey E Hinton, Simon Osindero, and Yee-Whye Teh. A fast learning algorithm for deep belief nets. Neural computation, 18(7):1527-1554, 2006. 1
+Pierre E Jacob, John O'Leary, and Yves F Atchade. Unbiased markov chain monte carlo with couplings. arXiv preprint arXiv:1708.03625, 2017. 1, 3.1, 3.2, 5, 4, D.1, D.1, D.1
+Bai Jiang, Tung-Yu Wu, Yifan Jin, Wing H Wong, et al. Convergence of contrastive divergence algorithm in exponential family. The Annals of Statistics, 46(6A):3067-3098, 2018. 5
+Alicia A Johnson and Owen Burbank. Geometric ergodicity and scanning strategies for two-component gibbs samplers. Communications in Statistics-Theory and Methods, 44(15):3125-3145, 2015. D.1
+Diederik P Kingma and Max Welling. Stochastic gradient vb and the variational auto-encoder. In Proceedings of the 2nd International Conference on Learning Representations, 2014. 1
+Oswin Krause, Asja Fischer, and Christian Igel. Population-contrastive-divergence: Does consistency help with rbm training? Pattern Recognition Letters, 102:1-7, 2018. 5
+Yann LeCun, Bernhard E Boser, John S Denker, Donnie Henderson, Richard E Howard, Wayne E Hubbard, and Lawrence D Jackel. Handwritten digit recognition with a back-propagation network. In Advances in Neural Information Processing Systems 2, pp. 396-404, 1990. 6.3
+David A Levin and Yuval Peres. Markov Chains and Mixing Times, volume 107. American Mathematical Soc., 2017. A.1
+Nicholas Metropolis, Arianna W Rosenbluth, Marshall N Rosenbluth, Augusta H Teller, and Edward Teller. Equation of state calculations by fast computing machines. The Journal of Chemical Physics, 21(6):1087-1092, 1953. 3.2
+
+Sean P Meyn and Richard L Tweedie. Markov Chains and Stochastic Stability. Springer Science & Business Media, 2012. 3.3
+Erik Nijkamp, Mitch Hill, Song-Chun Zhu, and Ying Nian Wu. Learning non-convergent non-persistent short-run mcmc toward energy-based model. In Advances in Neural Information Processing Systems 32, pp. 5233-5243, 2019. 2
+Herbert Robbins and Sutton Monro. A stochastic approximation method. The Annals of Mathematical Statistics, 22(3):400-407, 1951. 1
+Jeffrey S Rosenthal. Minorization conditions and convergence rates for markov chain monte carlo. Journal of the American Statistical Association, 90(430):558-566, 1995. D.1
+Francisco JR Ruiz and Michalis K Titsias. A contrastive divergence for combining variational inference and mcmc. arXiv preprint arXiv:1905.04062, 2019. 1
+Pedro HP Savarese, Mayank Kakodkar, and Bruno Ribeiro. From monte carlo to las vegas: Improving restricted boltzmann machine training through stopping sets. In Thirty-Second AAAI Conference on Artificial Intelligence, 2018. 5
+Hannes Schulz, Andreas Müller, and Sven Behnke. Investigating convergence of restricted boltzmann machine learning. In NIPS 2010 Workshop on Deep Learning and Unsupervised Feature Learning, 2010. 1, 2, 6.1
+Paul Smolensky. Information processing in dynamical systems: Foundations of harmony theory. Technical report, Colorado Univ at Boulder Dept of Computer Science, 1986. 1
+Ilya Sutskever and Tijmen Tieleman. On the convergence properties of contrastive divergence. In Proceedings of the Thirteenth International Conference on Artificial Intelligence and Statistics, pp. 789-795, 2010. 2
+Tijmen Tieleman. Training restricted boltzmann machines using approximations to the likelihood gradient. In Proceedings of the 25th International Conference on Machine Learning, pp. 1064-1071. ACM, 2008. 2
+Tijmen Tieleman and Geoffrey Hinton. Using fast weights to improve persistent contrastive divergence. In Proceedings of the 26th International Conference on Machine Learning, pp. 1033-1040. ACM, 2009. 2
+Max Welling, Michal Rosen-Zvi, and Geoffrey E Hinton. Exponential family harmoniums with an application to information retrieval. In Advances in Neural Information Processing Systems 17, pp. 1481-1488, 2005. 1
+Jianwen Xie, Yang Lu, Song-Chun Zhu, and Yingnian Wu. A theory of generative convnet. In Proceedings of the 33rd International Conference on Machine Learning, pp. 2635-2644, 2016. 1
+Jianwen Xie, Yang Lu, Ruiqi Gao, and Ying Nian Wu. Cooperative learning of energy-based model and latent variable model via mcmc teaching. In Thirty-Second AAAI Conference on Artificial Intelligence, 2018a. 1
+Jianwen Xie, Zilong Zheng, Ruiqi Gao, Wenguan Wang, Song-Chun Zhu, and Ying Nian Wu. Learning descriptor networks for 3d shape synthesis and analysis. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 8629-8638, 2018b. 1
+Alan L Yuille. The convergence of contrastive divergences. In Advances in Neural Information Processing Systems 17, pp. 1593-1600, 2005. 5
+
+# A DISTRIBUTION COUPLING METHODS
+
+# A.1 THE MAXIMAL COUPLING ALGORITHM
+
+Let $(\xi, \eta)$ be a pair of random variables defined on the same probability space, and $p$ and $q$ be two distributions. $(\xi, \eta)$ is called a coupling of $p$ and $q$ if marginally $\xi \sim p$ and $\eta \sim q$ . It is well known (see e.g. Proposition 4.7 of Levin & Peres, 2017) that among all possible joint distributions of $(\xi, \eta)$ ,
+
+$$
+P (\xi = \eta) \leq 1 - \| p - q \| _ {\mathrm {T V}} = \int \min \{p (x), q (x) \} \mathrm {d} x, \tag {4}
+$$
+
+where $\| p - q \|_{\mathrm{TV}}$ is the total variation distance between $p$ and $q$ . The maximal coupling algorithm, given in Algorithm 4, generates a coupling $(\xi, \eta)$ that achieves the bound in (4). That is, it maximizes the probability that two random variables are equal subject to their marginal distributions.
+
+Algorithm 4 Maximal coupling of two distributions $p(\cdot)$ and $q(\cdot)$ , from Jacob et al. (2017).
+Input: Density functions $p(\cdot)$ and $q(\cdot)$
+Output: A coupling $(\xi, \eta)$ with $\xi \sim p(\cdot)$ and $\eta \sim q(\cdot)$
+1: Sample $\xi \sim p(\cdot)$ and $U \sim \mathrm{Uniform}(0, 1)$ independently
+2: if $U \leq q(\xi) / p(\xi)$ then
+3: return $(\xi, \xi)$
+4: else
+5: Sample $\eta \sim q(\cdot)$ and $U' \sim \mathrm{Uniform}(0, 1)$ independently until $U' > p(\eta) / q(\eta)$
+6: return $(\xi, \eta)$
+7: end if
+
+# A.2 COUPLING METHOD FOR RBM
+
+In the general maximal coupling method (Algorithm 4), let $p(\cdot) = \mathcal{T}(\cdot|\xi_t)$ and $q(\cdot) = \mathcal{T}(\cdot|\eta_{t-1})$ be the transition densities of RBM, and then it generates the new states $\xi_{t+1}$ and $\eta_t$ with the probability $P(\xi_{t+1} = \eta_t|\xi_t, \eta_{t-1})$ maximized. If the event $\{\xi_{t+1} = \eta_t\}$ does not happen, then $\xi_{t+1}$ and $\eta_t$ are sampled independently.
+
+However, if $\xi_{t + 1}$ and $\eta_t$ are close to each other, then in the next iteration the probability $P(\xi_{t + 2} = \eta_{t + 1}|\xi_{t + 1},\eta_t)$ would be large, which helps to shorten the stopping time. Therefore, we are motivated to minimize some type of distance between $\xi_{t + 1}$ and $\eta_t$ . For RBM, we characterize it by $\mathbb{E}(\| \mathbf{v}_{t + 1} - \mathbf{v}_t'\| _2|\mathbf{v}_{t + 1}\neq \mathbf{v}_t')$ and $\mathbb{E}(\| \mathbf{h}_{t + 1} - \mathbf{h}_t'\| _2|\mathbf{v}_{t + 1},\mathbf{v}_t')$ . Since all these variables are binary vectors, the norm of difference is basically the number of unequal components, and the problem reduces to the maximal coupling of Bernoulli variables.
+
+First consider $\mathbb{E}(\| \mathbf{h}_{t + 1} - \mathbf{h}_t'\| _2|\pmb{v}_{t + 1},\pmb{v}_t')$ . Given the $\mathbf{v}$ variables, $\mathbf{h}_{t + 1}$ and $\mathbf{h}_t^\prime$ follow Bernoulli distributions elementwisely, with individual mean vectors denoted as $\mu_{1}$ and $\mu_{2}$ , respectively. It can be shown that the maximal coupling of two Bernoulli variables is achieved by using the same random variate, so $\mathbb{E}(\| \mathbf{h}_{t + 1} - \mathbf{h}_t'\| _2|\pmb{v}_{t + 1},\pmb{v}_t')$ is minimized by setting $h_{t + 1} = \mathbf{1}\{Z\leq \mu_1\}$ and $h_t^\prime = \mathbf{1}\{Z\leq \mu_2\}$ , where $Z\sim \mathrm{Uniform}([0,1]^n)$ . This leads to lines 15-16 of Algorithm 3.
+
+Next, conditional on $\{\mathbf{v}_{t + 1}\neq \mathbf{v}_t'\}$ , the maximal coupling algorithm generates $\mathbf{v}_{t + 1}$ and $\mathbf{v}_t^\prime$ with marginal distributions proportional to $p_1(\boldsymbol {v}) - \min \{p_1(\boldsymbol {v}),p_2(\boldsymbol {v})\}$ and $p_2(\boldsymbol {v}) - \min \{p_1(\boldsymbol {v}),p_2(\boldsymbol {v})\}$ , respectively, where $p_1(\cdot) = \mathcal{T}_v(\cdot |\boldsymbol {h}_t)$ and $p_2(\cdot) = \mathcal{T}_v(\cdot |\boldsymbol{h}_{t - 1}^{\prime})$ . Algorithm 3 implements this by two rejection sampling steps (line 8 and line 11). If we use the common random variates $\mathbf{Z}_2\sim$ Uniform([0, 1] $n$ ) for the proposals, then $\mathbf{v}_{t + 1}$ and $\mathbf{v}_t^\prime$ are maximally coupled in the event that they are accepted in the same iteration. This property helps to reduce $\mathbb{E}(\| \mathbf{v}_{t + 1} - \mathbf{v}_t^\prime \| _2|\mathbf{v}_{t + 1}\neq \mathbf{v}_t^\prime)$ .
+
+To demonstrate that the specialized Algorithm 3 improves the general Algorithm 1, we sample coupled Markov chains from an RBM model with $m = 500$ , $n = 100$ , and the elements of $(W, b, c)$ are all generated from a $\mathcal{N}(0, 0.1^2)$ distribution. For both algorithms, the elements of the initial state $v_0$ are sampled from independent Bernoulli(0.5) distributions, and we generate coupled Markov chains until the stopping time $\tau$ is reached or the chain length exceeds 1000. Figure 5 shows the distributions of $\tau$ for both algorithms based on 1000 replications.
+
+
+Figure 5: Distribution of the stopping time $\tau$ for the general (Algorithm 1) and specialized (Algorithm 3) coupling methods.
+
+It is very clear that the general algorithm leads to a surprisingly long stopping time, and even has a long tail beyond 1000. In contrast, $65.4\%$ of the stopping times in the specialized algorithm are smaller than or equal to 10. In this sense the improvement brought about by Algorithm 3 is huge.
+
+# B ADDITIONAL RESULTS FOR NUMERICAL EXPERIMENTS
+
+All experiments in this article were run on an Intel® Xeon® Gold 6126 processor with 12 cores and 24 threads. CD and PCD algorithms used the OpenBLAS library3 for parallel matrix computations, and UCD used OpenMP4 to generate Markov chains in parallel.
+
+# B.1 BAS DATA
+
+For the BAS data, we gradually increase the value of $k$ in the CD- $k$ algorithm, and plot their training trajectories for the log-likelihood values (Figure 6). It can be seen that the smallest $k$ to make the result comparable to UCD is about 20. However, the stopping time for UCD has an average of 2.40 across all the iterations, which means that it is more efficient than a fixed- $k$ CD algorithm with a similar performance. The running time for each training algorithm, which is given in Table 1, also supports this claim.
+
+
+Figure 6: CD- $k$ algorithms for training the BAS data with different $k$ .
+
+# B.2 SIMULATED RBM DATA
+
+For the experiment in Section 6.2, Figure 7 shows the training processes of CD- $k$ algorithms with larger $k$ . Figure 8 gives the average stopping time for UCD in each iteration, and the number of
+
+Table 1: Running time (in seconds) for each training algorithm on the BAS experiment.
+
+| CD-1 w/ log-likelihood values | CD-1 | CD-2 | CD-5 | CD-10 | CD-20 | PCD | UCD |
| 65.01 | 5.38 | 8.44 | 17.89 | 33.17 | 63.51 | 5.18 | 15.99 |
+
+discarded samples in the rejection sampling step. Table 2 illustrates the computational time for each algorithm. We can find that the computational cost of UCD is slightly larger than but very close to CD-1 and PCD.
+
+
+Figure 7: Approximate log-likelihood values for each algorithm on the simulated RBM data set.
+
+
+Figure 8: Left: average stopping time $\tau$ for UCD in training the model on simulated RBM data. Right: average number of rejected samples in the coupling algorithm for UCD.
+
+
+
+Table 2: Running time (in seconds) for each training algorithm on the experiment in Section 6.2.
+
+| CD-1 w/ log-likelihood values | CD-1 | CD-2 | CD-5 | CD-10 | PCD | UCD |
| 216.46 | 16.52 | 24.44 | 48.54 | 89.09 | 16.18 | 28.47 |
+
+One useful technique to combine the computational efficiency of CD/PCD and the convergence of UCD is to use CD/PCD in the early stage of the optimization, and then take the resulting parameter values as initial starts for the UCD algorithm. Figure 9 demonstrates this idea: in the first 500 iterations the model is trained using PCD, and then the parameter values are fine-tuned by UCD with a small number of iterations and a reduced learning rate.
+
+# B.3 FASHION-MNIST DATA
+
+For the Fashion-MNIST data, Figure 10 gives the training trajectories of CD-10, CD-20, and CD-30 algorithms, but unfortunately none of them have a convergent pattern. Figure 11 shows the average stopping time and the number of discarded samples in the UCD algorithm. Again, the cost for rejection sampling can be ignored, and the value of $\tau$ gets stable around 30 after 2000 iterations.
+
+
+Figure 9: Combine PCD and UCD for efficient and convergent training.
+
+Finally in Table 3 we demonstrate the running time for each training algorithm. Although UCD takes more time than other methods, the additional cost seems to be the necessary price to achieve a convergent result, as all other methods compared have a divergent log-likelihood.
+
+
+Figure 10: Approximate log-likelihood values for CD algorithms on the Fashion-MNIST data set.
+
+
+Figure 11: Left: average stopping time $\tau$ for UCD in training the model on Fashion-MNIST data. Right: average number of rejected samples in the coupling algorithm for UCD.
+
+
+
+# C VARIANCE OF GRADIENT ESTIMATES
+
+To compare the variances of stochastic gradients generated by different algorithms, in each optimization iteration we estimate the following gradient variance defined by
+
+$$
+V (\hat {f} (\pmb {\theta})) = \mathbb {E} \left\{\left\| \hat {f} (\pmb {\theta}) - \mathbb {E} (\hat {f} (\pmb {\theta})) \right\| _ {F} ^ {2} \right\},
+$$
+
+Table 3: Running time (in minutes) for each training algorithm on the Fashion-MNIST experiment.
+
+| CD-1 w/ log-likelihood values | CD-1 | CD-10 | CD-20 | CD-30 | PCD | UCD |
| 65.14 | 25.63 | 114.85 | 212.22 | 311.89 | 25.53 | 494.01 |
+
+where $\hat{f}(\theta)$ is an estimator for the second term of (2), and $\|\cdot\|_F$ is the Frobenius norm. Among the training methods considered in this article, $\hat{f}(\theta)$ is biased in CD and PCD, and is unbiased in UCD. We consider the example in Section 6.2, and estimate $V(\hat{f}(\theta))$ using the 1000 parallel Markov chains in each iteration. Figure 12 shows the estimated gradient variances for $b, c,$ and $W$ along the training process.
+
+
+Figure 12: Estimated gradient variance in each optimization iteration for different methods.
+
+It can be observed from Figure 12 that the gradient variance of UCD is generally comparable to CD and PCD, with only a few extreme cases. This finding suggests that the eliminated bias does not significantly increase the variance, which is important for the convergence speed of SG.
+
+# D PROOF OF THEOREMS
+
+# D.1 THEOREM 1
+
+Omitting the iteration index $i$ for brevity, we first prove that the stopping time $\tau$ has a finite expectation. Let $\mathcal{T}_{\theta}(\boldsymbol{x}|\boldsymbol{x}^{\prime})\coloneqq \mathcal{T}_{\theta}(\boldsymbol{v},\boldsymbol{h}|\boldsymbol{v}^{\prime},\boldsymbol{h}^{\prime}) = p(\boldsymbol{v}|\boldsymbol{h}^{\prime};\boldsymbol{\theta})p(\boldsymbol{h}|\boldsymbol{v};\boldsymbol{\theta})$ denote the transition density for a full update cycle. Under Assumptions 1 and 2, Lemma 2 of Johnson & Burbank (2015) shows that there exists a constant $\gamma \in [\gamma_1\gamma_2,1)$ such that
+
+$$
+\mathbb {E} _ {\mathbf {x} \sim \mathcal {T} _ {\theta} (\boldsymbol {x} | \boldsymbol {x} ^ {\prime})} l (\mathbf {h}) \leq \gamma l \left(\boldsymbol {h} ^ {\prime}\right) + \gamma_ {2} L _ {1} + L _ {2} \tag {5}
+$$
+
+for all $\pmb{x}^{\prime} \in \mathbb{X}$ . Therefore, the drift condition holds for the transition density $\mathcal{T}_{\theta}(\pmb{x}|\pmb{x}^{\prime})$
+
+Next, since Algorithm 1 is a maximal coupling algorithm, we have (see for example Jacob et al., 2017)
+
+$$
+P \left(\xi_ {t + 1} = \eta_ {t} \mid \xi_ {t} = \boldsymbol {x}, \eta_ {t - 1} = \boldsymbol {x} ^ {\prime}\right) = \int \min \left\{\mathcal {T} _ {\boldsymbol {\theta}} (\boldsymbol {y} | \boldsymbol {x}), \mathcal {T} _ {\boldsymbol {\theta}} (\boldsymbol {y} | \boldsymbol {x} ^ {\prime}) \right\} d \boldsymbol {y}.
+$$
+
+By Assumption 2, $p(\boldsymbol{v}|\boldsymbol{h};\boldsymbol{\theta}) \geq \varepsilon q(\boldsymbol{v})$ for all $\boldsymbol{h} \in \mathbb{D}$ , $\boldsymbol{v} \in \mathbb{V}$ , and $\boldsymbol{\theta} \in \Theta$ , so
+
+$$
+P \left(\xi_ {t + 1} = \eta_ {t} \mid \xi_ {t} = \boldsymbol {x}, \eta_ {t - 1} = \boldsymbol {x} ^ {\prime}\right) \geq \int \varepsilon q (\tilde {\boldsymbol {v}}) p (\tilde {\boldsymbol {h}} | \tilde {\boldsymbol {v}}; \boldsymbol {\theta}) \mathrm {d} \boldsymbol {y}
+$$
+
+on $\pmb{x},\pmb{x}^{\prime}\in \mathbb{D}\times \mathbb{V}$ , where $\pmb {y} = (\tilde{\pmb{v}},\tilde{\pmb{h}})$ . Note that $q(\tilde{\pmb{v}})p(\tilde{\pmb{h}} |\tilde{\pmb{v}};\pmb {\theta})$ is a joint density function, so $\int q(\tilde{\pmb{v}})p(\tilde{\pmb{h}} |\tilde{\pmb{v}};\pmb {\theta})\mathrm{d}\pmb {y} = 1$ , and hence $P(\xi_{t + 1} = \eta_t|\xi_t = x,\eta_{t - 1} = x')\geq \varepsilon$ for all $\pmb {h}\in \mathbb{D}$ and $\pmb {\theta}\in \Theta$ .
+
+Then by Proposition 3.4 of Jacob et al. (2017), there exist constants $\kappa_{1} > 0$ and $\rho_{1}\in (0,1)$ such that for all $t > 0$ , $P(\tau >t)\leq \kappa_1l(h_0)\rho_1^t$ . As a result, we obtain
+
+$$
+\mathbb {E} (\tau) = \sum_ {t = 0} ^ {\infty} P (\tau > t) \leq \frac {\kappa_ {1} l \left(\boldsymbol {h} _ {0}\right)}{1 - \rho_ {1}}. \tag {6}
+$$
+
+The right hand side of (6) does not depend on the value of $\theta$ , so $\mathbb{E}(\tau)$ is uniform in the iteration index $i$ .
+
+To make sure that $\tilde{g}(\pmb{\theta})$ is well defined, a few regularity conditions, formulated as Assumption 2.1 of Jacob et al. (2017), need to be verified. Under the drift condition (5) and Assumption 2, Theorem 12 of Rosenthal (1995) shows that $\{\xi_t\}$ is a geometrically ergodic Markov chain. Therefore, there exist constants $\kappa_2 > 0$ and $\rho_2 \in (0,1)$ such that
+
+$$
+\left| \mathbb {E} \phi (\xi_ {t}) - \mathbb {E} _ {\mathcal {M}} \phi \right| \leq \kappa_ {2} l \left(\boldsymbol {h} _ {0}\right) \rho_ {2} ^ {t} \tag {7}
+$$
+
+for all $\phi : |\phi(\pmb{v},\pmb{h})| \leq l(\pmb{h})$ . Therefore, there exists a constant $M > 0$ such that $|\mathbb{E}\phi(\xi_t)| \leq \mathbb{E}_{\mathcal{M}}l + \kappa_2l(\pmb{h}_0)\rho_2^t \leq D + \kappa_2l(\pmb{h}_0) \leq M < \infty$ .
+
+Since $|f(\pmb{x};\pmb{\theta})|^{2 + c} \leq l(\pmb{h})$ by Assumption 1, we get $\mathbb{E}\{|f(\xi_t)|^{2 + c}\} \leq M$ for all $t > 0$ . Moreover, (7) implies that $\mathbb{E}\{f(\xi_t)\} \to \mathbb{E}_{\mathcal{M}}f$ . These two results verify Assumption 2.1 of Jacob et al. (2017), and hence the unbiasedness of $\tilde{g} (\pmb{\theta})$ is true by design.
+
+Finally, we need to show that the second moment of the stochastic gradient is bounded uniformly in $\pmb{\theta}$ . Let $\Delta_k = f(\xi_k)$ and $\Delta_t = f(\xi_t) - f(\eta_{t-1})$ for $t \geq k+1$ , and then $\tilde{g}_2(\pmb{\theta}) = \sum_{t=k}^{\infty} \Delta_t$ . From the ergodicity property (7) we immediately get $\mathbb{E}(\Delta_k^2) \leq M$ . For $t \geq k+1$ ,
+
+$$
+\mathbb {E} (| \Delta_ {t} | ^ {2 + c}) = \mathbb {E} (| f (\xi_ {t}) - f (\eta_ {t - 1}) | ^ {2 + c}) \leq 2 ^ {1 + c} \mathbb {E} (| f (\xi_ {t}) | ^ {2 + c} + | f (\eta_ {t - 1}) | ^ {2 + c}) \leq 2 ^ {2 + c} M.
+$$
+
+Then by Hölder's inequality,
+
+$$
+\begin{array}{l} \mathbb {E} (\Delta_ {t} ^ {2}) = \mathbb {E} (\Delta_ {t} ^ {2} \mathbf {1} \{\tau > t \}) \leq \left\{\mathbb {E} (| \Delta_ {t} | ^ {2 + c}) \right\} ^ {2 / (c + 2)} \{P (\tau > t) \} ^ {c / (c + 2)} \\ \leq 4 M ^ {2 / (c + 2)} \left\{\kappa_ {1} l \left(\boldsymbol {h} _ {0}\right) \rho_ {1} ^ {t} \right\} ^ {c / (c + 2)}. \\ \end{array}
+$$
+
+Since $\tilde{g}_2(\pmb {\theta}) = \sum_{t = k}^{\infty}\Delta_t$ we get
+
+$$
+\mathbb {E} \left[ \{\tilde {g} _ {2} (\boldsymbol {\theta}) - \Delta_ {k} \} ^ {2} \right] = \mathbb {E} \left\{\left(\sum_ {t = k + 1} ^ {\infty} \Delta_ {t}\right) ^ {2} \right\} \leq \sum_ {t = k + 1} ^ {\infty} \sum_ {s = k + 1} ^ {\infty} \mathbb {E} | \Delta_ {t} \Delta_ {s} \mathbf {1} \{\tau > t \} \mathbf {1} \{\tau > s \}) |.
+$$
+
+We also have
+
+$$
+\mathbb {E} \left| \Delta_ {t} \Delta_ {s} {\bf 1} \{\tau > t \} {\bf 1} \{\tau > s \}) \right| \leq \sqrt {\mathbb {E} (\Delta_ {t} ^ {2} {\bf 1} \{\tau > t \}) \mathbb {E} (\Delta_ {s} ^ {2} {\bf 1} \{\tau > s \})} \leq C _ {0} \rho_ {3} ^ {s} \rho_ {3} ^ {t}
+$$
+
+for some constants $C_0 > 0$ and $\rho_{3}\in (0,1)$ , so finally,
+
+$$
+\mathbb {E} \left[ \{\tilde {g} _ {2} (\boldsymbol {\theta}) \} ^ {2} \right] \leq 2 \mathbb {E} \left(\Delta_ {k} ^ {2}\right) + 2 \mathbb {E} \left[ \{\tilde {g} _ {2} (\boldsymbol {\theta}) - \Delta_ {k} \} ^ {2} \right] \leq 2 M + 2 \sum_ {t = k + 1} ^ {\infty} \sum_ {s = k + 1} ^ {\infty} C _ {0} \rho_ {3} ^ {s} \rho_ {3} ^ {t} < \infty ,
+$$
+
+and the bound does not depend on $\theta$ .
+
+# D.2 COROLLARY 2
+
+Since $E(\boldsymbol{v}, \boldsymbol{h}; \boldsymbol{\theta})$ is continuous in $\boldsymbol{\theta}$ , every conditional distribution of $p(\boldsymbol{v}, \boldsymbol{h}; \boldsymbol{\theta})$ is also continuous in $\boldsymbol{\theta}$ . This implies that $\mathcal{T}_{\boldsymbol{\theta}}(\boldsymbol{x} | \boldsymbol{x}^{\prime})$ is continuous in $\boldsymbol{\theta}$ as well. We have assumed that $\mathcal{T}_{\boldsymbol{\theta}}$ is irreducible and aperiodic, so for each $\boldsymbol{\theta}$ , $\mathcal{T}_{\boldsymbol{\theta}}(\boldsymbol{x} | \boldsymbol{x}^{\prime}) > 0$ for every $\boldsymbol{x}, \boldsymbol{x}^{\prime} \in \mathbb{X}$ . By the compactness of $\Theta$ , there exist a constant $\varepsilon > 0$ such that $\mathcal{T}_{\boldsymbol{\theta}}(\boldsymbol{x} | \boldsymbol{x}^{\prime}) \geq \varepsilon$ for all $\boldsymbol{x}, \boldsymbol{x}^{\prime} \in \mathbb{X}$ and $\boldsymbol{\theta} \in \Theta$ .
+
+Similarly, $f(\pmb{x}; \pmb{\theta}) = \partial E(\pmb{v}, \pmb{h}; \pmb{\theta}) / \partial \pmb{\theta}$ is continuous in $\pmb{\theta}$ , so for any $c > 0$ , there is a constant $M > 1$ such that $|f(\pmb{x}; \pmb{\theta})|^{2 + c} \leq M$ for all $\pmb{x} \in \mathbb{X}$ and $\pmb{\theta} \in \Theta$ . Then by choosing constant functions $l(\pmb{h}) = M$ , $r(\pmb{v}) = M$ and constants $\gamma_1 = \gamma_2 = 1/2$ and $L_1 = L_2 = M/2$ , we make Assumption 1 hold.
+
+For Assumption 2, the density function $q(\cdot)$ can be chosen as a uniform distribution over the finite space $\mathbb{X}$ . Then the proof is complete.
\ No newline at end of file
diff --git a/unbiasedcontrastivedivergencealgorithmfortrainingenergybasedlatentvariablemodels/images.zip b/unbiasedcontrastivedivergencealgorithmfortrainingenergybasedlatentvariablemodels/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..2d7be580e0123ba94a4b9dcf2e96cec2c30ba8a8
--- /dev/null
+++ b/unbiasedcontrastivedivergencealgorithmfortrainingenergybasedlatentvariablemodels/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d14247650a92c9f7ccda141b5efef7a2dd9ffb8e6384c1eb1cf04d5f25cbb451
+size 645928
diff --git a/unbiasedcontrastivedivergencealgorithmfortrainingenergybasedlatentvariablemodels/layout.json b/unbiasedcontrastivedivergencealgorithmfortrainingenergybasedlatentvariablemodels/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..0abc6a0d85d3b121451238ae7076dc7421b72e73
--- /dev/null
+++ b/unbiasedcontrastivedivergencealgorithmfortrainingenergybasedlatentvariablemodels/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:849c5b7ac0fd94bc8c5bf57d822927324c401d57a7c8df85e7eb4348f192e7bb
+size 841238
diff --git a/understandingwhyneuralnetworksgeneralizewellthroughgsnrofparameters/785a65e0-5236-4926-8334-6ec212715e3c_content_list.json b/understandingwhyneuralnetworksgeneralizewellthroughgsnrofparameters/785a65e0-5236-4926-8334-6ec212715e3c_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..b3119b0330a585e76ed5289384762e905b4cf5ef
--- /dev/null
+++ b/understandingwhyneuralnetworksgeneralizewellthroughgsnrofparameters/785a65e0-5236-4926-8334-6ec212715e3c_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:285115ad9d242bffb8b9e49f99e79a79ab978c3f9d21093187d115606d66222a
+size 93314
diff --git a/understandingwhyneuralnetworksgeneralizewellthroughgsnrofparameters/785a65e0-5236-4926-8334-6ec212715e3c_model.json b/understandingwhyneuralnetworksgeneralizewellthroughgsnrofparameters/785a65e0-5236-4926-8334-6ec212715e3c_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..0527a4b68936f256ea2182e747c36fa34d9cdb46
--- /dev/null
+++ b/understandingwhyneuralnetworksgeneralizewellthroughgsnrofparameters/785a65e0-5236-4926-8334-6ec212715e3c_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b085d876a29d9a49a67473859573ce38cafeda7ff239926f987f94e55fd34d6d
+size 104422
diff --git a/understandingwhyneuralnetworksgeneralizewellthroughgsnrofparameters/785a65e0-5236-4926-8334-6ec212715e3c_origin.pdf b/understandingwhyneuralnetworksgeneralizewellthroughgsnrofparameters/785a65e0-5236-4926-8334-6ec212715e3c_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..172dd96e6e26fa52c88c6f41847d7a36d5a35325
--- /dev/null
+++ b/understandingwhyneuralnetworksgeneralizewellthroughgsnrofparameters/785a65e0-5236-4926-8334-6ec212715e3c_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:cad536b65b549955a73084353434fc8ba2a657507af9dd0425c76d846613a7e7
+size 1846559
diff --git a/understandingwhyneuralnetworksgeneralizewellthroughgsnrofparameters/full.md b/understandingwhyneuralnetworksgeneralizewellthroughgsnrofparameters/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..eed98d60b0ddde68af1b1c863612a6d0ccb6f6a1
--- /dev/null
+++ b/understandingwhyneuralnetworksgeneralizewellthroughgsnrofparameters/full.md
@@ -0,0 +1,403 @@
+# UNDERSTANDING WHY NEURAL NETWORKS GENERALIZE WELL THROUGH GSNR OF PARAMETERS
+
+Jinlong Liu1*, Guo-qing Jiang1, Yunzhi Bai1, Ting Chen2, and Huayan Wang1
+
+$^{1}$ Ytech - KWAI incorporation
+{liujinlong,jiangguoqing,baiyunzhi,wanghuayan} @kuaishou.com
+ $^{2}$ Samsung Research China - Beijing (SRC-B)
+ting11.chen@samsung.com
+
+# ABSTRACT
+
+As deep neural networks (DNNs) achieve tremendous success across many application domains, researchers tried to explore in many aspects on why they generalize well. In this paper, we provide a novel perspective on these issues using the gradient signal to noise ratio (GSNR) of parameters during training process of DNNs. The GSNR of a parameter is defined as the ratio between its gradient's squared mean and variance, over the data distribution. Based on several approximations, we establish a quantitative relationship between model parameters' GSNR and the generalization gap. This relationship indicates that larger GSNR during training process leads to better generalization performance. Moreover, we show that, different from that of shallow models (e.g. logistic regression, support vector machines), the gradient descent optimization dynamics of DNNs naturally produces large GSNR during training, which is probably the key to DNNs' remarkable generalization ability.
+
+# 1 INTRODUCTION
+
+Deep neural networks typically contain far more trainable parameters than training samples, which seems to easily cause a poor generalization performance. However, in fact they usually exhibit remarkably small generalization gaps. Traditional generalization theories such as VC dimension (Vapnik & Chervonenkis, 1991) or Rademacher complexity (Bartlett & Mendelson, 2002) cannot explain its mechanism. Extensive research focuses on the generalization ability of DNNs (Neyshabur et al., 2017; Arora et al., 2018; Keskar et al., 2016; Dinh et al., 2017; Hoffer et al., 2017; Novak et al., 2018; Dziugaite & Roy, 2017; Jakubovitz et al., 2019; Kawaguchi et al., 2017; Advani & Saxe, 2017).
+
+Unlike that of shallow models such as logistic regression or support vector machines, the global minimum of high-dimensional and non-convex DNNs cannot be found analytically, but can only be approximated by gradient descent and its variants (Zeiler, 2012; Kingma & Ba, 2014; Graves, 2013). Previous work (Zhang et al., 2016; Hardt et al., 2015; Dziugaite & Roy, 2017) suggests that the generalization ability of DNNs is closely related to gradient descent optimization. For example, Hardt et al. (2015) claims that any model trained with stochastic gradient descent (SGD) for reasonable epochs would exhibit small generalization error. Their analysis is based on the smoothness of loss function. In this work, we attempt to understand the generalization behavior of DNNs through GSNR and reveal how GSNR affects the training dynamics of gradient descent. Stanislav Fort (2019) studied a new gradient alignment measure called stiffness in order to understand generalization better and stiffness is related to our work.
+
+The GSNR of a parameter is defined as the ratio between its gradient's squared mean and variance over the data distribution. Previous work tried to use GSNR to conduct theoretical analysis on deep learning. For example, Rainforth et al. (2018) used GSNR to analyze variational bounds in
+
+unsupervised DNNs such as variational auto-encoder (VAE). Here we focus on analyzing the relation between GSNR and the generalization gap.
+
+Intuitively, GSNR measures the similarity of a parameter's gradients among different training samples. Large GSNR implies that most training samples agree on the optimization direction of this parameter, thus the parameter is more likely to be associated with a meaningful "pattern" and we assume its update could lead to a better generalization. In this work, we prove that the GSNR is strongly related to the generalization performance, and larger GSNR means a better generalization.
+
+To reveal the mechanism of DNNs' good generalization ability, we show that the gradient descent optimization dynamics of DNN naturally leads to large GSNR of model parameters and therefore good generalization. Furthermore, we give a complete analysis and a detailed interpretation to this phenomenon. We believe this is probably the key to DNNs remarkable generalization ability.
+
+In the remainder of this paper we first analyze the relation between GSNR and generalization (Section 2). We then show how the training dynamics lead to large GSNR of model parameters experimentally and analytically in Section 3.
+
+# 2 LARGER GSNR LEADS TO BETTER GENERALIZATION
+
+In this section, we establish a quantitative relation between the GSNR of model parameters and generalization gap, showing that larger GSNR during training leads to better generalization.
+
+# 2.1 GRADIENTS SIGNAL TO NOISE RATIO
+
+Consider a data distribution $\mathcal{Z} = \mathcal{X}\times \mathcal{Y}$ , from which each sample $(x,y)$ is drawn; a model $\hat{y} = f(x,\theta)$ parameterized by $\theta$ ; and a loss function $L$ .
+
+The parameters' gradient w.r.t. $L$ and sample $(x_{i},y_{i})$ is denoted by
+
+$$
+\mathbf {g} \left(x _ {i}, y _ {i}, \theta\right) \text {o r} \mathbf {g} _ {i} (\theta) := \frac {\partial L \left(y _ {i} , f \left(x _ {i} , \theta\right)\right)}{\partial \theta} \tag {1}
+$$
+
+whose $j$ -th element is $\mathbf{g}_i(\theta_j)$ . Note that throughout this paper we always use $i$ to index data examples and $j$ to index model parameters.
+
+Given the data distribution $\mathcal{Z}$ , we have the (sample-wise) mean and variance of $\mathbf{g}_i(\theta)$ . We denote them as $\tilde{\mathbf{g}}(\theta) = \mathrm{E}_{(x,y) \sim \mathcal{Z}}(\mathbf{g}(x,y,\theta))$ and $\rho^2(\theta) = \mathrm{Var}_{(x,y) \sim \mathcal{Z}}(\mathbf{g}(x,y,\theta))$ , respectively.
+
+The gradient signal to noise ratio (GSNR) of one model parameter $\theta_{j}$ is defined as:
+
+$$
+r \left(\theta_ {j}\right) := \frac {\tilde {\mathbf {g}} ^ {2} \left(\theta_ {j}\right)}{\rho^ {2} \left(\theta_ {j}\right)} \tag {2}
+$$
+
+At a particular point of the parameter space, GSNR measures the consistency of a parameter's gradients across different data samples. Figure 1 intuitively shows that if GSNR is large, the parameter gradient space tends to be distributed in the similar direction and if GSNR is small, the gradient vectors are then scatteredly distributed.
+
+# 2.2 ONE-STEP GENERALIZATION RATIO
+
+In this section we introduce a new concept to help measure the generalization performance during gradient descent optimization, which we call one-step generalization ratio (OSGR). Consider training set $D = \{(x_{1},y_{1}),\dots,(x_{n},y_{n})\} \sim \mathcal{Z}^{n}$ with $n$ samples drawn from $\mathcal{Z}$ , and a test set $D' = \{(x_{1}',y_{1}'),\dots,(x_{n'}',y_{n'}')\} \sim \mathcal{Z}^{n'}$ . In practice we use the loss on $D'$ to measure generalization. For simplicity, we assume the sizes of training and test datasets are equal, i.e. $n = n'$ . We denote the empirical training and test loss as:
+
+$$
+L [ D ] = \frac {1}{n} \sum_ {i = 1} ^ {n} L \left(y _ {i}, f \left(x _ {i}, \theta\right)\right), \quad L [ D ^ {\prime} ] = \frac {1}{n} \sum_ {i = 1} ^ {n} L \left(y _ {i} ^ {\prime}, f \left(x _ {i} ^ {\prime}, \theta\right)\right), \tag {3}
+$$
+
+respectively. Then the empirical generalization gap is given by $L[D'] - L[D]$ .
+
+
+Figure 1: Schematic diagram of the sample-wise parameter gradient distribution corresponding to greater (Left) and smaller (Right) GSNR. Pink arrows denote the gradient vectors for each sample while the blue arrow indicates their mean.
+
+
+
+
+Figure 2: Schematic diagram of the training behavior satisfies $OSGR(t) = 0$ (Left), $0 < OSGR(t) < 1$ (Middle) and $OSGR(t) \approx 1$ (Right). Note that the Middle scenario most commonly happens in regular tasks.
+
+
+
+
+
+In gradient descent optimization, both the training and test loss would decrease step by step. We use $\Delta L[D]$ and $\Delta L[D']$ to denote the one-step training and test loss decrease during training, respectively. Let's consider the ratio between the expectations of $\Delta L[D']$ and $\Delta L[D]$ of one single training step, which we denote as $\mathbf{R}(\mathcal{Z}, n)$ .
+
+$$
+\mathbf {R} (\mathcal {Z}, n) := \frac {E _ {D , D ^ {\prime} \sim \mathcal {Z} ^ {n}} \left(\Delta L \left[ D ^ {\prime} \right]\right)}{E _ {D \sim \mathcal {Z} ^ {n}} \left(\Delta L [ D ]\right)} \tag {4}
+$$
+
+Note that this ratio also depends on current model parameters $\theta$ and learning rate $\lambda$ . We are not including them in the above notation as we will not explicitly model these dependencies, but rather try to quantitatively characterize $\mathbf{R}$ for very small $\lambda$ and for $\theta$ at the early stage of training (satisfying Assumption 2.3.1).
+
+Also note that the expectation of $\Delta L[D']$ is over $D$ and $D'$ . This is because the optimization step is performed on $D$ . We refer to $\mathbf{R}(\mathcal{Z}, n)$ as OSGR of gradient descent optimization. Statistically the training loss decreases faster than the test loss and $0 < O S G R(t) < 1$ (Middle panel of Figure 2), which usually results in a non-zero generalization gap at the end of training. If $O S G R(t)$ is large ( $\approx 1$ ) in the whole training process (Right panel of Figure 2), generalization gap would be small when training completes, implying good generalization ability of the model. If $O S G R(t)$ is small ( $= 0$ ), the test loss will not decrease while the training loss normally drops (Left panel of Figure 2), corresponding to a large generalization gap.
+
+# 2.3 RELATIONZBETWEEN GSNR AND OSGR
+
+In this section, we derive a relation between the OSGR during training and the GSNR of model parameters. This relation indicates that, for the first time as far as we know, the sample-wise gradient distribution of parameters is related to the generalization performance of gradient descent optimization.
+
+In gradient descent optimization, we take the average gradient over training set $D$ , which we denote as $\mathbf{g}_D(\theta)$ . Note that we have used $\mathbf{g}_i(\theta)$ to denote gradient evaluated on one data sample and $\tilde{\mathbf{g}} (\theta)$ to denote its expectation over the entire data distribution. Similarly we define $\mathbf{g}_{D^{\prime}}(\theta)$ to be the average gradient over test set $D^{\prime}$ .
+
+$$
+\mathbf {g} _ {D} (\theta) = \frac {1}{n} \sum_ {i = 1} ^ {n} \mathbf {g} \left(x _ {i}, y _ {i}, \theta\right) = \frac {\partial L [ D ]}{\partial \theta}, \quad \mathbf {g} _ {D ^ {\prime}} (\theta) = \frac {1}{n} \sum_ {i = 1} ^ {n} \mathbf {g} \left(x _ {i} ^ {\prime}, y _ {i} ^ {\prime}, \theta\right) = \frac {\partial L [ D ^ {\prime} ]}{\partial \theta} \tag {5}
+$$
+
+Both the training and test dataset are randomly generated from the same distribution $\mathcal{Z}^n$ , so we can treat $\mathbf{g}_D(\theta)$ and $\mathbf{g}_{D'}(\theta)$ as random variables. At the beginning of the optimization process, $\theta$ is randomly initialized thus independent of $D$ , so $\mathbf{g}_D(\theta)$ and $\mathbf{g}_{D'}(\theta)$ would obey the same distribution. After a period of training, the model parameters begin to fit the training dataset and become a function of $D$ , i.e. $\theta = \theta(D)$ , therefore distributions of $\mathbf{g}_D(\theta(D))$ and $\mathbf{g}_{D'}(\theta(D))$ become different. However, we choose not to model this dependency and make the following assumption for our analysis:
+
+Assumption 2.3.1 (Non-overfitting limit approximation) The average gradient over the training dataset and test dataset $\mathbf{g}_D(\theta)$ and $\mathbf{g}_{D^{\prime}}(\theta)$ obey the same distribution.
+
+Obviously the mean of $\mathbf{g}_D(\theta)$ and $\mathbf{g}_{D^{\prime}}(\theta)$ is just the mean gradient over the data distribution $\tilde{\mathbf{g}} (\theta)$ .
+
+$$
+\mathrm {E} _ {D \sim \mathcal {Z} ^ {n}} [ \mathbf {g} _ {D} (\theta) ] = \mathrm {E} _ {D, D ^ {\prime} \sim \mathcal {Z} ^ {n}} [ \mathbf {g} _ {D ^ {\prime}} (\theta) ] = \tilde {\mathbf {g}} (\theta) \tag {6}
+$$
+
+We denote their variance as $\sigma^2 (\theta)$ , i.e.
+
+$$
+\operatorname {V a r} _ {D \sim \mathcal {Z} ^ {n}} [ \mathbf {g} _ {D} (\theta) ] = \operatorname {V a r} _ {D, D ^ {\prime} \sim \mathcal {Z} ^ {n}} [ \mathbf {g} _ {D ^ {\prime}} (\theta) ] = \sigma^ {2} (\theta) \tag {7}
+$$
+
+It is straightforward to show that:
+
+$$
+\sigma^ {2} (\theta) = \operatorname {V a r} _ {D \sim \mathcal {Z} ^ {n}} [ \frac {1}{n} \sum_ {i = 1} ^ {n} \mathbf {g} _ {i} (\theta) ] = \frac {1}{n} \rho^ {2} (\theta) \tag {8}
+$$
+
+where $\sigma^2 (\theta)$ is the variance of the average gradient over the dataset of size $n$ , and $\rho^2 (\theta)$ is the variance of the gradient of a single data sample.
+
+In one gradient descent step, the model parameter is updated by $\Delta \theta = \theta_{t + 1} - \theta_t = -\lambda \mathbf{g}_D(\theta)$ where $\lambda$ is the learning rate. If $\lambda$ is small enough, the one-step training and test loss decrease can be approximated by
+
+$$
+\Delta L [ D ] \approx - \Delta \theta \cdot \frac {\partial L [ D ]}{\partial \theta} + O \left(\lambda^ {2}\right) = \lambda \mathbf {g} _ {D} (\theta) \cdot \mathbf {g} _ {D} (\theta) + O \left(\lambda^ {2}\right) \tag {9}
+$$
+
+$$
+\Delta L \left[ D ^ {\prime} \right] \approx - \Delta \theta \cdot \frac {\partial L \left[ D ^ {\prime} \right]}{\partial \theta} + O \left(\lambda^ {2}\right) = \lambda \mathbf {g} _ {D} (\theta) \cdot \mathbf {g} _ {D ^ {\prime}} (\theta) + O \left(\lambda^ {2}\right) \tag {10}
+$$
+
+Usually there are some differences between the directions of $\mathbf{g}_D(\theta)$ and $\mathbf{g}_{D^{\prime}}(\theta)$ , so statistically $\Delta L[D]$ tends to be larger than $\Delta L[D^{\prime}]$ and the generalization gap would increase during training. When $\lambda \rightarrow 0$ , in one single training step the empirical generalization gap increases by $\Delta L[D] - \Delta L[D^{\prime}]$ , for simplicity we denote this quantity as $\bigtriangledown$ :
+
+$$
+\begin{array}{l} \bigtriangledown := \Delta L [ D ] - \Delta L [ D ^ {\prime} ] \approx \lambda \mathbf {g} _ {D} (\theta) \cdot \mathbf {g} _ {D} (\theta) - \lambda \mathbf {g} _ {D} (\theta) \cdot \mathbf {g} _ {D ^ {\prime}} (\theta) (11) \\ = \lambda (\tilde {\mathbf {g}} (\theta) + \epsilon) (\tilde {\mathbf {g}} (\theta) + \epsilon - \tilde {\mathbf {g}} (\theta) - \epsilon^ {\prime}) (12) \\ = \lambda (\tilde {\mathbf {g}} (\theta) + \epsilon) \left(\epsilon - \epsilon^ {\prime}\right) (13) \\ \end{array}
+$$
+
+Here we replaced the random variables by $\mathbf{g}_D(\theta) = \tilde{\mathbf{g}} (\theta) + \epsilon$ and $\mathbf{g}_{D^{\prime}}(\theta) = \tilde{\mathbf{g}} (\theta) + \epsilon^{\prime}$ , where $\epsilon$ and $\epsilon^\prime$ are random variables with zero mean and variance $\sigma^2 (\theta)$ . Since $E(\epsilon^{\prime}) = E(\epsilon) = 0$ , $\epsilon$ and $\epsilon^\prime$ are independent, the expectation of $\bigtriangledown$ is
+
+$$
+E _ {D, D ^ {\prime} \sim \mathcal {Z} ^ {n}} (\bigtriangledown) = E (\lambda \epsilon \cdot \epsilon) + O \left(\lambda^ {2}\right) = \lambda \sum_ {j} \sigma^ {2} \left(\theta_ {j}\right) + O \left(\lambda^ {2}\right) \tag {14}
+$$
+
+where $\sigma^2 (\theta_j)$ is the variance the of average gradient of the parameter $\theta_{j}$
+
+For simplicity, when it involves a single model parameter $\theta_{j}$ , we will use only a subscript $j$ instead of the full notation. For example, we use $\sigma_j^2$ , $r_j$ , and $\mathbf{g}_{D,j}$ to denote $\sigma^2 (\theta_j)$ , $r(\theta_j)$ , and $\mathbf{g}_D(\theta_j)$ respectively.
+
+Consider the expectation of $\Delta L[D]$ and $\Delta L[D']$ when $\lambda \to 0$
+
+$$
+E _ {D \sim \mathcal {Z} ^ {n}} (\Delta L [ D ]) \approx \lambda E _ {D \sim \mathcal {Z} ^ {n}} (\mathbf {g} _ {D} (\theta) \cdot \mathbf {g} _ {D} (\theta)) = \lambda \sum_ {j} E _ {D \sim \mathcal {Z} ^ {n}} \left(\mathbf {g} _ {D, j} ^ {2}\right) \tag {15}
+$$
+
+$$
+\begin{array}{l} E _ {D, D ^ {\prime} \sim \mathcal {Z} ^ {n}} (\Delta L [ D ^ {\prime} ]) = E _ {D, D ^ {\prime} \sim \mathcal {Z} ^ {n}} (\Delta L [ D ] - \bigtriangledown) (16) \\ \approx \lambda \sum_ {j} \left(E _ {D \sim \mathcal {Z} ^ {n}} \left(\mathbf {g} _ {D, j} ^ {2}\right) - \sigma_ {j} ^ {2}\right) (17) \\ = \lambda \sum_ {j} \left(E _ {D \sim \mathcal {Z} ^ {n}} \left(\mathbf {g} _ {D, j} ^ {2}\right) - \rho_ {j} ^ {2} / n\right) (18) \\ \end{array}
+$$
+
+Substituting (18) and (15) into (4) we have:
+
+$$
+\mathbf {R} (\mathcal {Z}, n) = 1 - \frac {\sum_ {j} \rho_ {j} ^ {2}}{n \sum_ {j} E _ {D \sim \mathcal {Z} ^ {n}} \left(\mathbf {g} _ {D , j} ^ {2}\right)} \tag {19}
+$$
+
+Although we derived eq. (19) from simplified assumptions, we can empirically verify it by estimating two sides of the equation on real data. We will elaborate on this estimation method in section 2.4.
+
+We can rewrite eq. (19) as:
+
+$$
+\begin{array}{l} \mathbf {R} (\mathcal {Z}, n) = 1 - \frac {1}{n} \sum_ {j} \frac {E _ {D \sim \mathcal {Z} ^ {n}} \left(\mathbf {g} _ {D , j} ^ {2}\right)}{\sum_ {j ^ {\prime}} E _ {D \sim \mathcal {Z} ^ {n}} \left(\mathbf {g} _ {D , j ^ {\prime}} ^ {2}\right)} \frac {\rho_ {j} ^ {2}}{E _ {D \sim \mathcal {Z} ^ {n}} \left(\mathbf {g} _ {D , j} ^ {2}\right)} (20) \\ = 1 - \frac {1}{n} \sum_ {j} \frac {E _ {D \sim \mathcal {Z} ^ {n}} \left(\mathbf {g} _ {D , j} ^ {2}\right)}{\sum_ {j ^ {\prime}} E _ {D \sim \mathcal {Z} ^ {n}} \left(\mathbf {g} _ {D , j ^ {\prime}} ^ {2}\right)} \frac {1}{r _ {j} + \frac {1}{n}} (21) \\ \end{array}
+$$
+
+where $E_{D\sim \mathcal{Z}^n}(\mathbf{g}_{D,j}^2) = Var_{D\sim \mathcal{Z}^n}(\mathbf{g}_{D,j}) + E_{D\sim \mathcal{Z}^n}^2 (\mathbf{g}_{D,j}) = \frac{1}{n}\rho_j^2 +\tilde{\mathbf{g}}_j^2.$
+
+We define $\Delta L_{j}[D]$ to be the training loss decrease caused by updating $\theta_{j}$ . We can show that when $\lambda$ is very small $\Delta L_{j}[D] = \lambda \mathbf{g}_{D,j}^{2} + O(\lambda^{2})$ . Therefore when $\lambda \to 0$ , we have
+
+$$
+\mathbf {R} (\mathcal {Z}, n) = 1 - \frac {1}{n} \sum_ {j} W _ {j} \frac {1}{r _ {j} + \frac {1}{n}}, \quad \text {w h e r e} W _ {j} := \frac {E _ {D \sim \mathcal {Z} ^ {n}} (\Delta L _ {j} [ D ])}{E _ {D \sim \mathcal {Z} ^ {n}} (\Delta L [ D ])} \quad \text {w i t h} \sum_ {j} W _ {j} = 1 \tag {22}
+$$
+
+Eq. (22) shows that the GSNR $r_j$ plays a crucial role in the model's generalization ability—the one-step generalization ratio in gradient descent equals one minus the weighted average of $\frac{1}{r_j + \frac{1}{n}}$ over all model parameters divided by $n$ . The weight is proportional to the expectation of the training loss, decreasing as the number of training parameters increases. This implies that larger GSNR of model parameters during training leads to smaller generalization gap growth, thus better generalization performance of the trained model. Also note when $n \to \infty$ , we have $\mathbf{R}(\mathcal{Z}, n) \to 1$ , meaning that training on more data helps generalization.
+
+# 2.4 EXPERIMENTAL VERIFICATION OF THE RELATIONSHIP BETWEEN GSNR AND OSGR
+
+The relation between GSNR and OSGR, i.e. eq. (19) or (22) can be empirically verified using any dataset if: (1) The dataset includes enough samples to construct many training sets and a large enough test set so that we can reliably estimate $\rho_j^2$ , $E_{D\sim \mathcal{Z}^n}(\mathbf{g}_{D,j}^2)$ and OSGR. (2) The learning rate is small enough. (3) In the early training stage of gradient descent.
+
+To empirically verify eq. (19), we show how to estimate its left and right hand sides, i.e. OSGR by definition and OSGR as a function of GSNR. Suppose we have $M$ training sets each with size $n$ , and a test set of size $n'$ . We initialize a model and train it separately on the $M$ training sets and test it with the same test set. For the $t$ -th training iteration, we denote the training loss and test loss of the model trained on the $m$ -th training dataset as $L_{t}^{(m)}$ and $L_{t}^{\prime(m)}$ , respectively. Then the left hand
+
+
+
+
+
+
+
+
+Figure 3: Left hand (LHS or OSGR by definition) and right side (RHS or OSGR as a function of GSNR) of eq. (19). Points are drawn under different experiment settings. Left: LHS vs RHS at epoch 20, 100, 500, 2500. Each point is drawn by LHS and RHS computed at the given epoch under different model structure (number of channels) or training data size; red dotted line is the line of best fit computed by least squares; blue dotted line is the line of reference representing $\mathrm{LHS} = \mathrm{RHS}$ ; the value of $c$ in each title represents the Pearson correlation coefficient between LHS and RHS computed by points in figure. Right: The legend. Different symbols and colors stand for different number of channels and training data size. Different random noise levels are not distinguished.
+
+
+
+side, i.e. OSGR by definition, of the $t$ -th iteration can be estimated by
+
+$$
+\mathbf {R} _ {t} (\mathcal {Z}, n) \approx \frac {\sum_ {m = 1} ^ {M} L _ {t + 1} ^ {\prime (m)} - L _ {t} ^ {\prime (m)}}{\sum_ {m = 1} ^ {M} L _ {t + 1} ^ {(m)} - L _ {t} ^ {(m)}} \tag {23}
+$$
+
+For the model trained on the $m$ -th training set, we can compute the $t$ -th step average gradient and sample-wise gradient variance of $\theta_{j}$ on the corresponding training set, denoted as $\mathbf{g}_{m,j,t}$ and $\rho_{m,j,t}^{2}$ , respectively. Therefore the right hand side of eq. (19) can be estimated by
+
+$$
+E _ {D \sim \mathcal {Z} ^ {n}} \left(\mathbf {g} _ {D, j, t} ^ {2}\right) \approx \frac {1}{M} \sum_ {m = 1} ^ {M} \mathbf {g} _ {m, j, t} ^ {2}, \quad \rho_ {j, t} ^ {2} \approx \frac {1}{M} \sum_ {m = 1} ^ {M} \rho_ {m, j, t} ^ {2} \tag {24}
+$$
+
+We performed the above estimations on MNIST with a simple CNN structure consists of 2 Conv-Relu-MaxPooling blocks and 2 fully-connected layers. First, to estimate eq. (24) with $M = 10$ , we randomly sample 10 training sets with size $n$ and a test set with size 10,000. To cover different conditions, we (1) choose $n \in \{1000, 2000, 4000, 6000, 8000, 10000, 15000\}$ , respectively; (2) inject noise by randomly changing the labels with probability $p_{random} \in \{0.0, 0.1, 0.2, 0.3, 0.5\}$ ; (3) change the model structure by varying number of channels in the layers, $ch \in \{6, 8, 10, 12, 14, 16, 18, 20\}$ . See Appendix A for more details of the setup. We use the gradient descent training (not SGD), with a small learning rate of 0.001. The left and right hand sides of 19 at different epochs are shown in Figure 3, where each point represents one specific choice of the above settings.
+
+At the beginning of training, the data points are closely distributed along the dashed line corresponding to LHS=RHS. This shows that eq. (19) fits quite well under a variety of different settings. As training proceeds, the points become more scattered as the non-overfitting limit approximation no longer holds, but correlation between the LHS and RHS remains high even when the training converges (at epoch 2,500). We also conducted the same experiment on CIFAR10 A.2 and a toy dataset A.3 observed the same behavior. See Appendix for these experiments.
+
+The empirical evidence together with our previous derivation of eq. (19) clearly show the relation between GSNR and OSGR and its implication in the model's generalization ability.
+
+# 3 TRAINING DYNAMICS OF DNNS NATURALLY LEADS TO LARGE GSNR
+
+In this section, we analyze and explain one interesting phenomenon: the parameters' GSNR of DNNs rises in the early stages of training, whereas the GSNR of shallow models such as logistic regression or support vector machines declines during the entire training process. This difference gives rise to GSNR's large practical values during training, which in turn is associated with good
+
+generalization. We analyze the dynamics behind this phenomenon both experimentally and theoretically.
+
+# 3.1 GSNR BEHAVIOR OF DNNS TRAINING
+
+For shallow models, the GSNR of parameters decreases in the whole training process because gradients become small as learning converges. But for DNNs it is not the case. We trained DNNs on the CIFAR datasets and computed the GSNR averaged over all model parameters. Because $E_{D\sim \mathcal{Z}^n}(\mathbf{g}_{D,j}^2) = \frac{1}{n}\rho_j^2 +\tilde{\mathbf{g}}_j^2$ and we assume $n$ is large, $E_{D\sim \mathcal{Z}^n}(\mathbf{g}_{D,j}^2)\approx \tilde{\mathbf{g}}_j^2$ . In the case of only one large training datasets, we estimate GSNR of $t$ -th iteration by
+
+$$
+r _ {j, t} \approx \mathbf {g} _ {D, j, t} ^ {2} / \rho_ {D, j, t} ^ {2} \tag {25}
+$$
+
+As shown in Figure 4, the GSNR starts out low with randomly initialized parameters. As learning progresses, the GSNR increases in the early training stage and stays at a high level in the whole learning process. For each model parameter, we also computed the proportion of the samples with the same gradient sign, denoted as $p_{\text{same_sign}}$ . In Figure 4c, we plot the mean of time series of this proportion for all the parameters. This value increases from about $50\%$ (half positive half negative due to random initialization) to about $56\%$ finally, which indicates that for most parameters, the gradient signs on different samples become more consistent. This is because meaningful features begin to emerge in the learning process and the gradients of the weights on these features tend to have the same sign among different samples.
+
+Previous research (Zhang et al., 2016) showed that DNNs achieved zero training loss by memorizing training samples even if the labels were randomized. We also plot the average GSNR for model trained using data with randomized labels in Figure 4 and find that the GSNR stays at a low level throughout the training process. Although the training loss of both the original and randomized labels go to zero (not shown), the GSNR curves clearly distinguish between these two cases and reveal the lack of meaningful patterns in the latter one. We believe this is the reason why DNNs trained on real and random data lead to completely different generalization behaviors.
+
+
+Figure 4: (a): GSNR curves generated by a simple network based on real and random data. An obvious upward process in the early training stage was observed for real data only. (b): Same plot for ResNet18. (c): Average of $p_{\text{same\_sign}}$ for the same model as in (a).
+
+
+
+
+
+# 3.2 TRAINING DYNAMICS BEHIND THE GSNR BEHAVIOR
+
+In this section we show that the feature learning ability of DNNs is the key reason why the GSNR curve behavior of DNNs is different from that of shallow models during the gradient descent training. To demonstrate this, a simple two-layer perceptron regression model is constructed. A synthetic dataset is generated as following. Each data point is constructed i.i.d. using $y = x_0x_1 + \epsilon$ , where $x_0$ and $x_1$ are drawn from uniform distribution $[-1, 1]$ and $\epsilon$ is drawn from uniform distribution $[-0.01, 0.01]$ . The training set and test set sizes are 200 and 10,000, respectively. We use a very simple two-layer MLP structure with 2 inputs, 20 hidden neurons and 1 output.
+
+We randomly initialized the model parameters and trained the model on the synthetic training dataset. As a control setup we also tried to freeze model weights in the first layer to prevent it from learning features. Note that a two layer MLP with the first layer frozen is equivalent to a linear regression model. That is, regression weights are learned on the second layer using fixed features extracted by the first layer. We plot the average GSNR of the second layer parameters for both the frozen and non-frozen cases. Figure 5 shows that in the non-frozen case, the average GSNR over parameters of
+
+
+Figure 5: Average GSNR (a) and loss (b) curves for the frozen and non-frozen case. (c): GSNR curves of individual parameters for the non-frozen case.
+
+
+
+
+
+the second layer shows a significant upward process, whereas in the frozen case the average GSNR decreases in the beginning and remains at a low level during the whole training process.
+
+In the non-frozen case, GSNR curve of individual parameters of the second layer are shown in Figure 5. The GSNR for some parameters show a significant upward process. To measure the quality of these features, we computed the Pearson correlation between them and the target output $y$ , both at the beginning of training and at the maximum point of their GSNR curves. We can see that the learning process learns "good" features (high correlation value, i.e. with stronger correlation with $y$ ) from random initialized ones, as shown in Table 1. This shows that the GSNR increasing process is related to feature learning.
+
+# 3.3 ANALYSIS OF TRAINING DYNAMICS BEHIND DNNS' GSNR BEHAVIOR
+
+In this section, we will investigate the training dynamics behind the GSNR curve behavior. In the case of fully connected network structure, we can analytically show that the numerator of GSNR, i.e. the squared gradient mean of model parameters, tends to increase in the early training stage through feature learning.
+
+Consider a fully connected network, whose parameters are $\theta = \{\mathbf{W}^{(1)},\mathbf{b}^{(1)},\dots,\mathbf{W}^{(l_{max})},\mathbf{b}^{(l_{max})}\}$ , where $\mathbf{W}^{(1)},\mathbf{b}^{(1)}$ are the weight matrix and bias of the first layer, and so on. We denote the activations of the $l$ -th layer as $\mathbf{a}^{(l)} = \{a_s^{(l)}(\theta^{(l-)})\}$ , where $s$ is the index for nodes/channels of this layer, and $\theta^{(l-)}$ is the collection of model parameters in the layers before $l$ , i.e. $\theta^{(l-)} = \{\mathbf{W}^{(1)},\mathbf{b}^{(1)},\dots,\mathbf{W}^{(l-1)},\mathbf{b}^{(l-1)}\}$ . In the forward pass on data sample $i$ , $\{a_s^l (\theta^{(l-)})\}$ is multiplied by the weight matrix $\mathbf{W}^{(l)}$ :
+
+$$
+o _ {i, c} ^ {(l)} = \sum_ {s} W _ {c, s} ^ {(l)} a _ {i, s} ^ {(l)} \left(\theta^ {(l -)}\right) \tag {26}
+$$
+
+where $\mathbf{o}^{(l)} = \{o_{i,c}^{(l)}\}$ is the output of the matrix multiplication, for the $i$ -th data sample, on the $l$ -th layer, $c = \{1,2,\dots,C\}$ is the index of nodes/channels in the $(l + 1)$ -th layer. We use $\mathbf{g}_D^{(l)}$ to denote the average gradient of weights of the $l$ -th layer $\mathbf{W}^{(l)}$ , i.e. $\mathbf{g}_D^{(l)} = \frac{1}{n}\sum_{i = 1}^n\frac{\partial L_i}{\partial\mathbf{W}^{(l)}}$ , where $L_{i}$ is the loss of the $i$ -th sample.
+
+Here we show that the feature learning ability of DNNs plays a crucial role in the GSNR increasing process. More precisely, we show that the learning of features $\mathbf{a}^{(l)}(\theta^{(l - )})$ , i.e. the learning of parameters $\theta^{(l - )}$ tends to increase the absolute value of $\mathbf{g}_D^{(l)}$ . Consider the one-step change of gradient mean $\Delta \mathbf{g}_D^{(l)} = \mathbf{g}_{D,t + 1}^{(l)} - \mathbf{g}_{D,t}^{(l)}$ with the learning rate $\lambda \rightarrow 0$ . In one training step, $\theta$ is updated by $\Delta \theta = \theta_{t + 1} - \theta_t = -\lambda \mathbf{g}_D(\theta)$ . Using linear approximation with $\lambda \rightarrow 0$ , we have
+
+$$
+\Delta \mathbf {g} _ {D, s, c} ^ {(l)} \approx \sum_ {j} \frac {\partial \mathbf {g} _ {D , s , c} ^ {(l)}}{\partial \theta_ {j}} \Delta \theta_ {j} = \sum_ {\theta_ {j} \in \theta^ {(l -)}} \frac {\partial \mathbf {g} _ {D , s , c} ^ {(l)}}{\partial \theta_ {j}} \Delta \theta_ {j} + \sum_ {\theta_ {j} \in \theta^ {(l +)}} \frac {\partial \mathbf {g} _ {D , s , c} ^ {(l)}}{\partial \theta_ {j}} \Delta \theta_ {j} \tag {27}
+$$
+
+where $\theta^{(l - )}$ and $\theta^{(l + )}$ denote model parameters before and after the $l$ -th layer (including the $l$ -th), respectively.
+
+We focus on the first term of eq. (27), i.e. the one-step change of $\mathbf{g}_D^{(l)}$ caused by learning $\theta^{(l-)}$ . Substituting $\mathbf{g}_D^{(l)} = \frac{1}{n} \sum_{i=1}^{n} \frac{\partial L_i}{\partial \mathbf{W}^{(l)}}$ and $\Delta \theta_j = (-\lambda \frac{1}{n} \sum_{i=1}^{n} \frac{\partial L_i}{\partial \theta_j})$ into eq. (27), we have
+
+$$
+\Delta \mathbf {g} _ {D, s, c} ^ {(l)} = - \frac {\lambda}{n ^ {2}} \sum_ {\theta_ {j} \in \theta^ {(l -)}} \mathbf {W} _ {s, c} ^ {(l)} \left(\sum_ {i = 1} ^ {n} \frac {\partial L _ {i}}{\partial o _ {i , c} ^ {(l)}} \frac {\partial a _ {i , s} ^ {(l)}}{\partial \theta_ {j}}\right) ^ {2} + o t h e r t e r m s \tag {28}
+$$
+
+The detailed derivation of eq. (28) can be found in Appendix B. We can see the first term (which is a summation over parameters in $\theta^{(l-)}$ ) in eq. (28) has opposite sign with $\mathbf{W}_{s,c}^{(l)}$ . This term will make $\Delta \mathbf{g}_{D,s,c}^{(l)}$ negatively correlated with $\mathbf{W}_{s,c}^{(l)}$ . We plot the correlation between $\Delta \mathbf{g}_{D,s,c}^{(l)}$ with $\mathbf{W}_{s,c}^{(l)}$ for a model trained on MNIST for 200 epochs in Figure 6a. In the early training stage, they are indeed negatively correlated. For top-10% weights with larger absolute values, the negative correlation is even more significant.
+
+Here we show that this negative correlation between $\Delta \mathbf{g}_{D,s,c}^{(l)}$ and $\mathbf{W}_{s,c}^{(l)}$ tends to increase the absolute value of $\mathbf{g}_D^{(l)}$ through an interesting mechanism. Consider the weights $\mathbf{W}_{s,c}^{(l)}$ with $\{\mathbf{W}_{s,c}^{(l)} > 0, \mathbf{g}_{D,s,c}^{(l)} < 0\}$ . Learning $\theta^{l-}$ would decrease $\mathbf{g}_{D,s,c}^{(l)}$ and thus increase its absolute value because the first term in eq. (28) is negative. On the other hand, learning $\mathbf{W}_{s,c}^{(l)}$ would increase $\mathbf{W}_{s,c}^{(l)}$ and its absolute value because $\Delta \mathbf{W}_{s,c}^{(l)} = -\lambda \mathbf{g}_{D,s,c}^{(l)}$ is positive. This will form a positive feedback process, in which the numerator of GSNR, $(\mathbf{g}_{D,s,c}^{(l)})^2$ , would increase and so is the GSNR. Similar analysis can be done for the case with $\{\mathbf{W}_{s,c}^{(l)} < 0, \mathbf{g}_{D,s,c}^{(l)} > 0\}$ .
+
+On the other hand, when $\{\mathbf{W}_{s,c}^{(l)}\mathbf{g}_{D,s,c}^{(l)} > 0\}$ , we show that the weights tend to change into the earlier case, i.e. $\{\mathbf{W}_{s,c}^{(l)}\mathbf{g}_{D,s,c}^{(l)} < 0\}$ during training. Consider the case of $\{\mathbf{W}_{s,c}^{(l)} > 0, \mathbf{g}_{D,s,c}^{(l)} > 0\}$ , the first term in eq. (28) is negative, learning $\theta^{(l-)}$ tends to decrease $\mathbf{g}_{D,s,c}^{(l)}$ or even change its sign. Another possibility is that learning $\mathbf{W}_{s,c}^{(l)}$ changes the sign of $\mathbf{W}_{s,c}^{(l)}$ because $\Delta \mathbf{W}_{s,c}^{(l)} = -\lambda \mathbf{g}_{D,s,c}^{(l)}$ is negative. In both cases the weights change into the earlier case with $\{\mathbf{W}_{s,c}^{(l)}\mathbf{g}_{D,s,c}^{(l)} < 0\}$ . Similar analysis can be done for the case of $\{\mathbf{W}_{s,c}^{(l)} < 0, \mathbf{g}_{D,s,c}^{(l)} < 0\}$ .
+
+Therefore $\{\mathbf{W}_{s,c}^{(l)}\mathbf{g}_{D,s,c}^{(l)} < 0\}$ is a more stable state in the training process. For a simple model trained on MNIST, We plot the proportion of weights satisfying $\{\mathbf{W}_{s,c}^{(l)}\mathbf{g}_{D,s,c}^{(l)} < 0\}$ in Figure 6b and find that there are indeed more weights with $\{\mathbf{W}_{s,c}^{(l)}\mathbf{g}_{D,s,c}^{(l)} < 0\}$ than the opposite. Because weights with small absolute value easily change sign during training, we also plot this proportion for the top-10% weights with larger absolute values. We can see that for the weights with large absolute values, nearly 80% of them have opposite signs with their gradient mean, confirming our earlier analysis. For these weights, the numerator of GSNR, $(\mathbf{g}_{D,s,c}^{(l)})^2$ , tends to increase through the positive feedback process as discussed above.
+
+
+Figure 6: MNIST experiments. Left: Correlation between $\Delta \mathbf{g}_{D,s,c}^{(l)}$ and $\mathbf{W}_{s,c}^{(l)}$ . Right: Ratio of weights that have opposite signs with their gradient mean.
+
+
+
+Table 1: Pearson correlation between features and target output $y$ , where $c_{t_0}$ and $c_{t_{max}}$ are correlations at the beginning of training and maximum of GSNR curve respectively.
+
+| feature id | ct0 | ctmax |
| 0 | -0.11 | 0.47 |
| 5 | 0.11 | 0.44 |
| 13 | 0.07 | 0.40 |
| 14 | -0.21 | -0.27 |
| 17 | -0.33 | 0.53 |
+
+# 4 SUMMARY
+
+In this paper, we performed a series of analysis on the role of model parameters' GSNR in deep neural networks' generalization ability. We showed that large GSNR is a key to small generalization gap, and gradient descent training naturally incurs and exploits large GSNR as the model discovers useful features in learning.
+
+# REFERENCES
+
+Madhu S Advani and Andrew M Saxe. High-dimensional dynamics of generalization error in neural networks. arXiv preprint arXiv:1710.03667, 2017.
+Sanjeev Arora, Rong Ge, Behnam Neyshabur, and Yi Zhang. Stronger generalization bounds for deep nets via a compression approach, 2018. arXiv:1802.05296.
+Peter L Bartlett and Shahar Mendelson. Rademacher and gaussian complexities: Risk bounds and structural results. Journal of Machine Learning Research, 3:463-482, 2002.
+Laurent Dinh, Razvan Pascanu, Samy Bengio, and Yoshua Bengio. Sharp minima can generalize for deep nets. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 1019-1028. JMLR.org, 2017.
+Gintare Karolina Dziugaite and Daniel M Roy. Computing nonvacuous generalization bounds for deep (stochastic) neural networks with many more parameters than training data. arXiv preprint arXiv:1703.11008, 2017.
+Alex Graves. Agenerating sequences with recurrent neural networks, 2013. arXiv:1308.0850v5.
+Moritz Hardt, Benjamin Recht, and Yoram Singer. Train faster, generalize better: Stability of stochastic gradient descent. arXiv preprint arXiv:1509.01240, 2015.
+Elad Hoffer, Itay Hubara, and Daniel Soudry. Train longer, generalize better: closing the generalization gap in large batch training of neural networks. Advances in Neural Information Processing Systems, pp. 1731-1741, 2017.
+Daniel Jakubovitz, Raja Giryes, and Miguel RD Rodrigues. Generalization error in deep learning, 2019.
+Kenji Kawaguchi, Leslie Pack Kaelbling, and Yoshua Bengio. Generalization in deep learning. arXiv preprint arXiv:1710.05468, 2017.
+Nitish Shirish Keskar, Dheevatsa Mudigere, Jorge Nocedal, Mikhail Smelyanskiy, and Ping Tak Peter Tang. On large-batch training for deep learning: Generalization gap and sharp minima. arXiv preprint arXiv:1609.04836, 2016.
+Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
+Behnam Neyshabur, Srinadh Bhojanapalli, David McAllester, and Nati Srebro. Exploring generalization in deep learning. In Advances in Neural Information Processing Systems, pp. 5947-5956, 2017.
+Roman Novak, Yasaman Bahri, Daniel A Abolafia, Jeffrey Pennington, and Jascha Sohl-Dickstein. Sensitivity and generalization in neural networks: An empirical study. arXiv:1802.08760, 2018.
+Tom Rainforth, Adam R Kosiorek, Tuan Anh Le, Chris J Maddison, Maximilian Igl, Frank Wood, and Yee Whye Teh. Tighter variational bounds are not necessarily better. arXiv preprint arXiv:1802.04537, 2018.
+Stanislaw Jastrzebski Srini Narayanan Stanislav Fort, Pawe Krzysztof Nowak. Stiffness: A new perspective on generalization in neural networks, 2019. arXiv:1901.09491.
+Vladimir N Vapnik and A Ja Chervonenkis. The necessary and sufficient conditions for consistency of the method of empirical risk. Pattern Recognition and Image Analysis, 1(3):284-305, 1991.
+
+Matthew D. Zeiler. Adadelta: An adaptive learning rate method, 2012. arXiv:1212.5701.
+Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning requires rethinking generalization. arXiv preprint arXiv:1611.03530, 2016.
+
+# A APPENDIX A
+
+# A.1 MODEL STRUCTURE IN SECTION 2.4
+
+As shown in Table 2, all models in the experiment consist of 2 Conv-Relu-MaxPooling blocks and 2 fully-connected layers, but they are different in the number of channels. We choose the number of channels $p$ from $\{6,8,10,12,14,16,18,20\}$ .
+
+Table 2: Model structure On MNIST in Section 2.4. $p$ is the number of channels and $q = \operatorname{int}\left( {{2.5} * p}\right)$
+
+| Layer | input #channels | output #channels |
| conv + relu + maxpooling | 1 | p |
| conv + relu + maxpooling | p | q |
| flatten | - | - |
| fc + relu | 16 * q | 10 * q |
| fc + relu | 10 * q | 10 |
| softmax | - | - |
+
+# A.2 EXPERIMENT ON CIFAR10
+
+Different from the experiment on MNIST, we use a deeper network on CIFAR10. We also include the Batch Normalization (BN) layer, because we find that it's difficult for the network to converge in the absence of it. The network consists of 4 Conv-BN-Relu-Conv-BN-Relu-MaxPooling blocks and 3 fully-connected layers. More details are shown in Table 3.
+
+Table 3: Model structure on CIFAR10. $p$ is the number of channels.
+
+| Layer | input #channels | output #channels |
| conv + bn + relu | 3 | p |
| conv + bn + relu | p | p |
| maxpooling | - | - |
| conv + bn + relu | p | 2p |
| conv + bn + relu | 2p | 2p |
| maxpooling | - | - |
| conv + bn + relu | 2p | 4p |
| conv + bn + relu | 4p | 4p |
| maxpooling | - | - |
| conv + bn + relu | 4p | 8p |
| conv + bn + relu | 8p | 8p |
| maxpooling | - | - |
| flatten | - | - |
| fc + relu | 32 * q | 8 * q |
| fc + relu | 8 * q | 8 * q |
| fc | 8 * q | 10 |
| softmax | - | - |
+
+The experiment is conducted under a similar setting as that of MNIST in section 2.4. We choose $n \in \{2000, 4000, 6000, 8000, 10000\}$ , $p_{random} \in \{0.0, 0.2, 0.4\}$ , $ch \in \{6, 8, 10, 12, 14, 16, 18\}$ . We use the gradient descent training (Not SGD), with a small learning rate of 0.001. The left and right hand sides of 19 at different epochs are shown in Figure 7, where each point represents one specific combination of the above settings. Note that at the evaluation step of every epoch, we use
+
+
+
+
+
+
+
+
+Figure 7: Left hand (LHS) and right side (RHS) of eq. (19). Points are drawn under different experiment settings. Left figure: LHS vs RHS relation at epoch 20, 100, 500, 1000.
+
+
+
+
+
+
+
+
+
+
+Figure 8: Similar with Fig. 3, but for a toy regression model discussed in in Appendix A.3.
+
+
+
+the same mean and variance inside the BN layers as the training dataset. That's to ensure that the network and loss function are consistent between training and test.
+
+At the beginning of training, compared to that of MNIST, the data points no longer perfectly resides on the diagonal dashed line. We suppose that's because of the presence of BN layer, whose internal parameters, i.e. running mean and running variance, are not regular learnable parameters in the optimization process, but change their values in a different way. Their change affects the OSGR, yet we could not include them in the estimation of OSGR. However, the strong positive correlation between the left and right hand sides of eq. (19) can always be observed until the training begins to converge.
+
+# A.3 EXPERIMENT ON TOY DATASET
+
+In this section we show a simple two-layer regression model consists of a FC-Relu structure with only 2 inputs, 1 hidden layer with $N$ neurons and 1 output. A similar synthetic dataset with the training data used in the experiment of Section 3.2 is generated as follows. Each data point is constructed i.i.d. using $y = x_0x_1 + \epsilon$ , where $x_0$ and $x_1$ are drawn from uniform distribution of $[-1,1]$ and $\epsilon$ is drawn from uniform distribution of $[- \eta_{noise}, \eta_{noise}]$ .
+
+To estimate eq. (24), we randomly generate 100 training sets with $n$ samples each, i.e. $M = 100$ and a test set with 20,000 samples. To cover different conditions, we (1) choose $n \in \{50, 100, 300, 600, 1000, 2000, 6000\}$ ; (2) inject noise with $\eta_{noise} \in \{0.2, 2, 4, 6, 8\}$ ; (3) perturb model structures by choosing $N \in \{6, 8, 10, 12, 14, 16, 18, 20\}$ . We use gradient descent with learning rate of 0.001.
+
+Figure 8 shows a similar behavior as Fig. 3. During the early training stages, the LHS and RHS of eq. (19) are very close. Their highly correlated relation remains until training converges, whereas the RHS of eq. (19) decreases significantly.
+
+# B APPENDIX B
+
+Derivation of eq. (28)
+
+$$
+\begin{array}{l} \Delta \mathbf {g} _ {D, s, c} ^ {(l)} = \sum_ {\theta_ {j} \in \theta^ {(l -)}} \frac {\partial \mathbf {g} _ {D , s , c} ^ {(l)}}{\partial \theta_ {j}} \Delta \theta_ {j} + o t h e r t e r m s (29) \\ = \sum_ {\theta_ {j} \in \theta^ {(l -)}} \frac {\partial \left(\frac {1}{n} \sum_ {i = 1} ^ {n} \frac {\partial L _ {i}}{\partial \mathbf {W} _ {s , c} ^ {(l)}}\right)}{\partial \theta_ {j}} (- \lambda \frac {1}{n} \sum_ {i = 1} ^ {n} \frac {\partial L _ {i}}{\partial \theta_ {j}}) + o t h e r t e r m s (30) \\ = \sum_ {\theta_ {j} \in \theta^ {(l -)}} \frac {\partial \left(\frac {1}{n} \sum_ {i = 1} ^ {n} \frac {\partial L _ {i}}{\partial o _ {i , c} ^ {(l)}} \frac {\partial o _ {i , c} ^ {(l)}}{\partial \mathbf {W} _ {s , c} ^ {(l)}}\right)}{\partial \theta_ {j}} (- \frac {\lambda}{n} \sum_ {i = 1} ^ {n} \sum_ {s ^ {\prime}, c ^ {\prime}} \frac {\partial L _ {i}}{\partial o _ {i , c ^ {\prime}} ^ {(l)}} \frac {\partial o _ {i , c ^ {\prime}} ^ {(l)}}{\partial a _ {i , s ^ {\prime}} ^ {(l)}} \frac {\partial a _ {i , s ^ {\prime}} ^ {(l)}}{\partial \theta_ {j}}) + o t h e r t e r m s (31) \\ = - \frac {\lambda}{n ^ {2}} \sum_ {\theta_ {j} \in \theta^ {(l -)}} \frac {\partial \left(\sum_ {i = 1} ^ {n} \frac {\partial L _ {i}}{\partial o _ {i , c} ^ {(l)}} a _ {i , s} ^ {(l)}\right)}{\partial \theta_ {j}} \left(\sum_ {i = 1} ^ {n} \sum_ {s ^ {\prime}, c ^ {\prime}} \frac {\partial L _ {i}}{\partial o _ {i , c ^ {\prime}} ^ {(l)}} \mathbf {W} _ {s ^ {\prime}, c ^ {\prime}} ^ {(l)} \frac {\partial a _ {i , s ^ {\prime}} ^ {(l)}}{\partial \theta_ {j}}\right) + o t h e r t e r m s (32) \\ = - \frac {\lambda}{n ^ {2}} \sum_ {\theta_ {j} \in \theta^ {(l -)}} \sum_ {i = 1} ^ {n} \left(\frac {\partial L _ {i}}{\partial o _ {i , c} ^ {(l)}} \frac {\partial a _ {i , s} ^ {(l)}}{\partial \theta_ {j}} + \frac {\partial^ {2} L _ {i}}{\partial o _ {i , c} ^ {(l)} \partial \theta_ {j}} a _ {i, s} ^ {(l)}\right) \left(\sum_ {s ^ {\prime}, c ^ {\prime}} \mathbf {W} _ {s ^ {\prime}, c ^ {\prime}} ^ {(l)} \sum_ {i = 1} ^ {n} \frac {\partial L _ {i}}{\partial o _ {i , c ^ {\prime}} ^ {(l)}} \frac {\partial a _ {i , s ^ {\prime}} ^ {(l)}}{\partial \theta_ {j}}\right) + o t h e r t e r m s (33) \\ \end{array}
+$$
+
+Above we used $\frac{\partial o_{i,c^{\prime}}^{(l)}}{\partial a_{i,s^{\prime}}^{(l)}} = \mathbf{W}_{s^{\prime},c^{\prime}}^{(l)}$ and $\frac{\partial o_{i,c}^{(l)}}{\partial\mathbf{W}_{s,c}^{(l)}} = a_{i,s}^{(l)}$ that can both be derived from eq. (26). Consider the first term of eq. (33). When $s^\prime = s, c^\prime = c$ , we have
+
+$$
+\Delta \mathbf {g} _ {s, c} ^ {(l)} = - \frac {\lambda}{n ^ {2}} \sum_ {\theta_ {j} \in \theta^ {(l -)}} \mathbf {W} _ {s, c} ^ {(l)} \left(\sum_ {i = 1} ^ {n} \frac {\partial L _ {i}}{\partial o _ {i , c} ^ {(l)}} \frac {\partial a _ {i , s} ^ {(l)}}{\partial \theta_ {j}}\right) ^ {2} + o t h e r t e r m s \tag {34}
+$$
+
+Note that the term related to $\frac{\partial^2L_i}{\partial o_{i,c}^{(l)}\partial\theta_j} a_{i,s}^{(l)}$ and the terms when $s^\prime \neq s$ or $c^{\prime}\neq c$ in eq. (33) are merged into other terms of eq. (34).
+
+# C APPENDIX C
+
+# Notations
+
+| Z | A data distribution satisfies X × Y |
| s or (x,y) | A single data sample |
| D | Training set consists of n samples drawn from Z |
| D' | Test set consists of n' samples drawn from Z |
| θ | Model parameters, whose components are denoted as θj |
| gs(θ) or gi(θ) | Parameters' gradient w.r.t. a single data sample s or (xi,yi) |
| g(θ) | Mean values of parameters' gradient over a total data distribution, i.e., Es~Z(gs(θ)) |
| gd(θ) | Average gradient over the training dataset, i.e., 1/n∑i=1n gi(θ) |
| gd'(θ) | Average gradient over the test dataset, i.e., 1/n' ∑i=1n' gi'(θ). Note that, in eq. (5), we assume n' = n |
| gd,j | Same as gd(θj) |
| ρ2(θ) | Variance of parameters' gradient of a single sample, i.e., VarS~Z(gs(θ)) |
| ρj2 | Same as ρ2(θj) |
| σ2(θ) | Variance of the average gradient over a training dataset of size n, i.e., VarD~Zn[gd(θ)] |
| σj2 | Same as σ2(θj) |
| rj or r(θj) | Gradient signal to noise ratio (GSNR) of model parameter θj |
| L[D] | Empirical training loss, i.e., 1/n ∑i=1n L(yi, f(xi,θ)) |
| L[D'] | Empirical test loss, i.e., 1/n' ∑i=1n' L(yi', f(xi',θ)) |
| ΔL[D] | One-step training loss decrease |
| ΔLj[D] | One-step training loss decrease caused by updating one parameter θj |
| R(Z,n) | One-step generalization ratio (OSGR) for the training and test sets of size n sampled from data distribution Z, i.e., ED,D'~Zn(ΔL[D']) / ED~Zn(ΔL[D]) |
| λ | Learning rate |
| ∇ | One-step generalization gap increment, i.e., ΔL[D] - ΔL[D'] |
| ε | Random variables with zero mean and variance σ2(θ) |
| W(l) and b(l) | Model parameters (weight matrix and bias) of the l-th layer |
| θ(l-) | Collection of model parameters over all the layers before the l-th layer |
| gD(l) | Average gradient of W(l) over the training dataset |
| θ(l+) | Collection of model parameters over all the layers after the l-th layer, including the l-th layer |
| a(l) = {as(l)(θ(l-))} | Activations of the l-th layer, where s = {1,2,...,S} is the index of nodes/channels in the l-th layer. |
| o(l) = {oc(l)} | Outputs of matrix multiplication of the l-th layer, where c = {1,2,...,C} is index of nodes/channels in the (l+1)-th layer. |
| a(i,s) and o(i,c) | a(s) and o(c) evaluated on data sample i |
\ No newline at end of file
diff --git a/understandingwhyneuralnetworksgeneralizewellthroughgsnrofparameters/images.zip b/understandingwhyneuralnetworksgeneralizewellthroughgsnrofparameters/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..69db6c8384792f35950811d3a7d0e48b70aac9e5
--- /dev/null
+++ b/understandingwhyneuralnetworksgeneralizewellthroughgsnrofparameters/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:6e13a7a9a149817c6c3a05594420c225ac80d888c298ebd2533b85c1fe1411d3
+size 897379
diff --git a/understandingwhyneuralnetworksgeneralizewellthroughgsnrofparameters/layout.json b/understandingwhyneuralnetworksgeneralizewellthroughgsnrofparameters/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..93466a3ec6ae9ff8997e5168f70ca72b94608867
--- /dev/null
+++ b/understandingwhyneuralnetworksgeneralizewellthroughgsnrofparameters/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ad714e2e1b9ec5d7f26de6883eacd0c4ef07d8db56c96de2b76f5a6b023b5dd7
+size 563139
diff --git a/whatcanneuralnetworksreasonabout/72c119b4-8b97-47f3-8a72-652c5414b73e_content_list.json b/whatcanneuralnetworksreasonabout/72c119b4-8b97-47f3-8a72-652c5414b73e_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..766e45808eb9e263d5910eba679b13ae2263a078
--- /dev/null
+++ b/whatcanneuralnetworksreasonabout/72c119b4-8b97-47f3-8a72-652c5414b73e_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:1b725df9ac8126173fc77ebd173b168b39af50063595ddd0064454ad7ff4456b
+size 122259
diff --git a/whatcanneuralnetworksreasonabout/72c119b4-8b97-47f3-8a72-652c5414b73e_model.json b/whatcanneuralnetworksreasonabout/72c119b4-8b97-47f3-8a72-652c5414b73e_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..bcfd2ece4308186abedccdda7ccc439326fc25b6
--- /dev/null
+++ b/whatcanneuralnetworksreasonabout/72c119b4-8b97-47f3-8a72-652c5414b73e_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:2ada3973420c3d89f9e76fb868b819d25429d01b07d47e58504b913f513d82fc
+size 148561
diff --git a/whatcanneuralnetworksreasonabout/72c119b4-8b97-47f3-8a72-652c5414b73e_origin.pdf b/whatcanneuralnetworksreasonabout/72c119b4-8b97-47f3-8a72-652c5414b73e_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..7319c440d9c180669b39087ef4e77f462d8b2643
--- /dev/null
+++ b/whatcanneuralnetworksreasonabout/72c119b4-8b97-47f3-8a72-652c5414b73e_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e6b6b38ca0fce9d539559fc6ea566c9635683a0984a06565e168ea00951da036
+size 829352
diff --git a/whatcanneuralnetworksreasonabout/full.md b/whatcanneuralnetworksreasonabout/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..baf2123f91944d0e647747b6942539bbf0cc639a
--- /dev/null
+++ b/whatcanneuralnetworksreasonabout/full.md
@@ -0,0 +1,509 @@
+# WHAT CAN NEURAL NETWORKS REASON ABOUT?
+
+Keyulu Xu†, Jingling Li†, Mozhi Zhang†, Simon S. Du§, Ken-ichi Kawarabayashi¶, Stefanie Jegelka†
+
+†Massachusetts Institute of Technology (MIT)
+$^{\ddagger}$ University of Maryland
+$^{\S}$ Institute for Advanced Study (IAS)
+National Institute of Informatics (NII)
+
+{keyulu, stefje}@mit.edu
+
+# ABSTRACT
+
+Neural networks have succeeded in many reasoning tasks. Empirically, these tasks require specialized network structures, e.g., Graph Neural Networks (GNNs) perform well on many such tasks, but less structured networks fail. Theoretically, there is limited understanding of why and when a network structure generalizes better than others, although they have equal expressive power. In this paper, we develop a framework to characterize which reasoning tasks a network can learn well, by studying how well its computation structure aligns with the algorithmic structure of the relevant reasoning process. We formally define this algorithmic alignment and derive a sample complexity bound that decreases with better alignment. This framework offers an explanation for the empirical success of popular reasoning models, and suggests their limitations. As an example, we unify seemingly different reasoning tasks, such as intuitive physics, visual question answering, and shortest paths, via the lens of a powerful algorithmic paradigm, dynamic programming (DP). We show that GNNs align with DP and thus are expected to solve these tasks. On several reasoning tasks, our theory is supported by empirical results.
+
+# 1 INTRODUCTION
+
+Recently, there have been many advances in building neural networks that can learn to reason. Reasoning spans a variety of tasks, for instance, visual and text-based question answering (Johnson et al., 2017a; Weston et al., 2015; Hu et al., 2017; Fleuret et al., 2011; Antol et al., 2015), intuitive physics, i.e., predicting the time evolution of physical objects (Battaglia et al., 2016; Watters et al., 2017; Fragkiadaki et al., 2016; Chang et al., 2017), mathematical reasoning (Saxton et al., 2019; Chang et al., 2019) and visual IQ tests (Santoro et al., 2018; Zhang et al., 2019).
+
+Curiously, neural networks that perform well in reasoning tasks usually possess specific structures (Santoro et al., 2017). Many successful models follow the Graph Neural Network (GNN) framework (Battaglia et al., 2018; 2016; Palm et al., 2018; Mrowca et al., 2018; Sanchez-Gonzalez et al., 2018; Janner et al., 2019). These networks explicitly model pairwise relations and recursively update each object's representation by aggregating its relations with other objects. Other computational structures, e.g., neural symbolic programs (Yi et al., 2018; Mao et al., 2019; Johnson et al., 2017b) and Deep Sets (Zaheer et al., 2017), are effective on specific tasks.
+
+However, there is limited understanding of the relation between the generalization ability and network structure for reasoning. What tasks can a neural network (sample efficiently) learn to reason about? Answering this question is crucial for understanding the empirical success and limitations of existing models, and for designing better models for new reasoning tasks.
+
+This paper is an initial work towards answering this fundamental question, by developing a theoretical framework to characterize what tasks a neural network can reason about. We build on a simple observation that reasoning processes resemble algorithms. Hence, we study how well a reasoning algorithm aligns with the computation graph of the network. Intuitively, if they align well, the network only needs to learn simple algorithm steps to simulate the reasoning process, which leads to better sample efficiency. We formalize this intuition with a numeric measure of algorithmic alignment,
+
+
+Summary statistics
+
+
+What is the maximum value difference among treasures?
+Relational argmax
+What are the colors of the furthest pair of objects?
+
+
+Dynamic programming
+What is the cost to defeat monster $X$ by following the optimal path?
+Figure 1: Overview of reasoning tasks with increasingly complex structure. Each task category shows an example task on which we perform experiments in Section 4. Algorithmic alignment suggests that (a) Deep Sets and GNNs, but not MLP, can sample efficiently learn summary statistics, (b) GNNs, but not Deep Sets, can learn relational argmax, (c) GNNs can learn dynamic programming, an algorithmic paradigm that we show to unify many reasoning tasks, (d) GNNs cannot learn subset sum (NP-hard), but NES, a network we design based on exhaustive search, can generalize. Our theory agrees with empirical results (Fig. 3).
+
+
+NP-hard problem
+Subset sum: Is there a subset that sums to 0?
+
+and show initial support for our hypothesis that algorithmic alignment facilitates learning: Under simplifying assumptions, we show a sample complexity bound that decreases with better alignment.
+
+Our framework explains the empirical success of popular reasoning models and suggests their limitations. As concrete examples, we study four categories of increasingly complex reasoning tasks: summary statistics, relational argmax (asking about properties of the result of comparing multiple relations), dynamic programming, and NP-hard problems (Fig. 1). Using alignment, we characterize which architectures are expected to learn each task well: Networks inducing permutation invariance, such as Deep Sets (Zaheer et al., 2017), can learn summary statistics, and one-iteration GNNs can learn relational argmax. Many other more complex tasks, such as intuitive physics, visual question answering, and shortest paths – despite seeming different – can all be solved via a powerful algorithmic paradigm: dynamic programming (DP) (Bellman, 1966). Multi-iteration GNNs algorithmically align with DP and hence are expected to sample-efficiently learn these tasks. Indeed, they do. Our results offer an explanation for the popularity of GNNs in the relational reasoning literature, and also suggest limitations for tasks with even more complex structure. As an example of such a task, we consider subset sum, an NP-hard problem where GNNs indeed fail. Overall, empirical results (Fig. 3) agree with our theoretical analysis based on algorithmic alignment (Fig. 1). These findings also suggest how to take into account task structure when designing new architectures.
+
+The perspective that structure in networks helps is not new. For example, in a well-known position paper, Battaglia et al. (2018) argue that GNNs are suitable for relational reasoning because they have relational inductive biases, but without formalizations. Here, we take such ideas one step further, by introducing a formal definition (algorithmic alignment) for quantifying the relation between network and task structure, and by formally deriving implications for learning. These theoretical ideas are the basis for characterizing what reasoning tasks a network can learn well. Our algorithmic structural condition also differs from structural assumptions common in learning theory (Vapnik, 2013; Bartlett & Mendelson, 2002; Bartlett et al., 2017; Neyshabur et al., 2015; Golowich et al., 2018) and specifically aligns with reasoning.
+
+In summary, we introduce algorithmic alignment to analyze learning for reasoning. Our initial theoretical results suggest that algorithmic alignment is desirable for generalization. On four categories of reasoning tasks with increasingly complex structure, we apply our framework to analyze which tasks some popular networks can learn well. GNNs algorithmically align with dynamic programming, which solves a broad range of reasoning tasks. Finally, our framework implies guidelines for designing networks for new reasoning tasks. Experimental results confirm our theory.
+
+# 2 PRELIMINARIES
+
+We begin by introducing notations and summarizing common neural networks for reasoning tasks. Let $S$ denote the universe, i.e., a configuration/set of objects to reason about. Each object $s \in S$ is represented by a vector $X$ . This vector could be state descriptions (Battaglia et al., 2016; Santoro
+
+
+Figure 2: Our framework suggests that better algorithmic alignment improves generalization. As an example, our framework explains why GNN generalizes when learning to answer shortest paths. A correct reasoning process for the shortest paths task is the Bellman-Ford algorithm. The computation structure of a GNN (left) aligns well with Bellman-Ford (right): the GNN can simulate Bellman-Ford by merely learning a simple reasoning step, i.e., the relaxation step in the last line (a sum, and a min over neighboring nodes $v$ ) via its aggregation operation. In contrast, a giant MLP or Deep Set must learn the structure of the entire for-loop. Thus, the GNN is expected to generalize better when learning shortest paths, as is confirmed in experiments (Section 4.3).
+
+et al., 2017) or features learned from data such as images (Santoro et al., 2017). Information about the specific question can also be included in the object representations. Given a set of universes $\{S_1,\dots,S_M\}$ and answer labels $\{y_{1},\ldots ,y_{M}\} \subseteq \mathcal{V}$ , we aim to learn a function $g$ that can answer questions about unseen universes, $y = g(S)$ .
+
+Multi-layer perceptron (MLP). For a single-object universe, applying an MLP on the object representation usually works well. But when there are multiple objects, simply applying an MLP to the concatenated object representations often does not generalize (Santoro et al., 2017).
+
+Deep Sets. As the input to the reasoning function is an unordered set, the function should be permutation-invariant, i.e., the output is the same for all input orderings. To induce permutation invariance in a neural network, Zaheer et al. (2017) propose Deep Sets, of the form
+
+$$
+y = \mathrm {M L P} _ {2} \left(\sum_ {s \in S} \mathrm {M L P} _ {1} \left(X _ {s}\right)\right). \tag {2.1}
+$$
+
+Graph Neural Networks (GNNs). GNNs are originally proposed for learning on graphs (Scarselli et al., 2009b). Their structures follow a message passing scheme (Gilmer et al., 2017; Xu et al., 2018; 2019), where the representation $h_s^{(k)}$ of each node $s$ (in iteration $k$ ) is recursively updated by aggregating the representation of neighboring nodes. GNNs can be adopted for reasoning by considering objects as nodes and assuming all objects pairs are connected, i.e., a complete graph (Battaglia et al., 2018):
+
+$$
+h _ {s} ^ {(k)} = \sum_ {t \in S} \mathrm {M L P} _ {1} ^ {(k)} \left(h _ {s} ^ {(k - 1)}, h _ {t} ^ {(k - 1)}\right), \quad h _ {S} = \mathrm {M L P} _ {2} \left(\sum_ {s \in S} h _ {s} ^ {(K)}\right), \tag {2.2}
+$$
+
+where $h_S$ is the answer/output and $K$ is the number of GNN layers. Each object's representation is initialized as $h_s^{(0)} = X_s$ . Although other aggregation functions are proposed, we use sum in our experiments. Similar to Deep Sets, GNNs are also permutation invariant. While Deep Sets focus on individual objects, GNNs can also focus on pairwise relations.
+
+The GNN framework includes many reasoning models. Relation Networks (Santoro et al., 2017) and Interaction Networks (Battaglia et al., 2016) resemble one-layer GNNs. Recurrent Relational Networks (Palm et al., 2018) apply LSTMs (Hochreiter & Schmidhuber, 1997) after aggregation.
+
+# 3 THEORETICAL FRAMEWORK: ALGORITHMIC ALIGNMENT
+
+Next, we study how the network structure and task may interact, and possible implications for generalization. Empirically, different network structures have different degrees of success in learning reasoning tasks, e.g., GNNs can learn relations well, but Deep Sets often fail (Fig. 3). However, all these networks are universal approximators (Propositions 3.1 and 3.2). Thus, their differences in test accuracy must come from generalization.
+
+We observe that the answer to many reasoning tasks may be computed via a reasoning algorithm; we further illustrate the algorithms for some reasoning tasks in Section 4. Many neural networks can represent algorithms (Pérez et al., 2019). For example, Deep Sets can universally represent permutation-invariant set functions (Zaheer et al., 2017; Wagstaff et al., 2019). This also holds for GNNs and MLPs, as we show in Propositions 3.1 and 3.2 (our setting differs from Scarselli et al. (2009a) and Xu et al. (2019), who study functions on graphs):
+
+Proposition 3.1. Let $f: \mathbb{R}^{d \times N} \to \mathbb{R}$ be any continuous function over sets $S$ of bounded cardinality $|S| \leq N$ . If $f$ is permutation-invariant to the elements in $S$ , and the elements are in a compact set in $\mathbb{R}^d$ , then $f$ can be approximated arbitrarily closely by a GNN (of any depth).
+
+Proposition 3.2. For any GNN $\mathcal{N}$ , there is an MLP that can represent all functions $\mathcal{N}$ can represent.
+
+But, empirically, not all network structures work well when learning these algorithms, i.e., they generalize differently. Intuitively, a network may generalize better if it can represent a function "more easily". We formalize this idea by algorithmic alignment, formally defined in Definition 3.4. Indeed, not only the reasoning process has an algorithmic structure: the neural network's architecture induces a computational structure on the function it computes. This corresponds to an algorithm that prescribes how the network combines computations from modules. Fig. 2 illustrates this idea for a GNN, where the modules are its MLPs applied to pairs of objects. In the shortest paths problem, the GNN matches the structure of the Bellman-Ford algorithm: to simulate the Bellman-Ford with a GNN, the GNN's MLP modules only need to learn a simple update equation (Fig. 2). In contrast, if we want to represent the Bellman-Ford algorithm with a single MLP, it needs to simulate an entire for-loop, which is much more complex than one update step. Therefore, we expect the GNN to have better sample complexity than MLP when learning to solve shortest path problems.
+
+This perspective suggests that a neural network which better aligns with a correct reasoning process (algorithmic solution) can more easily learn a reasoning task than a neural network that does not align well. If we look more broadly at reasoning, there may also exist solutions which only solve a task approximately, or whose structure is obtuse. In this paper, we focus on reasoning tasks whose underlying reasoning process is exact and has clear algorithmic structure. We leave the study of approximation algorithms and unknown structures for future work.
+
+# 3.1 FORMALIZATION OF ALGORITHMIC ALIGNMENT
+
+We formalize the above intuition in a PAC learning framework (Valiant, 1984). PAC learnability formalizes simplicity as sample complexity, i.e., the number of samples needed to ensure low test error with high probability. It refers to a learning algorithm $\mathcal{A}$ that, given training samples $\{x_i,y_i\}_{i = 1}^M$ outputs a function $f = \mathcal{A}(\{x_i,y_i\}_{i = 1}^M)$ . The learning algorithm here is the neural network and its training method, e.g., gradient descent. A function is simple if it has low sample complexity.
+
+Definition 3.3. (PAC learning and sample complexity). Fix an error parameter $\epsilon >0$ and failure probability $\delta \in (0,1)$ . Suppose $\{x_i,y_i\}_{i = 1}^M$ are i.i.d. samples from some distribution $\mathcal{D}$ , and the data satisfies $y_{i} = g(x_{i})$ for some underlying function $g$ . Let $f = \mathcal{A}(\{x_i,y_i\}_{i = 1}^M)$ be the function generated by a learning algorithm $\mathcal{A}$ . Then $g$ is $(M,\epsilon ,\delta)$ -learnable with $\mathcal{A}$ if
+
+$$
+\mathbb {P} _ {x \sim \mathcal {D}} [ \| f (x) - g (x) \| \leq \epsilon ] \geq 1 - \delta . \tag {3.1}
+$$
+
+The sample complexity $\mathcal{C}_{\mathcal{A}}(g,\epsilon ,\delta)$ is the minimum $M$ so that $g$ is $(M,\epsilon ,\delta)$ -learnable with $\mathcal{A}$ .
+
+With the PAC learning framework, we define a numeric measure of algorithmic alignment (Definition 3.4), and under simplifying assumptions, we show that the sample complexity decreases with better algorithmic alignment (Theorem 3.6).
+
+Formally, a neural network aligns with an algorithm if it can simulate the algorithm via a limited number of modules, and each module is simple, i.e., has low sample complexity.
+
+Definition 3.4. (Algorithmic alignment). Let $g$ be a reasoning function and $\mathcal{N}$ a neural network with $n$ modules $\mathcal{N}_i$ . The module functions $f_1, \ldots, f_n$ generate $g$ for $\mathcal{N}$ if, by replacing $\mathcal{N}_i$ with $f_i$ , the network $\mathcal{N}$ simulates $g$ . Then $\mathcal{N}(M, \epsilon, \delta)$ -alge-nimically aligns with $g$ if (1) $f_1, \ldots, f_n$ generate $g$ and (2) there are learning algorithms $\mathcal{A}_i$ for the $\mathcal{N}_i$ 's such that $n \cdot \max_i C_{\mathcal{A}_i}(f_i, \epsilon, \delta) \leq M$ .
+
+Good algorithmic alignment, i.e., small $M$ , implies that all algorithm steps $f_{i}$ to simulate the algorithm $g$ are easy to learn. Therefore, the algorithm steps should not simulate complex programming constructs such as for-loops, whose sample complexity is large (Theorem 3.5).
+
+Next, we show how to compute the algorithmic alignment value $M$ . Algorithmic alignment resembles Kolmogorov complexity (Kolmogorov, 1998) for neural networks. Thus, it is generally non-trivial to obtain the optimal alignment between a neural network and an algorithm. However, one important difference to Kolmogorov complexity is that any algorithmic alignment that yields decent sample complexity is good enough (unless we want the tightest bound). In Section 4, we will see several examples where finding a good alignment is not hard. Then, we can compute the value of an alignment by summing the sample complexity of the algorithm steps with respect to the modules, e.g. MLPs. For illustration, we show an example of how one may compute sample complexity of MLP modules.
+
+A line of works show one can analyze the optimization and generalization behavior of overparameterized neural networks via neural tangent kernel (NTK) (Allen-Zhu et al., 2019; Arora et al., 2019a;b; 2020; Du et al., 2019c;a; Jacot et al., 2018; Li & Liang, 2018). Building upon Arora et al. (2019a), Du et al. (2019b) show that infinitely-wide GNNs trained with gradient descent can provably learn certain smooth functions. The current work studies a broader class of functions, e.g., algorithms, compared to those studied in Du et al. (2019b), but with more simplifying assumptions.
+
+Here, Theorem 3.5, proved in the Appendix, summarizes and extends Theorem 6.1 of Arora et al. (2019a) for over-parameterized MLP modules to vector-valued functions. Our framework can be used with other sample complexity bounds for other types of modules, too.
+
+Theorem 3.5. (Sample complexity for overparameterized MLP modules). Let $\mathcal{A}$ be an overparameterized and randomly initialized two-layer MLP trained with gradient descent for a sufficient number of iterations. Suppose $g:\mathbb{R}^d\to \mathbb{R}^m$ with components $g(x)^{(i)} = \sum_{j}\alpha_{j}^{(i)}\bigl (\beta_{j}^{(i)\top}x\bigr)^{p_{j}^{(i)}}$ where $\beta_j^{(i)}\in \mathbb{R}^d$ $\alpha \in \mathbb{R}$ , and $p_j^{(i)} = 1$ or $p_j^{(i)} = 2l$ $(l\in \mathbb{N}_{+})$ . The sample complexity $\mathcal{C}_A(g,\epsilon ,\delta)$ is
+
+$$
+\mathcal {C} _ {\mathcal {A}} (g, \epsilon , \delta) = O \left(\frac {\max _ {i} \sum_ {j = 1} ^ {K} p _ {j} ^ {(i)} \left| \alpha_ {j} ^ {(i)} \right| \cdot \left\| \beta_ {j} ^ {(i)} \right\| _ {2} ^ {p _ {j} ^ {(i)}} + \log (m / \delta)}{(\epsilon / m) ^ {2}}\right). \tag {3.2}
+$$
+
+Theorem 3.5 suggests that functions that are "simple" when expressed as a polynomial, e.g., via a Taylor expansion, are sample efficiently learnable by an MLP module. Thus, algorithm steps that perform computation over many objects may require many samples for an MLP module to learn, since the number $K$ of polynomials or $\| \beta_j^{(i)}\|$ can increase in Eqn. (3.2). "For loop" is one example of such complex algorithm steps.
+
+# 3.2 BETTER ALGORITHMIC ALIGNMENT IMPLIES BETTER GENERALIZATION
+
+We show an initial result demonstrating that algorithmic alignment is desirable for generalization. Theorem 3.6 states that, in a simplifying setting where we sequentially train modules of a network with auxiliary labels, the sample complexity bound increases with algorithmic alignment value $M$ .
+
+While we do not have auxiliary labels in practice, we observe the same pattern for end-to-end learning in experiments (Section 4). We leave sample complexity analysis for end-to-end-learning to future work. We prove Theorem 3.6 in Appendix D.
+
+Theorem 3.6. (Algorithmic alignment improves sample complexity). Fix $\epsilon$ and $\delta$ . Suppose $\{S_i, y_i\}_{i=1}^M \sim \mathcal{D}$ , where $|S_i| < N$ , and $y_i = g(S_i)$ for some $g$ . Suppose $\mathcal{N}_1, \ldots, \mathcal{N}_n$ are network $\mathcal{N}$ 's MLP modules in sequential order. Suppose $\mathcal{N}$ and $g(M, \epsilon, \delta)$ -algeRMically align via functions $f_1, \ldots, f_n$ . Under the following assumptions, $g$ is $(M, O(\epsilon), O(\delta))$ -learnable by $\mathcal{N}$ .
+
+a) Algorithm stability. Let $\mathcal{A}$ be the learning algorithm for the $\mathcal{N}_i$ 's. Suppose $f = \mathcal{A}(\{x_i, y_i\}_{i=1}^M)$ , and $\hat{f} = \mathcal{A}(\{\hat{x}_i, y_i\}_{i=1}^M)$ . For any $x$ , $\|f(x) - \hat{f}(x)\| \leq L_0 \cdot \max_i \|x_i - \hat{x}_i\|$ , for some $L_0$ .
+b) Sequential learning. We train $\mathcal{N}_i$ 's sequentially: $\mathcal{N}_1$ has input samples $\{\hat{x}_i^{(1)}, f_1(\hat{x}_i^{(1)})\}_{i=1}^N$ , with $\hat{x}_i^{(1)}$ obtained from $S_i$ . For $j > 1$ , the input $\hat{x}_i^{(j)}$ for $\mathcal{N}_j$ are the outputs from the previous modules, but labels are generated by the correct functions $f_{j-1}, \ldots, f_1$ on $\hat{x}_i^{(1)}$ .
+c) Lipschitzness. The learned functions $\hat{f}_j$ satisfy $\| \hat{f}_j(x) - \hat{f}_j(\hat{x})\| \leq L_1\| x - \hat{x}\|$ , for some $L_{1}$ .
+
+
+(a) Maximum value difference.
+
+
+(c) Monster trainer.
+
+
+(b) Furthest pair.
+
+
+(d) Subset sum. Random guessing yields $50\%$ .
+Figure 3: Test accuracies on reasoning tasks with increasingly complex structure. Fig. 1 shows an overview of the tasks. GNN $k$ is GNN with $k$ iterations. (a) Summary statistics. All models except MLP generalize. (b) Relational argmax. Deep Sets fail. (c) Dynamic programming. Only GNNs with sufficient iterations generalize. (d) An NP-hard problem. Even GNNs fail, but NES generalizes.
+
+In our analysis, the Lipschitz constants and the universe size are constants going into $O(\epsilon)$ and $O(\delta)$ . As an illustrative example, we use Theorem 3.6 and 3.5 to show that GNN has a polynomial improvement in sample complexity over MLP when learning simple relations. Indeed, GNN aligns better with summary statistics of pairwise relations than MLP does (Section 4.1).
+
+Corollary 3.7. Suppose universe $S$ has $\ell$ objects $X_{1},\ldots ,X_{\ell}$ , and $g(S) = \sum_{i,j}(X_i - X_j)^2$ . In the setting of Theorem 3.6, the sample complexity bound for MLP is $O(\ell^2)$ times larger than for GNN.
+
+# 4 PREDICTING WHAT NEURAL NETWORKS CAN REASON ABOUT
+
+Next, we apply our framework to analyze the neural networks for reasoning from Section 2: MLP, Deep Sets, and GNNs. Using algorithmic alignment, we predict whether each model can generalize on four categories of increasingly complex reasoning tasks: summary statistics, relational argmax, dynamic programming, and an NP-hard problem (Fig. 3). Our theoretical analysis is confirmed with experiments (Dataset and training details are in Appendix G). To empirically compare sample complexity of different models, we make sure all models perfectly fit training sets through extensive hyperparameter tuning. Therefore, the test accuracy reflects how well a model generalizes.
+
+The examples in this section, together with our framework, suggest an explanation why GNNs are widely successful across reasoning tasks: Popular reasoning tasks such as visual question answering and intuitive physics can be solved by DP. GNNs align well with DP, and hence are expected to learn sample efficiently.
+
+# 4.1 SUMMARY STATISTICS
+
+As discussed in Section 2, we assume each object $X$ has a state representation $X = [h_{1}, h_{2}, \dots, h_{k}]$ , where each $h_{i} \in \mathbb{R}^{d_{i}}$ is a feature vector. An MLP can learn simple polynomial functions of the state representation (Theorem 3.5). In this section, we show how Deep Sets use MLP as building blocks to learn summary statistics.
+
+Questions about summary statistics are common in reasoning tasks. One example from CLEVR (Johnson et al., 2017a) is "How many objects are either small cylinders or red things?" Deep Sets (Eqn. 2.1) align well with algorithms that compute summary statistics over individual objects. Suppose we want to compute the sum of a feature over all objects. To simulate the reasoning algorithm, we can use the first MLP in Deep Sets to extract the desired feature and aggregate them using the pooling layer. Under this alignment, each MLP only needs to learn simple steps, which leads to good sample complexity. Similarly, Deep Sets can learn to compute max or min of a feature by using smooth approximations like the softmax $\max_{s\in S}X_s\approx \log (\sum_{s\in X_s}\exp (X_s))$ . In contrast, if we train an MLP to perform sum or max, the MLP must learn a complex for-loop and therefore needs more
+
+
+Figure 4: Test accuracy vs. training set size for models trained on sub-sampled training sets and evaluated on the same test set of monster trainer (DP task). Test accuracies increase faster when a neural network aligns well with an algorithmic solution of the task. For example, the test accuracy of GNN4 increases by $23\%$ when the number of training samples increases from 40,000 to 80,000, which is much higher than that of Deep Sets $(0.2\%)$ .
+
+samples. Therefore, our framework predicts that Deep Sets have better sample complexity than MLP when learning summary statistics.
+
+Maximum value difference. We confirm our predictions by training models to compute the maximum value difference task. Each object in this task is a treasure $X = [h_1, h_2, h_3]$ with location $h_1$ , value $h_2$ , and color $h_3$ . We train models to predict the difference in value between the most and the least valuable treasure, $y(S) = \max_{s \in S} h_2(X_s) - \min_{s \in S} h_2(X_s)$ .
+
+The test accuracy follows our prediction (Fig. 3a). MLP does not generalize and only has $9\%$ test accuracy, while Deep Sets has $96\%$ . Interestingly, if we sort the treasures by value (Sorted MLP in Fig. 3a), MLP achieves perfect test accuracy. This observation can be explained with our theory—when the treasures are sorted, the reasoning algorithm is reduced to a simple subtraction: $y(S) = h_2(X_{|S|}) - h_2(X_1)$ , which has a low sample complexity for even MLPs (Theorem 3.5). GNNs also have high test accuracies. This is because summary statistics are a special case of relational argmax, which GNNs can learn as shown next.
+
+# 4.2 RELATIONAL ARGMAX
+
+Next, we study relational argmax: tasks where we need to compare pairwise relations and answer a question about that result. For example, a question from Sort-of-CLEVR (Santoro et al., 2017) asks "What is the shape of the object that is farthest from the gray object?", which requires comparing the distance between object pairs.
+
+One-iteration GNN aligns well with relational argmax, as it sums over all pairs of objects, and thus can compare, e.g. via softmax, pairwise information without learning the "for loops". In contrast, Deep Sets require many samples to learn this, because most pairwise relations cannot be encoded as a sum of individual objects:
+
+Claim 4.1. Suppose $g(x,y) = 0$ if and only if $x = y$ . There is no $f$ such that $g(x,y) = f(x) + f(y)$ .
+
+Therefore, if we train a Deep Set to compare pairwise relations, one of the MLP modules has to learn a complex "for loop", which leads to poor sample complexity. Our experiment confirms that GNNs generalize better than Deep Sets when learning relational argmax.
+
+Furthest pair. As an example of relational argmax, we train models to identify the furthest pair among a set of objects. We use the same object settings as the maximum value difference task. We train models to find the colors of the two treasures with the largest distance. The answer is a pair of colors, encoded as an integer category:
+
+$$
+y (S) = \left(h _ {3} \left(X _ {s _ {1}}\right), h _ {3} \left(X _ {s _ {2}}\right)\right) \quad \text {s . t .} \left\{X _ {s _ {1}}, X _ {s _ {2}} \right\} = \arg \max _ {s _ {1}, s _ {2} \in S} \| h _ {1} \left(X _ {s _ {1}}\right) - h _ {1} \left(X _ {s _ {2}}\right) \| _ {\ell_ {1}}
+$$
+
+Distance as a pairwise function satisfies the condition in Claim 4.1. As predicted by our framework, Deep Sets has only $21\%$ test accuracy, while GNNs have more than $90\%$ accuracy.
+
+# 4.3 DYNAMIC PROGRAMMING
+
+We observe that a broad class of relational reasoning tasks can be unified by the powerful algorithmic paradigm dynamic programming (DP) (Bellman, 1966). DP recursively breaks down a problem into simpler sub-problems. It has the following general form:
+
+$$
+\operatorname {A n s w e r} [ k ] [ i ] = \mathrm {D P - U p d a t e} (\{\operatorname {A n s w e r} [ k - 1 ] [ j ] \}, j = 1 \dots n), \tag {4.1}
+$$
+
+where $\text{Answer}[k][i]$ is the solution to the sub-problem indexed by iteration $k$ and state $i$ , and DP-Update is an task-specific update function that computes $\text{Answer}[k][i]$ from $\text{Answer}[k - 1][j]$ 's.
+
+GNNs algorithmically align with a class of DP algorithms. We can interpret GNN as a DP algorithm, where node representations $h_i^{(k)}$ are Answer[k][i], and the GNN aggregation step is the DP-Update. Therefore, Theorem 3.6 suggests that a GNN with enough iterations can sample efficiently learn any DP algorithm with a simple DP-update function, e.g. sum/min/max.
+
+Shortest paths. As an example, we experiment with GNN on Shortest paths, a standard DP problem. Shortest paths can be solved by the Bellman-Ford algorithm (Bellman, 1958), which recursively updates the minimum distance between each object $u$ and the source $s$ :
+
+$$
+\operatorname {d i s t a n c e} [ 1 ] [ u ] = \operatorname {c o s t} (s, u), \quad \operatorname {d i s t a n c e} [ k ] [ u ] = \min _ {v} \left\{\operatorname {d i s t a n c e} [ k - 1 ] [ v ] + \operatorname {c o s t} (v, u) \right\}, \tag {4.2}
+$$
+
+As discussed above, GNN aligns well with this DP algorithm. Therefore, our framework predicts that GNN has good sample complexity when learning to find shortest paths. To verify this, we test different models on a monster trainer game, which is a shortest path variant with unknown cost functions that need to be learned by the models. Appendix G.3 describes the task in details.
+
+In Fig. 3c, only GNNs with at least four iterations generalize well. The empirical result confirms our theory: a neural network can sample efficiently learn a task if it aligns with a correct algorithm. Interestingly, GNN does not need as many iterations as Bellman-Ford. While Bellman-Ford needs $N = 7$ iterations, GNNs with four iterations have almost identical test accuracy as GNNs with seven iterations (94% vs 95%). This can also be explained through algorithmic alignment, as GNN aligns with an optimized version of Bellman-Ford, which we explain in Appendix G.3.
+
+Fig. 4 shows how the test accuracies of different models vary with the number of sub-sampled training points. Indeed, the test accuracy increases more slowly for models that align worse with the task, which implies they need more training samples to achieve similar generalization performance. Again, this confirms our theory.
+
+After verifying that GNNs can sample-efficiently learn DP, we show that two popular families of reasoning tasks, visual question answering and intuitive physics, can be formulated as DP. Therefore, our framework explains why GNNs are effective in these tasks.
+
+Visual question answering. The Pretty-CLEVR dataset (Palm et al., 2018) is an extension of Sort-of-CLEVR (Santoro et al., 2017) and CLEVR (Johnson et al., 2017a). GNNs work well on these datasets. Each question in Pretty-CLEVR has state representations and asks "Starting at object $X$ , if each time we jump to the closest object, which object is $K$ jumps away?". This problem can be solved by DP, which computes the answers for $k$ jumps from the answers for $(k - 1)$ jumps.
+
+$$
+\operatorname {c l o s e s t} [ 1 ] [ i ] = \arg \min _ {j} d (i, j), \quad \operatorname {c l o s e s t} [ k ] [ i ] = \operatorname {c l o s e s t} [ k - 1 ] \left[ \operatorname {c l o s e s t} [ 1 ] [ i ] \right] \text {f o r} k > 1, \tag {4.3}
+$$
+
+where $\text{closest}[k][i]$ is the answer for jumping $k$ times from object $i$ , and $d(i,j)$ is the distance between the $i$ -th and the $j$ -th object.
+
+Intuitive physics. Battaglia et al. (2016) and Watters et al. (2017) train neural networks to predict object dynamics in rigid body scenes and n-body systems. Chang et al. (2017) and Janner et al. (2019) study other rigid body scenes. If the force acting on a physical object stays constant, we can compute the object's trajectory with simple functions (physics laws) based on its initial position and force. Physical interactions, however, make the force change, which means the function to compute the object's dynamics has to change too. Thus, a DP algorithm would recursively compute the next force changes in the system and update DP states (velocity, momentum, position etc of objects) according to the (learned) forces and physics laws (Thijssen, 2007).
+
+$$
+\text {f o r} k = 1.. K: \quad \text {t i m e} = \min _ {i, j} \text {F o r c e - c h a n g e - t i m e} (\text {s t a t e} [ k - 1, i ], \text {s t a t e} [ k - 1, j ]), \tag {4.4}
+$$
+
+$$
+\text {f o r} i = 1.. N: \quad \text {s t a t e} [ k ] [ i ] = \text {U p d a t e - b y - f o r c e s} (\text {s t a t e} [ k - 1 ] [ j ], \text {t i m e}), j = 1.. N, \tag {4.5}
+$$
+
+Force-change-time computes the time at which the force between object $i$ and $j$ will change. Update-by-forces updates the state of each object at the next force change time. In rigid body systems, force changes only at collision. In datasets where no object collides more than once between time frames, one-iteration algorithm/GNN can work (Battaglia et al., 2016). More iterations are needed if multiple collisions occur between two consecutive frames (Li & Liang, 2018). In n-body systems, forces change continuously but smoothly. Thus, finite-iteration DP/GNN can be viewed as a form of Runge-Kutta method (DeVries & Hamill, 1995).
+
+# 4.4 DESIGNING NEURAL NETWORKS WITH ALGORITHMIC ALIGNMENT
+
+While DP solves many reasoning tasks, it has limitations. For example, NP-hard problems cannot be solved by DP. It follows that GNN also cannot sample-efficiently learn these hard problems. Our framework, however, goes beyond GNNs. If we know the structure of a suitable underlying reasoning algorithm, we can design a network with a similar structure to learn it. If we have no prior knowledge about the structure, then neural architecture search over algorithmic structures will be needed.
+
+Subset Sum. As an example, we design a new architecture that can learn to solve the subset sum problem: Given a set of numbers, does there exist a subset that sums to 0? Subset sum is NP-hard (Karp, 1972) and cannot be solved by DP. Therefore, our framework predicts that GNN cannot generalize on this task. One subset sum algorithm is exhaustive search, where we enumerate all $2^{|S|}$ possible subsets $\tau$ and check whether $\tau$ has zero-sum. Following this algorithm, we design a similarly structured neural network which we call Neural Exhaustive Search (NES). Given a universe, NES enumerates all subsets of objects and passes each subset through an LSTM followed by a MLP. The results are aggregated with a max-pooling layer and MLP:
+
+$$
+\mathrm {M L P} _ {2} \left(\max _ {\tau \subseteq S} \mathrm {M L P} _ {1} \circ \operatorname {L S T M} \left(X _ {1}, \dots , X _ {| \tau |}: X _ {1}, \dots , X _ {| \tau |} \in \tau\right)\right). \tag {4.6}
+$$
+
+This architecture aligns well with subset-sum, since the first MLP and LSTM only need to learn a simple step, checking whether a subset has zero sum. Therefore, we expect NES to generalize well in this task. Indeed, NES has $98\%$ test accuracy, while other models perform much worse (Fig. 3d).
+
+# 5 CONCLUSION
+
+This paper is an initial step towards formally understanding how neural networks can learn to reason. In particular, we answer what tasks a neural network can learn to reason about well, by studying the generalization ability of learning the underlying reasoning processes for a task. To this end, we introduce an algorithmic alignment framework to formalize the interaction between the structure of a neural network and a reasoning process, and provide preliminary results on sample complexity. Our results explain the success and suggest the limits of current neural architectures: Graph Neural Networks generalize in many popular reasoning tasks because the underlying reasoning processes for those tasks resemble dynamic programming.
+
+Our algorithmic alignment perspective may inspire neural network design and opens up theoretical avenues. An interesting direction for future work is to design, e.g. via algorithmic alignment, neural networks that can learn other reasoning paradigms beyond dynamic programming, and to explore the neural architecture search space of algorithmic structures.
+
+From a broader standpoint, reasoning assumes a good representation of the concepts and objects in the world. To complete the picture, it would also be interesting to understand how to better disentangle and eventually integrate "representation" and "reasoning".
+
+# ACKNOWLEDGMENTS
+
+We thank Zi Wang and Jiajun Wu for insightful discussions. This research was supported by NSF CAREER award 1553284, DARPA DSO's Lagrange program under grant FA86501827838 and a Chevron-MIT Energy Fellowship. This research was also supported by JST ERATO JPMJER1201 and JSPS Kakenhi JP18H05291. MZ was supported by DARPA award HR0011-15-C-0113 under subcontract to Raytheon BBN Technologies. The views, opinions, and/or findings contained in this article are those of the author and should not be interpreted as representing the official views or policies, either expressed or implied, of the Defense Advanced Research Projects Agency or the Department of Defense.
+
+# REFERENCES
+
+Zeyuan Allen-Zhu, Yanzhi Li, and Yingyu Liang. Learning and generalization in overparameterized neural networks, going beyond two layers. In Advances in Neural Information Processing Systems, pp. 6155-6166, 2019.
+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.
+Sanjeev Arora, Simon Du, Wei Hu, Zhiyuan Li, and Ruosong Wang. Fine-grained analysis of optimization and generalization for overparameterized two-layer neural networks. In International Conference on Machine Learning, pp. 322-332, 2019a.
+Sanjeev Arora, Simon S Du, Wei Hu, Zhiyuan Li, Russ R Salakhutdinov, and Ruosong Wang. On exact computation with an infinitely wide neural net. In Advances in Neural Information Processing Systems, pp. 8139-8148, 2019b.
+Sanjeev Arora, Simon S. Du, Zhiyuan Li, Ruslan Salakhutdinov, Ruosong Wang, and Dingli Yu. Harnessing the power of infinitely wide deep nets on small-data tasks. In International Conference on Learning Representations, 2020.
+Peter L Bartlett and Shahar Mendelson. Rademacher and gaussian complexities: Risk bounds and structural results. Journal of Machine Learning Research, 3(Nov):463-482, 2002.
+Peter L Bartlett, Dylan J Foster, and Matus J Telgarsky. Spectrally-normalized margin bounds for neural networks. In Advances in Neural Information Processing Systems, pp. 6240-6249, 2017.
+Peter Battaglia, Razvan Pascanu, Matthew Lai, Danilo Jimenez Rezende, et al. Interaction networks for learning about objects, relations and physics. In Advances in Neural Information Processing Systems, pp. 4502-4510, 2016.
+Peter W Battaglia, Jessica B Hamrick, Victor Bapst, Alvaro Sanchez-Gonzalez, Vinicius Zambaldi, Mateusz Malinowski, Andrea Tacchetti, David Raposo, Adam Santoro, Ryan Faulkner, et al. Relational inductive biases, deep learning, and graph networks. arXiv preprint arXiv:1806.01261, 2018.
+Richard Bellman. On a routing problem. Quarterly of applied mathematics, 16(1):87-90, 1958.
+Richard Bellman. Dynamic programming. Science, 153(3731):34-37, 1966.
+Michael Chang, Abhishek Gupta, Sergey Levine, and Thomas L. Griffiths. Automatically composing representation transformations as a means for generalization. In International Conference on Learning Representations, 2019.
+Michael B Chang, Tomer Ullman, Antonio Torralba, and Joshua B Tenenbaum. A compositional object-based approach to learning physical dynamics. In International Conference on Learning Representations, 2017.
+Paul L DeVries and Patrick Hamill. A first course in computational physics, 1995.
+Simon Du, Jason Lee, Haochuan Li, Liwei Wang, and Xiyu Zhai. Gradient descent finds global minima of deep neural networks. In International Conference on Machine Learning, pp. 1675-1685, 2019a.
+Simon S Du, Kangcheng Hou, Russ R Salakhutdinov, Barnabas Poczos, Ruosong Wang, and Keyulu Xu. Graph neural tangent kernel: Fusing graph neural networks with graph kernels. In Advances in Neural Information Processing Systems, pp. 5724-5734, 2019b.
+Simon S. Du, Xiyu Zhai, Barnabas Poczos, and Aarti Singh. Gradient descent provably optimizes over-parameterized neural networks. In International Conference on Learning Representations, 2019c.
+
+François Fleuret, Ting Li, Charles Dubout, Emma K Wampler, Steven Yantis, and Donald Geman. Comparing machines and humans on a visual categorization test. Proceedings of the National Academy of Sciences, 108(43):17621-17625, 2011.
+Katerina Fragkiadaki, Pulkit Agrawal, Sergey Levine, and Jitendra Malik. Learning visual predictive models of physics for playing billiards. In International Conference on Learning Representations, 2016.
+Justin Gilmer, Samuel S Schoenholz, Patrick F Riley, Oriol Vinyals, and George E Dahl. Neural message passing for quantum chemistry. In International Conference on Machine Learning, pp. 1273-1272, 2017.
+Noah Golowich, Alexander Rakhlin, and Ohad Shamir. Size-independent sample complexity of neural networks. In Conference On Learning Theory, pp. 297-299, 2018.
+Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural computation, 9(8): 1735-1780, 1997.
+Ronghang Hu, Jacob Andreas, Marcus Rohrbach, Trevor Darrell, and Kate Saenko. Learning to reason: End-to-end module networks for visual question answering. In Proceedings of the IEEE International Conference on Computer Vision, pp. 804-813, 2017.
+Arthur Jacot, Franck Gabriel, and Clément Hongler. Neural tangent kernel: Convergence and generalization in neural networks. In Advances in neural information processing systems, pp. 8571-8580, 2018.
+Michael Janner, Sergey Levine, William T. Freeman, Joshua B. Tenenbaum, Chelsea Finn, and Jiajun Wu. Reasoning about physical interactions with object-centric models. In International Conference on Learning Representations, 2019.
+Justin Johnson, Bharath Hariharan, Laurens van der Maaten, Li Fei-Fei, C Lawrence Zitnick, and Ross Girshick. Clevr: A diagnostic dataset for compositional language and elementary visual reasoning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2901-2910, 2017a.
+Justin Johnson, Bharath Hariharan, Laurens van der Maaten, Judy Hoffman, Li Fei-Fei, C Lawrence Zitnick, and Ross Girshick. Inferring and executing programs for visual reasoning. In Proceedings of the IEEE International Conference on Computer Vision, pp. 2989-2998, 2017b.
+Richard M Karp. Reducibility among combinatorial problems. In Complexity of computer computations, pp. 85-103. Springer, 1972.
+Andrei N Kolmogorov. On tables of random numbers. Theoretical Computer Science, 207(2): 387-395, 1998.
+Yuanzhi Li and Yingyu Liang. Learning overparameterized neural networks via stochastic gradient descent on structured data. In Advances in Neural Information Processing Systems, pp. 8157-8166, 2018.
+Jiayuan Mao, Chuang Gan, Pushmeet Kohli, Joshua B. Tenenbaum, and Jiajun Wu. The neurosymbolic concept learner: Interpreting scenes, words, and sentences from natural supervision. In International Conference on Learning Representations, 2019.
+Damian Mrowca, Chengxu Zhuang, Elias Wang, Nick Haber, Li F Fei-Fei, Josh Tenenbaum, and Daniel L Yamins. Flexible neural representation for physics prediction. In Advances in Neural Information Processing Systems, pp. 8799-8810, 2018.
+Behnam Neyshabur, Ryota Tomioka, and Nathan Srebro. Norm-based capacity control in neural networks. In Conference on Learning Theory, pp. 1376-1401, 2015.
+Rasmus Palm, Ulrich Paquet, and Ole Winther. Recurrent relational networks. In Advances in Neural Information Processing Systems, pp. 3368-3378, 2018.
+
+Jorge Pérez, Javier Marinković, and Pablo Barceló. On the turing completeness of modern neural network architectures. In International Conference on Learning Representations, 2019.
+Alvaro Sanchez-Gonzalez, Nicolas Heess, Jost Tobias Springenberg, Josh Merel, Martin Riedmiller, Raia Hadsell, and Peter Battaglia. Graph networks as learnable physics engines for inference and control. In International Conference on Machine Learning, pp. 4467-4476, 2018.
+Adam Santoro, David Raposo, David G Barrett, Mateusz Malinowski, Razvan Pascanu, Peter Battaglia, and Timothy Lillicrap. A simple neural network module for relational reasoning. In Advances in neural information processing systems, pp. 4967-4976, 2017.
+Adam Santoro, Felix Hill, David Barrett, Ari Morcos, and Timothy Lillicrap. Measuring abstract reasoning in neural networks. In International Conference on Machine Learning, pp. 4477-4486, 2018.
+David Saxton, Edward Grefenstette, Felix Hill, and Pushmeet Kohli. Analysing mathematical reasoning abilities of neural models. In International Conference on Learning Representations, 2019.
+Franco Scarselli, Marco Gori, Ah Chung Tsoi, Markus Hagenbuchner, and Gabriele Monfardini. Computational capabilities of graph neural networks. IEEE Transactions on Neural Networks, 20 (1):81-102, 2009a.
+Franco Scarselli, Marco Gori, Ah Chung Tsoi, Markus Hagenbuchner, and Gabriele Monfardini. The graph neural network model. IEEE Transactions on Neural Networks, 20(1):61-80, 2009b.
+Jos Thijssen. Computational physics. Cambridge university press, 2007.
+Leslie G Valiant. A theory of the learnable. In Proceedings of the sixteenth annual ACM symposium on Theory of computing, pp. 436-445. ACM, 1984.
+Vladimir Vapnik. The nature of statistical learning theory. Springer science & business media, 2013.
+Edward Wagstaff, Fabian B Fuchs, Martin Engelcke, Ingmar Posner, and Michael Osborne. On the limitations of representing functions on sets. In International Conference on Machine Learning, 2019.
+Nicholas Watters, Daniel Zoran, Theophane Weber, Peter Battaglia, Razvan Pascanu, and Andrea Tacchetti. Visual interaction networks: Learning a physics simulator from video. In Advances in neural information processing systems, pp. 4539-4547, 2017.
+Jason Weston, Antoine Bordes, Sumit Chopra, Alexander M Rush, Bart van Merrienboer, Armand Joulin, and Tomas Mikolov. Towards ai-complete question answering: A set of prerequisite toy tasks. arXiv preprint arXiv:1502.05698, 2015.
+Keyulu Xu, Chengtao Li, Yonglong Tian, Tomohiro Sonobe, Ken-ichi Kawarabayashi, and Stefanie Jegelka. Representation learning on graphs with jumping knowledge networks. In International Conference on Machine Learning, pp. 5453-5462, 2018.
+Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How powerful are graph neural networks? In International Conference on Learning Representations, 2019.
+Kexin Yi, Jiajun Wu, Chuang Gan, Antonio Torralba, Pushmeet Kohli, and Josh Tenenbaum. Neural-symbolic vqa: Disentangling reasoning from vision and language understanding. In Advances in Neural Information Processing Systems, pp. 1031-1042, 2018.
+Manzil Zaheer, Satwik Kottur, Siamak Ravanbakhsh, Barnabas Poczos, Ruslan R Salakhutdinov, and Alexander J Smola. Deep sets. In Advances in Neural Information Processing Systems, pp. 3391-3401, 2017.
+Chi Zhang, Feng Gao, Baoxiong Jia, Yixin Zhu, and Song-Chun Zhu. Raven: A dataset for relational and analogical visual reasoning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 5317-5327, 2019.
+
+# A PROOF OF PROPOSITION 3.1
+
+We will prove the universal approximation of GNNs by showing that GNNs have at least the same expressive power as Deep Sets, and then apply the universal approximation of Deep Sets for permutation invariant continuous functions.
+
+Zaheer et al. (2017) prove the universal approximation of Deep Sets under the restriction that the set size is fixed and the hidden dimension is equal to the set size plus one. Wagstaff et al. (2019) extend the universal approximation result for Deep Sets by showing that the set size does not have to be fixed and the hidden dimension is only required to be at least as large as the set size. The results for our purposes can be summarized as follows.
+
+Universal approximation of Deep Sets. Assume the elements are from a compact set in $\mathbb{R}^d$ . Any continuous function on a set $S$ of size bounded by $N$ , i.e., $f: \mathbb{R}^{d \times N} \to \mathbb{R}$ , that is permutation invariant to the elements in $S$ can be approximated arbitrarily close by some Deep Sets model with sufficiently large width and output dimension for its MLPs.
+
+Next we show any Deep Sets can be expressed by some GNN with one message passing iteration. The computation structure of one-layer GNNs is shown below.
+
+$$
+h _ {s} = \sum_ {t \in S} \phi \left(X _ {s}, X _ {t}\right), \quad h _ {S} = g \left(\sum_ {s \in S} h _ {s}\right), \tag {A.1}
+$$
+
+where $\phi$ and $g$ are parameterized by MLPs. If $\phi$ is a function that ignores $X_{t}$ so that $\phi(X_s, X_t) = \rho(X_s)$ for some $\rho$ , e.g., by letting part of the weight matrices in $\phi$ be 0, then we essentially get a Deep Sets in the following form.
+
+$$
+h _ {s} = \rho \left(X _ {s}\right), \quad h _ {S} = g \left(\sum_ {s \in S} h _ {s}\right). \tag {A.2}
+$$
+
+For any such $\rho$ , we can get the corresponding $\phi$ via the construction above. Hence for any Deep Sets, we can express it with an one-layer GNN. The same result applies to GNNs with multiple layers (message passing iterations), because we can express a function $\rho(X_s)$ by the composition of multiple $\rho^{(k)}$ 's, which we can express with a GNN layer via our construction above. It then follows that GNNs are universal approximators for permutation invariant continuous functions.
+
+# B PROOF OF PROPOSITION 3.2
+
+For any GNN $\mathcal{N}$ , we construct an MLP that is able to do the exact same computation as $\mathcal{N}$ . It will then follow that the MLP can represent any function $\mathcal{N}$ can represent. Suppose the computation structure of $\mathcal{N}$ is the following.
+
+$$
+h _ {s} ^ {(k)} = \sum_ {t \in S} f ^ {(k)} \left(h _ {s} ^ {(k - 1)}, h _ {t} ^ {(k - 1)}\right), \quad h _ {S} = g \left(\sum_ {s \in S} h _ {s} ^ {(K)}\right), \tag {B.1}
+$$
+
+where $f$ and $g$ are parameterized by MLPs. Suppose the set size is bounded by $M$ (the expressive power of GNNs also depend on $M$ Wagstaff et al. (2019)). We first show the result for a fixed size input, i.e., MLPs can simulate GNNs if the input set has a fixed size, and then apply an ensemble approach to deal with variable sized input.
+
+Let the input to the MLP be a vector concatenated by $h_s^{(0)}$ 's, in some arbitrary ordering. For each message passing iteration of $\mathcal{N}$ , any $f^{(k)}$ can be represented by an MLP. Thus, for each pair of $(h_t^{(k-1)}, h_s^{(k-1)})$ , we can set weights in the MLP so that the concatenation of all $f(h_t^{(k-1)}, h_s^{(k-1)})$ becomes the hidden vector after some layers of the MLP. With the vector of $f(h_t^{(k-1)}, h_s^{(k-1)})$ as input, in the next few layers of the MLP we can construct weights so that we have the concatenation of $h_s^{(k)} = \sum_{t \in S} f^{(k)}(h_s^{(k-1)}, h_t^{(k-1)})$ as the result of the hidden dimension, because we can encode summation with weights in MLPs. So far, we can simulate an iteration of GNN $\mathcal{N}$ with layers of MLP. We can repeat the process for $K$ times by stacking the similar layers. Finally, with a concatenation of
+
+$h_s^{(K)}$ as our hidden dimension in the MLP, similarly, we can simulate $h_S = g\left(\sum_{s \in S} h_s^{(K)}\right)$ with layers of MLP. Stacking all layers together, we have obtained an MLP that can simulate $\mathcal{N}$ .
+
+To deal with variable sized inputs, we construct $M$ MLPs that can simulate the GNN for each input set size 1, ..., $M$ . Then we construct a meta-layer, whose weights represent (universally approximate) the summation of the output of $M$ MLPs multiplied by an indicator function of whether each MLPs has the same size as the set input (these need to be input information). The meta layer weights on top can then essentially select the output from of MLP that has the same size as the set input and then exactly simulate the GNN. Note that the MLP we construct here has the requirement for how we input the data and the information of set sizes etc. In practice, we can have $M$ MLPs and decide which MLP to use depending on the input set size.
+
+# C PROOF OF THEOREM 3.5
+
+Theorem 3.5 is a generalization of Theorem 6.1 in (Arora et al., 2019a), which addresses the scalar case. See (Arora et al., 2019a) for a complete list of assumptions.
+
+Theorem C.1. (Arora et al., 2019a) Suppose we have $g: \mathbb{R}^d \to \mathbb{R}$ , $g(x) = \sum_{j} \alpha_j (\beta_j^\top x)^{p_j}$ , where $\beta_j \in \mathbb{R}^d$ , $\alpha \in \mathbb{R}$ , and $p_j = 1$ or $p_j = 2l$ ( $l \in \mathbb{N}_+$ ). Let $\mathcal{A}$ be an overparameterized two-layer MLP that is randomly initialized and trained with gradient descent for a sufficient number of iterations. The sample complexity $\mathcal{C}_{\mathcal{A}}(g, \epsilon, \delta)$ is $O\left(\frac{\sum_{j} p_j |\alpha_j| \cdot \| \beta_j \|_2^{p_j} + \log(1 / \delta)}{\epsilon^2}\right)$ .
+
+To extend the sample complexity bound to vector-valued functions, we view each entry/component of the output vector as an independent scalar-valued output. We can then apply a union bound to bound the error rate and failure probability for the output vector, and thus, bound the overall sample complexity.
+
+Let $\epsilon$ and $\delta$ be the given error rate and failure probability. Moreover, suppose we choose some error rate $\epsilon_0$ and failure probability $\delta_0$ for the output/function of each entry. Applying Theorem C.1 to each component
+
+$$
+g (x) ^ {(i)} = \sum_ {j} \alpha_ {j} ^ {(i)} \left(\beta_ {j} ^ {(i) \top} x\right) ^ {p _ {j} ^ {(i)}} =: g _ {i} (x) \tag {C.1}
+$$
+
+yields a sample complexity bound of
+
+$$
+\mathcal {C} _ {\mathcal {A}} \left(g _ {i}, \epsilon_ {0}, \delta_ {0}\right) = O \left(\frac {\sum_ {j} p _ {j} ^ {(i)} \left| \alpha_ {j} ^ {(i)} \right| \cdot \left\| \beta_ {j} ^ {(i)} \right\| _ {2} ^ {p _ {j} ^ {(i)}} + \log \left(1 / \delta_ {0}\right)}{\epsilon_ {0} ^ {2}}\right) \tag {C.2}
+$$
+
+for each $g_i(x)$ . Now let us bound the overall error rate and failure probability given $\epsilon_0$ and $\delta_0$ for each entry. The probability that we fail to learn each of the $g_i$ is at most $\delta_0$ . Hence, by a union bound, the probability that we fail to learn any of the $g_i$ is at most $m \cdot \delta_0$ . Thus, with probability at least $1 - m\delta_0$ , we successfully learn all $g_i$ for $i = 1, \dots, m$ , so the error for every entry is bounded by $\epsilon_0$ . The error for the vector output is then at most $\sum_{i=1}^{m}\epsilon_0 = m\epsilon_0$ .
+
+Setting $m\delta_0 = \delta$ and $m\epsilon_0 = \epsilon$ gives us $\delta_0 = \frac{\delta}{m}$ and $\epsilon_0 = \frac{\epsilon}{m}$ . Thus, if we can successfully learn the function for each output entry independently with error $\epsilon / m$ and failure rate $\delta / m$ , we can successfully learn the entire vector-valued function with rate $\epsilon$ and $\delta$ . This yields the following overall sample complexity bound:
+
+$$
+\mathcal {C} _ {\mathcal {A}} (g, \epsilon , \delta) = O \left(\frac {\max _ {i} \sum_ {j} p _ {j} ^ {(i)} \left| \alpha_ {j} ^ {(i)} \right| \cdot \left\| \beta_ {j} ^ {(i)} \right\| _ {2} ^ {p _ {j} ^ {(i)}} + \log (m / \delta)}{(\epsilon / m) ^ {2}}\right) \tag {C.3}
+$$
+
+Regarding $m$ as a constant, we can further simplify the sample complexity to
+
+$$
+\mathcal {C} _ {\mathcal {A}} (g, \epsilon , \delta) = O \left(\frac {\operatorname* {m a x} _ {i} \sum_ {j} p _ {j} ^ {(i)} \left| \alpha_ {j} ^ {(i)} \right| \cdot \left\| \beta_ {j} ^ {(i)} \right\| _ {2} ^ {p _ {j} ^ {(i)}} + \log (1 / \delta)}{\epsilon^ {2}}\right). \tag {C.4}
+$$
+
+# D PROOF OF THEOREM 3.6
+
+We will show the learnability result by an inductive argument. Specifically, we will show that under our setting and assumptions, the error between the learned function and correct function on the test set will not blow up after the transform of another learned function $\hat{f}_j$ , assuming learnability on previous $\hat{f}_1, \dots, \hat{f}_{j-1}$ by induction. Thus, we can essentially provably learn at all layers/iterations and eventually learn $g$ .
+
+Suppose we have performed the sequential learning. Let us consider what happens at the test time. Let $f_{j}$ be the correct functions as defined in the algorithmic alignment. Let $\hat{f}_{j}$ be the functions learned by algorithm $\mathcal{A}_{j}$ and MLP $\mathcal{N}_{j}$ . We have input $S \sim \mathcal{D}$ , and our goal is to bound $\| g(S) - \hat{g}(S) \|$ with high probability. To show this, we bound the error of the intermediate representation vectors, i.e., the output of $\hat{f}_{j}$ and $f_{j}$ , and thus, the input to $\hat{f}_{j+1}$ and $f_{j+1}$ .
+
+Let us first consider what happens for the first module $\mathcal{N}_1$ . $f_1$ and $\hat{f}_1$ have the same input distribution $x \sim \mathcal{D}$ , where $x$ are obtained from $S$ , e.g., the pairwise object representations as in Eqn. 2.2. Hence, by the learnability assumption on $\mathcal{A}_1$ , $\| f_1(x) - \hat{f}_1(x) \| < \epsilon$ with probability at least $1 - \delta$ . The error for the input of $\mathcal{N}_2$ is then $O(\epsilon)$ with failure probability $O(\delta)$ , because there are a constant number of terms of aggregation of $f_1$ 's output, and we can apply union bound to upper bound the failure probability.
+
+Next, we proceed by induction. Let us fix a $k$ . Let $z$ denote the input for $f_{k}$ , which are generated by the previous $f_{j}$ 's, and let $\hat{z}$ denote the input for $\hat{f}_k$ , which are generated by the previous $\hat{f}_j$ 's. Assume $\| z - \hat{z}\| \leq O(\epsilon)$ with failure probability at most $O(\delta)$ . We aim to show that this holds for $k + 1$ . For the simplicity of notation, let $f$ denote the correct function $f_{k}$ and let $\hat{f}$ denote the learned function $\hat{f}_k$ . Since there are a constant number of terms for aggregation, our goal is then to bound $\| \hat{f} (\hat{z}) - f(z)\|$ . By triangle inequality, we have
+
+$$
+\begin{array}{l} \| \hat {f} (\hat {z}) - f (z) \| = \| \hat {f} (\hat {z}) - \hat {f} (z) + \hat {f} (z) - f (z) \| (D.1) \\ \leq \left\| \hat {f} (\hat {z}) - \hat {f} (z) \right\| + \left\| \hat {f} (z) - f (z) \right\| (D.2) \\ \end{array}
+$$
+
+We can bound the first term with the Lipschitzness assumption of $\hat{f}$ as the following.
+
+$$
+\| \hat {f} (\hat {z}) - \hat {f} (z) \| \leq L _ {1} \| \hat {z} - z \| \tag {D.3}
+$$
+
+To bound the second term, our key insight is that $f$ is a learnale correct function, so by the learnability coefficients in algorithmic alignment, it is close to the function $\tilde{f}$ learned by the learning algorithm $\mathcal{A}$ on the correct samples, i.e., $f$ is close to $\tilde{f} = \mathcal{A}\left(\{z_{i},y_{i}\}\right)$ . Moreover, $\hat{f}$ is generated by the learning algorithm $\mathcal{A}$ on the perturbed samples, i.e., $\hat{f} = \mathcal{A}\left(\{\hat{z}_i,y_i\}\right)$ . By the algorithm stability assumption, $\hat{f}$ and $\tilde{f}$ should be close if the input samples are only slightly perturbed. It then follows that
+
+$$
+\begin{array}{l} \| \hat {f} (z) - f (z) \| = \| \hat {f} (z) - \tilde {f} (z) + \tilde {f} (z) - f (z) \| (D.4) \\ \leq \| \hat {f} (z) - \tilde {f} (z) \| + \| \tilde {f} (z) - f (z) \| (D.5) \\ \leq L _ {0} \max _ {i} \| z _ {i} - \hat {z} _ {i} \| + \epsilon \quad \mathrm {w . p .} \geq 1 - \delta (D.6) \\ \end{array}
+$$
+
+where $z_{i}$ and $\hat{z}_{i}$ are the training samples at the same layer $k$ . Here, we apply the same induction condition as what we had for $z$ and $\hat{z}$ : $\| z_{i} - \hat{z}_{i} \| \leq O(\epsilon)$ with failure probability at most $O(\delta)$ . We can then apply union bound to bound the probability of any bad event happening. Here, we have 3 bad events each happening with probability at most $O(\delta)$ . Thus, with probability at least $1 - O(\delta)$ , we have
+
+$$
+\left\| \hat {f} (\hat {z}) - f (z) \right\| \leq L _ {1} O (\epsilon) + L _ {0} O (\epsilon) + \epsilon = O (\epsilon) \tag {D.7}
+$$
+
+This completes the proof.
+
+# E PROOF OF COROLLARY 3.7
+
+Our main insight is that a giant MLP learns the same function $(X_{i} - X_{j})^{2}$ for $\ell^2$ times and encode them in the weights. This leads to the $O(\ell^2)$ extra sample complexity through Theorem 3.5, because the number of polynomial terms $(X_{i} - X_{j})^{2}$ is of order $\ell^2$ .
+
+First of all, the function $f(x,y) = (x - y)^2$ can be expressed as the following polynomial.
+
+$$
+(x - y) ^ {2} = \left([ 1 - 1 ] ^ {\top} [ x y ]\right) ^ {2} \tag {E.1}
+$$
+
+We have $\beta = [1 - 1]$ , so $p\cdot \| \beta \| ^p = 4$ . Hence, by Theorem 3.5, it takes $O(\frac{\log(1 / \delta)}{\epsilon^2})$ samples for an MLP to learn $f(x,y) = (x - y)^{2}$ . Under the sequential training setting, an one-layer GNN applies an MLP to learn $f$ , and then sums up the outcome of $f(X_{i},X_{j})$ for all pairs $X_{i},X_{j}$ . Here, we essentially get the aggregation error $O(\ell^2\cdot \epsilon)$ from $\ell^2$ pairs. However, we will see that applying an MLP to learn $g$ will also incur the same aggregation error. Hence, we do not need to consider the aggregation error effect when we compare the sample complexities.
+
+Now we consider using MLP to learn the function $g$ . No matter in what order the objects $X_{i}$ are concatenated, we can express $g$ with the sum of polynomials as the following.
+
+$$
+g (S) = \sum_ {i j} \left(\beta_ {i j} ^ {\top} \left[ X _ {1}, \dots , X _ {n} \right]\right) ^ {2}, \tag {E.2}
+$$
+
+where $\beta_{ij}$ has 1 at the $i$ -th entry, $-1$ at the $j$ -th entry and 0 elsewhere. Hence $\| \beta_{ij} \|^p \cdot p = 4$ . It then follows from Theorem 3.5 and union bound that it takes $O((\ell^2 + \log(1/\hat{\delta})) / \hat{\epsilon}^2)$ to learn $g$ , where $\hat{\epsilon} = \ell^2 \epsilon$ and $\hat{\delta} = \ell^2 \delta$ . Here, as we have discussed above, the same aggregation error $\hat{\epsilon}$ occurs in the aggregation process of $f$ , so we can simply consider $\hat{\epsilon}$ for both. Thus, comparing $O(\log(1/\hat{\delta}) / \hat{\epsilon}^2)$ and $O((\ell^2 + \log(1/\hat{\delta})) / \hat{\epsilon}^2)$ gives us the $O(\ell^2)$ difference.
+
+# F PROOF OF CLAIM 4.1
+
+We prove the claim by contradiction. Suppose there exists $f$ such that $f(x) + f(y) = g(x, y)$ for any $x$ and $y$ . This implies that for any $x$ , we have $f(x) + f(x) = g(x, x) = 0$ . It follows that $f(x) = 0$ for any $x$ . Now consider some $x$ and $y$ so that $x \neq y$ . We must have $f(x) + f(y) = 0 + 0 = 0$ . However, $g(x, y) \neq 0$ because $x \neq y$ . Hence, there exists $x$ and $y$ so that $f(x) + f(y) \neq g(x, y)$ . We have reached a contradiction.
+
+# G EXPERIMENTS: DATA AND TRAINING DETAILS
+
+# G.1 FANTASTIC TREASURE: MAXIMUM VALUE DIFFERENCE
+
+Dataset generation. In the dataset, we sample 50,000 training data, 5,000 validation data, and 5,000 test data. For each model, we report the test accuracy with the hyperparameter setting that achieves the best validation accuracy. In each training sample, the input universe consists of 25 treasures $X_{1},\ldots,X_{25}$ . For each treasure $X_{i}$ , we have $X_{i} = [h_{1},h_{2},h_{3}]$ , where the location $h_1$ is sampled uniformly from $[0..20]^8$ , the value $h_2$ is sample uniformly form $[0..100]$ , and the color $h_3$ is sampled uniformly from $[1..6]$ . The task is to answer what the difference is in value between the most and least valuable treasure. We generate the answer label $y$ for a universe $S$ as follows: we find the maximum difference in value among all treasures and set it to $y$ . Then we make the label $y$ into one-hot encoding with $100 + 1 = 101$ classes.
+
+Hyperparameter setting. We train all models with the Adam optimizer, with learning rate from $1e - 3$ , $5e - 4$ , and $1e - 4$ , and we decay the learning rate by 0.5 every 50 steps. We use cross-entropy loss. We train all models for 150 epochs. We tune batch size of 128 and 64.
+
+For GNNs and HRN, we choose the hidden dimension of MLP modules from 128 and 256. For DeepSet and MLP, we choose the hidden dimension of MLP modules from 128, 256, 2500, 5000. For the MLP and DeepSet model, we choose the number of of hidden layers for MLP moduels from 4 and 8, 16. For GNN and HRN, we set the number of hidden layers of the MLP modules to 3, 4. Moreover, dropout with rate 0.5 is applied before the last two hidden layers of $\mathrm{MLP}_1$ , i.e., the last MLP module in all models.
+
+# G.2 FANTASTIC TREASURE: FURTHEST PAIR
+
+Dataset generation. In the dataset, we sample 60,000 training data, 6,000 validation data, and 6,000 test data. For each model, we report the test accuracy with the hyperparameter setting that
+
+achieves the best validation accuracy. In each training sample, the input universe consists of 25 treasures $X_{1}, \ldots, X_{25}$ . For each treasure $X_{i}$ , we have $X_{i} = [h_{1}, h_{2}, h_{3}]$ , where the location $h_{1}$ is sampled uniformly from $[0..20]^{8}$ , the value $h_{2}$ is sample uniformly form $[0..100]$ , and the color $h_{3}$ is sampled uniformly from $[1..6]$ . The task is to answer what are the colors of the two treasure that are the most distant from each other. We generate the answer label $y$ for a universe $S$ as follows: we find the pair of treasures that are the most distant from each other, say $(X_{i}, X_{j})$ . Then we order the pair $(h_{3}(X_{i}), h_{3}(X_{j}))$ to obtain an ordered pair $(a, b)$ with $a \leq b$ (aka. $a = \min\{h_{3}(X_{i}), h_{3}(X_{j})\}$ and $(b = \max\{h_{3}(X_{i}), h_{3}(X_{j})\})$ ), where $h_{3}(X_{i})$ denotes the color of $X_{i}$ . Then we compute the label $y$ from $(a, b)$ by counting how many valid pairs of colors are smaller than $(a, b)$ (a pair $(k, l)$ is smaller than $(a, b)$ iff i). $k < a$ or ii). $k = a$ and $l < b$ . The label $y$ is one-hot encoding of the minimum cost with $6 \times (6 - 1)/2 + 6 = 21$ classes.
+
+Hyperparameter setting. We train all models with the Adam optimizer, with learning rate from $1e - 3$ , $5e - 4$ , and $1e - 4$ , and we decay the learning rate by 0.5 every 50 steps. We use cross-entropy loss. We train all models for 150 epochs. We tune batch size of 128 and 64.
+
+For the MLP and DeepSet model, we choose the number of of hidden layers of MLP modules from 4 and 8, 16. For GNN and HRN models, we set the number of hidden layers of the MLP modules from 3 and 4. For DeepSet and MLP models, we choose the hidden dimension of MLP modules from 128, 256, 2500, 5000. For GNNs and HRN, we choose the hidden dimension of MLP modules from 128 and 256. Moreover, dropout with rate 0.5 is applied before the last two hidden layers of $\mathrm{MLP}_1$ , i.e., the last MLP module in all models.
+
+# G.3 MONSTER TRAINER
+
+Task description. We are a monster trainer who lives in a world $S$ with 10 monsters. Each monster $X = [h_1, h_2]$ has a location $h_1 \in [0..10]^2$ and a unique combat level $h_2 \in [1..10]$ . In each game, the trainer starts at a random location with level zero, $X_{\text{trainer}} = [p_0, 0]$ , and receives a quest to defeat the level- $k$ monster. At each time step, the trainer can challenge any more powerful monster $X$ , with a cost equal to the product of the travel distance and the level difference $c(X_{\text{trainer}}, X) = \| h_1(X_{\text{trainer}}) - h_1(X) \|_{\ell_1} \times (h_2(X) - h_2(X_{\text{trainer}}))$ . After defeating monster $X$ , the trainer's level upgrades to $h_2(X)$ , and the trainer moves to $h_1(X)$ . We ask the minimum cost of completing the quest, i.e., defeating the level- $k$ monster. The range of cost (number of classes for prediction) is 200. To make games even more challenging, we sample games whose optimal solution involves defeating three to seven non-quest monsters.
+
+A DP algorithm for shortest paths that needs half of the iterations of Bellman-Ford. We provide a DP algorithm as the following. To compute a shortest-path from a source object $s$ to a target object $t$ with at most seven stops, we run the following updates for four iterations:
+
+$$
+\operatorname {d i s t a n c e} _ {s} [ 1 ] [ u ] = \operatorname {c o s t} (s, u), \quad \operatorname {d i s t a n c e} _ {s} [ k ] [ u ] = \min _ {v} \left\{\operatorname {d i s t a n c e} _ {s} [ k - 1 ] [ v ] + \operatorname {c o s t} (v, u) \right\}, \tag {G.1}
+$$
+
+$$
+\operatorname {d i s t a n c e} _ {t} [ 1 ] [ u ] = \operatorname {c o s t} (u, t), \quad \operatorname {d i s t a n c e} _ {t} [ k ] [ u ] = \min _ {v} \left\{\operatorname {d i s t a n c e} _ {t} [ k - 1 ] [ v ] + \operatorname {c o s t} (u, v) \right\}. \tag {G.2}
+$$
+
+Update Eqn. G.1 is identical to the Bellman-Ford algorithm Eqn. 4.2, and $\mathrm{distance}_s[k][u]$ is the shortest distance from $s$ to $u$ with at most $k$ stops. Update Eqn. G.2 is a reverse Bellman-Ford algorithm, and $\mathrm{distance}_t[k][u]$ is the shortest distance from $u$ to $t$ with at most $k$ stops. After running Eqn. G.1 and Eqn. G.2 for $k$ iterations, we can compute a shortest path with at most $2k$ stops by enumerating a mid-point and aggregating the results of the two Bellman-Ford algorithms:
+
+$$
+\min _ {u} \left\{\operatorname {d i s t a n c e} _ {s} [ k ] [ u ] + \operatorname {d i s t a n c e} _ {t} [ k ] [ u ] \right\}. \tag {G.3}
+$$
+
+Thus, this algorithm needs half of the iterations of Bellman-Ford.
+
+Dataset generation. In the dataset, we sample 200,000 training data, 6,000 validation data, and 6,000 test data. For each model, we report the test accuracy with the hyperparameter setting that achieves the best validation accuracy. In each training sample, the input universe consists of the trainer and 10 monsters $X_0, \ldots, X_{10}$ , and the request level $k$ , i.e., we need to challenge monster $k$ . We have $X_i = [h_1, h_2]$ , where $h_1 = i$ indicates the combat level, and the location $h_2 \in [0..10]^2$ is sampled uniformly from $[0..10]^2$ . We generate the answer label $y$ for a universe $S$ as follows. We implement a shortest path algorithm to compute the minimum cost from the trainer to monster $k$ ,
+
+where the cost is defined in task description. Then the label $y$ is a one-hot encoding of minimum cost with 200 classes. Moreover, when we sample the data, we apply rejection sampling to ensure that the minimum cost's shortest path is of length 3, 4, 5, 6, 7 with equal probability. That is, we eliminate the trivial questions.
+
+Hyperparameter setting. We train all models with the Adam optimizer, with learning rate from $2e - 4$ and $5e - 4$ , and we decay the learning rate by 0.5 every 50 steps. We use cross-entropy loss. We train all models for 300 epochs. We tune batch size of 128 and 64.
+
+For the MLP model, we choose the number of layers from 4 and 8, 16. For other models, we choose the number of hidden layers of MLP modules from 3 and 4. For GNN models, we choose the hidden dimension of MLP modules from 128 and 256. For DeepSet and MLP models, we choose the hidden dimension of MLP modules from 128, 256, 2500. Moreover, dropout with rate 0.5 is applied before the last two hidden layers of $\mathrm{MLP}_1$ , i.e., the last MLP module in all models.
+
+# G.4 SUBSET SUM
+
+Dataset generation. In the dataset, we sample 40,000 training data, 4,000 validation data, and 4,000 test data. For each model, we report the test accuracy with the hyperparameter setting that achieves the best validation accuracy. In each training sample, the input universe $S$ consists of 6 numbers $X_{1},\ldots ,X_{6}$ , where each $X_{i}$ is uniformly sampled from [-200..200]. The goal is to decide if there exists a subset that sums up to 0. In the data generation, we carefully decrease the number of questions that have trivial answers: 1) we control the number of samples where $0\in \{X_1,\dots,X_6\}$ to be around $1\%$ of the total training data; 2) we further control the number of samples where $X_{1} + \ldots +X_{6} = 0$ or $\exists i,j\in [1..6]$ so that $X_{i} = -X_{j}$ to be around $1.5\%$ of the total training data. In addition, we apply rejection sampling to make sure that the questions with answer yes (aka. such subset exists) and answer no (aka. no such subset exists) are balanced (i.e., 20,000 samples for each class in the training data).
+
+Hyperparameter setting. We train all models with the Adam optimizer, with learning rate from $1e - 3$ , $5e - 4$ , and $1e - 4$ , and we decay the learning rate by 0.5 every 50 steps. We use cross-entropy loss. We train all models for 300 epochs. The batch size we use for all models is 64.
+
+For DeepSets and MLP models, we choose the number of hidden layers of the MLP modules from 4, 8, 16. For GNN and HRN models, we set the number of hidden layers of the last MLP modules to 4. For DeepSets and MLP, we choose the hidden dimension of MLP modules from 128, 256, 2500, 5000. For GNN and HRN models, we choose the hidden dimension of MLP modules from 128 and 256. Moreover, dropout with rate 0.5 is applied before the last two hidden layers of $\mathrm{MLP}_1$ , i.e., the last MLP module in all models.
+
+The model Neural Exhaustive Search (NES) enumerates all possible non-empty subsets $\tau$ of $S$ , and passes the numbers of $\tau$ to an MLP, in a random order, to obtain the hidden feature. The hidden feature is then passed to a single-direction one-layer LSTM of hidden dimension 128. Afterwards, NES applies an aggregation function to these $2^{6} - 1$ hidden states obtained by the LSTM to obtain the final output. For NES, we set the number of hidden layers of the last MLP, i.e., $\mathrm{MLP}_2$ , to 4, the number of hidden layers of the MLPs prior to the last MLP, i.e., $\mathrm{MLP}_1$ , to 3, and we choose the hidden dimension of all MLP modules from 128 and 256.
\ No newline at end of file
diff --git a/whatcanneuralnetworksreasonabout/images.zip b/whatcanneuralnetworksreasonabout/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..637e9942b2143bdc7af28679ca59d012a3fd56ca
--- /dev/null
+++ b/whatcanneuralnetworksreasonabout/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a68f7045ef31195ca67634e4ea1b445edba3dff713a094e4b76c8a411977e806
+size 334959
diff --git a/whatcanneuralnetworksreasonabout/layout.json b/whatcanneuralnetworksreasonabout/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..7fdc72bf855b61e4b853314db625c1e6e1db6182
--- /dev/null
+++ b/whatcanneuralnetworksreasonabout/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:2308075ef652d331620d0094c25a3151a5cba29c5d7c248d4223976f9d1a6a4e
+size 860043
diff --git a/whitenoiseanalysisofneuralnetworks/9a181fc5-fbd6-4da9-b722-66008e77f6f7_content_list.json b/whitenoiseanalysisofneuralnetworks/9a181fc5-fbd6-4da9-b722-66008e77f6f7_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..5b9d059bfab6b6a72960191707fa4cf1e7f754e8
--- /dev/null
+++ b/whitenoiseanalysisofneuralnetworks/9a181fc5-fbd6-4da9-b722-66008e77f6f7_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:4b266a93aca4566546b5b504d17ec41342cb9921c70fe50e291ad10d308d4f58
+size 116614
diff --git a/whitenoiseanalysisofneuralnetworks/9a181fc5-fbd6-4da9-b722-66008e77f6f7_model.json b/whitenoiseanalysisofneuralnetworks/9a181fc5-fbd6-4da9-b722-66008e77f6f7_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..c4a362cef8b648a70b328dcf19684ed447658de5
--- /dev/null
+++ b/whitenoiseanalysisofneuralnetworks/9a181fc5-fbd6-4da9-b722-66008e77f6f7_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:3017b05618c3461f2f5b923ffb253ef4b6b5823414fedc47e5a16e93029c03aa
+size 135301
diff --git a/whitenoiseanalysisofneuralnetworks/9a181fc5-fbd6-4da9-b722-66008e77f6f7_origin.pdf b/whitenoiseanalysisofneuralnetworks/9a181fc5-fbd6-4da9-b722-66008e77f6f7_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..0c5688e324d5ad64a65aab1eaa4be289133ecd6e
--- /dev/null
+++ b/whitenoiseanalysisofneuralnetworks/9a181fc5-fbd6-4da9-b722-66008e77f6f7_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:5aa02320494bebccdb57545ac81ef0a304121bdd5e18b8b71181231f2c314bf9
+size 14055656
diff --git a/whitenoiseanalysisofneuralnetworks/full.md b/whitenoiseanalysisofneuralnetworks/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..2340e100db3dce648af2ec0c85ea2d8331f853de
--- /dev/null
+++ b/whitenoiseanalysisofneuralnetworks/full.md
@@ -0,0 +1,432 @@
+# WHITE NOISE ANALYSIS OF NEURAL NETWORKS
+
+Ali Borji & Sikun Lin†*
+
+†University of California, Santa Barbara, CA
+
+aliborji@gmail.com, sikun@ucsb.edu
+
+# ABSTRACT
+
+A white noise analysis of modern deep neural networks is presented to unveil their biases at the whole network level or the single neuron level. Our analysis is based on two popular and related methods in psychophysics and neurophysiology namely classification images and spike triggered analysis. These methods have been widely used to understand the underlying mechanisms of sensory systems in humans and monkeys. We leverage them to investigate the inherent biases of deep neural networks and to obtain a first-order approximation of their functionality. We emphasize on CNNs since they are currently the state of the art methods in computer vision and are a decent model of human visual processing. In addition, we study multi-layer perceptrons, logistic regression, and recurrent neural networks. Experiments over four classic datasets, MNIST, Fashion-MNIST, CIFAR-10, and ImageNet, show that the computed bias maps resemble the target classes and when used for classification lead to an over two-fold performance than the chance level. Further, we show that classification images can be used to attack a black-box classifier and to detect adversarial patch attacks. Finally, we utilize spike triggered averaging to derive the filters of CNNs and explore how the behavior of a network changes when neurons in different layers are modulated. Our effort illustrates a successful example of borrowing from neurosciences to study ANNs and highlights the importance of cross-fertilization and synergy across machine learning, deep learning, and computational neuroscience1.
+
+# 1 INTRODUCTION
+
+Any vision system, biological or artificial, has its own biases. These biases emanate from different sources. Two common sources include a) the environment and the data on which the system has been trained, and b) system constraints (e.g., hypothesis class, model parameters). Exploring these biases is important from at least two perspectives. First, it allows to better understand a system (e.g., explain and interpret its decisions). Second, it helps reveal system vulnerabilities and make it more robust against adversarial perturbations and attacks.
+
+In this paper, we recruit two popular methods from computational neuroscience to study the inherent biases in deep neural networks. The first one, called classification images technique, was introduced into visual psychophysics by Ahumada Jr (1996) as a new experimental tool. It has been used to examine visual processing and to understand vision across a variety of tasks including simple detection tasks, visual search, and object recognition. It has also been applied to the auditory domain. See Murray (2011) for a review of the topic. The second method, known as spike triggered analysis (Marmarelis, 2012), is often used to discover the best stimulus to which a neuron responds (e.g., oriented bars). These methods are appealing for our purpose since a) they are general and can be applied to study any black box system (so long it emits a response to an input stimulus) and b) make a modest number of assumptions. From a system identification point of view, they provide a first-order approximation of a complex system such as the brain or an artificial neural network.
+
+By feeding white noise stimuli to a classifier and averaging the ones that are categorized into a particular class, we obtain an estimate of the templates it uses for classification. Unlike classification images experiments in human psychophysics, where running a large number of trials is impractical, artificial systems can often be tested against a large number of inputs. While still a constraint, we will discuss how such problems can be mitigated (e.g., by generating stimuli containing faint structures). Over four datasets, MNIST (LeCun et al., 1998), Fashion-MNIST (Xiao et al., 2017),
+
+
+Figure 1: Illustration of the classification images concept. A) Two sample digits as well as their linear combination with different magnitudes of white noise (i.e., $\gamma \mathbf{s} + (1 - \gamma)\mathbf{n}$ ; Eq. 3). B) Average correct and incorrect prediction maps of a binary CNN (Fig. 10 in supplement) trained to separate digits 1 and 7. The fifth column shows the difference between average of stimuli predicted as 1 and average of stimuli predicted as 7. The column marked with “*” is similar to the fifth column but computation is done only over noise patterns (and not the augmented stimuli), hence “classification images” (i.e., $(\bar{\mathbf{n}}^{11} + \bar{\mathbf{n}}^{71}) - (\bar{\mathbf{n}}^{17} + \bar{\mathbf{n}}^{77})$ ; Eq. 1). See supp. Fig. 12 for more illustrations. These templates can be used to classify a digit as to 1 or 7. Yellow (blue) color corresponds to regions with positive (negative) correlation with the response as 1. C) Same as B but using a 5 vs. 6 CNN.
+
+CIFAR-10 (Krizhevsky et al., 2009), and ImageNet Deng et al. (2009), we employ classification images to discover implicit biases of a network, utilize those biases to influence network decisions, and detect adversarial perturbations. We also show how spike triggered averaging can be used to identify and visualize filters in different layers of a CNN. Finally, in a less directly related analysis to classification images, we demonstrate how decisions of a CNN are influenced by varying the signal to noise ratio (akin to microstimulation experiments in monkey electrophysiology or priming experiments in psychophysics). We find that CNNs behave in a similar fashion to their biological counterparts and their responses can be characterized by a psychometric function. This may give insights regarding top-down attention and feedback mechanisms in CNNs (See Borji & Itti (2012)).
+
+# 2 RELATED WORKS AND CONCEPTS
+
+Our work relates to a large body of research attempting to understand, visualize, and interpret deep neural networks. These networks have been able to achieve impressive performance on a variety of challenging vision and learning tasks (e.g., Krizhevsky et al. (2012); He et al. (2016)). However, they are still not well understood, have started to saturate in performance (Recht et al., 2019), are brittle2, and continue to trail humans in accuracy and generalization. This calls for a tighter confluence between machine learning, computer vision, and neuroscience. In this regard, the proposed tools here are complementary to the existing ones in the deep learning toolbox.
+
+Perhaps, the closest work to ours is Vondrick et al. (2015) where they attempted to learn biases in the human visual system and transfer those biases into object recognition systems. Some other works (e.g., Fong et al. (2018)) have also used human data (e.g., fMRI, cell recording) to improve the accuracy of classifiers, but have not utilized classification images. Bashivan et al. (2019) used activation maximization to iteratively change the pixel values in the direction of the gradient to maximize the firing rate of V4 neurons3. Unlike these works, here we strive to inspect the biases in classifiers, in particular, neural networks, to improve their interpretability and robustness.
+
+# 2.1 CLASSIFICATION IMAGES
+
+In a typical binary classification image experiment, on each trial, a signal $\mathbf{s} \in \mathbb{R}^d$ and a noise image $\mathbf{z} \in \mathbb{R}^d$ are summed to produce the stimulus $\mathbf{n}$ . The observer is supposed to decide which of the two categories the stimulus belongs to. Classification image is then calculated as:
+
+$$
+\mathbf {c} = \left(\bar {\mathbf {n}} ^ {1 2} + \bar {\mathbf {n}} ^ {2 2}\right) - \left(\bar {\mathbf {n}} ^ {1 1} + \bar {\mathbf {n}} ^ {2 1}\right) \tag {1}
+$$
+
+where $\bar{\mathbf{n}}^{sr}$ is the average of noise patterns in a stimulus-response class of trials. For example, $\bar{\mathbf{n}}^{12}$ is the average of the noise patterns over all trials where the stimulus contained signal 1 but
+
+the observer responded 2. $\mathbf{c} \in \mathbb{R}^d$ is an approximation of the template that the observer uses to discriminate between the two stimulus classes. The intuition behind the classification images is that the noise patterns in some trials have features similar to one of the signals, thus biasing the observer to choose that signal. By computing the average over many trials a pattern may emerge. $\mathbf{c}$ can also be interpreted as the correlation map between stimulus and response:
+
+$$
+\operatorname {c o r r} [ \mathbf {n}, r ] = \frac {\mathbb {E} (\mathbf {n} - \mathbb {E} [ \mathbf {n} ]) \mathbb {E} (r - \mathbb {E} [ r ])}{\sigma_ {n} \sigma_ {r}} \tag {2}
+$$
+
+where $\sigma_{n}$ is the pixel-wise standard deviation of the noise $\mathbf{n}$ and $\sigma_{r}$ is the standard deviation of response $r$ . High positive correlations occur at spatial locations that strongly influence the observer's responses. Conversely, very low (close to zero) correlations occur at locations that have no influence on the observer's responses. Assuming zero-mean noise and an unbiased observer, Eq. 2 reduces to $\mathbf{c}_{\mathrm{corr}} = \bar{\mathbf{n}}^{*2} - \bar{\mathbf{n}}^{*1}$ , where $\bar{\mathbf{n}}^{*u}$ is the average of the noise patterns over all trials where the observer gave a response $u$ (See Murray (2011) for details). Thus, $\mathbf{c}_{\mathrm{corr}}$ is the average of the noise patterns over all trials where the observer responded $r = 2$ , minus the average over all trials where the observer responded $r = 1$ , regardless of which signal was presented.
+
+We have illustrated the classification images concept in Fig. 1 with a binary classifier trained to separate two digits. The stimulus is a linear combination of noise plus signal as follows:
+
+$$
+\mathbf {t} = \gamma \times \mathbf {s} + (\mathbf {1} - \gamma) \times \mathbf {n}; \gamma \in [ 0, 1 ] \tag {3}
+$$
+
+The computed templates for different $\gamma$ values $^4$ , using about 10 million trials, highlight regions that are correlated with one of the digits (here 1 vs. 7 or 5 vs. 6). The template fades away with increasing noise (e.g., $\gamma = 0$ ) but it still resembles the template in the low-noise condition (i.e., $\gamma = 0.3$ ).
+
+# 2.2 SPIKE TRIGGERED ANALYSIS
+
+The spike-triggered analysis, also known as "reverse correlation" or "white-noise analysis", is a tool for characterizing the response properties of a neuron using the spikes emitted in response to a time-varying stimulus. It includes two methods: spike-triggered averaging (STA) and spike-triggered covariance (STC). They provide an estimate of a neuron's linear receptive field and are useful techniques for the analysis of electrophysiological data. In the visual system, these methods have been used to characterize retinal ganglion cells (Meister et al., 1994; Sakai & Naka, 1987), lateral geniculate neurons (Reid & Alonso, 1995), and simple cells in the primary visual cortex (DeAngelis et al., 1993; Jones & Palmer, 1987). See Schwartz et al. (2006) for a review.
+
+STA is the average stimulus preceding a spike. It provides an unbiased estimate of a neuron's receptive field only if the stimulus distribution is spherically symmetric (e.g., Gaussian white noise). STC can be used to identify a multi-dimensional feature space in which a neuron computes its response. It identifies the stimulus features affecting a neuron's response via an eigen-decomposition of the spike-triggered covariance matrix (Sandler & Marmarelis, 2015; Park & Pillow, 2011).
+
+Let $\mathbf{x} \in \mathbb{R}^d$ denote a spatio-temporal stimulus vector affecting a neuron's scalar spike response $y$ in a single time bin. The main goal of neural characterization is to find $\Theta$ , a low-dimensional projection matrix such that $\Theta^T\mathbf{x}$ captures the neuron's dependence on the stimulus $\mathbf{x}$ . The STA and the STC matrix are the empirical first and second moments of the spike-triggered stimulus-response pairs $\{\mathbf{x}_i|y_i\}_{i=1}^N$ , respectively. They are defined as:
+
+$$
+\text {S T A :} \mu = \frac {1}{n _ {s p}} \sum_ {i = 1} ^ {N} y _ {i} \mathbf {x} _ {i}, \quad \text {a n d} \quad \text {S T C :} \Lambda = \frac {1}{n _ {s p}} \sum_ {i = 1} ^ {N} y _ {i} \left(\mathbf {x} _ {i} - \mu\right) \left(\mathbf {x} _ {i} - \mu\right) ^ {T}, \tag {4}
+$$
+
+where $n_{sp} = \sum y_i$ is the number of spikes and $N$ is the total number of time bins. The traditional spike triggered analysis gives an estimate for the basis $\Theta$ consisting of: (1) $\mu$ , if it is significantly different from zero, and (2) the eigenvectors of $\Lambda$ corresponding to those eigenvalues that are significantly different from eigenvalues of the prior stimulus covariance $\Phi = \mathbb{E}[XX^T]$ . When a stimulus is not white noise (i.e., is correlated in space or time), whitened STA can be written as:
+
+$$
+\mathrm {S T A} _ {w} = \frac {N}{n _ {s p}} \left(\mathbf {X} ^ {T} \mathbf {X}\right) ^ {- 1} \mathbf {X} ^ {T} \mathbf {y} \tag {5}
+$$
+
+
+20
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+B
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Figure 2: A) Classification images of a CNN trained on MNIST (with $99.2\%$ test accuracy). Image titles show ground truth, predicted class for the bias map, and the frequency of the noise patterns classified as that digit. B) Classification images of logistic regression over MNIST with $92.46\%$ test accuracy. C) Confusion matrices of four classifiers (CNN and log. reg. biases, mean digit image, and log. reg. weights). The classification was done via template matching using dot product.
+
+
+
+where $\mathbf{X}$ is a matrix whose $i$ th row is the stimulus vector $\mathbf{x}_i^T$ and $\mathbf{y}$ denotes a column vector whose $i$ th element is $y_i$ . The whitened STA is equivalent to linear least-squares regression of the stimulus against the spike train.
+
+Classification images and spike triggered analysis are related in the sense that both estimate the terms of a Wiener/Volterra expansion in which the mapping from the stimuli to the firing rate is described using a low-order polynomial (Marmarelis, 2012). See Dayan et al. (2001) for a discussion on this. Here, we focus on STA and leave STC to future works.
+
+# 3 APPLICATIONS
+
+We present four use cases of classification images and STA to examine neural networks, with a focus on CNNs since they are a decent model of human visual processing and are state of the art computer vision models. Our approach, however, is general and can be applied to any classifier. In particular, it is most useful when dealing with black-box methods where choices are limited.
+
+# 3.1 UNDERSTANDING AND VISUALIZING CLASSIFIER BIASES
+
+We trained a CNN with 2 conv layers, 2 pooling layers, and one fully connected layer (see supplement Fig. 10) on the MNIST dataset. This CNN achieves $99.2\%$ test accuracy. We then generated 1 million $28 \times 28$ white noise images and fed them to the CNN. The average noise map for each digit class is shown in Fig. 2A. These biases/templates illustrate the regions that are important for classification. Surprisingly, for some digits (0 to 7), it is very easy to tell which digit the bias map represents5. We notice that most of the noise patterns are classified as 8, perhaps because this digit has a lot of structure in common with other digits. Feeding the average noise maps back to CNN, they are classified correctly, except 8 which is classified as 2 (see image captions in Fig. 2A).
+
+Classification images of the CNN over MNIST perceptually make sense to humans. This, however, does not necessarily hold across all classifiers and datasets. For example, classification images of a logistic regression classifier on MNIST, shown in Fig. 2B, do not resemble digits (the same happens to MLP and RNN; see supplement Fig. 13). This implies that perhaps CNNs extract features the same way the human visual system does, thus share similar mechanisms and biases with humans. Classification images over the CIFAR-10 dataset, derived using 1 million $32 \times 32$ RGB noise patterns, are shown in Fig. 3A. In contrast to MNIST and Fashion-MNIST (Fig. 5), classification images on CIFAR-10 (using CNNs) do not resemble target classes. One possible reason might be because images are more calibrated and aligned over the former two datasets than CIFAR-10 images.
+
+
+Figure 3: A) Mean training images (top) and mean white noise pattern/bias maps (bottom) across CIFAR-10 classes. Image titles show ground truth class and prediction of the bias map, respectively. B) Confusion matrices using mean images (top) and bias maps (bottom) as classifiers, respectively. Notice that for some classes, it is easier to guess the class label from the mean image (e.g., frog).
+
+How much information do the classification images carry? To answer this question, we used bias maps to classify the MNIST test digits. The bias map with the maximum dot product to the test digit determines the output class. The confusion matrix of this classifier is shown in Fig. 2C. Using the CNN bias map as a classifier leads to $25.8\%$ test accuracy. The corresponding number for a classifier made of logistic regression bias is $47.6\%$ . Both of these numbers are significantly above $10\%$ chance accuracy. To get an idea regarding the significance of these numbers, we repeated the same using the mean images and logistic regression weights. These two classifiers lead to $63.1\%$ and $83.8\%$ test accuracy, respectively, which are better than the above-mentioned results using bias maps but demand access to the ground-truth data and labels. Over CIFAR-10, classification using bias maps leads to $23.71\%$ test accuracy which is well above chance. Using the mean training images of CIFAR-10 leads to $28.69\%$ test accuracy (Fig. 3B).
+
+Analysis of sample complexity. To get an idea regarding the sample complexity of the classification images approach, we ran three analyses. In the first one, we varied the number of noise patterns as $n = 1000 \times k$ ; $k \in \{1, 10, 100, 1000\}$ . We found that with 10K noise stimuli, the bias maps already start to look like the target digits (see Fig. 4, and supplement Fig. 14). In the second analysis, we followed Greene et al. (2014) to generate noise patterns containing subtle structures. Over MNIST and Fashion-MNIST datasets, we used ridge regression to reconstruct all 60K training images from a set of 960 Gabor wavelets (See Appendix for details). We then projected the learned weights (a matrix of size $60\mathrm{K} \times 960$ ) to a lower-dimensional space using principal component analysis (PCA). We kept 250 components that explained $96.1\%$ of the variance. To gen-
+
+erate a noise pattern, we randomly generated a vector of 250 numbers and projected it back to the 960D space, using them as weights for image-shaped Gabor wavelets and then sum them to $28 \times 28$ noise image. Over CIFAR-10, we used 1520 Gabor filters for each RGB channel and kept 600 principal components that explained $97.5\%$ of the variance. Classification images using 1M samples generated this way for MNIST, Fashion-MNIST, and CIFAR-10 datasets are shown in Fig. 5. Classification images resemble the target classes even better now (compared to using white noise). Using the new bias maps for classification, we are able to classify MNIST, Fashion-MNIST and CIFAR-10 test data with $35.5\%$ , $41.21\%$ , and $21.67\%$ accuracy, respectively. In the third analysis, we trained an autoencoder and a variational autoencoder (Kingma & Welling, 2013) over MNIST, only for 2 epochs. We did so to make the encoders powerful just enough to produce images that contain subtle digit structures (See Fig. 15 in supplement). As expected, now the classification images can be computed with much less number of stimuli ( $\sim 100$ ). Results from these analyses suggest that it is possible to lower the sample complexity when some (unlabeled) data is available. This is, in particular, appealing for practical applications of classification images.
+
+Results on ImageNet. We conducted an experiment on ImageNet validation set including 50K images covering 1000 categories and 1 million samples using Gabor PCA sampling (from the above CIFAR-10 experiment over CIFAR-10 images) and pretrained CNNs (on ImageNet train set). As results in Table 1 show, even with 1M samples and without parameter tuning, we obtain an improvement over the chance level (0.0010 or $0.1\%$ ). We obtain about $2x$ accuracy than chance using ResNet152 He et al. (2016). It seems that 1M samples is not enough to cover all classes since no
+
+
+Figure 4: Progressive build-up of the bias maps for 0, 1, and 2.
+
+
+Figure 5: Classification images, some sample generated images, confusion matrices of bias map classifiers, as well as one sample image and its reconstruction using Gabor wavelets over MNIST (left), Fashion-MNIST (middle) and CIFAR-10 (right) datasets. Please see Appendix for details on Gabor filter bank, image generation using linear regression, and PCA. We used 960, 960 and 1520 Gabor wavelets over MNIST, Fashion-MNIST, and CIFAR-10, respectively. The corresponding number of PCA components are 250, 250 and 600 (per color channel).
+
+
+
+
+
+noise pattern is classified under almost half of the classes using ResNet152. For some backbones, even a larger number of classes remain empty (yet another evidence that white noise can reveal biases in models). We believe it is possible to improve these results with more samples. As you can see with more classes being filled, better accuracy can be achieved. It takes only a few minutes (about 2) to process all 1M images at $32 \times 32$ resolution using a single GPU. Notice that ImageNet models have been trained on $224 \times 224$ images, while here we test them on $32 \times 32$ noise images for the sake of computational complexity. A better approach would be to train the models on $32 \times 32$ images or feed the noise at $224 \times 224$ resolution. This, however, demands more computational
+
+power but may result in better performance.
+
+Overall, our pilot investigation on large scale datasets is promising. We believe better results than the ones reported in Table 1 are possible with further modifications (e.g., using better distance measures between an image and the average noise map for each class). Also, it is likely that increasing the number of samples will lead to better performance.
+
+| backbone | accuracy | run time | empty classes |
| ResNet152 | 0.00180 | 2:15 | 564 |
| ResNet101 | 0.00152 | 1:36 | 539 |
| densenet201 | 0.00118 | 2:12 | 998 |
| squeezenet1_1 | 0.00104 | 0:13 | 999 |
| googlenet | 0.00102 | 0:26 | 999 |
| mnasnet1_3 | 0.00082 | 0:32 | 922 |
| vgg_19_bn | 0.00074 | 1:51 | 994 |
+
+Table 1: Results on ImageNet.
+
+# 3.2 ADVERSARIAL ATTACK AND DEFENSE
+
+Deep neural networks achieve remarkable results on various visual recognition tasks. They are, however, highly susceptible to being fooled by images that are modified in a particular way (so-called adversarial examples). Interesting adversarial examples are the ones that can confuse a model but not a human (i.e., imperceptible perturbations). Likewise, it is also possible to generate a pattern that is perceived by a human as noise but is classified by a network as a legitimate object with high confidence (Nguyen et al., 2015). Beyond the security implications, adversarial examples also provide insights into the weaknesses, strengths, and blind-spots of models.
+
+Adversarial attack. A natural application of the bias maps is to utilize them to influence a black-box system, in targeted or un-targeted manners, by adding them to the healthy inputs. Over MNIST, we added different magnitudes of bias maps (controlled by $\gamma$ ; Eq. 3) to the input digits and calculated the misclassification accuracy or fooling rate of a CNN (same as the one used in the previous section). This is illustrated in Fig. 6A. Obviously, there is a compromise between the perceptibility of perturbation (i.e., adding bias) and the fooling rate. With $\gamma = 0.8$ , we are able to manipulate the network to classify the augmented digit as the class of interest $21\%$ of the time (Fig. 6C; chance is
+
+
+Figure 6: A) Adding bias to a digit changes it to the target class in many cases (here with $\gamma = 0.8$ ). Adding bias to noise (2nd col.) turns noise to the target digit in almost all cases. The histograms show the distribution of predicted classes (intact digits or pure noise; 1st row). Note that most of the noise images are classified as 8 (top histogram in 2nd col). B) Same as A but using mean digit (computed over the training set). Adding the mean image is more effective but causes a much more perceptible perturbation. C) The degree to which (i.e., accuracy) a stimulus is classified as the target class (i.e., fooled) by adding different magnitudes of bias (or mean image) to it. Converting noise to a target is easier than converting a signal. There is a trade-off between perceptual perturbation and accuracy (i.e., subtle bias leads to less number of digits being misclassified).
+
+$10\%$ ). In comparison, adding the same amount of the mean image to digits fools the network almost always but is completely perceptible. In a similar vein, we are able to convert noise to a target digit class by adding bias to it (Fig. 6B). With $\gamma = 0.5$ , which is perceptually negligible (See supplement Fig. 17), we can manipulate the network $20.7\%$ of the time. Notice that in contrast to many black-box adversarial attacks that demand access to logits or gradients, our approach only requires the hard labels and does not make any assumption regarding the input distribution.
+
+Adversarial defense. In a recent work, Brown et al. (2017) introduced a technique called adversarial patch as a backdoor attack on a neural network. They placed a particular type of pattern on some inputs and trained the network with the poisoned data. The patches were allowed to be visible but were limited to a small, localized region of the input image. Here, we explore whether and how classification images can be used to detect adversarial patch attacks.
+
+
+Figure 7: A) Top: A 10-way CNN trained on MNIST (with half of the zeros augmented with a patch and relabeled as 1) performs very well on a clean test set (top confusion matrix). On a test set containing all zeros contaminated, it (incorrectly) classifies them as one. Classification images (right side) successfully reveal the perturbed region. Bottom: Same as above but over 8 and 9 digits. B) Classification images reveal the adversarial patch attack over CIFAR-10. Here, half of the birds are contaminated with a patch and are labeled as cat. C) Turning a frog into a car by adding the activation of the conv6 layer, computed using white noise, of the car category to the frog. See supplement. D) Average gradients before the adversarial patch attack (top) and after the attack (middle). The small yellow region on the top-right of digit 8 means that increasing those pixels increases the loss and thus leads to misclassification (i.e., turns 8 to another digit). (bottom) Average gradient with all 8s contaminated and relabeled as 9. The blue region on the top-right of digit 9 means that increasing those pixels lowers the loss and thus leads to classifying a digit as 9. This analysis is performed over the MNIST training set. Please see also Figs. 18 and 21.
+
+
+Figure 8: Example filters derived using spike triggered averaging (STA) for the first two conv layers of a CNN trained on MNIST dataset (left; RF sizes are $5 \times 5$ and $14 \times 14$ ) and 4 layers of a CNN on CIFAR-10 dataset (right; RF sizes in order are $3 \times 3, 5 \times 5, 14 \times 14$ and $32 \times 32$ ). See also Fig. 22 in the supplement for filter weights (i.e., CNN trained over real data).
+
+We performed three experiments, two on MNIST and one on CIFAR-10 (Fig. 7). Over MNIST, we constructed two training sets as follows. In the first one, we took half of the 0s and placed a $3 \times 3$ patch (x-shape) on their top-left corner and relabeled them as 1. The other half of zeros and all other digits remained intact. In the second one, we placed a c-shape patch on the top-right corner of half of the 8s, relabeled them as 9, and left the other half and other digits intact. We then trained two 10-way CNNs (same architecture as in the previous section) on these training sets. The CNNs perform close to perfect on the healthy test sets. Over a test set with all zeros contaminated (or eights), they completely misclassify the perturbed digits (See confusion matrices in the 2nd and 4th rows of Fig. 7A). Computing the classification images for these classifiers, we find a strong activation at the location of the adversarial patches in both cases. Note that the derived classification images still resemble the ones we found using the un-attacked classifiers (Fig. 2A) but now new regions pop out. Over CIFAR-10, we placed an H-shape pattern on top-right of half of the birds and labeled them as cats. The trained CNN classifier performs normally on a clean dataset. Again, computing the bias unveils a tamper in the network (Fig. 7B). To verify these findings, we computed the average gradient of the classification loss with respect to the input image for intact and attacked networks over the healthy and tampered training sets (Fig. 7). The average gradient shows a slight activation at the location of the perturbation (Fig. 7D), but it is not as pronounced as results using bias images.
+
+# 3.3 FILTER VISUALIZATION
+
+A number of ways have been proposed to understand how neural networks work by visualizing their filters (Nguyen et al., 2019). Example approaches include plotting filters of the first layers, identifying stimuli that maximally activate a neuron, occlusion maps by masking image regions (Zeiler & Fergus, 2014), activation maximization by optimizing a random image to be classified as an object (Erhan et al., 2009), saliency maps by calculating the effect of every pixel on the output of the model (Simonyan et al., 2013), network inversion (Mahendran & Vedaldi, 2015), and network dissection (Bau et al., 2017). Here, we propose a new method based on spike triggered averaging.
+
+For each model, we fed 1 million randomly generated patterns to the network and recorded the average response of single neurons at different layers. We changed the activation functions in the convolution layers of the CIFAR-10 CNN model to tanh, as using ReLU activation resulted in some dead filters. Fig. 8 shows the results over MNIST and CIFAR-10 datasets. We also show the filters computed using real data for the sake of comparison in the supplement (Fig. 22). As it can be seen, filters extract structural information (e.g., oriented edges) and are similar to those often derived by other visualization techniques. Comparing derived filters using noise patterns and derived filtered using training on real data (i.e., kernel weights), we notice that the two are exactly the same. This holds over both MNIST and CIFAR-10 datasets (Fig. 22 in supplement).
+
+Next, for the CIFAR-10 model, we computed mean layer activation maps of conv2, conv4, conv6, and fc layers by sending noise through the network. Results are shown in Fig. 20 in the supplement. Comparing these maps with the mean activation maps derived using real data, we observe high similarity in the fc layer and relatively less similarity in the other layers. The high similarity in the fc layer is because it is immediately before the class decision layer, and thus for a noise pattern to fall under a certain class, it has to have a similar weight vector as the learned weights from real data. This is corroborated by the higher average L2 distance across different classes in the fc layer, compared to the other layers, over both noise and real data (bottom panel in Fig. 20).
+
+
+Figure 9: Psychometric curves of a CNN trained on MNIST. The x-axis shows the magnitude of the signal added to the noise (panel D). The y-axis shows the accuracy. Legends show the magnitude of stimulation ( $k$ in Eq. 6). Larger $k$ (redder curve) means more bias. Increasing $fc$ bias enhances recognition towards the target digit for all digits (panel A). The opposite happens when lowering the bias (see supplement). Stimulating neurons in conv layers helps some digits (for which those neurons are positively correlated) but hinders some others (panels B and C). See the supplement for results over all digits across all CNN layers. Best viewed in color.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+We then asked whether it is possible to bias the network towards certain classes (similar to the adversarial analysis in Fig. 6) by injecting information, learned from average noise patterns to the input image or its activation maps at different layers. For example, as shown in Fig. 7C, we can turn a frog into a car by adding the average conv6 activation of the noise patterns classified as a car to it. This can be done in a visually (almost) imperceptible manner. Results over other classes of CIFAR-10 and different activation layers are shown in Fig. 21 (supplement). For some classes (e.g., cat or bird), it is easy to impact the network, whereas for some others (e.g., horse) it is harder. Results indicate that for different objects, different layers have more influence on classification.
+
+# 3.4 MICRO-STIMULATION
+
+Microstimulation, the electrical current-driven excitation of neurons, is used in neurophysiology research to identify the functional significance of a population of neurons (Cohen & Newsome, 2004; Lewis et al., 2016). Due to its precise temporal and spatial characteristics, this technique is often used to investigate the causal relationship between neural activity and behavioral performance. It has also been employed to alleviate the impact of damaged sensory apparatus and build brain-machine interfaces (BMIs) to improve the quality of life of people who have lost the ability to use their limbs. For example, stimulation of the primary visual cortex creates flashes of light which can be used to restore some vision for blind people. Microstimulation has been widely used to study visual processing across several visual areas including MT, V1, V4, IT, and FEF (Moore & Fallah, 2004). Here, we investigate how augmenting the stimuli with white noise impacts internal activations of artificial neural networks and their outputs.
+
+We linearly combined signal and white noise, according to Eq. 3, and measured the classification accuracy of a CNN trained on MNIST (Fig. 9). Without any stimulation, with the original network biases and weights, increasing the amount of signal (shown on the x-axis) improves the accuracy from 0 (corresponding to $100\%$ noise) to 1 (corresponding to $100\%$ signal). The resulting S-shaped curve resembles the psychometric functions observed in human psychophysics experiments (Wichmann & Hill, 2001). We then varied the amount of network bias in different layers according to the following formula and measured the accuracy again:
+
+$$
+b _ {m l} ^ {\text {n e w}} = b _ {m l} ^ {\text {o l d}} + \lambda_ {l} \times k \times \frac {1}{\max \left(a _ {m l}\right)} \sum_ {i = 1} ^ {N} a _ {m l i} \tag {6}
+$$
+
+where $b_{ml}$ is the bias term for map $m$ in layer $l$ , and $a_{mli}$ is the activation of neuron $i$ at the $m$ th map of the $l$ th layer. $k$ controls the magnitude of stimulation. $\lambda_l$ is used to scale the activation values, since sensitivity of the output to neurons at different layers varies (here we use $\lambda_l = 0.01, 0.1, 1$ for
+
+$fc$ , $conv1$ , and $conv2$ , respectively). Bias term $(b_{ml})$ is shared across all neurons in a map (i.e., for the same kernel). Notice that increasing bias in Eq. 6 is proportional to the map activation. Thus, stimulation has a higher impact on more active (selective) neurons.
+
+Increasing bias of the $fc$ neurons shifts the psychometric function to the left. This means that for the same amount of noise as before (i.e., no stimulation), now CNN classifies the input more frequently as the target digit. In other words, the network thinks of noise as the digit. Increasing $fc$ biases consistently elevates accuracy for all digits. Conversely, reducing the $fc$ bias shifts the psychometric function to the right for all digits (Fig. 24 in supplement; i.e., using minus sign in Eq. 6). The effect of stimulation on convolutional layers is not consistent. For example, increasing conv2 bias shifts the curves to the right for 0 and 1, and to the left for 3. We observed that stimulation or inhibition of conv1 layer almost always hurts all digits. We speculate this might be because conv1 filters capture features that are shared across all digits, and thus a subtle perturbation hurts the network.
+
+We were able to replicate the above results using a binary CNN akin to yes/no experiments on humans or monkeys. Results are provided in supplement Fig. 25. Our findings qualitatively agree with the results reported in Afraz et al. (2006). They artificially stimulated clusters of IT neurons while monkeys judged whether noisy visual images were 'face' or 'non-face'. Microstimulation of face-selective neurons biased the monkeys' decisions towards the face category.
+
+# 4 DISCUSSION AND CONCLUSION
+
+We showed that white noise analysis is effective in unveiling hidden biases in deep neural networks and other types of classifiers. A drawback is a need for a large number of trials. To lower the sample complexity, we followed the approach in Greene et al. (2014) and also recruited generative models. As a result, we were able to lower the sample complexity dramatically. As another alternative, Vondrick et al. (2015) used the Hoggles feature inversion technique (Vondrick et al., 2013) to generate images containing subtle scene structures. Their computed bias maps roughly resembled natural scenes. We found that the quality of the bias maps highly depends on the classifier type and the number of trials. Also, classification images over natural scene datasets are not expected to look like the instances of natural images since even the mean images do not represent sharp objects. Please see Figs. 2 and 5. In this regard, spike triggered covariance can be utilized to find stimuli (eigen vectors) to which a network or a neuron responds (Schwartz et al., 2006).
+
+We foresee several avenues for future research. We invite researchers to employ the tools developed here to analyze even more complex CNN architectures including ResNet (He et al., 2016) and InceptionNet (Szegedy et al., 2017). They can also be employed to investigate biases of other models such as CapsuleNets (Hinton et al., 2018) and GANs (Goodfellow et al., 2014a), and to detect and defend against other types of adversarial attacks. The outcomes can provide a better understanding of the top-down processes in deep networks, and the ways they can be integrated with bottom-up processes. Moreover, applying some other methods from experimental neuroscience (Bickle, 2016) (e.g., lesioning, staining) and theoretical neuroscience (e.g., spike-triggered non-negative matrix factorization (Liu et al., 2017), Bayesian STC (Park & Pillow, 2011), and Convolutional STC (Wu et al., 2015)) to inspect neural networks is another interesting future direction. Using classification images to improve the accuracy of classifiers (as in Vondrick et al. (2015)) or their robustness (as was done here) are also promising directions.
+
+Here, we focused primarily on visual recognition. Rajashekar et al. (2006) used classification images to estimate the template that guides saccades during the search for simple visual targets, such as triangles or circles. Caspi et al. (2004) measured temporal classification images to study how the saccadic targeting system integrates information over time. Keane et al. (2007) utilized classification images to investigate the perception of illusory and occluded contours. Inspired by these works, classification images, and STA can be applied to other computer vision tasks such as object detection, edge detection, activity recognition, and segmentation. Finally, unveiling biases of complicated deep networks can be fruitful in building bias-resilient and fair ANNs (e.g., racial fairness).
+
+In summary, we utilized two popular methods in computational neuroscience, classification images and spike triggered averaging, to understand and interpret the behavior of artificial neural networks. We demonstrated that they bear value for practical purposes (e.g., solving challenging issues such as adversarial attacks) and for further theoretical advancements. More importantly, our efforts show that confluence across machine learning, computer vision, and neuroscience can benefit all of these fields (See Hassabis et al. (2017)). We will release our code and data to facilitate future research.
+
+# REFERENCES
+
+Seyed-Reza Afraz, Roozbeh Kiani, and Hossein Esteky. Microstimulation of inferotemporal cortex influences face categorization. Nature, 442(7103):692, 2006.
+AJ Ahumada Jr. Perceptual classification images from vernier acuity masked by noise. Perception, 25(1_suppl):2-2, 1996.
+Pouya Bashivan, Kohitij Kar, and James J DiCarlo. Neural population control via deep image synthesis. Science, 364(6439):eaav9436, 2019.
+David Bau, Bolei Zhou, Aditya Khosla, Aude Oliva, and Antonio Torralba. Network dissection: Quantifying interpretability of deep visual representations. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 6541-6549, 2017.
+John Bickle. *Revolutions in neuroscience: Tool development.* Frontiers in systems neuroscience, 10:24, 2016.
+Ali Borji and Laurent Itti. State-of-the-art in visual attention modeling. IEEE transactions on pattern analysis and machine intelligence, 35(1):185-207, 2012.
+Tom B Brown, Dandelion Mané, Aurko Roy, Martín Abadi, and Justin Gilmer. Adversarial patch. arXiv preprint arXiv:1712.09665, 2017.
+Avi Caspi, Brent R Beutter, and Miguel P Eckstein. The time course of visual information accrual guiding eye movement decisions. Proceedings of the National Academy of Sciences, 101(35): 13086-13090, 2004.
+Marlene R Cohen and William T Newsome. What electrical microstimulation has revealed about the neural basis of cognition. Current opinion in neurobiology, 14(2):169-177, 2004.
+Peter Dayan, Laurence F Abbott, et al. Theoretical neuroscience, volume 806. Cambridge, MA: MIT Press, 2001.
+Gregory C DeAngelis, Izumi Ohzawa, and RD Freeman. Spatiotemporal organization of simple-cell receptive fields in the cat's striate cortex. ii. linearity of temporal and spatial summation. Journal of Neurophysiology, 69(4):1118-1135, 1993.
+Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In 2009 IEEE conference on computer vision and pattern recognition, pp. 248-255. IEEE, 2009.
+Dumitru Erhan, Yoshua Bengio, Aaron Courville, and Pascal Vincent. Visualizing higher-layer features of a deep network. University of Montreal, 1341(3):1, 2009.
+Ruth C Fong, Walter J Scheirer, and David D Cox. Using human brain activity to guide machine learning. *Scientific reports*, 8(1):5397, 2018.
+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, 2014a.
+Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. arXiv preprint arXiv:1412.6572, 2014b.
+Michelle R Greene, Abraham P Botros, Diane M Beck, and Li Fei-Fei. Visual noise from natural scene statistics reveals human scene category representations. arXiv preprint arXiv:1411.5331, 2014.
+Demis Hassabis, Dharshan Kumaran, Christopher Summerfield, and Matthew Botvinick. Neuroscience-inspired artificial intelligence. Neuron, 95(2):245-258, 2017.
+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.
+
+Geoffrey E Hinton, Sara Sabour, and Nicholas Frosst. Matrix capsules with em routing. In 6th international conference on learning representations, ICLR, 2018.
+Judson P Jones and Larry A Palmer. The two-dimensional spatial structure of simple receptive fields in cat striate cortex. Journal of neurophysiology, 58(6):1187-1211, 1987.
+Brian P Keane, Hongjing Lu, and Philip J Kellman. Classification images reveal spatiotemporal contour interpolation. Vision Research, 47(28):3460-3475, 2007.
+Diederik P Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013.
+Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. Technical report, Citeseer, 2009.
+Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In Advances in neural information processing systems, pp. 1097-1105, 2012.
+Yann LeCun, Léon Bottou, Yoshua Bengio, Patrick Haffner, et al. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278-2324, 1998.
+Philip M Lewis, Richard H Thomson, Jeffrey V Rosenfeld, and Paul B Fitzgerald. Brain neuromodulation techniques: a review. The neuroscientist, 22(4):406-421, 2016.
+Jian K Liu, Helene M Schreyer, Arno Onken, Fernando Rozenblit, Mohammad H Khani, Vidhyasankar Krishnamoorthy, Stefano Panzeri, and Tim Gollisch. Inference of neuronal functional circuitry with spike-triggered non-negative matrix factorization. Nature communications, 8(1): 149, 2017.
+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.
+Vasilis Marmarelis. Analysis of physiological systems: The white-noise approach. Springer Science & Business Media, 2012.
+Markus Meister, Jerome Pine, and Denis A Baylor. Multi-neuronal signals from the retina: acquisition and analysis. Journal of neuroscience methods, 51(1):95-106, 1994.
+Tirin Moore and Mazyar Fallah. Microstimulation of the frontal eye field and its effects on covert spatial attention. Journal of neurophysiology, 91(1):152-162, 2004.
+Richard F Murray. Classification images: A review. Journal of vision, 11(5):2-2, 2011.
+Anh Nguyen, Jason Yosinski, and Jeff Clune. Deep neural networks are easily fooled: High confidence predictions for unrecognizable images. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 427-436, 2015.
+Anh Nguyen, Jason Yosinski, and Jeff Clune. Understanding neural networks via feature visualization: A survey. arXiv preprint arXiv:1904.08939, 2019.
+II Memming Park and Jonathan W Pillow. Bayesian spike-triggered covariance analysis. In Advances in neural information processing systems, pp. 1692-1700, 2011.
+Umesh Rajashekar, Alan C Bovik, and Lawrence K Cormack. Visual search in noise: Revealing the influence of structural cues by gaze-contingent classification image analysis. Journal of Vision, 6 (4):7-7, 2006.
+Benjamin Recht, Rebecca Roelofs, Ludwig Schmidt, and Vaishaal Shankar. DoImagenet classifiers generalize toImagenet? arXiv preprint arXiv:1902.10811, 2019.
+R Clay Reid and Jose-Manuel Alonso. Specificity of monosynaptic connections from thalamus to visual cortex. Nature, 378(6554):281, 1995.
+
+HIROKO M Sakai and K Naka. Signal transmission in the catfish retina. v. sensitivity and circuit. Journal of Neurophysiology, 58(6):1329-1350, 1987.
+Roman A Sandler and Vasilis Z Marmarelis. Understanding spike-triggered covariance using wiener theory for receptive field identification. Journal of vision, 15(9):16-16, 2015.
+Odelia Schwartz, Jonathan W Pillow, Nicole C Rust, and Eero P Simoncelli. Spike-triggered neural characterization. Journal of vision, 6(4):13-13, 2006.
+Karen Simonyan, Andrea Vedaldi, and Andrew Zisserman. Deep inside convolutional networks: Visualising image classification models and saliency maps. arXiv preprint arXiv:1312.6034, 2013.
+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.
+Christian Szegedy, Sergey Ioffe, Vincent Vanhoucke, and Alexander A Alemi. Inception-v4, inception-resnet and the impact of residual connections on learning. In Thirty-First AAAI Conference on Artificial Intelligence, 2017.
+Carl Vondrick, Aditya Khosla, Tomasz Malisiewicz, and Antonio Torralba. Hoggles: Visualizing object detection features. In Proceedings of the IEEE International Conference on Computer Vision, pp. 1-8, 2013.
+Carl Vondrick, Hamed Piri siavash, Aude Oliva, and Antonio Torralba. Learning visual biases from human imagination. In Advances in neural information processing systems, pp. 289-297, 2015.
+Felix A Wichmann and N Jeremy Hill. The psychometric function: I. fitting, sampling, and goodness of fit. Perception & psychophysics, 63(8):1293-1313, 2001.
+Anqi Wu, Il Memming Park, and Jonathan W Pillow. Convolutional spike-triggered covariance analysis for neural subunit models. In Advances in neural information processing systems, pp. 793-801, 2015.
+Han Xiao, Kashif Rasul, and Roland Vollgraf. Fashion-mnist: a novel image dataset for benchmarking machine learning algorithms. arXiv preprint arXiv:1708.07747, 2017.
+Matthew D Zeiler and Rob Fergus. Visualizing and understanding convolutional networks. In European conference on computer vision, pp. 818-833. Springer, 2014.
+
+# A APPENDIX
+
+Creating visual noise from natural scene statistics. We followed Greene et al. (2014) to generate noise patterns containing subtle structures. We amassed a digit database of 60K images from MNIST training set and represented each image as the output of a bank of Gabor filters at three spatial scales (2, 4 and 10 cycles per image, and wavelets were truncated to lie within the borders of the image), four orientations (0, 45, 90 and 135 degrees) and two quadrature phases (0 and 90 degrees). Thus, each image is represented by $2 \times 2 \times 2 \times 4 + 4 \times 4 \times 2 \times 4 + 10 \times 10 \times 2 \times 4 = 960$ total Gabor wavelets. Weights of Gabor wavelets for each image were determined using ridge regression. We then performed principal components analysis (PCA) on the 60K-image by the 960-wavelet weight matrix. We kept the first 250 principal components that explain $96.1\%$ of the variance in data. A noise image was created by choosing a random value for each principal component score, scaled to the observed range for each component.
+
+We also gathered a natural object database of 50K images from the CIFAR-10 training set. For these colored images, we performed the above-mentioned approach on each channel. More specifically, we represented each $32 \times 32$ -sized channel with four-scale (2, 4, 7, 11 cycles), four-orientation, two-phase Gabor wavelets, which results in $2 \times 2 \times 2 \times 4 + 4 \times 4 \times 2 \times 4 + 7 \times 7 \times 2 \times 4 + 11 \times 11 \times 2 \times 4 = 1520$ total Gabor wavelets per channel. Then for each channel, we performed ridge regression to get the 50K-by-1520 weight matrix, which is passed to PCA and kept the first 600 PCs. These PCAs can explain variance in three channels as $97.57\%$ , $97.51\%$ , and $97.52\%$ , respectively.
+
+```python
+One hidden Layer NN
+class Model(nnModule): def__init__(self): super(Model,self).__init_() self.fc $=$ nn.Linear(784,1000) self.fc2 $=$ nn.Linear(1000,10) defforward(self,x): $\mathbf{x} = \mathbf{x}$ .view(-1,784)) h $=$ F.relu(self.fc(x)) h $=$ self.fc2(h) returnF散热max(h)
+```
+
+```python
+class autoencoder(nnModule): def __init__(self): super( autoencoder, self).__init__( ) self encoder $=$ nn Sequential( nn.Linear(28\*28,128), nn.ReLU True), nn.Linear(128,64), nn.ReLU True), nn.Linear(64,12), nn.ReLU True), nn.Linear(12,9)) self decoder $=$ nn Sequential( nn.Linear(9,12), nn.ReLU True), nn.Linear(12,64), nn.ReLU True), nn.Linear(64,128), nn.ReLU True), nn.Linear(128,28\*28), nn.Tanh() def forward(self,x): $\mathbf{z} =$ self encoder(x) $\mathbf{x} =$ self decoder(z) return x,z def generate(self, code): # $\mathrm{z} =$ self encoder(x) $\mathbf{x} =$ self decoder(code) return x
+```
+
+```python
+class Model(nnModule): def __init__(self): super(Model, self).__init_() self.conv1 = nn.Conv2d(1, 20, 5, 1) self.conv2 = nn.Conv2d(20, 50, 5, 1) self.fc1 = nn.Linear(4*4*50, 500) self.fc2 = nn.Linear(500, 10) def forward(self, x): x_1 = Frelu(self.conv1(x)) x = F.max_pool12d(x_1, 2, 2) x_2 = Frelu(self.conv2(x)) x = F.max_pool12d(x_2, 2, 2) x = x.view(-1, 4*4*50) x_3 = Frelu(self.fc1(x)) h = F softmax(self.fc2(x_3), dim=1) return h, x_3, x_2, x_1
+```
+
+```python
+class VAE(nnModule): def __init__(self): super(VAE, self).__init_(self.fc1 = nn.Linear(784, 400) self.fc21 = nn.Linear(400, latent_d) self.fc22 = nn.Linear(400, latent_d) self.fc3 = nn.Linear(latent_d, 400) self.fc4 = nn.Linear(400, 784) def encode(self, x): h1 = F.relu(self.fc1(x)) return self.fc21(h1), self.fc22(h1) def reparametrize(self, mu, logvar): std = logvar.mul(0.5).exp_ if torch.cuda.is-available(): eps = torch.cuda FloatTensor(std.size()).normal_ else: eps = torch FloatTensor(std.size()).normal_ (eps = Variable(eps) return eps.mul(std).add_(mu) def decode(self, z): h3 = F.relu(self.fc3(z)) return F.sigmoid(self.fc4(h3)) def forward(self, x): mu, logvar = self.encode(x) z = self.reparametrize(mu, logvar) return self.decode(z), mu, logvar
+```
+
+```python
+class RNNModel(nnModule): def __init__(self, input_dim, hidden_dim, layer_dim, output_dim): super(RNNModel, self).__init_(self.hidden_dim = hidden_dim self(layer_dim = layer_dim self.rnn = nn.RNN(input_dim, hidden_dim, layer_dim, batch_first=True, nonlinearity='tanh') self.fc = nn.Linear(hidden_dim, output_dim) def forward(self, x): h0 = torch.zeros(self(layer_dim, x.size(0), self-hidden_dim).to(device) out, hn = self.rnn(x, h0detach()) out = self.fc(out[:, -1, :]) return out
+```
+
+Figure 10: The architecture of the models used in this study including MLP, CNN, RNN, AutoEncoder, and VAE.
+
+```python
+class Model(nnModule): def __init__(self, p): super (Model, self).__init_( ) self.conv1 = nnSEQUENTIAL( nn.Conv2d (in_channels $= 3$ , out_channels $=$ p, kernel_size $= 3$ , padding $\equiv 1$ ), nnBatchNorm2d(p), nn.ReLU (inplace $\equiv$ True), nn.Conv2d (in_channels $=$ p, out_channels $= 64$ , kernel_size $= 3$ , padding $\equiv 1$ ), nn.ReLU (inplace $\equiv$ True)) self.pool1 = nn.MaxPool2d (kernel_size $= 2$ , stride $= 2$ ) self.conv2 = nnSEQUENTIAL( nn.Conv2d (in_channels $= 64$ , out_channels $= 128$ , kernel_size $= 3$ , padding $\equiv 1$ ), nnBatchNorm2d (128), nn.ReLU (inplace $\equiv$ True), nn.Conv2d (in_channels $= 128$ , out_channels $= 128$ , kernel_size $= 3$ , padding $\equiv 1$ ), nn.ReLU (inplace $\equiv$ True)) self.pool2 = nnSEQUENTIAL( nn.MaxPool2d (kernel_size $= 2$ , stride $= 2$ ), nn.Dropout2d(p=0.05)) self.conv3 = nnSEQUENTIAL( nn.Conv2d (in_channels $= 128$ , out_channels $= 256$ , kernel_size $= 3$ , padding $\equiv 1$ ), nnBatchNorm2d (256), nn.ReLU (inplace $\equiv$ True), nn.Conv2d (in_channels $= 256$ , out_channels $= 256$ , kernel_size $= 3$ , padding $\equiv 1$ ), nn.ReLU (inplace $\equiv$ True)) self.pool3 = nn.MaxPool2d (kernel_size $= 2$ , stride $= 2$ ) self.fc_layer1 = nn.Sequentia! ( nn.Dropout(p=0.1), nn.Linear (4096, 1024), nn.ReLU (inplace $\equiv$ True), nn.Linear (1024, 512), nn.ReLU (inplace $\equiv$ True)) self.fc_layer2 = nn.Sequentia! ( nn.Dropout(p=0.1), nn.Linear (512, 10)) def forward(self, x): x_conv1 = self.conv1(x) x_conv2 = self.conv2(self.pool1(x_conv1)) x_conv3 = self.conv3(self.pool2(x_conv2)) x1 = self.pool3(x_conv3) x2 = x1.view(x1.size(0), -1) x3 = self.fc_layer1(x2) x4 = self.fc_layer2(x3) return x4, x3, x_conv3, x_conv2, x_conv1
+```
+
+Figure 11: The architecture of the CNN used to classify CIFAR-10 images.
+
+| γ | 0 | .1 | .2 | .3 | .4 | .5 | .6 | .7 | .8 | .9 | 1 |
| (1-γ) × noise + γ × bias | 0.1 | 0.113 | 0.127 | 0.149 | 0.174 | 0.207 | 0.271 | 0.429 | 0.666 | 0.743 | 0.9 |
| (1-γ) × signal + γ × bias | 0.1 | 0.1 | 0.1 | 0.1 | 0.101 | 0.102 | 0.105 | 0.123 | 0.214 | 0.587 | 0.9 |
| (1-γ) × noise + γ × mean | 0.1 | 0.127 | 0.179 | 0.313 | 0.618 | 0.842 | 0.986 | 1.0 | 1.0 | 1.0 | 1.0 |
| (1-γ) × signal + γ × mean | 0.1 | 0.101 | 0.103 | 0.109 | 0.149 | 0.28 | 0.534 | 0.83 | 0.994 | 1.0 | 1.0 |
+
+Table 2: Numbers corresponding to the bar charts in Fig. 6C.
+
+
+Figure 12: More examples and illustration of classification images concept.
+
+
+Figure 13: Classification images for a two layer MLP (784 $\longrightarrow$ 1000 $\longrightarrow$ 10) shown at the top and an RNN classifier at the bottom. None of the noise patterns were classified as 1 using both classifiers. While the derived biases do not resemble digits, they still convey information to predict the class of a test digit. Please see Figs. 2 and Fig. 3 in the main text.
+
+
+Figure 14: Analysis of sample complexity for deriving classification images from a CNN trained on MNIST dataset (see Fig. 2). With around 10K samples, computed biases already start to resemble the target digits.
+
+
+Figure 15: Using an AutoEncoder and a VAE to generate samples containing faint structures to be used for computing the classification images over MNIST dataset, using a CNN classifier. Both generators were trained only for two epochs to prohibit the CNN to from generating perfect samples (shown at the top). Bottom panels show classification images derived using 100, 1K, and 10K samples from each generator. Note that classification images converge much faster now compared with the white noise stimuli.
+
+
+
+# White noise frequency of noise classification
+
+
+Figure 16: Top: frequency of Gabor noise classified as a Fashion MNIST class. Middle: same as above but using white noise. Bottom: Classification images using white noise. See also Fig. 3.
+
+
+Figure 17: Illustration of influencing the CNN decisions (on MNIST) towards a particular digit class by adding bias to the digits (top) and adding bias to the noise (bottom). This is akin to targeted attack. See Fig. 7 in the main text.
+
+
+before attack
+
+
+after attack
+Figure 18: Confusion matrices for adversarial patch attack on CIFAR-10 dataset (bird to cat). Class names: plane, car, bird, cat, deer, dog, frog, horse, ship and truck. See Fig. 7.
+
+
+Mean MNIST digits
+
+
+Mean MNIST digits (adversarial train set)
+Figure 19: Mean MNIST digits, clean training set (top) and adversarial training set (bottom). See Fig. 7.
+
+
+Figure 20: Top) Average layer activation using noise (left) and real data (right) over a CNN trained on CIFAR-10 dataset. Bottom) Mean distance between average layer activations of different classes across model layers.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Y
+
+
+Figure 21: Effect of adding activation at conv6, conv4, conv2 and input of noises classified as different classes to real images. The figure shows CIFAR-10 model misclassification ratio vs. $\gamma$ , where input to the model is
+
+$((1 - \gamma) \times \text{noise activation of a certain class} + \gamma \times \text{real data input image})$
+
+Misclassification ratio is calculated as
+
+the number of images not belonging to the activation-added class but are classified as it over the number of images not belonging to the activation-added class. The visualization of adding activation to input is shown in Fig. 7C.
+
+
+Figure 22: Trained model weights (i.e., convolutional kernels) of the first layer of a CNN trained on MNIST or CIFAR-10. These are not calculated by feeding noise patterns. They are derived after training the model on data. Interestingly, they are the same as those derived using white noise (See Fig. 8 in the main text.
+
+
+Figure 23: Result of microstimulation over MNIST digits using a 10-way CNN classifier. Bias is increased for all layers.
+
+
+Figure 24: Result of microstimulation over MNIST digits using a 10-way CNN classifier. Bias is decreased for all layers.
+
+
+
+
+
+
+Figure 25: Results of microstimulation for a two binary decision making tasks using a CNN classifier (1 vs. 3) and (2 vs. 8). Left(right) panels show increasing (decreasing) bias for each layer. See Fig. 9 in the main text.
+
+
\ No newline at end of file
diff --git a/whitenoiseanalysisofneuralnetworks/images.zip b/whitenoiseanalysisofneuralnetworks/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..e1cad8dd29b7745b83013ec917c605fa5282f127
--- /dev/null
+++ b/whitenoiseanalysisofneuralnetworks/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:88b68d9385f704525f63a7ebf86ff66a13d8fdd589b95e7f62d8546920a9e3b5
+size 2585134
diff --git a/whitenoiseanalysisofneuralnetworks/layout.json b/whitenoiseanalysisofneuralnetworks/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..e70525b702fd6e7061221e1be2db2d52358c7f21
--- /dev/null
+++ b/whitenoiseanalysisofneuralnetworks/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:aa8dd1cf277c698bf921796c1e31354aebe89ce2b7ec280cba7330911776dcf7
+size 645495
diff --git a/word2ketspaceefficientwordembeddingsinspiredbyquantumentanglement/4c2a040b-8958-4d27-b2d4-43c63e46cd78_content_list.json b/word2ketspaceefficientwordembeddingsinspiredbyquantumentanglement/4c2a040b-8958-4d27-b2d4-43c63e46cd78_content_list.json
new file mode 100644
index 0000000000000000000000000000000000000000..354ddc46bda93a95c48919a70b94aa50985c0644
--- /dev/null
+++ b/word2ketspaceefficientwordembeddingsinspiredbyquantumentanglement/4c2a040b-8958-4d27-b2d4-43c63e46cd78_content_list.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:dff641ee6ad4e589cb4e89c897ddfff2038c5494598701ed20e8f68d26194b7d
+size 61764
diff --git a/word2ketspaceefficientwordembeddingsinspiredbyquantumentanglement/4c2a040b-8958-4d27-b2d4-43c63e46cd78_model.json b/word2ketspaceefficientwordembeddingsinspiredbyquantumentanglement/4c2a040b-8958-4d27-b2d4-43c63e46cd78_model.json
new file mode 100644
index 0000000000000000000000000000000000000000..11452abcb20801f0640475036364934a9031d029
--- /dev/null
+++ b/word2ketspaceefficientwordembeddingsinspiredbyquantumentanglement/4c2a040b-8958-4d27-b2d4-43c63e46cd78_model.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0529c91465ca3f9082bce3d421d2a1f7f4de0858cefbd30430838fb3166cb5f7
+size 75217
diff --git a/word2ketspaceefficientwordembeddingsinspiredbyquantumentanglement/4c2a040b-8958-4d27-b2d4-43c63e46cd78_origin.pdf b/word2ketspaceefficientwordembeddingsinspiredbyquantumentanglement/4c2a040b-8958-4d27-b2d4-43c63e46cd78_origin.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..0cd1e53961e0fba845f36d0637833deadc142c0e
--- /dev/null
+++ b/word2ketspaceefficientwordembeddingsinspiredbyquantumentanglement/4c2a040b-8958-4d27-b2d4-43c63e46cd78_origin.pdf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e32a6a9ddfb910d30ebdeaa2496ff9ed41246dce64dbd42562580dbcc142071f
+size 754654
diff --git a/word2ketspaceefficientwordembeddingsinspiredbyquantumentanglement/full.md b/word2ketspaceefficientwordembeddingsinspiredbyquantumentanglement/full.md
new file mode 100644
index 0000000000000000000000000000000000000000..57e0157745bd50d886d2b65325e9b4c41631ab5e
--- /dev/null
+++ b/word2ketspaceefficientwordembeddingsinspiredbyquantumentanglement/full.md
@@ -0,0 +1,245 @@
+# word2ket: SPACE-EFFICIENT WORD EMBEDDINGS INSPIRED BY QUANTUM ENTANGLEMENT
+
+Aliakbar Panahi
+
+Department of Computer Science Virginia Commonwealth University panahia@vcu.edu
+
+Seyran Saeedi
+
+Department of Computer Science Virginia Commonwealth University saeedis@vcu.edu
+
+Tom Arodz*
+
+Department of Computer Science Virginia Commonwealth University Richmond, VA 23284, USA tarodz@vcu.edu
+
+# ABSTRACT
+
+Deep learning natural language processing models often use vector word embeddings, such as word2vec or GloVe, to represent words. A discrete sequence of words can be much more easily integrated with downstream neural layers if it is represented as a sequence of continuous vectors. Also, semantic relationships between words, learned from a text corpus, can be encoded in the relative configurations of the embedding vectors. However, storing and accessing embedding vectors for all words in a dictionary requires large amount of space, and may strain systems with limited GPU memory. Here, we used approaches inspired by quantum computing to propose two related methods1, word2ket and word2ketXS, for storing word embedding matrix during training and inference in a highly efficient way. Our approach achieves a hundred-fold or more reduction in the space required to store the embeddings with almost no relative drop in accuracy in practical natural language processing tasks.
+
+# 1 INTRODUCTION
+
+Modern deep learning approaches for natural language processing (NLP) often rely on vector representation of words to convert discrete space of human language into continuous space best suited for further processing through a neural network. For a language with vocabulary of size $d$ , a simple way to achieve this mapping is to use one-hot representation - each word is mapped to its own row of a $d \times d$ identity matrix. There is no need to actually store the identity matrix in memory, it is trivial to reconstruct the row from the word identifier. Word embedding approaches such as word2vec (Mikolov et al., 2013) or GloVe (Pennington et al., 2014) use instead vectors of dimensionality $p$ much smaller than $d$ to represent words, but the vectors are not necessarily extremely sparse nor mutually orthogonal. This has two benefits: the embeddings can be trained on large text corpora to capture the semantic relationship between words, and the downstream neural network layers only need to be of width proportional to $p$ , not $d$ , to accept a word or a sentence. We do, however, need to explicitly store the $d \times p$ embedding matrix in GPU memory for efficient access during training and inference. Vocabulary sizes can reach $d = 10^5$ or $10^6$ (Pennington et al., 2014), and dimensionality of the embeddings used in current systems ranges from $p = 300$ (Mikolov et al., 2013; Pennington et al., 2014) to $p = 1024$ (Devlin et al., 2018). The $d \times p$ embedding matrix thus becomes a substantial, often dominating, part of the parameter space of a learning model.
+
+In classical computing, information is stored in bits - a single bit represents an element from the set $\mathbb{B} = \{0,1\}$ , it can be in one of two possible states. A quantum equivalent of a bit, a qubit, is
+
+fully described by a single two-dimensional complex unit-norm vector, that is, an element from the set $\mathbb{C}^2$ . A state of an $n$ -qubit quantum register corresponds to a vector in $\mathbb{C}^{2^n}$ . To have exponential dimensionality of the state space, though, the qubits in the register have to be interconnected so that their states can become entangled; a set of all possible states of $n$ completely separated, independent qubits can be fully represented by $\mathbb{C}^{2n}$ instead of $\mathbb{C}^{2^n}$ . Entanglement is a purely quantum phenomenon - we can make quantum bits interconnected, so that a state of a two-qubit system cannot be decomposed into states of individual qubits. We do not see entanglement in classical bits, which are always independent - we can describe a byte by separately listing the state of each of the eight bits. We can, however, approximate quantum register classically - store vectors of size $m$ using $O(\log m)$ space, at the cost of losing the ability to express all possible $m$ -dimensional vectors that an actual $O(\log m)$ -qubit quantum register would be able to represent. As we show in this paper, the loss of representation power does not have a significant impact on NLP machine learning algorithms that use the approximation approaches to store and manipulate the high-dimensional word embedding matrix.
+
+# 1.1 OUR CONTRIBUTION
+
+Here, we used approaches inspired by quantum computing to propose two related methods, word2ket and word2ketXS, for storing word embedding matrix during training and inference in a highly efficient way $^2$ . The first method operates independently on the embedding of each word, allowing for more efficient processing, while the second method operates jointly on all word embeddings, offering even higher efficiency in storing the embedding matrix, at the cost of more complex processing. Empirical evidence from three NLP tasks shows that the new word2ket embeddings offer high space saving rate at little cost in terms of accuracy of the downstream NLP model.
+
+# 2 FROM TENSOR PRODUCT SPACES TO word2ket EMBEDDINGS
+
+# 2.1 TENSOR PRODUCT SPACE
+
+Consider two separable $^3$ Hilbert spaces $\mathcal{V}$ and $\mathcal{W}$ . A tensor product space of $\mathcal{V}$ and $\mathcal{W}$ , denoted as $\mathcal{V} \otimes \mathcal{W}$ , is a separable Hilbert space $\mathcal{H}$ constructed using ordered pairs $v \otimes w$ , where $v \in \mathcal{V}$ and $w \in \mathcal{W}$ . In the tensor product space, the addition and multiplication in $\mathcal{H}$ have the following properties
+
+$$
+c \left\{v \otimes w \right\} = \left\{c v \right\} \otimes w = v \otimes \left\{c w \right\}, \tag {1}
+$$
+
+$$
+v \otimes w + v ^ {\prime} \otimes w = \left\{v + v ^ {\prime} \right\} \otimes w,
+$$
+
+$$
+v \otimes w + v \otimes w ^ {\prime} = v \otimes \left\{w + w ^ {\prime} \right\}.
+$$
+
+The inner product between $v \otimes w$ and $v' \otimes w'$ is defined as a product of individual inner products
+
+$$
+\langle v \otimes w, v ^ {\prime} \otimes w ^ {\prime} \rangle = \langle v, v ^ {\prime} \rangle \langle w, w ^ {\prime} \rangle . \tag {2}
+$$
+
+It immediately follows that $||v \otimes w|| = ||v|| ||w||$ ; in particular, a tensor product of two unit-norm vectors, from $\mathcal{V}$ and $\mathcal{W}$ , respectively, is a unit norm vector in $\mathcal{V} \otimes \mathcal{W}$ . The Hilbert space $\mathcal{V} \otimes \mathcal{W}$ is a space of equivalence classes of pairs $v \otimes w$ ; for example $\{cv\} \otimes w$ and $v \otimes \{cw\}$ are equivalent ways to write the same vector. A vector in a tensor product space is often simply called a tensor.
+
+Let $\{\psi_j\}$ and $\{\phi_k\}$ be orthonormal basis sets in $\mathcal{V}$ and $\mathcal{W}$ , respectively. From eq. 1 and 2 we can see that
+
+$$
+\left\{\sum_ {j} c _ {j} \psi_ {j} \right\} \otimes \left\{\sum_ {k} d _ {k} \phi_ {k} \right\} = \sum_ {j} \sum_ {k} c _ {j} d _ {k} \psi_ {j} \otimes \phi_ {k},
+$$
+
+$$
+\langle \psi_ {j} \otimes \phi_ {k}, \psi_ {j ^ {\prime}} \otimes \phi_ {k ^ {\prime}} \rangle = \delta_ {j - j ^ {\prime}} \delta_ {k - k ^ {\prime}},
+$$
+
+where $\delta_z$ is the Kronecker delta, equal to one at $z = 0$ and to null elsewhere. That is, the set $\{\psi_j\otimes \phi_k\}_{jk}$ forms an orthonormal basis in $\mathcal{V}\otimes \mathcal{W}$ , with coefficients indexed by pairs $jk$ and
+
+numerically equal to the products of the corresponding coefficients in $\mathcal{V}$ and $\mathcal{W}$ . We can add any pairs of vectors in the new spaces by adding the coefficients. The dimensionality of $\mathcal{V} \otimes \mathcal{W}$ is the product of dimensionalities of $\mathcal{V}$ and $\mathcal{W}$ .
+
+We can create tensor product spaces by more than one application of tensor product, $\mathcal{H} = \mathcal{U}\otimes \mathcal{V}\otimes \mathcal{W}$ with arbitrary bracketing, since tensor product is associative. Tensor product space of the form
+
+$$
+\bigotimes_ {j = 1} ^ {n} \mathcal {H} _ {j} = \mathcal {H} _ {1} \otimes \mathcal {H} _ {2} \otimes \dots \otimes \mathcal {H} _ {n}
+$$
+
+is said to have tensor order $^4$ of $n$
+
+# 2.2 ENTANGLED TENSORS
+
+Consider $\mathcal{H} = \mathcal{V}\otimes \mathcal{W}$ . We have seen the addition property $v\otimes w + v^{\prime}\otimes w = \{v + v^{\prime}\} \otimes w$ and similar property with linearity in the first argument - tensor product is bilinear. We have not, however, seen how to express $v\otimes w + v^{\prime}\otimes w^{\prime}$ as $\phi \otimes \psi$ for some $\phi \in \mathcal{V}$ , $\psi \in \mathcal{W}$ . In many cases, while the left side is a proper vector from the tensor product space, it is not possible to find such $\phi$ and $\psi$ . The tensor product space contains not only vectors of the form $v\otimes w$ , but also their linear combinations, some of which cannot be expressed as $\phi \otimes \psi$ . For example, $\sum_{j=0}^{1}\sum_{k=1}^{1}\frac{\psi_j\otimes\phi_k}{\sqrt{4}}$ can be decomposed as $\left\{\sum_{j=0}^{1}\frac{1}{\sqrt{2}}\psi_j\right\} \otimes \left\{\sum_{k=1}^{1}\frac{1}{\sqrt{2}}\phi_k\right\}$ . On the other hand, $\frac{\psi_0\otimes\phi_0 + \psi_1\otimes\phi_1}{\sqrt{2}}$ cannot; no matter what we choose as coefficients $a, b, c, d$ , we have
+
+$$
+\begin{array}{l} \frac {1}{\sqrt {2}} \psi_ {0} \otimes \phi_ {0} + \frac {1}{\sqrt {2}} \psi_ {1} \otimes \phi_ {1} \neq (a \psi_ {0} + b \psi_ {1}) \otimes (c \phi_ {0} + d \phi_ {1}) \\ = a c \psi_ {0} \otimes \phi_ {0} + b d \psi_ {1} \otimes \phi_ {1} + a d \psi_ {0} \otimes \phi_ {1} + b c \psi_ {1} \otimes \phi_ {0}, \\ \end{array}
+$$
+
+since we require $ac = 1 / \sqrt{2}$ , that is, $a \neq 0$ , $c \neq 0$ , and similarly $bd = 1 / \sqrt{2}$ , that is, $b \neq 0$ , $c \neq 0$ , yet we also require $bd = ad = 0$ , which is incompatible with $a, b, c, d \neq 0$ .
+
+For tensor product spaces of order $n$ , that is, $\bigotimes_{j=1}^{n} \mathcal{H}_j$ , tensors of the form $v = \bigotimes_{j=1}^{n} v_j$ , where $v_j \in \mathcal{H}_j$ , are called simple. Tensor rank5 of a tensor $v$ is the smallest number of simple tensors that sum up to $v$ ; for example, $\frac{\psi_0 \otimes \phi_0 + \psi_1 \otimes \phi_1}{\sqrt{2}}$ is a tensor of rank 2. Tensors with rank greater than one are called entangled. Maximum rank of a tensor in a tensor product space of order higher than two is not known in general (Buczyński & Landsberg, 2013).
+
+# 2.3 THE word2ket EMBEDDINGS
+
+A $p$ -dimensional word embedding model involving a $d$ -token vocabulary is a mapping $f: [d] \to \mathbb{R}^p$ , that is, it maps word identifiers into a $p$ -dimensional real Hilbert space, an inner product space with the standard inner product $\langle \cdot, \cdot \rangle$ leading to the $L_2$ norm. Function $f$ is trained to capture semantic information from the language corpus it is trained on, for example, two words $i$ , $j$ with $\langle f(i), f(j) \rangle \sim 0$ are expected to be semantically unrelated. In practical implementations, we represent $f$ as a collection of vectors $f_i \in \mathbb{R}^p$ indexed by $i$ , typically in the form of $d \times p$ matrix $M$ , with embeddings of individual words as rows.
+
+We propose to represent an embedding $v \in \mathbb{R}^p$ of each a single word as an entangled tensor. Specifically, in word2ket, we use tensor of rank $r$ and order $n$ of the form
+
+$$
+v = \sum_ {k = 1} ^ {r} \bigotimes_ {j = 1} ^ {n} v _ {j k}, \tag {3}
+$$
+
+where $v_{jk} \in \mathbb{R}^q$ . The resulting vector $v$ has dimension $p = q^n$ , but takes $rnq = O(rq\log p / q)$ space. We use $q \geq 4$ ; it does not make sense to reduce it to $q = 2$ since a tensor product of two vectors in $\mathbb{R}^2$ takes the same space as a vector in $\mathbb{R}^4$ , but not every vector in $\mathbb{R}^4$ can be expressed as a rank-one tensor in $\mathbb{R}^2 \otimes \mathbb{R}^2$ .
+
+If the downstream computation involving the word embedding vectors is limited to inner products of embedding vectors, there is no need to explicitly calculate the $q^n$ -dimensional vectors. Indeed, we have (see eq. 2)
+
+$$
+\langle v, w \rangle = \left\langle \sum_ {k = 1} ^ {r} \bigotimes_ {j = 1} ^ {n} v _ {j k}, \sum_ {k ^ {\prime} = 1} ^ {r} \bigotimes_ {j = 1} ^ {n} w _ {j k ^ {\prime}} \right\rangle = \sum_ {k, k ^ {\prime} = 1} ^ {r, r} \prod_ {j = 1} ^ {n} \left\langle v _ {j k}, w _ {j k ^ {\prime}} \right\rangle .
+$$
+
+Thus, the calculation of inner product between two $p$ -dimensional word embeddings, $v$ and $w$ , represented via word2ket takes $O\left(r^2 q\log p / q\right)$ time and $O(1)$ additional space.
+
+In most applications, a small number of embedding vectors do need to be made available for processing through subsequent neural network layers - for example, embeddings of all words in all sentences in a batch. For a batch consisting of $b$ words, the total space requirement is $O(bp + rq\log p / q)$ , instead of $O(dp)$ in traditional word embeddings.
+
+Reconstructing a $b$ -word batch of $p$ -dimensional word embedding vectors from tensors of rank $r$ and order $n$ takes $O(brpn)$ arithmetic operations. To facilitate parallel processing, we arrange the order- $n$ tensor product space into a balanced tensor product tree (see Figure 1), with the underlying vectors $v_{jk}$ as leaves, and $v$ as root. For example, for $n = 4$ , instead of $v = \sum_{k}((v_{1k} \otimes v_{2k}) \otimes v_{3k}) \otimes v_{4k}$ we use $v = \sum_{k}(v_{1k} \otimes v_{2k}) \otimes (v_{3k} \otimes v_{4k})$ . Instead of performing $n$ multiplications sequentially, we can perform them in parallel along branches of the tree, reducing the length of the sequential processing to $O(\log n)$ .
+
+Typically, word embeddings are trained using gradient descent. The proposed embedding representation involves only differentiable arithmetic operations, so gradients with respect to individual elements of vectors $v_{jk}$ can always be defined. With the balanced tree structure, word2ket representation can be seen as a sequence of $O(\log n)$ linear layers with linear activation functions, where $n$ is already small. Still, the gradient of the embedding vector $v$ with respect to an underlying tunable parameters $v_{lk}$ involves products $\partial \left( \sum_{k} \prod_{j=1}^{n} v_{jk} \right) / \partial v_{lk} = \prod_{j \neq l} v_{jk}$ , leading to potentially high Lipschitz constant of the gradient, which may harm training. To alleviate this problem, at each node in the balanced tensor product tree we use LayerNorm (Ba et al., 2016).
+
+# 3 LINEAR OPERATORS IN TENSOR PRODUCT SPACES AND word2ketXS
+
+# 3.1 LINEAR OPERATORS IN TENSOR PRODUCT SPACES
+
+Let $A:\mathcal{V}\to \mathcal{U}$ be a linear operator that maps vectors from Hilbert space $\mathcal{V}$ into vector in Hilbert space $\mathcal{U}$ ; that is, for $v,v^{\prime},\in \mathcal{V}$ , $\alpha ,\beta \in \mathbb{R}$ , the vector $A(\alpha v + \beta v^{\prime}) = \alpha Av + \beta Av^{\prime}$ is a member of $\mathcal{U}$ . Let us also define a linear operator $B:\mathcal{W}\rightarrow \mathcal{Y}$ .
+
+A mapping $A \otimes B$ is a linear operator that maps vectors from $\mathcal{V} \otimes \mathcal{W}$ into vectors in $\mathcal{U} \otimes \mathcal{V}$ . We define $A \otimes B: \mathcal{V} \otimes \mathcal{W} \to \mathcal{U} \otimes \mathcal{V}$ through its action on simple vectors and through linearity
+
+$$
+(A \otimes B) \left(\sum_ {j k} \psi_ {j} \otimes \phi_ {k}\right) = \sum_ {j k} (A \psi_ {j}) \otimes (B \phi_ {k}),
+$$
+
+for $\psi_j\in \mathcal{V}$ and $\phi_k\in \mathcal{U}$ . Same as for vectors, tensor product of linear operators is bilinear
+
+$$
+\left(\sum_ {j} a _ {j} A _ {j}\right) \otimes \left(\sum_ {k} b _ {k} B _ {k}\right) = \sum_ {j k} a _ {j} b _ {k} \left(A _ {j} \otimes B _ {k}\right).
+$$
+
+In finite-dimensional case, for $n \times n'$ matrix representation of linear operator $A$ and $m \times m'$ matrix representing $B$ , we can represent $A \otimes B$ as an $mn \times m'n'$ matrix composed of blocks $a_{jk}B$ .
+
+# 3.2 THE word2ketXS EMBEDDINGS
+
+We can see a $p$ -dimensional word embedding model involving a $d$ -token vocabulary as a linear operator $F: \mathbb{R}^d \to \mathbb{R}^p$ that maps the one-hot vector corresponding to a word into the corresponding word embedding vector. Specifically, if $e_i$ is the $i$ -th basis vector in $\mathbb{R}^d$ representing $i$ -th word in the vocabulary, and $v_i$ is the embedding vector for that word in $\mathbb{R}^p$ , then the word embedding linear operator is $F = \sum_{i=1}^{d} v_i e_i^T$ . If we store the word embeddings a $d \times p$ matrix $M$ , we can then interpret that matrix's transpose, $M^T$ , as the matrix representation of the linear operator $F$ .
+
+Consider $q$ and $t$ such that $q^n = p$ and $t^n = d$ , and a series of $n$ linear operators $F_j: \mathbb{R}^t \to \mathbb{R}^q$ . A tensor product $\bigotimes_{j=1}^{n} F_j$ is a $\mathbb{R}^d \to \mathbb{R}^p$ linear operator. In word2ketXS, we represent the $d \times p$ word embedding matrix as
+
+$$
+F = \sum_ {k = 1} ^ {r} \bigotimes_ {j = 1} ^ {n} F _ {j k}, \tag {4}
+$$
+
+where $F_{jk}$ can be represented by a $q\times t$ matrix. The resulting matrix $F$ has dimension $p\times d$ , but takes $r nqt = O$ ( $rqt\max(\log p / q, \log d / t)$ ) space. Intuitively, the additional space efficiency comes from applying tensor product-based exponential compression not only horizontally, individually to each row, but horizontally and vertically at the same time, to the whole embedding matrix.
+
+We use the same balanced binary tree structure as in word2ket. To avoid reconstructing the full embedding matrix each time a small number of rows is needed for a multiplication by a weight matrix in the downstream layer of the neural NLP model, which would eliminate any space saving, we use lazy tensors (Gardner et al., 2018; Charlier et al., 2018). If $A$ is an $m \times n$ matrix and matrix $B$ is $p \times q$ , then $ij^{th}$ entry of $A \otimes B$ is equal to
+
+$$
+(A \otimes B) _ {i j} = a _ {\lfloor (i - 1) / p \rfloor + 1, \lfloor (j - 1) / q \rfloor + 1} b _ {i - \lfloor (i - 1) / p \rfloor p, j - \lfloor (j - 1) / q \rfloor q}.
+$$
+
+As we can see, reconstructing a row of the full embedding matrix involves only single rows of the underlying matrices, and can be done efficiently using lazy tensors.
+
+
+Figure 1: Architecture of the word2ket (left) and word2ketXS (right) embeddings. The word2ket example depicts a representation of a single-word 256-dimensional embedding vector using rank 5, order 4 tensor $\sum_{k=1}^{5} \bigotimes_{j=1}^{4} v_{jk}$ that uses twenty 4-dimensional vectors $v_{jk}$ as the underlying trainable parameters. The word2ketXS example depicts representation of a full 81-word, 16-dimensional embedding matrix as $\sum_{k=1}^{5} \bigotimes_{j=1}^{4} F_{jk}$ that uses twenty $3 \times 2$ matrices $F_{jk}$ as trainable parameters.
+
+
+
+# 4 EXPERIMENTAL EVALUATION OF word2ket AND word2ketXS IN DOWNSTREAM NLP TASKS
+
+In order to evaluate the ability of the proposed space-efficient word embeddings in capturing semantic information about words, we used them in three different downstream NLP tasks: text summarization, language translation, and question answering. In all three cases, we compared the accuracy in the downstream task for the proposed space-efficient embeddings with the accuracy achieved by regular embeddings, that is, embeddings that store $p$ -dimensional vectors for $d$ -word vocabulary using a single $d \times p$ matrix.
+
+Table 1: Results for the GIGAWORD text summarization task using Rouge-1, Rouge-2, and Rouge-L metrics. The space saving rate is defined as the total number of parameters for the embedding divided by the total number of parameters in the corresponding regular embedding.
+
+| Embedding | Order/Rank | Dim | RG-1 | RG-2 | RG-L | #Params | Space Saving Rate |
| Regular | 1/1 | 256 | 35.80 | 16.40 | 32.47 | 7,789,568 | 1 |
| word2ket | 4/1 | 256 | 33.65 | 14.87 | 30.47 | 486,848 | 16 |
| word2ketXS | 2/10 | 400 | 35.19 | 16.21 | 31.76 | 70,000 | 111 |
| word2ketXS | 4/1 | 256 | 34.05 | 15.39 | 30.75 | 224 | 34,775 |
| Regular | 1/1 | 8,000 | 36.71 | 17.48 | 33.37 | 243,424,000 | 1 |
| word2ketXS | 2/10 | 8000 | 35.17 | 16.35 | 31.72 | 19,200 | 12,678 |
+
+In text summarization experiments, we used the GIGAWORD text summarization dataset (Graff et al., 2003) using the same preprocessing as (Chen et al., 2019), that is, using 200K examples in training. We used an encoder-decoder sequence-to-sequence architecture with bidirectional forward-backward RNN encoder and an attention-based RNN decoder (Luong et al., 2015), as implemented in PyTorch-Texar Hu et al. (2018). In both the encoder and the decoder we used internal layers with dimensionality of 256 and dropout rate of 0.2, and trained the models, starting from random weights and embeddings, for 20 epochs. We used the validation set to select the best model epoch, and reported results on a separate test set. We used Rouge 1, 2, and L scores (Lin, 2004). In addition to testing the regular dimensionality of 256, we also explored 400, and 8000, but kept the dimensionality of other layers constant.
+
+The results in Table 1 show that word2ket can achieve 16-fold reduction in trainable parameters at the cost of a drop of Rouge scores by about 2 points. As expected, word2ketXS is much more space-efficient, matching the scores of word2ket while allowing for 34,000 fold reduction in trainable parameters. More importantly, it offers over 100-fold space reduction while reducing the Rouge scores by only about 0.5. Thus, in the evaluation on the remaining two NLP tasks we focused on word2ketXS.
+
+The second task we explored is German-English machine translation, using the IWSLT2014 (DEEN) dataset of TED and TEDx talks as preprocessed in (Ranzato et al., 2016). We used the same sequence-to-sequence model as in GIGAWORD summarization task above. We used BLEU score
+
+Table 2: Results for the IWSLT2014 German-to-English machine translation task. The space saving rate is defined as the total number of parameters for the embedding divided by the total number of parameters in the corresponding regular embedding.
+
+| Embedding | Order/Rank | Dimensionality | BLEU | #Params | Space Saving Rate |
| Regular | 1/1 | 256 | 26.44 | 8,194,816 | 1 |
| word2ketXS | 2/30 | 400 | 25.97 | 214,800 | 38 |
| word2ketXS | 2/10 | 400 | 25.33 | 71,600 | 114 |
| word2ketXS | 3/10 | 1000 | 25.02 | 9,600 | 853 |
+
+Table 3: Results for the Stanford Question Answering task using DrQA model. The space saving rate is defined as the total number of parameters for the embedding divided by the total number of parameters in the corresponding regular embedding.
+
+| Embedding | Order/Rank | F1 | #Params | Space Saving Rate |
| Regular | 1 | 72.73 | 35,596,500 | 1 |
| word2ketXS | 2/2 | 72.23 | 24,840 | 1,433 |
| word2ketXS | 4/1 | 70.65 | 380 | 93,675 |
+
+to measure test set performance. We explored embedding dimensions of 100, 256, 400, 1000, and 8000 by using different values for the tensor order and the dimensions of the underlying matrices $F_{jk}$ . The results in Table 2 show a drop of about 1 point on the BLEU scale for 100-fold reduction in the parameter space, with drops of 0.5 and 1.5 for lower and higher space saving rates, respectively.
+
+The third task we used involves the Stanford Question Answering Dataset (SQuAD) dataset. We used the DrQA's model (Chen et al., 2017), a 3-layer bidirectional LSTMs with 128 hidden units for both paragraph and question encoding. We trained the model for 40 epochs, starting from random weights and embeddings, and reported the test set F1 score. DrQA uses an embedding with vocabulary size of 118,655 and embedding dimensionality of 300. As the embedding matrix is larger, we can increase the tensor order in word2ketXS to four, which allows for much higher space savings.
+
+Results in Table 3 show a 0.5 point drop in F1 score with 1000-fold saving of the parameter space required to store the embeddings. For order-4 tensor word2ketXS, we see almost $10^{5}$ -fold space saving rate, at the cost of a drop of F1 by less than two points, that is, by a relative drop of less than $3\%$ . We also investigated the computational overhead introduced by the word2ketXS embeddings. For tensors order 2, the training time for 40 epochs increased from 5.8 for the model using regular embedding to 7.4 hours for the word2ketXS-based model. Using tensors of order 4, to gain additional space savings, increased the time to 9 hours. Each run was executed on a single NVIDIA Tesla V100 GPU card, on a 2 Intel Xeon Gold 6146 CPUs, 384 GB RAM machine. While the training time increased, as shown in Fig. 3, the dynamics of model training remains largely unchanged.
+
+The results of the experiments show substantial decreases in the memory footprint of the word embedding part of the model, used in the input layers of the encoder and decoder of sequence-to-sequence models. These also have other parameters, including weight matrices in the intermediate layers, as well as the matrix of word probabilities prior to the last, softmax activation, that are not compressed by our method. During inference, embedding and other layers dominate the memory
+
+
+Figure 2: Dynamics of the test-set F1 score on SQuAD dataset using DrQA model with different embeddings: rank-2 order-2 word2ketXS, rank-1 order-4 word2ketXS, and regular embedding.
+
+| Question | True Answers | Model Prediction |
| What is the name of the region that is not defined by the eight or 10 county definitions? | Southern California Megaregion, the greater Southern California Megaregion | greater Southern California Megaregion |
| How many megaregions are there in the United States? | 11 | 11 |
| What is the name of the state that the megaregion expands to in the east? | Nevada | Southern California Megaregion |
| Which border does the megaregion extend over? | Mexican | Tijuana |
| What is the name of the area past the border that the megaregion extends into? | Tijuana | Tijuana |
| Question | True Answers | Model Prediction |
| Which newspaper defined southern California? | Los Angeles Times, the Los Angeles Times | Los Angeles Times |
| In which year did the newspaper define southern California? | 1900 | 1900 |
| In which year did the newspaper change its previous definition? | 1999 | 1900 |
| What was the newer county added to the list? | Imperial | Imperial |
| How many counties initially made up the definition of southern California? | seven | seven |
+
+Figure 3: Test set questions and answers from DrQA model trained using rank-1 order-4 word2ketXS embedding that utilizes only 380 parameters (four $19 \times 5$ matrices $F_{jk}$ , see eq. 4) to encode the full, 118,655-word embedding matrix.
+
+footprint of the model. Recent successful transformer models like BERT by (Devlin et al., 2018), GPT-2 by (Radford et al., 2019), RoBERTa by (Liu et al., 2019) and Sparse Transformers by (Child et al., 2019) require hundreds of millions of parameters to work. In RoBERTaBASE, 30% of the parameters belong to the word embeddings.
+
+During training, there is an additional memory need to store activations in the forward phase in all layers, to make them available for calculating the gradients in the backwards phase. These often dominate the memory footprint during training, but one can decrease the memory required for storing them with e.g. gradient checkpointing Chen et al. (2016) used recently in Child et al. (2019).
+
+# 4.1 RELATED WORK
+
+Given the current hardware limitation for training and inference, it is crucial to be able to decrease the amount of memory these networks requires to work. A number of approaches have been used in lowering the space requirements for word embeddings. Dictionary learning (Shu & Nakayama, 2018) and word embedding clustering (Andrews, 2016) approaches have been proposed. Bit encoding has been also proposed Gupta et al. (2015). An optimized method for uniform quantization of floating point numbers in the embedding matrix has been proposed recently (May et al., 2019). To compress a model for low-memory inference, (Han et al., 2015) used pruning and quantization for lowering the number of parameters. For low-memory training sparsity (Mostafa & Wang, 2019) (Gale et al., 2019) (Sohoni et al., 2019) and low numerical precision (De Sa et al., 2018) (Micikevicius et al., 2017) approaches were proposed. In approximating matrices in general, Fourier-based approximation methods have also been used (Zhang et al., 2018; Avron et al., 2017). None of these approaches can mach space saving rates achieved by word2ketXS. The methods based on bit encoding, such as Andrews (2016); Gupta et al. (2015); May et al. (2019) are limited to space saving rate of at most 32 for 32-bit architectures. Other methods, for example based on parameter sharing Suzuki & Nagata (2016) or on PCA, can offer higher saving rates, but their storage requirement is limited by $d + p$ , the vocabulary size and embedding dimensionality. In more distantly related work, tensor product spaces have been used in studying document embeddings, by using sketching of a tensor representing $n$ -grams in the document Arora et al. (2018).
+
+# ACKNOWLEDGMENTS
+
+T.A. is funded by NSF grant IIS-1453658.
+
+# REFERENCES
+
+Martin Andrews. Compressing word embeddings. In International Conference on Neural Information Processing, pp. 413-422. Springer, 2016.
+Sanjeev Arora, Mikhail Khodak, Nikunj Saunshi, and Kiran Vodrahalli. A compressed sensing view of unsupervised text embeddings, bag-of-n-grams, and LSTMs. In International Conference on Learning Representations, 2018.
+Haim Avron, Michael Kapralov, Cameron Musco, Christopher Musco, Ameya Velingker, and Amir Zandieh. Random Fourier features for kernel ridge regression: Approximation bounds and statistical guarantees. In Proceedings of the 34th International Conference on Machine Learning, pp. 253-262, 2017.
+Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016.
+Jarosław Buczyński and Joseph M Landsberg. Ranks of tensors and a generalization of secant varieties. Linear Algebra and its Applications, 438(2):668-689, 2013.
+Benjamin Charlier, Jean Feydy, and Joan Glaunes. KeOps: Calcul rapide sur GPU dans les espaces à noyaux, 2018.
+Danqi Chen, Adam Fisch, Jason Weston, and Antoine Bordes. Reading Wikipedia to answer open-domain questions. arXiv preprint arXiv:1704.00051, 2017.
+Liqun Chen, Yizhe Zhang, Ruiyi Zhang, Chenyang Tao, Zhe Gan, Haichao Zhang, Bai Li, Dinghan Shen, Changyou Chen, and Lawrence Carin. Improving sequence-to-sequence learning via optimal transport. arXiv preprint arXiv:1901.06283, 2019.
+Tianqi Chen, Bing Xu, Chiyuan Zhang, and Carlos Guestrin. Training deep nets with sublinear memory cost. arXiv preprint arXiv:1604.06174, 2016.
+Rewon Child, Scott Gray, Alec Radford, and Ilya Sutskever. Generating long sequences with sparse transformers. arXiv preprint arXiv:1904.10509, 2019.
+Christopher De Sa, Megan Leszczynski, Jian Zhang, Alana Marzoev, Christopher R Aberger, Kunle Olukotun, and Christopher Ré. High-accuracy low-precision training. arXiv preprint arXiv:1803.03383, 2018.
+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.
+Trevor Gale, Erich Elsen, and Sara Hooker. The state of sparsity in deep neural networks. CoRR, abs/1902.09574, 2019.
+Jacob Gardner, Geoff Pleiss, Kilian Q Weinberger, David Bindel, and Andrew G Wilson. GPyTorch: Blackbox matrix-matrix gaussian process inference with GPU acceleration. In Advances in Neural Information Processing Systems, pp. 7576-7586, 2018.
+David Graff, Junbo Kong, Ke Chen, and Kazuaki Maeda. English gigaword. Linguistic Data Consortium, Philadelphia, 4(1):34, 2003.
+Suyog Gupta, Ankur Agrawal, Kailash Gopalakrishnan, and Pritish Narayanan. Deep learning with limited numerical precision. In Proceedings of the 32nd International Conference on Machine Learning, pp. 1737-1746, 2015.
+Song Han, Huizi Mao, and William J Dally. Deep compression: Compressing deep neural networks with pruning, trained quantization and huffman coding. arXiv preprint arXiv:1510.00149, 2015.
+Zhiting Hu, Haoran Shi, Bowen Tan, Wentao Wang, Zichao Yang, Tiancheng Zhao, Junxian He, Lianhui Qin, Di Wang, et al. Texar: A modularized, versatile, and extensible toolkit for text generation. arXiv preprint arXiv:1809.00794, 2018.
+
+Chin-Yew Lin. Rouge: A package for automatic evaluation of summaries. In Text summarization branches out, pp. 74-81, 2004.
+Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov. Roberta: A robustly optimized bert pretraining approach. arXiv preprint arXiv:1907.11692, 2019.
+Minh-Thang Luong, Hieu Pham, and Christopher D Manning. Effective approaches to attention-based neural machine translation. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing, pp. 1412-1421, 2015.
+Avner May, Jian Zhang, Tri Dao, and Christopher Ré. On the downstream performance of compressed word embeddings. In Advances in Neural Information Processing Systems, pp. arXiv:1909.01264, 2019.
+Paulius Micikevicius, Sharan Narang, Jonah Alben, Gregory Diamos, Erich Elsen, David Garcia, Boris Ginsburg, Michael Houston, Oleksii Kuchaiev, Ganesh Venkatesh, et al. Mixed precision training. arXiv preprint arXiv:1710.03740, 2017.
+Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S Corrado, and Jeff Dean. Distributed representations of words and phrases and their compositionality. In Advances in Neural Information Processing Systems, pp. 3111-3119, 2013.
+Hesham Mostafa and Xin Wang. Parameter efficient training of deep convolutional neural networks by dynamic sparse reparameterization. In International Conference on Machine Learning, pp. 4646-4655, 2019.
+Jeffrey Pennington, Richard Socher, and Christopher Manning. GloVe: Global vectors for word representation. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing, pp. 1532-1543, 2014.
+Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. Language models are unsupervised multitask learners. OpenAI Blog, 1(8), 2019.
+Marc'Aurelio Ranzato, Sumit Chopra, Michael Auli, and Wojciech Zaremba. Sequence level training with recurrent neural networks. In International Conference on Learning Representations, pp. arXiv:1511.06732, 2016.
+Raphael Shu and Hideki Nakayama. Compressing word embeddings via deep compositional code learning. In International Conference on Learning Representations, pp. arXiv:1711.01068, 2018.
+Nimit Sharad Sohoni, Christopher Richard Aberger, Megan Leszczyński, Jian Zhang, and Christopher Ré. Low-memory neural network training: A technical report. CoRR, abs/1904.10631, 2019.
+Jun Suzuki and Masaaki Nagata. Learning compact neural word embeddings by parameter space sharing. In International Joint Conference on Artificial Intelligence, pp. 2046-2051, 2016.
+Jian Zhang, Avner May, Tri Dao, and Christopher Ré. Low-precision random Fourier features for memory-constrained kernel approximation. arXiv preprint arXiv:1811.00155, 2018.
\ No newline at end of file
diff --git a/word2ketspaceefficientwordembeddingsinspiredbyquantumentanglement/images.zip b/word2ketspaceefficientwordembeddingsinspiredbyquantumentanglement/images.zip
new file mode 100644
index 0000000000000000000000000000000000000000..69f16d254e985b42ffd5dbd18df42c301810ceb5
--- /dev/null
+++ b/word2ketspaceefficientwordembeddingsinspiredbyquantumentanglement/images.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a699a0317e9e4024f06b628039815e734910588ca6ef012cad80c31b4051af32
+size 326807
diff --git a/word2ketspaceefficientwordembeddingsinspiredbyquantumentanglement/layout.json b/word2ketspaceefficientwordembeddingsinspiredbyquantumentanglement/layout.json
new file mode 100644
index 0000000000000000000000000000000000000000..0a843fdbb9b29cc5f52ae16565a5528b20a98420
--- /dev/null
+++ b/word2ketspaceefficientwordembeddingsinspiredbyquantumentanglement/layout.json
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:cb728845b288d04e9b8d784c36f3d70857f1f2cf4d7ed727c588c45213284b5c
+size 427731